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 #%global sof_commit 72a04d57d04c2df6e9dbf4eba0a98f40c252ee0b
Name: alsa-sof-firmware Name: alsa-sof-firmware
Version: 1.8 Version: 1.8
Release: 2mamba Release: 3mamba
Summary: Firmware and topology files for Sound Open Firmware project Summary: Firmware and topology files for Sound Open Firmware project
Group: System/Kernel and Hardware Group: System/Kernel and Hardware
Vendor: openmamba Vendor: openmamba
Distribution: openmamba Distribution: openmamba
Packager: Silvan Calarco <silvan.calarco@mambasoft.it> Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: https://github.com/thesofproject/sof-bin URL: https://github.com/thesofproject/sof-bin
Source: https://github.com/thesofproject/sof-bin.git/v%{version}/sof-bin-%{version}.tar.bz2 Source: https://github.com/thesofproject/sof-bin/releases/download/v%{version}/sof-bin-v%{version}.tar.gz
Source1: https://github.com/thesofproject/sof.git/v%{version}/sof-%{version}.tar.bz2 #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 License: BSD
## AUTOBUILDREQ-BEGIN ## AUTOBUILDREQ-BEGIN
BuildRequires: glibc-devel BuildRequires: glibc-devel
@ -19,67 +20,78 @@ BuildRequires: libalsa-devel
%description %description
Firmware and topology files for Sound Open Firmware project. Firmware and topology files for Sound Open Firmware project.
%prep %package debug
%setup -q -n sof-bin-%{version} -a1 Requires: alsa-sof-firmware
Summary: Debug files for Sound Open Firmware project
License: BSD
## add missing symlink %description debug
#ln -s v1.4.2/intel-signed/sof-cnl-v1.4.2.ri lib/firmware/intel/sof/sof-cml.ri 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 %build
%ifarch x86_64 aarch64 #%ifarch x86_64 aarch64
cd sof-%{version}/tools #cd firmware/intel/sof/tools
%cmake -d build #% cmake -d build
#
%make #% make
%endif #%endif
%install %install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" [ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
install -d -m0755 %{buildroot}/lib/firmware/intel install -d -m0755 %{buildroot}/usr/lib/firmware
install -d -m0755 %{buildroot}/%{_bindir} 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
# Remove prebuilt binaries find -P . -name "*.ri" | sed -e '/^.$/d' > $FILEDIR/alsa-sof-firmware.files
rm -f %{buildroot}%{_bindir}/* #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
# Workaround for update from previous version where sof is a directory but now it is a symlink find -P . -type d | sed -e '/^.$/d' > $FILEDIR/alsa-sof-firmware.dirs
rm -f %{buildroot}/lib/firmware/intel/sof popd
%ifarch x86_64 aarch64 sed -i -e 's:^./::' alsa-sof-firmware.{files,debug-files,dirs}
%makeinstall -C sof-%{version}/tools/build sed -i -e 's!^!/usr/lib/firmware/!' alsa-sof-firmware.{files,debug-files,dirs}
%endif sed -e 's/^/%%dir /' alsa-sof-firmware.dirs >> alsa-sof-firmware.files
cat alsa-sof-firmware.files
%clean %clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" [ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
# script to replace sof direcotory with symlink %pretrans -p <lua>
%posttrans path = "/lib/firmware/intel/sof-tplg"
[ -L /lib/firmware/intel/sof ] || ln -s sof-tplg-v%{version} /lib/firmware/intel/sof 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) %defattr(-,root,root)
%ifarch x86_64 aarch64 %dir /usr/lib/firmware/intel/sof-tplg
%{_bindir}/sof-ctl /usr/lib/firmware/intel/sof-tplg/*
%{_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
%doc LICENCE.Intel %doc LICENCE.Intel
%files debug -f alsa-sof-firmware.debug-files
%changelog %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 * Fri Jun 25 2021 Silvan Calarco <silvan.calarco@mambasoft.it> 1.8-2mamba
- remove x86_64 only prebuilt binaries - remove x86_64 only prebuilt binaries