From eed1d0205a996c323be4345e8a9267632b4e7c10 Mon Sep 17 00:00:00 2001 From: MSVSphere Packaging Team Date: Tue, 26 Nov 2024 17:44:20 +0300 Subject: [PATCH] import package-notes-0.5-12.el10 --- .gitignore | 0 .package-notes.metadata | 0 SOURCES/macros.package-notes-srpm | 29 ++++++ SOURCES/redhat-package-notes.in | 2 + SPECS/package-notes.spec | 144 ++++++++++++++++++++++++++++++ 5 files changed, 175 insertions(+) create mode 100644 .gitignore create mode 100644 .package-notes.metadata create mode 100644 SOURCES/macros.package-notes-srpm create mode 100644 SOURCES/redhat-package-notes.in create mode 100644 SPECS/package-notes.spec diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/.package-notes.metadata b/.package-notes.metadata new file mode 100644 index 0000000..e69de29 diff --git a/SOURCES/macros.package-notes-srpm b/SOURCES/macros.package-notes-srpm new file mode 100644 index 0000000..3724897 --- /dev/null +++ b/SOURCES/macros.package-notes-srpm @@ -0,0 +1,29 @@ +# This file is part of the package-notes package. +# +# Add an ELF note with information about the package the code was compiled for. +# See https://fedoraproject.org/wiki/Changes/Package_information_on_ELF_objects +# for details. +# +# To opt out of the use of this feature completely, include this in the spec +# file: +# +# %undefine _package_note_flags +# +# Which linker will be used? This should be either "bfd", "gold", "mold", or "lld". +# +# (The default linker for clang on armv7hl is lld.) +%_package_note_linker %["%_target_cpu" == "armv7hl" && "%{toolchain}" == "clang" ? "lld" : "bfd"] + +# These are defined for backwards compatibility. Do not use. +%_package_note_file 1 +%_generate_package_note_file %{nil} + +# Overall status: 1 if looks like we can insert the note, 0 otherwise +# Unfortunately "clang" does not support specs files so the note insertion is disabled when using it. +%_package_note_status %{!?_package_note_flags:0}%{?_package_note_flags:%[0%{?_package_note_file:1} && 0%{?name:1} && "%_target_cpu" != "noarch" && "%{toolchain}" != "clang" ? 1 : 0]} + + +# The linker flags to be passed to the compiler to insert the notes section will +# be created by the spec file, to avoid issues with quoting and escaping across +# different build systems and shells. +%_package_note_flags %[%_package_note_status ? "-specs=/usr/lib/rpm/redhat/redhat-package-notes" : ""] diff --git a/SOURCES/redhat-package-notes.in b/SOURCES/redhat-package-notes.in new file mode 100644 index 0000000..3a19b1b --- /dev/null +++ b/SOURCES/redhat-package-notes.in @@ -0,0 +1,2 @@ +*link: ++ --package-metadata={\"type\":\"rpm\",\"name\":\"%:getenv(RPM_PACKAGE_NAME \",\"version\":\"%:getenv(RPM_PACKAGE_VERSION -%:getenv(RPM_PACKAGE_RELEASE \",\"architecture\":\"%:getenv(RPM_ARCH \",\"osCpe\":\"@OSCPE@\"})))) diff --git a/SPECS/package-notes.spec b/SPECS/package-notes.spec new file mode 100644 index 0000000..8c817c2 --- /dev/null +++ b/SPECS/package-notes.spec @@ -0,0 +1,144 @@ +## START: Set by rpmautospec +## (rpmautospec version 0.6.1) +## RPMAUTOSPEC: autorelease, autochangelog +%define autorelease(e:s:pb:n) %{?-p:0.}%{lua: + release_number = 12; + base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); + print(release_number + base_release_number - 1); +}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} +## END: Set by rpmautospec + +Name: package-notes +Version: 0.5 +Release: %autorelease +Summary: Generate LDFLAGS to insert .note.package section +License: 0BSD +URL: https://github.com/systemd/package-notes + +Source0: redhat-package-notes.in +Source1: 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.37-34 +Conflicts: binutils-gold < 2.37-34 +Conflicts: mold < 1.3.0 +Conflicts: lld < 14.0.5-4 + +%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 a 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 -m0644 -Dt %{buildroot}%{_rpmmacrodir}/ %{SOURCE1} + +%files srpm-macros +%{_rpmconfigdir}/redhat/redhat-package-notes +%{_rpmmacrodir}/macros.package-notes-srpm + +%changelog +## START: Generated by rpmautospec +* Mon Jun 24 2024 Troy Dawson - 0.5-12 +- Bump release for June 2024 mass rebuild + +* Thu Jan 25 2024 Fedora Release Engineering - 0.5-11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Sun Jan 21 2024 Fedora Release Engineering - 0.5-10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Thu Jul 20 2023 Fedora Release Engineering - 0.5-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Sat May 20 2023 Zbigniew Jędrzejewski-Szmek - 0.5-8 +- Make sure redhat-package-notes spec is skipped if _package_note_flags is + undefined (rbhz#2184553) + +* Thu Jan 19 2023 Fedora Release Engineering - 0.5-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Sat Sep 03 2022 Luca Boccassi - 0.5-6 +- test: run clang build too + +* Mon Aug 29 2022 Luca Boccassi - 0.5-5 +- Disable by default with lld + +* Tue Aug 16 2022 Benjamin A. Beasley - 0.5-4 +- Fix regression due to typo in _package_note_status +- Fixes RHBZ#2118722 + +* Tue Aug 16 2022 Zbigniew Jędrzejewski-Szmek - 0.5-3 +- Switch to --package-metadata also with lld (#2051597) + +* Tue Aug 09 2022 Luca Boccassi - 0.5-1 +- Switch to --package-metadata (#2055863, #2083878, #2099999, #2059858, #2055458) + +* Sat Aug 06 2022 Tom Stellard - 0.4-17 +- Add CI test + +* Fri Jul 22 2022 Fedora Release Engineering - 0.4-16 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Sat Mar 26 2022 Luca Boccassi - 0.4-15 +- Fix wrong binary fields on big endian + +* Tue Jan 25 2022 Zbigniew Jędrzejewski-Szmek - 0.4-14 +- Disable notes when clang toolchain is used on arm + +* Mon Jan 24 2022 Zbigniew Jędrzejewski-Szmek - 0.4-13 +- Disable notes with linkers other than bfd + +* Mon Jan 24 2022 Zbigniew Jędrzejewski-Szmek - 0.4-12 +- Add --insert-after param to the note generation script + +* Sat Jan 22 2022 Zbigniew Jędrzejewski-Szmek - 0.4-11 +- Add %%_package_note_linker and document everything (rhbz#2043178, + rhbz#2043368) + +* Sat Jan 22 2022 Zbigniew Jędrzejewski-Szmek - 0.4-10 +- Allow unsetting %%_package_note_readonly to drop the READONLY attribute + +* Fri Jan 21 2022 Zbigniew Jędrzejewski-Szmek - 0.4-9 +- Use %%{buildsubdir} in %%_package_note_file if defined + +* Fri Jan 21 2022 Zbigniew Jędrzejewski-Szmek - 0.4-8 +- Also voidify the macros if we're on a noarch build + +* Fri Jan 21 2022 Zbigniew Jędrzejewski-Szmek - 0.4-7 +- Use $RPM_PACKAGE_VERSION variable to refer to the package version + +* Fri Jan 21 2022 Zbigniew Jędrzejewski-Szmek - 0.4-6 +- Make _generate_package_note_file always recreate the file + +* Fri Jan 21 2022 Zbigniew Jędrzejewski-Szmek - 0.4-5 +- Conditionalize all macros on %%_package_note_file being defined + +* Thu Jan 20 2022 Fedora Release Engineering - 0.4-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Fri Jan 14 2022 Zbigniew Jędrzejewski-Szmek - 0.4-3 +- Rename srpm macros file + +* Fri Jan 14 2022 Zbigniew Jędrzejewski-Szmek - 0.4-2 +- Add package-notes-srpm-macros subpackage to configure rpm builds + +* Tue Nov 16 2021 Zbigniew Jędrzejewski-Szmek - 0.4-1 +- Version 0.4 + +## END: Generated by rpmautospec