kernel-firmware/makespec.sh

103 lines
2.5 KiB
Bash
Raw Normal View History

#!/bin/sh
#
# makespec.sh VERSION < kernel-firmware.spec.in > kernel-firmware.spec
#
export LANG=C
version="$1"
topics=$(awk '{print $1}' topicdefs | sort)
define_subpackage () {
local topic="$1"
local desc=$(grep '^'"$topic"'[[:space:]]' topicdefs | sed -e's/^[a-zA-Z0-9-]*[[:space:]]*//')
echo "%package $topic"
echo "Summary: Kernel firmware files for $desc"
echo "Group: System/Kernel"
echo "Requires(post): /usr/bin/mkdir /usr/bin/touch"
echo "Requires(postun):/usr/bin/mkdir /usr/bin/touch"
echo "Requires(post): dracut >= 049"
echo "Conflicts: kernel < 5.3"
Accepting request 1116463 from home:tiwai:branches:Kernel:HEAD - Update to version 20231006 (git commit 389575a8a177) (jsc#PED-6130, jsc#PED-6081): * WHENCE: add symlink for BananaPi M64 * linux-firmware: Add firmware file for Intel Bluetooth AX211 * linux-firmware: Update firmware file for Intel Bluetooth AX201 * linux-firmware: Update firmware file for Intel Bluetooth AX201 * linux-firmware: Update firmware file for Intel Bluetooth AX211 * linux-firmware: Update firmware file for Intel Bluetooth AX211 * linux-firmware: Update firmware file for Intel Bluetooth AX210 * linux-firmware: Update firmware file for Intel Bluetooth 9560 * linux-firmware: Update firmware file for Intel Bluetooth 9260 * Build debian and fedora images * Add new Makefile target to build a deb and rpm package * i915: Update MTL DMC to v2.17 * iwlwifi: add FWs for new GL and MA device types with multiple RF modules * amd_pmf: Add initial PMF TA for Smart PC Solution Builder * linux-firmware: Update FW files for MRVL PCIE 8997 chipsets * rtl_bt: Update RTL8851B BT USB firmware to 0x048A_D230 * iwlwifi: add new FWs from core81-65 release * iwlwifi: update cc/Qu/QuZ firmwares for core81-65 release - Drop fdupes to avoid missing files for split packages (bsc#1215464) - Add conflicts to each split subpk against uncompressed raw package; the contents may conflict and the compressed files won't be effective unless the raw files get removed - Update aliases OBS-URL: https://build.opensuse.org/request/show/1116463 OBS-URL: https://build.opensuse.org/package/show/Kernel:HEAD/kernel-firmware?expand=0&rev=443
2023-10-09 14:56:49 +02:00
echo "Conflicts: kernel-firmware < %{version}"
echo "Conflicts: kernel-firmware-uncompressed"
echo "%if 0%{?suse_version} >= 1550"
echo "# make sure we have post-usrmerge filesystem package on TW"
echo "Conflicts: filesystem < 84"
echo "%endif"
grep "^${topic}:" topicprovs | sed -e's/^[^ \t]*:[[:space:]]*//g'
sh ./get_supplements.sh $topic
echo
echo "%description $topic"
echo "This package contains compressed kernel firmware files for"
echo "$desc."
echo
}
define_post () {
local l="$*"
if [ -z "$l" -a -f uncompressed-post ]; then
cat uncompressed-post
return 0
fi
if [ -n "$l" -a -f "$l"-post ]; then
cat "$l"-post
return 0
fi
test -n "$l" && l=" $l"
echo "%post$l"
echo "%{?regenerate_initrd_post}"
echo
echo "%postun$l"
echo "%{?regenerate_initrd_post}"
echo
echo "%posttrans$l"
echo "%{?regenerate_initrd_posttrans}"
}
sed -e"s/@@VERSION@@/$version/g" | while read line; do
if [ "$line" = "@@ALLPROVS@@" ]; then
sed -e's/^[^ \t]*:[[:space:]]*//g' topicprovs
continue
fi
if [ "$line" = "@@SUBPKGLIST@@" ]; then
for t in $topics; do
echo "Requires: %{name}-$t = %{version}"
done
continue
fi
if [ "$line" = "@@SUBPKGPROVS@@" ]; then
for t in $topics; do
echo "Provides: %{name}-$t = %{version}"
done
continue
fi
if [ "$line" = "@@SUBPACKAGES@@" ]; then
for t in $topics; do
define_subpackage $t
done
continue
fi
case "$line" in
@@POST@@*)
define_post $(echo "$line" | sed -e's/^@@POST@@ *//')
continue;;
esac
if [ "$line" = "@@SUBPKGPOSTS@@" ]; then
for t in $topics; do
echo
define_post $t
done
continue
fi
if [ "$line" = "@@SUBPKGFILES@@" ]; then
for t in $topics; do
echo "%files -f files-$t $t"
echo
done
continue
fi
echo "$line"
done
exit 0