2011-10-05 07:01:45 +02:00
|
|
|
#
|
2011-10-25 07:02:09 +02:00
|
|
|
# spec file for package kernel-source@VARIANT@
|
2011-10-05 07:01:45 +02:00
|
|
|
#
|
2011-10-25 07:02:09 +02:00
|
|
|
# Copyright (c) @YEAR@ SUSE LINUX Products GmbH, Nuernberg, Germany.
|
2011-10-05 07:01:45 +02:00
|
|
|
#
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
|
|
|
#
|
2010-12-01 11:20:27 +01:00
|
|
|
# icecream 0
|
2014-01-31 08:01:42 +01:00
|
|
|
|
2014-02-02 08:01:46 +01:00
|
|
|
|
2011-10-05 07:01:45 +02:00
|
|
|
%define srcversion @SRCVERSION@
|
2011-01-23 20:47:15 +01:00
|
|
|
%define patchversion @PATCHVERSION@
|
2011-10-05 07:01:45 +02:00
|
|
|
%define variant @VARIANT@%{nil}
|
2011-02-11 07:03:11 +01:00
|
|
|
%define vanilla_only @VANILLA_ONLY@
|
2011-10-05 07:01:45 +02:00
|
|
|
|
|
|
|
%include %_sourcedir/kernel-spec-macros
|
|
|
|
|
|
|
|
%define src_install_dir usr/src/linux-%kernelrelease%variant
|
|
|
|
|
|
|
|
Name: kernel-source@VARIANT@
|
|
|
|
Summary: The Linux Kernel Sources
|
2014-02-02 08:01:46 +01:00
|
|
|
License: GPL-2.0
|
|
|
|
Group: Development/Sources
|
2011-10-05 07:01:45 +02:00
|
|
|
Version: @RPMVERSION@
|
2013-10-03 08:02:42 +02:00
|
|
|
%if 0%{?is_kotd}
|
|
|
|
Release: <RELEASE>.g@COMMIT@
|
|
|
|
%else
|
2011-10-25 07:02:09 +02:00
|
|
|
Release: @RELEASE@
|
2013-10-03 08:02:42 +02:00
|
|
|
%endif
|
2011-10-05 07:01:45 +02:00
|
|
|
Url: http://www.kernel.org/
|
|
|
|
AutoReqProv: off
|
2014-02-02 08:01:46 +01:00
|
|
|
BuildRequires: coreutils
|
2011-10-05 07:01:45 +02:00
|
|
|
BuildRequires: fdupes
|
2014-02-02 08:01:46 +01:00
|
|
|
BuildRequires: sed
|
2011-10-05 07:01:45 +02:00
|
|
|
Requires(post): coreutils sed
|
2010-12-01 11:20:27 +01:00
|
|
|
Provides: %name = %version-%source_rel
|
2014-02-02 08:01:46 +01:00
|
|
|
Provides: linux
|
|
|
|
Provides: multiversion(kernel)
|
2014-01-23 08:04:33 +01:00
|
|
|
Source0: @TARBALL_URL@linux-%srcversion.tar.xz
|
2011-10-05 07:01:45 +02:00
|
|
|
Source2: source-post.sh
|
|
|
|
Source3: kernel-source.rpmlintrc
|
|
|
|
Source8: devel-pre.sh
|
|
|
|
Source9: devel-post.sh
|
|
|
|
Source10: preun.sh
|
|
|
|
Source11: postun.sh
|
|
|
|
Source12: pre.sh
|
|
|
|
Source13: post.sh
|
|
|
|
Source14: series.conf
|
|
|
|
Source16: guards
|
|
|
|
Source17: apply-patches
|
|
|
|
Source21: config.conf
|
|
|
|
Source23: supported.conf
|
|
|
|
Source33: check-for-config-changes
|
2011-10-25 07:02:09 +02:00
|
|
|
Source35: group-source-files.pl
|
2011-10-05 07:01:45 +02:00
|
|
|
Source37: README.SUSE
|
|
|
|
Source38: README.KSYMS
|
|
|
|
Source39: config-options.changes.txt
|
|
|
|
Source40: source-timestamp
|
|
|
|
Source44: find-provides
|
|
|
|
Source45: split-modules
|
|
|
|
Source46: modversions
|
|
|
|
Source48: macros.kernel-source
|
|
|
|
Source49: kernel-module-subpackage
|
|
|
|
Source50: kabi.pl
|
|
|
|
Source51: mkspec
|
|
|
|
Source52: kernel-source%variant.changes
|
|
|
|
Source53: kernel-source.spec.in
|
|
|
|
Source54: kernel-binary.spec.in
|
|
|
|
Source55: kernel-syms.spec.in
|
|
|
|
Source56: kernel-docs.spec.in
|
2013-05-01 08:12:39 +02:00
|
|
|
Source57: kernel-cert-subpackage
|
2014-04-01 08:03:05 +02:00
|
|
|
Source58: constraints.in
|
2011-10-05 07:01:45 +02:00
|
|
|
Source60: config.sh
|
|
|
|
Source61: compute-PATCHVERSION.sh
|
2013-10-03 08:02:42 +02:00
|
|
|
Source62: old-flavors
|
2011-10-05 07:01:45 +02:00
|
|
|
Source63: arch-symbols
|
|
|
|
Source64: package-descriptions
|
|
|
|
Source65: kernel-spec-macros
|
|
|
|
Source66: configtool.pl
|
|
|
|
Source67: log.sh
|
2011-10-25 07:02:09 +02:00
|
|
|
Source68: host-memcpy-hack.h
|
2012-01-06 07:02:55 +01:00
|
|
|
Source69: try-disable-staging-driver
|
2014-04-15 08:02:51 +02:00
|
|
|
Source70: kernel-obs-build.spec.in
|
|
|
|
Source71: kernel-obs-qa.spec.in
|
2014-08-18 08:02:31 +02:00
|
|
|
Source72: compress-vmlinux.sh
|
2011-10-05 07:01:45 +02:00
|
|
|
Source100: config.tar.bz2
|
|
|
|
Source101: config.addon.tar.bz2
|
|
|
|
Source102: patches.arch.tar.bz2
|
|
|
|
Source103: patches.drivers.tar.bz2
|
|
|
|
Source104: patches.fixes.tar.bz2
|
|
|
|
Source105: patches.rpmify.tar.bz2
|
|
|
|
Source106: patches.suse.tar.bz2
|
|
|
|
Source107: patches.xen.tar.bz2
|
|
|
|
Source108: patches.addon.tar.bz2
|
|
|
|
Source109: patches.kernel.org.tar.bz2
|
|
|
|
Source110: patches.apparmor.tar.bz2
|
|
|
|
Source111: patches.rt.tar.bz2
|
|
|
|
Source112: patches.trace.tar.bz2
|
|
|
|
Source113: patches.kabi.tar.bz2
|
|
|
|
Source120: kabi.tar.bz2
|
2011-05-21 07:04:56 +02:00
|
|
|
Source121: sysctl.tar.bz2
|
2011-10-05 07:01:45 +02:00
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
|
|
|
BuildArch: noarch
|
|
|
|
Prefix: /usr/src
|
|
|
|
# Source is only complete with devel files.
|
2014-01-23 08:04:33 +01:00
|
|
|
Requires: kernel-devel%variant = %version-%release
|
2011-10-05 07:01:45 +02:00
|
|
|
|
|
|
|
%(chmod +x %_sourcedir/{@SCRIPTS@})
|
|
|
|
|
|
|
|
%define symbols %(set -- $([ -e %_sourcedir/extra-symbols ] && cat %_sourcedir/extra-symbols) ; echo $*)
|
|
|
|
%define variant_symbols %(case %name in (*-rt) echo "RT" ;; esac)
|
|
|
|
|
|
|
|
%define do_vanilla "%variant" == ""
|
|
|
|
|
|
|
|
%description
|
|
|
|
Linux kernel sources with many fixes and improvements.
|
|
|
|
|
2010-12-01 11:20:27 +01:00
|
|
|
|
2011-10-25 07:02:09 +02:00
|
|
|
%source_timestamp
|
2011-10-05 07:01:45 +02:00
|
|
|
%package -n kernel-devel%variant
|
2011-10-25 07:02:09 +02:00
|
|
|
Summary: Development files needed for building kernel modules
|
|
|
|
Group: Development/Sources
|
|
|
|
AutoReqProv: off
|
2011-10-05 07:01:45 +02:00
|
|
|
Provides: kernel-devel%variant = %version-%source_rel
|
2014-02-02 08:01:46 +01:00
|
|
|
Provides: multiversion(kernel)
|
2014-09-04 08:03:33 +02:00
|
|
|
Requires: kernel-macros
|
2011-10-05 07:01:45 +02:00
|
|
|
|
|
|
|
%description -n kernel-devel%variant
|
|
|
|
Kernel-level headers and Makefiles required for development of
|
|
|
|
external kernel modules.
|
|
|
|
|
2014-09-04 08:03:33 +02:00
|
|
|
%source_timestamp
|
|
|
|
|
|
|
|
%package -n kernel-macros
|
|
|
|
Summary: RPM macros for building Kernel Module Packages
|
|
|
|
Group: Development/Sources
|
|
|
|
# Note: This does not provide multiversion(kernel) nor is its name decorated
|
|
|
|
# with the variant (-rt)
|
|
|
|
|
|
|
|
%description -n kernel-macros
|
|
|
|
This package provides the rpm macros and templates for Kernel Module Pakcages
|
2010-12-01 11:20:27 +01:00
|
|
|
|
2011-10-25 07:02:09 +02:00
|
|
|
%source_timestamp
|
2014-09-04 08:03:33 +02:00
|
|
|
|
2011-10-05 07:01:45 +02:00
|
|
|
%package vanilla
|
|
|
|
Summary: Vanilla Linux kernel sources with minor build fixes.
|
|
|
|
Group: Development/Sources
|
|
|
|
AutoReqProv: off
|
2010-12-01 11:20:27 +01:00
|
|
|
Provides: %name-vanilla = %version-%source_rel
|
2014-02-02 08:01:46 +01:00
|
|
|
Provides: multiversion(kernel)
|
2011-10-05 07:01:45 +02:00
|
|
|
|
|
|
|
%description vanilla
|
|
|
|
Vanilla Linux kernel sources with minor build fixes.
|
|
|
|
|
2010-12-01 11:20:27 +01:00
|
|
|
|
2011-10-25 07:02:09 +02:00
|
|
|
%source_timestamp
|
2014-09-04 08:03:33 +02:00
|
|
|
|
2011-10-05 07:01:45 +02:00
|
|
|
%prep
|
|
|
|
|
|
|
|
echo "Symbol(s): %symbols"
|
|
|
|
|
|
|
|
# Unpack all sources and patches
|
|
|
|
%setup -q -c -T @UNPACK_PATCHES@
|
|
|
|
|
|
|
|
%build
|
|
|
|
mkdir -p $RPM_BUILD_ROOT/usr/src
|
|
|
|
cd $RPM_BUILD_ROOT/usr/src
|
|
|
|
|
|
|
|
# Unpack the vanilla kernel sources
|
2014-01-23 08:04:33 +01:00
|
|
|
tar -xf %{S:0}
|
2011-01-13 07:02:36 +01:00
|
|
|
if test "%srcversion" != "%kernelrelease%variant"; then
|
|
|
|
mv linux-%srcversion linux-%kernelrelease%variant
|
|
|
|
fi
|
2010-12-01 11:20:27 +01:00
|
|
|
|
2011-10-05 07:01:45 +02:00
|
|
|
%if %do_vanilla
|
2011-02-11 07:03:11 +01:00
|
|
|
%if %vanilla_only
|
|
|
|
mv \
|
|
|
|
%else
|
|
|
|
cp -al \
|
|
|
|
%endif
|
|
|
|
linux-%kernelrelease%variant linux-%kernelrelease-vanilla
|
2011-10-05 07:01:45 +02:00
|
|
|
cd linux-%kernelrelease-vanilla
|
|
|
|
%_sourcedir/apply-patches --vanilla %_sourcedir/series.conf %my_builddir %symbols
|
|
|
|
rm -f $(find . -name ".gitignore")
|
|
|
|
cd ..
|
|
|
|
%endif
|
|
|
|
|
2011-02-11 07:03:11 +01:00
|
|
|
%if ! %vanilla_only
|
|
|
|
ln -sf linux%variant linux%variant # dummy symlink
|
|
|
|
|
|
|
|
cd linux-%kernelrelease%variant
|
2011-10-05 07:01:45 +02:00
|
|
|
%_sourcedir/apply-patches %_sourcedir/series.conf %my_builddir %symbols
|
|
|
|
rm -f $(find . -name ".gitignore")
|
|
|
|
|
|
|
|
if [ -f %_sourcedir/localversion ] ; then
|
|
|
|
cat %_sourcedir/localversion > localversion
|
|
|
|
fi
|
2011-02-11 07:03:11 +01:00
|
|
|
%endif
|
2011-10-05 07:01:45 +02:00
|
|
|
|
|
|
|
# Hardlink duplicate files automatically (from package fdupes).
|
|
|
|
%fdupes $RPM_BUILD_ROOT
|
|
|
|
|
|
|
|
%install
|
2011-02-11 07:03:11 +01:00
|
|
|
%if ! %vanilla_only
|
2011-10-05 07:01:45 +02:00
|
|
|
# Install the documentation and example Kernel Module Package.
|
2014-09-04 08:03:33 +02:00
|
|
|
DOC=/usr/share/doc/packages/%name-%kernelrelease
|
|
|
|
mkdir -p %buildroot/$DOC
|
|
|
|
cp %_sourcedir/README.SUSE %_sourcedir/config-options.changes.txt %buildroot/$DOC
|
|
|
|
ln -s $DOC/README.SUSE %buildroot/%src_install_dir/
|
2011-10-05 07:01:45 +02:00
|
|
|
|
2014-09-04 08:03:33 +02:00
|
|
|
%if "%variant" == ""
|
2011-10-05 07:01:45 +02:00
|
|
|
install -m 755 -d $RPM_BUILD_ROOT/etc/rpm
|
|
|
|
install -m 644 %_sourcedir/macros.kernel-source $RPM_BUILD_ROOT/etc/rpm/
|
|
|
|
install -m 755 -d $RPM_BUILD_ROOT/usr/lib/rpm
|
2013-05-01 08:12:39 +02:00
|
|
|
install -m 644 %_sourcedir/kernel-{module,cert}-subpackage \
|
2011-10-05 07:01:45 +02:00
|
|
|
$RPM_BUILD_ROOT/usr/lib/rpm/
|
2014-09-04 08:03:33 +02:00
|
|
|
%endif
|
2011-10-05 07:01:45 +02:00
|
|
|
|
|
|
|
for script in post; do
|
|
|
|
sed -e "s:@KERNELRELEASE@:%kernelrelease:g" \
|
|
|
|
-e "s:@SRCVARIANT@:%variant:g" \
|
|
|
|
%_sourcedir/source-$script.sh > %name-$script.sh
|
|
|
|
done
|
|
|
|
|
|
|
|
pushd "%buildroot"
|
|
|
|
perl "%_sourcedir/group-source-files.pl" \
|
|
|
|
-D "$OLDPWD/devel.files" -N "$OLDPWD/nondevel.files" \
|
|
|
|
-L "%src_install_dir"
|
|
|
|
popd
|
|
|
|
|
2011-02-11 07:03:11 +01:00
|
|
|
# kernel-source and kernel-$flavor-devel are built independently, but the
|
|
|
|
# shipped sources (/usr/src/linux/) need to be older than generated files
|
|
|
|
# (/usr/src/linux-obj). We rely on the git commit timestamp to not point into
|
|
|
|
# the future and be thus lower than the timestamps of files built from the
|
|
|
|
# source (bnc#669669).
|
|
|
|
ts="$(head -n1 %_sourcedir/source-timestamp)"
|
|
|
|
find %buildroot/usr/src/linux* ! -type l | xargs touch -d "$ts"
|
|
|
|
|
2011-10-05 07:01:45 +02:00
|
|
|
%post -f %name-post.sh
|
|
|
|
|
|
|
|
%post -n kernel-devel%variant -f %name-post.sh
|
|
|
|
|
|
|
|
%files -f nondevel.files
|
|
|
|
%defattr(-, root, root)
|
|
|
|
|
|
|
|
%files -n kernel-devel%variant -f devel.files
|
|
|
|
%defattr(-,root,root)
|
|
|
|
%ghost /usr/src/linux%variant
|
2014-09-04 08:03:33 +02:00
|
|
|
%doc /usr/share/doc/packages/*
|
|
|
|
|
|
|
|
%if "%variant" == ""
|
|
|
|
%files -n kernel-macros
|
|
|
|
%defattr(-,root,root)
|
2011-10-05 07:01:45 +02:00
|
|
|
/etc/rpm/macros.kernel-source
|
2013-05-01 08:12:39 +02:00
|
|
|
/usr/lib/rpm/kernel-*-subpackage
|
2011-02-11 07:03:11 +01:00
|
|
|
%endif
|
2011-10-05 07:01:45 +02:00
|
|
|
|
2014-09-04 08:03:33 +02:00
|
|
|
%endif
|
|
|
|
|
2011-10-05 07:01:45 +02:00
|
|
|
%if %do_vanilla
|
2011-10-25 07:02:09 +02:00
|
|
|
|
2011-10-05 07:01:45 +02:00
|
|
|
%files vanilla
|
|
|
|
%defattr(-, root, root)
|
|
|
|
/usr/src/linux-%kernelrelease-vanilla
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%changelog
|