%define postver 4
%define rel 0.1
-%define alt_kernel 6.6
+%define __alt_kernel %{nil}
+
+%if "%{__alt_kernel}" != ""
+%define alt_kernel %{__alt_kernel}
+%endif
+
+%define versuffix -%{basever}
# kernel release (used in filesystem and eventually in uname -r)
# modules will be looked from /lib/modules/%{kernel_release}
# localversion is just that without version for "> localversion"
%define localversion %{rel}
-%define kernel_release %{version}%{?alt_kernel:-%{alt_kernel}}-%{localversion}
+%define kernel_release %{version}%{?alt_kernel:_%{alt_kernel}}-%{localversion}
Summary: The Linux kernel (the core of the Linux operating system)
Summary(de.UTF-8): Der Linux-Kernel (Kern des Linux-Betriebssystems)
Summary(et.UTF-8): Linuxi kernel (ehk operatsioonisüsteemi tuum)
Summary(fr.UTF-8): Le Kernel-Linux (La partie centrale du systeme)
Summary(pl.UTF-8): Jądro Linuksa
-Name: kernel%{_alt_kernel}
+Name: kernel%{versuffix}%{_alt_kernel}
Version: %{basever}.%{postver}
Release: %{rel}
Epoch: 3
Suggests: linux-firmware
Provides: %{name}(netfilter) = 20070806
Provides: %{name}(vermagic) = %{kernel_release}
-Obsoletes: kernel%{_alt_kernel}-vanilla
Obsoletes: kernel-firmware
Obsoletes: kernel-modules
Conflicts: e2fsprogs < 1.29
%define objdir %{topdir}/%{targetobj}
%define targetobj %{_target_base_arch}-gcc-%(%{kgcc} -dumpversion)
-%define _kernelsrcdir /usr/src/linux%{_alt_kernel}-%{version}
+%define _kernelsrcdir /usr/src/linux%{versuffix}%{_alt_kernel}-%{version}
%if "%{_target_base_arch}" != "%{_host_base_arch}"
%define CrossOpts ARCH=%{_target_base_arch} CROSS_COMPILE=%{_target_cpu}-tld-linux-
Summary(pl.UTF-8): vmlinux - rozpakowany obraz jądra
Group: Base/Kernel
Obsoletes: kernel-smp-vmlinux
-Obsoletes: kernel%{_alt_kernel}-vanilla-vmlinux
%description vmlinux
vmlinux - uncompressed kernel image.
Requires(postun): %{name} = %{epoch}:%{version}-%{release}
Requires: %{name} = %{epoch}:%{version}-%{release}
Obsoletes: kernel-smp-drm
-Obsoletes: kernel%{_alt_kernel}-vanilla-drm
AutoReqProv: no
%description drm
Requires(postun): %{name} = %{epoch}:%{version}-%{release}
Requires: %{name} = %{epoch}:%{version}-%{release}
Obsoletes: kernel-smp-pcmcia
-Obsoletes: kernel%{_alt_kernel}-vanilla-pcmcia
Conflicts: pcmcia-cs < 3.1.21
Conflicts: pcmciautils < 004
AutoReqProv: no
Requires(postun): %{name} = %{epoch}:%{version}-%{release}
Requires: %{name} = %{epoch}:%{version}-%{release}
Obsoletes: kernel-smp-sound-alsa
-Obsoletes: kernel%{_alt_kernel}-vanilla-sound-alsa
AutoReqProv: no
%description sound-alsa
Summary(pl.UTF-8): Pliki nagłówkowe jądra Linuksa
Group: Development/Building
Provides: %{name}-headers(netfilter) = 20070806
-Obsoletes: kernel%{_alt_kernel}-vanilla-headers
AutoReqProv: no
%description headers
Summary(pl.UTF-8): Pliki służące do budowania modułów jądra
Group: Development/Building
Requires: %{name}-headers = %{epoch}:%{version}-%{release}
-Obsoletes: kernel%{_alt_kernel}-vanilla-module-build
Conflicts: rpmbuild(macros) < 1.652
AutoReqProv: no
Summary(pl.UTF-8): Kod źródłowy jądra Linuksa
Group: Development/Building
Requires: %{name}-module-build = %{epoch}:%{version}-%{release}
-Obsoletes: kernel%{_alt_kernel}-vanilla-source
AutoReqProv: no
%description source
Summary(de.UTF-8): Kernel Dokumentation
Summary(pl.UTF-8): Dokumentacja do jądra Linuksa
Group: Documentation
-Obsoletes: kernel%{_alt_kernel}-vanilla-doc
AutoReqProv: no
%description doc
%endif
# Fix EXTRAVERSION in main Makefile
-sed -i 's#EXTRAVERSION =.*#EXTRAVERSION = %{?alt_kernel:-%{alt_kernel}}#g' Makefile
+sed -i 's#EXTRAVERSION =.*#EXTRAVERSION = %{?alt_kernel:_%{alt_kernel}}#g' Makefile
# cleanup backups after patching
find '(' -name '*~' -o -name '*.orig' -o -name '.gitignore' ')' -print0 | xargs -0 -r -l512 rm -f
%{__sed} -i -e '1s,/usr/bin/python$,%{__python},' \
-e '1s,/usr/bin/env python$,%{__python},' \
-e '1s,/usr/bin/env python3$,%{__python3},' \
- scripts/bloat-o-meter \
- scripts/diffconfig \
- scripts/jobserver-exec \
- scripts/show_delta \
- tools/hv/vmbus_testing \
- tools/kvm/kvm_stat/kvm_stat \
- tools/testing/selftests/exec/binfmt_script.py
+ drivers/staging/greybus/tools/lbtest \
+ scripts/bloat-o-meter \
+ scripts/diffconfig \
+ scripts/dtc/dt-extract-compatibles \
+ scripts/jobserver-exec \
+ scripts/show_delta \
+ tools/hv/vmbus_testing \
+ tools/kvm/kvm_stat/kvm_stat \
+ tools/testing/selftests/exec/binfmt_script.py
find -name '*.pl' -print0 | \
xargs -0 %{__sed} -i -e '1s,/usr/bin/env perl,%{__perl},' \
scripts/sphinx-pre-install \
scripts/stackdelta
-%{__sed} -E -i -e '1s,#!\s*/usr/bin/env\s+bash(\s|$),#!/bin/bash\\1,' \
- scripts/config
-
-%{__sed} -i -e '1s,/usr/bin/awk,/bin/awk,' \
- scripts/ld-version.sh
+%{__sed} -i -e '1s,/usr/bin/env bash,%{__bash},' \
+ tools/testing/selftests/powerpc/security/mitigation-patching.sh \
+ scripts/config \
+ scripts/check-local-export
%build
install -d %{objdir}
%depmod %{kernel_release}
%post headers
-ln -snf %{basename:%{_kernelsrcdir}} %{_prefix}/src/linux%{_alt_kernel}
+ln -snf %{basename:%{_kernelsrcdir}} %{_prefix}/src/linux%{versuffix}%{_alt_kernel}
%postun headers
if [ "$1" = "0" ]; then
- if [ -L %{_prefix}/src/linux%{_alt_kernel} ]; then
- if [ "$(readlink %{_prefix}/src/linux%{_alt_kernel})" = "linux%{_alt_kernel}-%{version}" ]; then
- rm -f %{_prefix}/src/linux%{_alt_kernel}
+ if [ -L %{_prefix}/src/linux%{versuffix}%{_alt_kernel} ]; then
+ if [ "$(readlink %{_prefix}/src/linux%{versuffix}%{_alt_kernel})" = "linux%{versuffix}%{_alt_kernel}-%{version}" ]; then
+ rm -f %{_prefix}/src/linux%{versuffix}%{_alt_kernel}
fi
fi
fi