remove version for installation paths (based on Fedora specfile) [release 1.8-3mamba;Wed Sep 22 2021]

This commit is contained in:
Silvan Calarco 2024-01-05 20:20:53 +01:00
parent 3dc5998f4b
commit 25999dd4d9

View File

@ -1,15 +1,16 @@
#%global sof_commit 72a04d57d04c2df6e9dbf4eba0a98f40c252ee0b
Name: alsa-sof-firmware
Version: 1.8
Release: 2mamba
Release: 3mamba
Summary: Firmware and topology files for Sound Open Firmware project
Group: System/Kernel and Hardware
Vendor: openmamba
Distribution: openmamba
Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: https://github.com/thesofproject/sof-bin
Source: https://github.com/thesofproject/sof-bin.git/v%{version}/sof-bin-%{version}.tar.bz2
Source1: https://github.com/thesofproject/sof.git/v%{version}/sof-%{version}.tar.bz2
Source: https://github.com/thesofproject/sof-bin/releases/download/v%{version}/sof-bin-v%{version}.tar.gz
#Source: https://github.com/thesofproject/sof-bin.git/v%{version}/sof-bin-%{version}.tar.bz2
#Source1: https://github.com/thesofproject/sof.git/v%{version}/sof-%{version}.tar.bz2
License: BSD
## AUTOBUILDREQ-BEGIN
BuildRequires: glibc-devel
@ -19,67 +20,78 @@ BuildRequires: libalsa-devel
%description
Firmware and topology files for Sound Open Firmware project.
%prep
%setup -q -n sof-bin-%{version} -a1
%package debug
Requires: alsa-sof-firmware
Summary: Debug files for Sound Open Firmware project
License: BSD
## add missing symlink
#ln -s v1.4.2/intel-signed/sof-cnl-v1.4.2.ri lib/firmware/intel/sof/sof-cml.ri
%description debug
This package contains the debug files for the Sound Open Firmware project.
%prep
%setup -q -n sof-bin-v%{version}
mkdir -p firmware/intel/sof
# we have the version in the package name
mv sof-v%{version}/* firmware/intel/sof
# move topology files
mv sof-tplg-v%{version} firmware/intel/sof-tplg
# remove NXP firmware files
rm LICENCE.NXP
rm -rf firmware/intel/sof-tplg/sof-imx8*
%build
%ifarch x86_64 aarch64
cd sof-%{version}/tools
%cmake -d build
%make
%endif
#%ifarch x86_64 aarch64
#cd firmware/intel/sof/tools
#% cmake -d build
#
#% make
#%endif
%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
install -d -m0755 %{buildroot}/lib/firmware/intel
install -d -m0755 %{buildroot}/%{_bindir}
install -d -m0755 %{buildroot}/usr/lib/firmware
cp -ra firmware/* %{buildroot}/usr/lib/firmware/
FW_DEST=%{buildroot}/lib/firmware/intel TOOLS_DEST=%{buildroot}%{_bindir} ./install.sh v%{version}.x/v%{version}
FILEDIR=$(pwd)
pushd %{buildroot}/usr/lib/firmware
find -P . -name "*.ri" | sed -e '/^.$/d' > $FILEDIR/alsa-sof-firmware.files
#find -P . -name "*.tplg" | sed -e '/^.$/d' >> $FILEDIR/alsa-sof-firmware.files
find -P . -name "*.ldc" | sed -e '/^.$/d' > $FILEDIR/alsa-sof-firmware.debug-files
find -P . -type d | sed -e '/^.$/d' > $FILEDIR/alsa-sof-firmware.dirs
popd
# Remove prebuilt binaries
rm -f %{buildroot}%{_bindir}/*
# Workaround for update from previous version where sof is a directory but now it is a symlink
rm -f %{buildroot}/lib/firmware/intel/sof
%ifarch x86_64 aarch64
%makeinstall -C sof-%{version}/tools/build
%endif
sed -i -e 's:^./::' alsa-sof-firmware.{files,debug-files,dirs}
sed -i -e 's!^!/usr/lib/firmware/!' alsa-sof-firmware.{files,debug-files,dirs}
sed -e 's/^/%%dir /' alsa-sof-firmware.dirs >> alsa-sof-firmware.files
cat alsa-sof-firmware.files
%clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
# script to replace sof direcotory with symlink
%posttrans
[ -L /lib/firmware/intel/sof ] || ln -s sof-tplg-v%{version} /lib/firmware/intel/sof
:
%pretrans -p <lua>
path = "/lib/firmware/intel/sof-tplg"
st = posix.stat(path)
if st and st.type == "link" then
os.remove(path)
end
%files
%files -f alsa-sof-firmware.files
%defattr(-,root,root)
%ifarch x86_64 aarch64
%{_bindir}/sof-ctl
%{_bindir}/sof-logger
%{_bindir}/sof-probes
%endif
#/lib/firmware/intel/sof
/lib/firmware/intel/sof-tplg
%dir /lib/firmware/intel/sof-tplg-v%{version}
/lib/firmware/intel/sof-tplg-v%{version}/sof-*.tplg
%dir /lib/firmware/intel/sof-v%{version}
%dir /lib/firmware/intel/sof-v%{version}/community
/lib/firmware/intel/sof-v%{version}/community/sof-*.ri
%dir /lib/firmware/intel/sof-v%{version}/intel-signed
/lib/firmware/intel/sof-v%{version}/intel-signed/*.ri
/lib/firmware/intel/sof-v%{version}/sof-*.ldc
/lib/firmware/intel/sof-v%{version}/sof-*.ri
%dir /usr/lib/firmware/intel/sof-tplg
/usr/lib/firmware/intel/sof-tplg/*
%doc LICENCE.Intel
%files debug -f alsa-sof-firmware.debug-files
%changelog
* Wed Sep 22 2021 Silvan Calarco <silvan.calarco@mambasoft.it> 1.8-3mamba
- remove version for installation paths (based on Fedora specfile)
* Fri Jun 25 2021 Silvan Calarco <silvan.calarco@mambasoft.it> 1.8-2mamba
- remove x86_64 only prebuilt binaries