From 8bcc502b42bc921a0f0630f34ac5eca57d123c72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0abata?= Date: Wed, 14 Oct 2020 23:57:42 +0200 Subject: [PATCH] RHEL 9.0.0 Alpha bootstrap The content of this branch was automatically imported from Fedora ELN with the following as its source: https://src.fedoraproject.org/rpms/efi-rpm-macros#53e42294ce46ed2cdb009f29d17dfad96a790f04 --- .gitignore | 8 +++ README.md | 3 + efi-rpm-macros.spec | 118 ++++++++++++++++++++++++++++++++++ gating.yaml | 6 ++ sources | 1 + tests/macros.efi-srpm_test.sh | 58 +++++++++++++++++ tests/test.spec | 22 +++++++ tests/tests.yml | 12 ++++ 8 files changed, 228 insertions(+) create mode 100644 README.md create mode 100644 efi-rpm-macros.spec create mode 100644 gating.yaml create mode 100644 sources create mode 100644 tests/macros.efi-srpm_test.sh create mode 100644 tests/test.spec create mode 100644 tests/tests.yml diff --git a/.gitignore b/.gitignore index e69de29..a163eed 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1,8 @@ +*~ +*.rpm +*.tar.* +.*.sw? +.build-*.log +efi-rpm-macros-*/ +x86_64/ +noarch/ diff --git a/README.md b/README.md new file mode 100644 index 0000000..7ba770d --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# efi-rpm-macros + +The efi-rpm-macros package \ No newline at end of file diff --git a/efi-rpm-macros.spec b/efi-rpm-macros.spec new file mode 100644 index 0000000..4ebf296 --- /dev/null +++ b/efi-rpm-macros.spec @@ -0,0 +1,118 @@ +Summary: Common RPM Macros for building EFI-related packages +Name: efi-rpm-macros +Version: 4 +Release: 5%{?dist} +License: GPLv3+ +URL: https://github.com/rhboot/%{name}/ +BuildRequires: git sed +BuildArch: noarch + +Source0: https://github.com/rhboot/%{name}/releases/download/%{version}/%{name}-4.tar.bz2 + +%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 +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 +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 -n %{name}-4 +git config --local --add efi.vendor "%{_efi_vendor_}" +git config --local --add efi.esp-root /boot/efi +git config --local --add efi.arches "x86_64 aarch64 %{arm} %{ix86}" + +%build +%make_build clean all + +%install +%make_install + +#%%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 +%{_rpmconfigdir}/brp-boot-efi-times + +%files -n efi-filesystem +%defattr(0700,root,root,-) +%dir /boot/efi +%dir /boot/efi/EFI +%dir /boot/efi/EFI/BOOT +%dir /boot/efi/EFI/%{_efi_vendor_} + +%changelog +* Mon Jul 27 2020 Fedora Release Engineering - 4-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Tue Jan 28 2020 Fedora Release Engineering - 4-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Wed Jul 24 2019 Fedora Release Engineering - 4-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Thu Jan 31 2019 Fedora Release Engineering - 4-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Wed Sep 26 2018 Peter Jones - 4-1 +- Provide %%{efi_build_requires} and brp-boot-efi-times + +* Thu Jul 12 2018 Fedora Release Engineering - 3-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* 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. +- Make efi-*-macros packages not be ExclusiveArch, because they need to work + in non-efi-arch packages. + +* 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/gating.yaml b/gating.yaml new file mode 100644 index 0000000..6985029 --- /dev/null +++ b/gating.yaml @@ -0,0 +1,6 @@ +--- !Policy +product_versions: + - rhel-8 +decision_context: osci_compose_gate +rules: + - !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional} diff --git a/sources b/sources new file mode 100644 index 0000000..ce2c756 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (efi-rpm-macros-4.tar.bz2) = 0c580902ec053d3bac167086a70fefd5785ddfd93873a48bb7801ab287b2b7af9db325a1f6e3609ad996656cfff713f741f911d012e89b48250ae108fedb789c diff --git a/tests/macros.efi-srpm_test.sh b/tests/macros.efi-srpm_test.sh new file mode 100644 index 0000000..7875cea --- /dev/null +++ b/tests/macros.efi-srpm_test.sh @@ -0,0 +1,58 @@ +#!/bin/bash + +# exit when any command fails +set -e + +declare -A archs +archs[ia64]="efi_alt_arch=none + efi_alt_arch_upper=NONE + efi_arch=ia64 + efi_arch_upper=IA64 + efi_has_alt_arch=00 + efi_has_arch=01" +archs[x86_64]="efi_alt_arch=ia32 + efi_alt_arch_upper=IA32 + efi_arch=x64 + efi_arch_upper=X64 + efi_has_alt_arch=01 + efi_has_arch=01" +archs["%{ix86}"]="efi_alt_arch=none + efi_alt_arch_upper=NONE + efi_arch=ia32 + efi_arch_upper=IA32 + efi_has_alt_arch=00 + efi_has_arch=01" +archs[aarch64]="efi_alt_arch=none + efi_alt_arch_upper=NONE + efi_arch=aa64 + efi_arch_upper=AA64 + efi_has_alt_arch=00 + efi_has_arch=01" +archs["%{arm}"]="efi_alt_arch=none + efi_alt_arch_upper=NONE + efi_arch=arm + efi_arch_upper=ARM + efi_has_alt_arch=00 + efi_has_arch=01" + +common="efi_esp_boot=/boot/efi/EFI/BOOT + efi_esp_dir=/boot/efi/EFI/redhat + efi_esp_efi=/boot/efi/EFI + efi_esp_root=/boot/efi + efi_vendor=redhat" + +output=$(mktemp) + +for arch in "${!archs[@]}"; do + echo "Testing ${arch}" + rpmbuild -bp --target ${arch}-redhat-linux test.spec \ + | grep -A12 %prep > $output + + for item in ${archs[$arch]}; do + grep ^$item $output + done + for item in ${common}; do + grep ^$item $output + done + echo "" +done diff --git a/tests/test.spec b/tests/test.spec new file mode 100644 index 0000000..c649d9a --- /dev/null +++ b/tests/test.spec @@ -0,0 +1,22 @@ +Name: test +Version: 1 +Release: 1%{?dist} +Summary: test +License: None + +%description +None + +%prep +echo efi_alt_arch=%{efi_alt_arch} +echo efi_alt_arch_upper=%{efi_alt_arch_upper} +echo efi_arch=%{efi_arch} +echo efi_arch_upper=%{efi_arch_upper} +echo efi_esp_boot=%{efi_esp_boot} +echo efi_esp_dir=%{efi_esp_dir} +echo efi_esp_efi=%{efi_esp_efi} +echo efi_esp_root=%{efi_esp_root} +echo efi_has_alt_arch=%{efi_has_alt_arch} +echo efi_has_arch=%{efi_has_arch} +echo efi_srpm_macros_version=%{efi_srpm_macros_version} +echo efi_vendor=%{efi_vendor} diff --git a/tests/tests.yml b/tests/tests.yml new file mode 100644 index 0000000..c943904 --- /dev/null +++ b/tests/tests.yml @@ -0,0 +1,12 @@ +--- +- hosts: all + roles: + - role: standard-test-basic + tags: + - classic + required_packages: + - rpm-build + tests: + - rpm-macros: + dir: . + run: ./macros.efi-srpm_test.sh