Blame SPECS/alsa-sof-firmware.spec

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