2019-03-19 09:08:50 +01:00
|
|
|
%define rpm_kver %(rpm -q --qf '%%{VERSION}' %kernel_package_name)
|
|
|
|
%define rpm_krel %(rpm -q --qf '%%{RELEASE}' %kernel_package_name)
|
|
|
|
|
2021-11-18 10:32:57 +01:00
|
|
|
%include /usr/lib/rpm/kernel/kernel-spec-macros
|
|
|
|
|
2019-03-19 09:08:50 +01:00
|
|
|
# Force bzip2 instead of lzma compression to
|
|
|
|
# 1) allow install on older dist versions, and
|
|
|
|
# 2) decrease build times (bsc#962356)
|
|
|
|
# %%define _binary_payload w9.bzdio
|
|
|
|
# Do not recompute the build-id of vmlinux in find-debuginfo.sh (bsc#964063)
|
|
|
|
%undefine _unique_build_ids
|
|
|
|
%define _no_recompute_build_ids 1
|
|
|
|
# prevent usr/lib/debug/boot/vmlinux-4.12.14-11.10-default-4.12.14-11.10.ppc64le.debug
|
|
|
|
%undefine _unique_debug_names
|
|
|
|
|
|
|
|
%define kernel_requires %(rpm -q --queryformat '[%%{REQUIREFLAGS:deptype},%%{REQUIRENEVRS}\\n]' %kernel_package_name | grep -vE 'rpmlib,|interp,' | grep -E 'manual,' | sed -e 's/.*,//' | tr '\\n' ' ')
|
|
|
|
%define kernel_requires_pre %(rpm -q --queryformat '[%%{REQUIREFLAGS:deptype},%%{REQUIRENEVRS}\\n]' %kernel_package_name | grep -vE 'rpmlib,|interp,' | grep -E 'pre,' | sed -e 's/.*,//' | tr '\\n' ' ')
|
|
|
|
%define kernel_requires_preun %(rpm -q --queryformat '[%%{REQUIREFLAGS:deptype},%%{REQUIRENEVRS}\\n]' %kernel_package_name | grep -vE 'rpmlib,|interp,' | grep -E 'preun,' | sed -e 's/.*,//' | tr '\\n' ' ')
|
|
|
|
%define kernel_requires_post %(rpm -q --queryformat '[%%{REQUIREFLAGS:deptype},%%{REQUIRENEVRS}\\n]' %kernel_package_name | grep -vE 'rpmlib,|interp,' | grep -E 'post,' | sed -e 's/.*,//' | tr '\\n' ' ')
|
|
|
|
%define kernel_requires_postun %(rpm -q --queryformat '[%%{REQUIREFLAGS:deptype},%%{REQUIRENEVRS}\\n]' %kernel_package_name | grep -vE 'rpmlib,|interp,' | grep -E 'postun,' | sed -e 's/.*,//' | tr '\\n' ' ')
|
2020-01-17 09:06:43 +01:00
|
|
|
%define kernel_base_provides %(rpm -q --queryformat '[%%{PROVIDENEVRS}\\n]' %kernel_package_name | sed -E 's/^%kernel_package_name(-srchash| =)/%name\\1/g' | grep -vE '^(ksym|kmod|firmware)[(]' | tr '\\n' ' )')
|
|
|
|
%define kernel_base_obsoletes %(rpm -q --queryformat '[%%{OBSOLETENEVRS}\\n]' %kernel_package_name | sed -E 's/^%kernel_package_name(-srchash| =)/%name\\1/g' | grep -vE '^(ksym|kmod|firmware)[(]' | tr '\\n' ' )')
|
|
|
|
%define kernel_base_conflicts %(rpm -q --queryformat '[%%{CONFLICTNEVRS}\\n]' %kernel_package_name | grep -vE '^(ksym|kmod|firmware)[(]' | tr '\\n' ' )')
|
|
|
|
%define kernel_base_recommends %(rpm -q --queryformat '[%%{RECOMMENDNEVRS}\\n]' %kernel_package_name | grep -v '^kernel-firmware' | grep -vE '^(ksym|kmod|firmware)[(]' | tr '\\n' ' )')
|
2019-03-19 09:08:50 +01:00
|
|
|
|
|
|
|
%if ! %(expr 1 - 1)
|
|
|
|
%if "%{kernel_requires}" != ""
|
|
|
|
Requires: %kernel_requires
|
|
|
|
%endif
|
|
|
|
%if "%{kernel_requires_pre}" != ""
|
|
|
|
Requires(pre): %kernel_requires_pre
|
|
|
|
%endif
|
|
|
|
%if "%{kernel_requires_preun}" != ""
|
|
|
|
Requires(preun):%kernel_requires_preun
|
|
|
|
%endif
|
|
|
|
%if "%{kernel_requires_post}" != ""
|
|
|
|
Requires(post): %kernel_requires_post
|
|
|
|
%endif
|
|
|
|
%if "%{kernel_requires_postun}" != ""
|
|
|
|
Requires(postun):%kernel_requires_postun
|
|
|
|
%endif
|
|
|
|
%endif
|
2020-01-17 09:06:43 +01:00
|
|
|
%if "%{kernel_base_provides}" != ""
|
|
|
|
Provides: %{kernel_base_provides}
|
|
|
|
%endif
|
|
|
|
%if "%{kernel_base_obsoletes}" != ""
|
|
|
|
Obsoletes: %{kernel_base_obsoletes}
|
|
|
|
%endif
|
|
|
|
%if "%{kernel_base_conflicts}" != ""
|
|
|
|
Conflicts: %{kernel_base_conflicts}
|
|
|
|
%endif
|
2020-01-04 09:05:41 +01:00
|
|
|
%if "%{kernel_base_recommends}" != ""
|
|
|
|
Recommends: %{kernel_base_recommends}
|
|
|
|
%endif
|
2021-11-18 10:32:57 +01:00
|
|
|
# This should give Conflicts: %%kernel_package_name = %%source_rel as old
|
|
|
|
# kernel-default-base did. Together with the %%obsolete_rebuilds translated
|
|
|
|
# from %%kernel_package_name to %%name we should be set for obsoletes against
|
|
|
|
# kernel rebuilds.
|
2019-03-19 09:08:50 +01:00
|
|
|
Conflicts: %(rpm -q --queryformat '[%%{PROVIDENEVRS}\n]' %kernel_package_name | grep '^%kernel_package_name =' | sort -V | head -n 1)
|
2021-11-18 10:32:57 +01:00
|
|
|
# To protect against obsolete rebuilds of self we need a provide equivalent to
|
|
|
|
# %%source_rel on this package version, and do obsolete of lower upload numbers
|
|
|
|
# and lower rebuild numbers of %%name built against same kernel.
|
|
|
|
# The %%source-rel is calculated from the subpackage version here.
|
|
|
|
Provides: %name = %version-%source_rel
|
|
|
|
%obsolete_rebuilds_subpackage %name
|
2019-03-19 09:08:50 +01:00
|
|
|
|
|
|
|
%description
|
|
|
|
%(rpm -q --qf '%%{DESCRIPTION}' %kernel_package_name)
|
|
|
|
%extradescription
|
|
|
|
|
|
|
|
This is a subpackage of %kernel_package_name. Development files are in
|
2019-11-06 09:08:16 +01:00
|
|
|
%kernel_package_name-devel, sources in kernel-source%variant, and
|
|
|
|
debug information in %kernel_package_name-debuginfo.
|
2019-03-19 09:08:50 +01:00
|
|
|
|
2019-04-12 10:08:27 +02:00
|
|
|
%package rebuild
|
|
|
|
Summary: Empty package to ensure rebuilding %name in OBS
|
|
|
|
Group: Other
|
|
|
|
Requires: %kernel_package_name = %rpm_kver-%rpm_krel
|
|
|
|
|
|
|
|
%description rebuild
|
|
|
|
This is empty package that ensures %name is rebuilt every time
|
|
|
|
%kernel_package_name is rebuilt in OBS.
|
|
|
|
|
|
|
|
There is no reason to install this package.
|
|
|
|
|
|
|
|
%files rebuild
|
|
|
|
|
2019-03-19 09:08:50 +01:00
|
|
|
%prep
|
|
|
|
|
|
|
|
%build
|
|
|
|
|
|
|
|
%install
|
|
|
|
|
|
|
|
echo "%{?modules}" | tr ', ' '\n\n' > request-modules
|
|
|
|
%scriptdir/kernel-subpackage-build %kernel_package_name %rpm_kver-%rpm_krel %package_name-%version-%release
|
|
|
|
|
2021-10-08 06:38:15 +02:00
|
|
|
%pre -f prein.sh
|
|
|
|
|
|
|
|
%post -f postin.sh
|
|
|
|
|
2019-03-19 09:08:50 +01:00
|
|
|
%preun -f preun.sh
|
|
|
|
|
|
|
|
%postun -f postun.sh
|
|
|
|
|
2021-10-08 06:38:15 +02:00
|
|
|
%posttrans -f posttrans.sh
|
2019-03-19 09:08:50 +01:00
|
|
|
|
|
|
|
%files -f subpackage.flist
|
|
|
|
|
|
|
|
%changelog
|