#70 Backport rpmautospec fallback macros
Merged a year ago by carlwgeorge. Opened a year ago by gotmax23.
rpms/ gotmax23/epel-rpm-macros rpmautospec  into  epel8

file modified
+10 -1
@@ -1,6 +1,6 @@ 

  Name:           epel-rpm-macros

  Version:        8

- Release:        37

+ Release:        38

  Summary:        Extra Packages for Enterprise Linux RPM macros

  

  License:        GPLv2
@@ -23,6 +23,9 @@ 

  # misc macros

  Source150:      macros.build-constraints

  Source151:      https://src.fedoraproject.org/rpms/redhat-rpm-config/raw/rawhide/f/macros.shell-completions

+ # autochangelog and autorelease fallback macros

+ %global rpmautospec_commit 52f3c2017e10c5ab5a183fed772e9fe8a86a20fb

+ Source152:      https://pagure.io/fedora-infra/rpmautospec/raw/%{rpmautospec_commit}/f/rpm/macros.d/macros.rpmautospec

  

  BuildArch:      noarch

  Requires:       redhat-release >= %{version}
@@ -99,10 +102,13 @@ 

      %{buildroot}%{_rpmmacrodir}/macros.build-constraints

  install -Dpm 644 %{SOURCE151} \

      %{buildroot}%{_rpmmacrodir}/macros.shell-completions

+ install -Dpm 644 %{SOURCE152} \

+     %{buildroot}%{_rpmmacrodir}/macros.rpmautospec

  

  %files

  %license GPL

  %{_rpmmacrodir}/macros.epel-rpm-macros

+ %{_rpmmacrodir}/macros.rpmautospec

  %{_sysconfdir}/rpm/macros.zzz-epel-override

  %{_fileattrsdir}/pythondist.attr

  
@@ -119,6 +125,9 @@ 

  

  

  %changelog

+ * Fri Mar 10 2023 Maxwell G <maxwell@gtmx.me> - 8-38

+ - Backport rpmautospec fallback macros

+ 

  * Wed Feb 08 2023 Maxwell G <gotmax@e.email> - 8-37

  - Stop overriding macros that are now in RHEL 8.7

  

file added
+16
@@ -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")

+ }

+ 

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.

Build failed. More information on how to proceed and troubleshoot errors available at https://fedoraproject.org/wiki/Zuul-based-ci
https://fedora.softwarefactory-project.io/zuul/buildset/e1513443e4e242e791d73f43acc209b4

Pull-Request has been merged by carlwgeorge

a year ago
Metadata