Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions packaging/fedora/build-fork-rpm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,20 @@ if [ ! -f "$OUT/SOURCES/macros.kwin.in" ]; then
cp "$stock/macros.kwin.in" "$OUT/SOURCES/"
fi

# The spec to build from: the tag's sequence number written in as its default. The source
# package carries this spec, and Copr rebuilds the source package from it alone (rpmbuild -bs
# in mock, with no --define): with the repository's default every source package named the pf3
# archive, and a pf4 build failed for a missing kwin-v6.8.2-pf3.tar.gz.
built_spec="$OUT/SPECS/$(basename "$SPEC")"
sed "s/^%{!?pf:%global pf [0-9]*}\$/%{!?pf:%global pf ${pfn}}/" "$SPEC" > "$built_spec"
[ "$(grep -c -x "%{!?pf:%global pf ${pfn}}" "$built_spec")" = 1 ] ||
{ echo "the spec has no single pf default line to set" >&2; exit 1; }
# What a rebuild from the spec alone takes: the tag's own archive (the directory it unpacks is
# named by the same number).
grep -q -x "Source0: https://github.com/archledger/kwin/archive/${TAG}/kwin-${TAG}.tar.gz" <<<"$(rpmspec -P "$built_spec")" ||
{ echo "the spec does not name ${archive} on its own" >&2; exit 1; }
SPEC=$built_spec

# SRPM=1 builds the source package only (what Copr takes); otherwise the binary packages.
if [ "${SRPM:-0}" = 1 ]; then
rpmbuild -bs --define "_topdir $OUT" --define "pf ${pfn}" "$SPEC"
Expand Down
3 changes: 2 additions & 1 deletion packaging/fedora/kwin-fusion.spec
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
Name: kwin
Version: 6.8.2
# The fork's sequence number on this upstream version: the source is the tag
# v%%{version}-pf%%{pf}. build-fork-rpm.sh passes the tag's own number.
# v%%{version}-pf%%{pf}. build-fork-rpm.sh writes the tag's own number here in the spec it
# builds from, so the source package names its own archive when it is rebuilt alone (Copr).
%{!?pf:%global pf 3}
Release: 3%{?dist}.pf%{pf}
Summary: KDE Window manager (the Plasma Fusion fork)
Expand Down