Add macros.rpmautospec

While these macros were previously shipped as a subpackage of
python-rpmautospec, they do not depend on the Python module, and the
rest of that package includes dependencies not wanted in RHEL/ELN (such
as koji).
This commit is contained in:
Yaakov Selkowitz 2023-08-22 11:10:34 -04:00
parent 80967bfcc6
commit 1359905724
2 changed files with 24 additions and 2 deletions

16
macros.rpmautospec Normal file
View File

@ -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")
}

View File

@ -4,7 +4,7 @@
# 2) When making changes, increment the version (in baserelease) by 1.
# rpmdev-bumpspec and other tools update the macro below, which is used
# in Version: to get the desired effect.
%global baserelease 263
%global baserelease 264
Summary: Red Hat specific rpm configuration files
Name: redhat-rpm-config
@ -50,6 +50,7 @@ Source153: macros.forge
Source155: macros.ldconfig
Source156: macros.vpath
Source157: macros.shell-completions
Source158: macros.rpmautospec
# Build policy scripts
# this comes from https://github.com/rpm-software-management/rpm/pull/344
@ -106,7 +107,6 @@ Requires: qt5-srpm-macros
Requires: qt6-srpm-macros
# rust-srpm-macros v24 contains %%build_rustflags defintion
Requires: rust-srpm-macros >= 24
Requires: rpmautospec-rpm-macros
Requires: package-notes-srpm-macros
Requires: pyproject-srpm-macros
@ -135,6 +135,8 @@ Requires: (llvm if clang)
# -fstack-clash-protection and -fcf-protection require GCC 8.
Conflicts: gcc < 8.0.1-0.22
Obsoletes: rpmautospec-rpm-macros < 0.3.6
Provides: system-rpm-config = %{version}-%{release}
%global rrcdir /usr/lib/rpm/redhat
@ -238,6 +240,7 @@ install -p -m 644 -t %{buildroot}%{_rpmluadir}/fedora/srpm forge.lua
%{_rpmconfigdir}/macros.d/macros.fedora-misc
%{_rpmconfigdir}/macros.d/macros.forge
%{_rpmconfigdir}/macros.d/macros.ldconfig
%{_rpmconfigdir}/macros.d/macros.rpmautospec
%{_rpmconfigdir}/macros.d/macros.shell-completions
%{_rpmconfigdir}/macros.d/macros.vpath
%dir %{_rpmluadir}/fedora
@ -254,6 +257,9 @@ install -p -m 644 -t %{buildroot}%{_rpmluadir}/fedora/srpm forge.lua
%doc buildflags.md
%changelog
* Tue Aug 22 2023 Yaakov Selkowitz <yselkowi@redhat.com> - 264-1
- Add macros.rpmautospec
* Mon Aug 21 2023 Miroslav Suchy <msuchy@redhat.com> - 263-1
- Migrate to SPDX