rpmautospec koji plugin bakes in the result of %autorelease and %autochangelog into the SRPM. When used on a Fedora or EL 9 machine with rpmautospec installed, fedpkg does the same. However, it's currently impossible to rebuild specfiles that use rpmautospec on EL 8 itself due to the unexpanded %autorelease and %autochangelog macros failing the SRPM build. This adds the same fallback %autorelease and %autochangelog macro definitions that are available in the Fedora and EPEL 9 buildroots. This allows locally rebuilding packages that use rpmautospec with plain rpmbuild or fedpkg on an EL 8 system or with `mock --spec`.epel8
parent
59caa90b5f
commit
7c1824e99a
@ -0,0 +1,16 @@
|
|||||||
|
%autorelease(e:s:pb:n) %{?-p:0.}%{lua:
|
||||||
|
release_number = tonumber(rpm.expand("%{?_rpmautospec_release_number}%{!?_rpmautospec_release_number:1}"));
|
||||||
|
base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}"));
|
||||||
|
print(release_number + base_release_number - 1);
|
||||||
|
}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}}
|
||||||
|
%autochangelog %{lua:
|
||||||
|
locale = os.setlocale(nil)
|
||||||
|
os.setlocale("C.utf8")
|
||||||
|
date = os.date("%a %b %d %Y")
|
||||||
|
os.setlocale(locale)
|
||||||
|
packager = rpm.expand("%{?packager}%{!?packager:John Doe <packager@example.com>}")
|
||||||
|
evr = rpm.expand("%{?epoch:%{epoch}:}%{version}-%{release}")
|
||||||
|
print("* " .. date .. " " .. packager .. " - " .. evr .. "\\n")
|
||||||
|
print("- local build")
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in new issue