2019-08-15 19:52:36 +02:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# makespec.sh VERSION < kernel-firmware.spec.in > kernel-firmware.spec
|
|
|
|
#
|
|
|
|
|
|
|
|
version="$1"
|
|
|
|
|
|
|
|
topics=$(awk '{print $1}' topicdefs)
|
|
|
|
|
|
|
|
define_subpackage () {
|
|
|
|
local topic="$1"
|
2019-08-19 17:52:25 +02:00
|
|
|
local desc=$(grep '^'"$topic"'[[:space:]]' topicdefs | sed -e's/^[a-zA-Z0-9-]*[[:space:]]*//')
|
2019-08-15 19:52:36 +02:00
|
|
|
echo "%package $topic"
|
|
|
|
echo "Summary: Kernel firmware files for $desc"
|
|
|
|
echo "Group: System/Kernel"
|
2020-06-04 17:27:43 +02:00
|
|
|
echo "Requires(post): /usr/bin/mkdir /usr/bin/touch"
|
2022-06-08 12:40:21 +02:00
|
|
|
echo "Requires(postun):/usr/bin/mkdir /usr/bin/touch"
|
2019-09-23 09:44:12 +02:00
|
|
|
echo "Requires(post): dracut >= 049"
|
2019-08-15 19:52:36 +02:00
|
|
|
echo "Conflicts: kernel < 5.3"
|
2021-07-16 16:30:05 +02:00
|
|
|
echo "%if 0%{?suse_version} >= 1550"
|
|
|
|
echo "# make sure we have post-usrmerge filesystem package on TW"
|
|
|
|
echo "Conflicts: filesystem < 84"
|
|
|
|
echo "%endif"
|
2019-08-15 19:52:36 +02:00
|
|
|
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="$*"
|
|
|
|
test -n "$l" && l=" $l"
|
|
|
|
echo "%post$l"
|
|
|
|
echo "%{?regenerate_initrd_post}"
|
2022-06-08 12:40:21 +02:00
|
|
|
echo
|
2019-08-15 19:52:36 +02:00
|
|
|
echo "%postun$l"
|
|
|
|
echo "%{?regenerate_initrd_post}"
|
2022-06-08 12:40:21 +02:00
|
|
|
echo
|
2019-08-15 19:52:36 +02:00
|
|
|
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" = "@@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
|
2022-06-08 12:40:21 +02:00
|
|
|
echo
|
2019-08-15 19:52:36 +02:00
|
|
|
define_post $t
|
|
|
|
done
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
if [ "$line" = "@@SUBPKGFILES@@" ]; then
|
|
|
|
for t in $topics; do
|
|
|
|
echo "%files -f files-$t $t"
|
2022-06-08 12:40:21 +02:00
|
|
|
echo
|
2019-08-15 19:52:36 +02:00
|
|
|
done
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
echo "$line"
|
|
|
|
done
|
|
|
|
|
|
|
|
exit 0
|