Blame SPECS/alsa-sof-firmware.spec

55e321
# This is a firmware package, so binaries (which are not run on the host)
55e321
# in the end package are expected.
55e321
%define _binaries_in_noarch_packages_terminate_build   0
55e321
%global _firmwarepath  /usr/lib/firmware
55e321
55e321
cc8acf
%global sof_version 1.6.1
cc8acf
%global sof_commit b77c851bc4ec1b6b552eaf1a61a66f3df4a13ab8
55e321
%global sof_shortcommit %(c=%{sof_commit}; echo ${c:0:7})
55e321
55e321
Summary:        Firmware and topology files for Sound Open Firmware project
55e321
Name:           alsa-sof-firmware
55e321
Version:        %{sof_version}
cc8acf
Release:        1%{?dist}
55e321
# See later in the spec for a breakdown of licensing
55e321
License:        BSD
55e321
URL:            https://github.com/thesofproject/sof-bin
55e321
Source:         https://github.com/thesofproject/sof-bin/archive/%{sof_commit}/sof-bin-%{sof_shortcommit}.tar.gz
55e321
55e321
# noarch, since the package is firmware
55e321
BuildArch:      noarch
55e321
55e321
%description
55e321
This package contains the firmware binaries for the Sound Open Firmware project.
55e321
55e321
%package debug
55e321
Requires:       alsa-sof-firmware
55e321
Summary:        Debug files for Sound Open Firmware project
55e321
License:        BSD
55e321
55e321
%description debug
55e321
This package contains the debug files for the Sound Open Firmware project.
55e321
55e321
%prep
55e321
%autosetup -n sof-bin-%{sof_commit}
55e321
55e321
cd lib/firmware
55e321
55e321
# we have the version in the package name
55e321
mv intel/sof/v%{sof_version}/* intel/sof
55e321
rmdir intel/sof/v%{sof_version}
55e321
55e321
# rename intel signed firmware files
cc8acf
for platform in apl cnl ehl icl tgl; do
55e321
  mv intel/sof/intel-signed/sof-$platform-v%{sof_version}.ri intel/sof/intel-signed/sof-$platform.ri
55e321
  ln -sf intel-signed/sof-$platform.ri intel/sof/sof-$platform.ri
55e321
done
55e321
55e321
# rename public signed firmware files
cc8acf
for platform in apl cnl icl tgl; do
55e321
  mv intel/sof/public-signed/sof-$platform-v%{sof_version}.ri intel/sof/public-signed/sof-$platform.ri
55e321
done
55e321
55e321
# rename unsigned firmware files
55e321
for platform in bdw byt cht; do
55e321
  mv intel/sof/sof-$platform-v%{sof_version}.ri intel/sof/sof-$platform.ri
55e321
done
55e321
55e321
# rename debug files
cc8acf
for platform in apl bdw byt cht cnl ehl icl tgl; do
55e321
  mv intel/sof/sof-$platform-v%{sof_version}.ldc intel/sof/sof-$platform.ldc
55e321
done
55e321
cc8acf
# add missing symlinks
cc8acf
ln -s intel-signed/sof-apl.ri intel/sof/sof-glk.ri
55e321
ln -s intel-signed/sof-cnl.ri intel/sof/sof-cml.ri
55e321
ln -s intel-signed/sof-cnl.ri intel/sof/sof-cfl.ri
55e321
55e321
# move topology files
55e321
rm -f intel/sof-tplg
55e321
mv intel/sof-tplg-v%{sof_version} intel/sof-tplg
55e321
55e321
# remove NXP firmware files
cc8acf
rm -rf nxp ../../LICENCE.NXP
cc8acf
rm -rf intel/sof-tplg/sof-imx8*
55e321
55e321
%build
55e321
55e321
%install
55e321
mkdir -p %{buildroot}%{_firmwarepath}
55e321
cp -ra lib/firmware/* %{buildroot}%{_firmwarepath}
55e321
55e321
# gather files and directories
55e321
FILEDIR=$(pwd)
55e321
pushd %{buildroot}/%{_firmwarepath}
55e321
find -P . -name "*.ri" | sed -e '/^.$/d' > $FILEDIR/alsa-sof-firmware.files
55e321
#find -P . -name "*.tplg" | sed -e '/^.$/d' >> $FILEDIR/alsa-sof-firmware.files
55e321
find -P . -name "*.ldc" | sed -e '/^.$/d' > $FILEDIR/alsa-sof-firmware.debug-files
55e321
find -P . -type d | sed -e '/^.$/d' > $FILEDIR/alsa-sof-firmware.dirs
55e321
popd
55e321
sed -i -e 's:^./::' alsa-sof-firmware.{files,debug-files,dirs}
55e321
sed -i -e 's!^!/usr/lib/firmware/!' alsa-sof-firmware.{files,debug-files,dirs}
55e321
sed -e 's/^/%%dir /' alsa-sof-firmware.dirs >> alsa-sof-firmware.files
55e321
cat alsa-sof-firmware.files
55e321
55e321
%files -f alsa-sof-firmware.files
55e321
%license LICENCE*
55e321
%doc README*
55e321
%dir %{_firmwarepath}
55e321
55e321
# Licence: 3-clause BSD
55e321
# .. for files with suffix .tplg
55e321
%{_firmwarepath}/intel/sof-tplg
55e321
55e321
# Licence: SOF (3-clause BSD plus others)
55e321
# .. for files with suffix .ri
55e321
55e321
%files debug -f alsa-sof-firmware.debug-files
55e321
55e321
%changelog
cc8acf
* Sun Jan  3 2021 Jaroslav Kysela <perex@perex.cz> - 1.6.1-1
cc8acf
- Update to v1.6.1
cc8acf
cc8acf
* Thu Dec 10 2020 Jaroslav Kysela <perex@perex.cz> - 1.6-2
cc8acf
- Update to v1.6 (Dec 9)
cc8acf
cc8acf
* Wed Nov 11 2020 Jaroslav Kysela <perex@perex.cz> - 1.6-1
cc8acf
- Update to v1.6 (Oct 13)
cc8acf
55e321
* Mon Jun  8 2020 Jaroslav Kysela <perex@perex.cz> - 1.5-2
55e321
- Update to v1.5
55e321
55e321
* Tue Apr 21 2020 Jaroslav Kysela <perex@perex.cz> - 1.4.2-2
55e321
- Initial version (Open Sound Firmware v1.4.2)