diff --git a/SPECS/bcm283x-firmware.spec b/SPECS/bcm283x-firmware.spec index 2700be0..2f1efab 100644 --- a/SPECS/bcm283x-firmware.spec +++ b/SPECS/bcm283x-firmware.spec @@ -17,9 +17,14 @@ URL: https://github.com/raspberrypi/ ExclusiveArch: %{arm} aarch64 +%if 0%{?rhel} == 7 +%define firmware_install_dir %{_datadir}/%{name} +%else BuildRequires: efi-filesystem BuildRequires: efi-srpm-macros Requires: efi-filesystem +%define firmware_install_dir %{efi_esp_root} +%endif Source0: %{name}-%{gitshort}.tar.xz Source1: config.txt @@ -35,20 +40,23 @@ Raspberry Pi. %build %install -mkdir -p %{buildroot}%{efi_esp_root}/overlays +mkdir -p %{buildroot}%{firmware_install_dir}/overlays %ifarch %{arm} -install -p %{SOURCE1} %{buildroot}%{efi_esp_root}/config.txt +install -p %{SOURCE1} %{buildroot}%{firmware_install_dir}/config.txt %endif %ifarch aarch64 -install -p %{SOURCE2} %{buildroot}%{efi_esp_root}/config.txt +install -p %{SOURCE2} %{buildroot}%{firmware_install_dir}/config.txt +%endif +install -p *bin %{buildroot}%{firmware_install_dir} +install -p *dat %{buildroot}%{firmware_install_dir} +install -p *elf %{buildroot}%{firmware_install_dir} +%if 0%{?fedora} || 0%{?rhel} >= 7 +install -p *dtb %{buildroot}%{firmware_install_dir} %endif -install -p *bin %{buildroot}%{efi_esp_root} -install -p *dat %{buildroot}%{efi_esp_root} -install -p *elf %{buildroot}%{efi_esp_root} -install -p *dtb %{buildroot}%{efi_esp_root} -install -p overlays/README %{buildroot}%{efi_esp_root}/overlays -install -p overlays/*.dtbo %{buildroot}%{efi_esp_root}/overlays +install -p overlays/README %{buildroot}%{firmware_install_dir}/overlays +install -p overlays/*.dtbo %{buildroot}%{firmware_install_dir}/overlays +%if 0%{?fedora} %pre # Remove in Fedora 32 or there abouts if [ -d /boot/fw ]; then @@ -57,18 +65,26 @@ if [ -d /boot/fw ]; then mount /boot/efi rmdir /boot/fw fi +%endif %files # DT Overlays covered under Linux Kernel GPLv2 %license LICENCE.broadcom COPYING.linux -%config(noreplace) %{efi_esp_root}/config.txt -%{efi_esp_root}/overlays -%{efi_esp_root}/*bin -%{efi_esp_root}/*dat -%{efi_esp_root}/*elf -%{efi_esp_root}/*.dtb +%if 0%{?rhel} == 7 +%{_datadir}/%{name} +%else +%config(noreplace) %{firmware_install_dir}/config.txt +%{firmware_install_dir}/overlays +%{firmware_install_dir}/*bin +%{firmware_install_dir}/*dat +%{firmware_install_dir}/*elf +%{firmware_install_dir}/*.dtb +%endif %changelog +* Tue Sep 10 2019 Pablo Greco 20190828-1.18bf532 +- Allow building in CentOS 7 saving to /usr/share + * Wed Aug 28 2019 Peter Robinson 20190828-1.18bf532 - Latest firmware update