From 6a3442902a97edd3585542059ba5130f1e295efe Mon Sep 17 00:00:00 2001 From: James Antill Date: Thu, 26 May 2022 06:46:03 -0400 Subject: [PATCH] Auto sync2gitlab import of efi-rpm-macros-3-3.el8.src.rpm --- .gitignore | 1 + ...make-all-of-our-macros-always-expand.patch | 74 +++++++++++++ EMPTY | 1 - efi-rpm-macros.spec | 102 ++++++++++++++++++ sources | 1 + 5 files changed, 178 insertions(+), 1 deletion(-) create mode 100644 .gitignore create mode 100644 0001-macros.efi-srpm-make-all-of-our-macros-always-expand.patch delete mode 100644 EMPTY create mode 100644 efi-rpm-macros.spec create mode 100644 sources diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..097d483 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/efi-rpm-macros-3.tar.bz2 diff --git a/0001-macros.efi-srpm-make-all-of-our-macros-always-expand.patch b/0001-macros.efi-srpm-make-all-of-our-macros-always-expand.patch new file mode 100644 index 0000000..3e14b87 --- /dev/null +++ b/0001-macros.efi-srpm-make-all-of-our-macros-always-expand.patch @@ -0,0 +1,74 @@ +From 29e47cd8011b1569c4a73c8e395c7fb5192e6dc1 Mon Sep 17 00:00:00 2001 +From: Peter Jones +Date: Fri, 4 May 2018 15:02:14 -0400 +Subject: [PATCH] macros.efi-srpm: make all of our macros always expandable, + even if wrong + +In particular, arch and altarch give "none", and when they do efi_has_arch +and efi_has_alt_arch are 0 (respectively). if they're correct, they'll +be 1. + +Signed-off-by: Peter Jones +--- + macros.efi-srpm.in | 17 ++++++++++++----- + 1 file changed, 12 insertions(+), 5 deletions(-) + +diff --git a/macros.efi-srpm.in b/macros.efi-srpm.in +index 5f8a784af8a..f3b4c68b2f9 100644 +--- a/macros.efi-srpm.in ++++ b/macros.efi-srpm.in +@@ -38,7 +38,7 @@ + elseif arch("%{arm}") then + return("arm") + else +- return("") ++ return("none") + end + end + -- alt arch +@@ -46,24 +46,30 @@ + if arch("x86_64") then + return("ia32") + else +- return(nil) ++ return("none") + end + end + -- make some macros + local done = rpm.expand("%{?_efi}") + if done == nil or done == "" then ++ local arch = getarch() + local alt = getaltarch() + print("%global _efi @@EFI_ARCHES@@\\n") + print("%global _efi_vendor @@EFI_VENDOR@@\\n") ++ if arch == "none" then ++ print("%global _efi_has_arch 0\\n") ++ else ++ print("%global _efi_has_arch 1\\n") ++ end + print("%global _efi_arch " .. getarch() .. "\\n") + print("%global _efi_arch_upper " .. string.upper(getarch()) .. "\\n") +- if alt == nil then ++ if alt == "none" then + print("%global _efi_has_alt_arch 0\\n") + else + print("%global _efi_has_alt_arch 1\\n") +- print("%global _efi_alt_arch " .. alt .. "\\n") +- print("%global _efi_alt_arch_upper " .. string.upper(alt) .. "\\n") + end ++ print("%global _efi_alt_arch " .. alt .. "\\n") ++ print("%global _efi_alt_arch_upper " .. string.upper(alt) .. "\\n") + end + }} + +@@ -79,6 +85,7 @@ + + %efi_arch %{expand:%{_efi_srpm_macros_setup}}%{_efi_arch} + %efi_arch_upper %{expand:%{_efi_srpm_macros_setup}}%{_efi_arch_upper} ++%efi_has_arch %{expand:%{_efi_srpm_macros_setup}}0%{_efi_has_arch} + %efi_has_alt_arch %{expand:%{_efi_srpm_macros_setup}}0%{_efi_has_alt_arch} + %efi_alt_arch %{expand:%{_efi_srpm_macros_setup}}%{?_efi_alt_arch}%{nil} + %efi_alt_arch_upper %{expand:%{_efi_srpm_macros_setup}}%{?_efi_alt_arch_upper}%{nil} +-- +2.14.3 + diff --git a/EMPTY b/EMPTY deleted file mode 100644 index 0519ecb..0000000 --- a/EMPTY +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/efi-rpm-macros.spec b/efi-rpm-macros.spec new file mode 100644 index 0000000..25efe66 --- /dev/null +++ b/efi-rpm-macros.spec @@ -0,0 +1,102 @@ +Summary: Common RPM Macros for building EFI-related packages +Name: efi-rpm-macros +Version: 3 +Release: 3%{?dist} +Group: Development/System +License: GPLv3+ +URL: https://github.com/rhboot/%{name}/ +BuildRequires: git sed +BuildArch: noarch + +Source0: https://github.com/rhboot/%{name}/releases/download/%{version}/%{name}-%{version}.tar.bz2 +Patch0001: 0001-macros.efi-srpm-make-all-of-our-macros-always-expand.patch + +%global debug_package %{nil} +%global _efi_vendor_ %(eval echo $(sed -n -e 's/rhel/redhat/' -e 's/^ID=//p' /etc/os-release)) + +%description +%{name} provides a set of RPM macros for use in EFI-related packages. + +%package -n efi-srpm-macros +Summary: Common SRPM Macros for building EFI-related packages +Group: Development/System +BuildArch: noarch +Requires: rpm + +%description -n efi-srpm-macros +efi-srpm-macros provides a set of SRPM macros for use in EFI-related packages. + +%package -n efi-filesystem +Summary: The basic directory layout for EFI machines +Group: System Environment/Base +BuildArch: noarch +Requires: filesystem + +%description -n efi-filesystem +The efi-filesystem package contains the basic directory layout for EFI +machine bootloaders and tools. + +%prep +%autosetup -S git + +%build +%make_build EFI_VENDOR=%{_efi_vendor_} clean all + +%install +%make_install EFI_VENDOR=%{_efi_vendor_} + +#%%files +#%%{!?_licensedir:%%global license %%%%doc} +#%%license LICENSE +#%%doc README +#%%{_rpmmacrodir}/macros.efi + +%files -n efi-srpm-macros +%{!?_licensedir:%global license %%doc} +%license LICENSE +%doc README +%{_rpmmacrodir}/macros.efi-srpm + +%files -n efi-filesystem +%defattr(0700,root,root,-) +%verify(not mode) %dir /boot/efi +%verify(not mode) %dir /boot/efi/EFI +%verify(not mode) %dir /boot/efi/EFI/BOOT +%verify(not mode) %dir /boot/efi/EFI/%{_efi_vendor_} + +%changelog +* Thu Nov 05 2020 Javier Martinez Canillas - 3-3 +- Ignore the mode bits when doing RPM verification of files in /boot/efi + Resolves: rhbz#1845052 + +* Fri May 04 2018 Peter Jones - 3-2 +- Always provide macros for efi_arch and efi_alt_arch (and their _upper + variants), and make efi_has_arch and efi_has_alt_arch 0 when they will be + wrong. This ensures everything can always expand when we're on a non-efi + architecture. + +* Fri May 04 2018 Peter Jones - 3-1 +- Update to version 3 to try and un-break rawhide composes due to + ExclusiveArch constraints. + +* Thu May 03 2018 Peter Jones - 2-6 +- Rework the macros for better srpm use. + +* Wed May 02 2018 Peter Jones - 2-5 +- Add efi-filesystem subpackage + +* Wed May 02 2018 Peter Jones - 2-4 +- Add %%{efi_has_alt_arch} + +* Tue May 01 2018 Peter Jones - 2-3 +- Make an efi-srpm-macros subpackage to pull in so %%{efi} works in + ExclusiveArch in koji. + +* Tue May 01 2018 Peter Jones - 2-2 +- Fix the non-efi and non-efi-alt-arch cases, hopefully. + +* Tue May 01 2018 Peter Jones - 2-1 +- Lots of rpmlint fixups and the like. + +* Mon Apr 30 2018 Peter Jones - 1-1 +- First shot at building it. diff --git a/sources b/sources new file mode 100644 index 0000000..99848fd --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (efi-rpm-macros-3.tar.bz2) = 0fba0b2e9d08f4da28eb3305f82a02e5d1787800c9e5dee8e78add3572935f80bf823318495763b126e8d79c927913ae4e9087533011032cd13175ed09955ac6