package-notes/package-notes.spec
Luca Boccassi 9da9df8af2 Switch to --package-metadata
Use a compiler specs file to avoid issues with escaping and quoting
when a package is built using autotools.
Generate the osCpe string at build time for now, as it's not set
as an env var by rpm yet.
2022-08-09 10:59:13 +01:00

48 lines
1.4 KiB
RPMSpec

Name: package-notes
Version: 0.5
Release: %autorelease
Summary: Generate LDFLAGS to insert .note.package section
License: 0BSD
Source0: redhat-package-notes.in
Source1: generate-rpm-note.sh
Source2: macros.package-notes-srpm
BuildArch: noarch
%description
This package provides a generator of linker scripts that insert a section with
an ELF note with a JSON payload that describes the package the binary was built
for.
%package srpm-macros
Summary: %{summary}
Obsoletes: package-notes < 0.5
# Those are minimum versions that implement --package-metadata
Conflicts: binutils < 2.38-23
Conflicts: binutils-gold < 2.38-23
Conflicts: mold < 1.3.0
%description srpm-macros
RPM macros to insert a section with an ELF note with a JSON payload that
describes the package the binary was built for via compiler spec file.
%prep
# nothing to do
%build
sed "s|@OSCPE@|$(cat /usr/lib/system-release-cpe)|" %{SOURCE0} > redhat-package-notes
%install
install -Dt %{buildroot}%{_rpmconfigdir}/redhat/ redhat-package-notes
install -Dt %{buildroot}%{_rpmconfigdir}/ %{SOURCE1}
install -m0644 -Dt %{buildroot}%{_rpmmacrodir}/ %{SOURCE2}
%files srpm-macros
%{_rpmconfigdir}/generate-rpm-note.sh
%{_rpmmacrodir}/macros.package-notes-srpm
%{_rpmconfigdir}/redhat/redhat-package-notes
%changelog
%autochangelog