Version: gitfbef4d %global debug_package %{nil} %global _firmwarepath /usr/lib/firmware %define _binaries_in_noarch_packages_terminate_build 0 Name: linux-firmware Release: 1%{?dist} Summary: Firmware files used by the Linux kernel License: GPL+ and GPLv2+ and MIT and Redistributable, no modification permitted URL: http://www.kernel.org/ BuildArch: noarch Source0: linux-firmware-main.tar.gz BuildRequires: make BuildRequires: git-core # Not required but de-dupes FW so reduces size BuildRequires: rdfind Requires: linux-firmware-whence Provides: kernel-firmware = %{version} Obsoletes: kernel-firmware < %{version} Conflicts: microcode_ctl < 2.1-0 Recommends: amd-gpu-firmware %description This package includes firmware files required for some devices to operate. %package whence Summary: WHENCE License file License: GPL+ and GPLv2+ and MIT and Redistributable, no modification permitted %description whence This package contains the WHENCE license file which documents the vendor license details. # GPU firmwares %package -n amd-gpu-firmware Summary: Firmware for AMD GPUs License: Redistributable, no modification permitted Requires: linux-firmware-whence %description -n amd-gpu-firmware Firmware for AMD amdgpu and radeon GPUs. %prep %autosetup -S git -p1 -n linux-firmware-main %build %install mkdir -p %{buildroot}/%{_firmwarepath} mkdir -p %{buildroot}/%{_firmwarepath}/updates %if 0%{?fedora} >= 34 || 0%{?rhel} >= 9 make DESTDIR=%{buildroot}/ FIRMWAREDIR=%{_firmwarepath} install-xz %else make DESTDIR=%{buildroot}/ FIRMWAREDIR=%{_firmwarepath} install %endif #Cleanup files we don't want to ship pushd %{buildroot}/%{_firmwarepath} # Remove firmware shipped in separate packages already # Perhaps these should be built as subpackages of linux-firmware? rm -rf ess korg sb16 yamaha # Remove firmware for Creative CA0132 HD as it's in alsa-firmware rm -f ctefx.bin* ctspeq.bin* # Remove source files we don't need to install rm -rf carl9170fw rm -rf cis/{src,Makefile} rm -f atusb/ChangeLog rm -f av7110/{Boot.S,Makefile} rm -f dsp56k/{bootstrap.asm,concat-bootstrap.pl,Makefile} rm -f iscis/{*.c,*.h,README,Makefile} rm -f keyspan_pda/{keyspan_pda.S,xircom_pgs.S,Makefile} rm -f usbdux/*dux */*.asm # No need to install old firmware versions where we also provide newer versions # which are preferred and support the same (or more) hardware rm -f libertas/sd8686_v8* rm -f libertas/usb8388_v5.bin* # Remove superfluous infra files rm -f check_whence.py configure Makefile README popd # Create file list but exclude firmwares that we place in subpackages FILEDIR=`pwd` pushd %{buildroot}/%{_firmwarepath} find . \! -type d > $FILEDIR/linux-firmware.files find . -type d | sed -e '/^.$/d' > $FILEDIR/linux-firmware.dirs popd sed -i -e 's:^./::' linux-firmware.{files,dirs} sed \ -i -e '/^amdgpu/d' \ linux-firmware.files sed -i -e 's!^!/usr/lib/firmware/!' linux-firmware.{files,dirs} sed -i -e 's/^/"/;s/$/"/' linux-firmware.files sed -e 's/^/%%dir /' linux-firmware.dirs >> linux-firmware.files %files -f linux-firmware.files %dir %{_firmwarepath} %license LICENCE.* LICENSE.* GPL* %files whence %license WHENCE # GPU firmwares %files -n amd-gpu-firmware %license LICENSE.radeon LICENSE.amdgpu %{_firmwarepath}/amdgpu/ %{_firmwarepath}/radeon/ %changelog * Sat Feb 17 2024 Switchy Rascal - Initial build