2008-07-18 12:15:21 +02:00
|
|
|
#
|
2009-10-21 01:06:56 +02:00
|
|
|
# spec file for package kernel-source (Version 2.6.31.4)
|
2008-07-18 12:15:21 +02:00
|
|
|
#
|
2009-01-10 14:03:47 +01:00
|
|
|
# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
2008-07-18 12:15:21 +02:00
|
|
|
#
|
2008-10-08 11:08:56 +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.
|
|
|
|
|
2008-07-18 12:15:21 +02:00
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
|
|
|
#
|
|
|
|
|
|
|
|
# norootforbuild
|
|
|
|
# icecream 0
|
|
|
|
|
2009-09-16 23:12:55 +02:00
|
|
|
%define srcversion 2.6.31
|
2009-10-21 01:06:56 +02:00
|
|
|
%define patchversion 2.6.31.4
|
2009-05-20 10:59:36 +02:00
|
|
|
%define variant %{nil}
|
2009-08-01 11:17:24 +02:00
|
|
|
%include %_sourcedir/kernel-spec-macros
|
2009-05-20 10:59:36 +02:00
|
|
|
%define src_install_dir usr/src/linux-%kernelrelease%variant
|
|
|
|
%define obj_install_dir /%src_install_dir-obj
|
|
|
|
%define rpm_install_dir %buildroot%real_install_dir
|
2008-07-18 12:15:21 +02:00
|
|
|
|
2008-10-08 11:08:56 +02:00
|
|
|
Name: kernel-source
|
|
|
|
Summary: The Linux Kernel Sources
|
2009-10-21 01:06:56 +02:00
|
|
|
Version: 2.6.31.4
|
2009-10-23 15:57:03 +02:00
|
|
|
Release: 2
|
2009-05-20 10:59:36 +02:00
|
|
|
%if %using_buildservice
|
|
|
|
%else
|
|
|
|
%endif
|
2008-10-08 11:08:56 +02:00
|
|
|
License: GPL v2 only
|
|
|
|
Group: Development/Sources
|
2009-06-20 01:58:35 +02:00
|
|
|
Url: http://www.kernel.org/
|
2008-10-08 11:08:56 +02:00
|
|
|
AutoReqProv: off
|
2008-07-18 12:15:21 +02:00
|
|
|
BuildRequires: coreutils sed
|
2008-09-29 18:18:36 +02:00
|
|
|
BuildRequires: fdupes
|
2008-07-18 12:15:21 +02:00
|
|
|
Requires(post): coreutils sed
|
|
|
|
Provides: linux
|
2009-05-20 10:59:36 +02:00
|
|
|
Provides: %name = %version-%source_rel
|
|
|
|
Source0: http://www.kernel.org/pub/linux/kernel/v2.6/linux-%srcversion.tar.bz2
|
2009-01-14 01:50:57 +01:00
|
|
|
Source2: source-post.sh
|
2009-08-18 12:35:53 +02:00
|
|
|
Source3: kernel-source.rpmlintrc
|
2009-05-20 10:59:36 +02:00
|
|
|
Source8: devel-pre.sh
|
|
|
|
Source9: devel-post.sh
|
2008-10-14 18:16:00 +02:00
|
|
|
Source10: preun.sh
|
|
|
|
Source11: postun.sh
|
|
|
|
Source12: pre.sh
|
|
|
|
Source13: post.sh
|
|
|
|
Source14: series.conf
|
|
|
|
Source16: guards
|
2008-10-08 11:08:56 +02:00
|
|
|
Source21: config.conf
|
|
|
|
Source23: supported.conf
|
|
|
|
Source33: check-for-config-changes
|
|
|
|
Source34: check-supported-list
|
|
|
|
Source37: README.SUSE
|
2009-05-20 10:59:36 +02:00
|
|
|
Source38: README.KSYMS
|
|
|
|
Source40: source-timestamp
|
2008-10-28 00:21:37 +01:00
|
|
|
Source44: find-provides
|
2008-10-08 11:08:56 +02:00
|
|
|
Source46: modversions
|
|
|
|
Source47: extract-modaliases
|
|
|
|
Source48: macros.kernel-source
|
|
|
|
Source49: kernel-module-subpackage
|
2009-09-07 22:37:07 +02:00
|
|
|
Source50: kabi.pl
|
2009-05-20 10:59:36 +02:00
|
|
|
Source51: mkspec
|
|
|
|
Source52: kernel-source%variant.changes
|
|
|
|
Source53: kernel-source.spec.in
|
|
|
|
Source54: kernel-binary.spec.in
|
|
|
|
Source55: kernel-syms.spec.in
|
|
|
|
Source56: config.sh
|
|
|
|
Source57: compute-PATCHVERSION.sh
|
|
|
|
Source58: old-packages.conf
|
|
|
|
Source59: arch-symbols
|
|
|
|
Source60: package-descriptions
|
2009-08-07 16:06:37 +02:00
|
|
|
Source61: kernel-spec-macros
|
2008-10-08 11:08:56 +02:00
|
|
|
Source100: config.tar.bz2
|
|
|
|
Source101: patches.arch.tar.bz2
|
|
|
|
Source102: patches.drivers.tar.bz2
|
|
|
|
Source103: patches.fixes.tar.bz2
|
|
|
|
Source104: patches.rpmify.tar.bz2
|
|
|
|
Source105: 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
|
2009-02-03 23:53:27 +01:00
|
|
|
Source113: patches.kabi.tar.bz2
|
2008-10-08 11:08:56 +02:00
|
|
|
Source120: kabi.tar.bz2
|
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
2009-05-20 10:59:36 +02:00
|
|
|
BuildArch: noarch
|
2008-10-08 11:08:56 +02:00
|
|
|
Prefix: /usr/src
|
2009-09-07 22:37:07 +02:00
|
|
|
%(chmod +x %_sourcedir/{guards,check-for-config-changes,kabi.pl,mkspec,compute-PATCHVERSION.sh,arch-symbols})
|
2009-05-20 10:59:36 +02:00
|
|
|
%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" == ""
|
2008-07-18 12:15:21 +02:00
|
|
|
|
|
|
|
%description
|
2008-10-08 11:08:56 +02:00
|
|
|
Linux kernel sources with many fixes and improvements.
|
|
|
|
|
|
|
|
|
2009-05-20 10:59:36 +02:00
|
|
|
%source_timestamp
|
|
|
|
%package vanilla
|
2009-07-09 04:41:55 +02:00
|
|
|
Summary: Vanilla Linux kernel sources with minor build fixes.
|
2009-06-20 01:58:35 +02:00
|
|
|
License: GPL v2 only
|
2009-05-20 10:59:36 +02:00
|
|
|
Group: Development/Sources
|
|
|
|
AutoReqProv: off
|
|
|
|
|
|
|
|
%description vanilla
|
2009-06-19 00:50:33 +02:00
|
|
|
Vanilla Linux kernel sources with minor build fixes.
|
2009-05-20 10:59:36 +02:00
|
|
|
|
|
|
|
|
|
|
|
%source_timestamp
|
2008-07-18 12:15:21 +02:00
|
|
|
%prep
|
2009-05-20 10:59:36 +02:00
|
|
|
if ! [ -e %_sourcedir/linux-%srcversion.tar.bz2 ]; then
|
|
|
|
echo "Please get a copy of linux-%srcversion.tar.bz2 from" \
|
2008-07-18 12:15:21 +02:00
|
|
|
"ftp://ftp.kernel.org/pub/linux/kernel/v2.6/."
|
|
|
|
fi
|
2009-05-20 10:59:36 +02:00
|
|
|
echo "Symbol(s): %symbols"
|
2008-07-18 12:15:21 +02:00
|
|
|
# Unpack all sources and patches
|
2009-02-03 23:53:27 +01:00
|
|
|
%setup -q -c -T -a 100 -a 101 -a 102 -a 103 -a 104 -a 105 -a 107 -a 108 -a 109 -a 110 -a 111 -a 112 -a 113
|
2008-07-18 12:15:21 +02:00
|
|
|
|
|
|
|
%build
|
|
|
|
# Release number without the EXTRAVERSION
|
|
|
|
RELEASE=%source_rel
|
|
|
|
while [ "$RELEASE" != "${RELEASE#[^0-9]*.}" ]; do
|
|
|
|
RELEASE=${RELEASE#[^0-9]*.}
|
|
|
|
done
|
2008-09-29 18:18:36 +02:00
|
|
|
mkdir -p $RPM_BUILD_ROOT/usr/src
|
|
|
|
cd $RPM_BUILD_ROOT/usr/src
|
2009-05-20 10:59:36 +02:00
|
|
|
ln -sf linux%variant linux%variant # dummy symlink
|
2008-09-29 18:18:36 +02:00
|
|
|
# Unpack the vanilla kernel sources
|
2009-07-09 04:41:55 +02:00
|
|
|
tar xjf %_sourcedir/linux-%srcversion.tar.bz2
|
2009-05-20 10:59:36 +02:00
|
|
|
mv linux-%srcversion linux-%kernelrelease%variant
|
2009-07-09 04:41:55 +02:00
|
|
|
# generate script to apply patches
|
|
|
|
echo "trap 'echo \"*** patch \$_ failed ***\"' ERR" \
|
|
|
|
>%my_builddir/apply-patches.sh
|
|
|
|
%_sourcedir/guards %symbols <%_sourcedir/series.conf | \
|
|
|
|
sed 's:^:patch -s -F0 -E -p1 --no-backup-if-mismatch -i %my_builddir/:' \
|
|
|
|
>>%my_builddir/apply-patches.sh
|
2009-05-20 10:59:36 +02:00
|
|
|
%if %do_vanilla
|
2009-07-09 04:41:55 +02:00
|
|
|
egrep '^trap|patches\.(kernel\.org|rpmify)/' %my_builddir/apply-patches.sh \
|
|
|
|
>%my_builddir/apply-patches-vanilla.sh
|
2009-05-20 10:59:36 +02:00
|
|
|
cp -al linux-%kernelrelease%variant linux-%kernelrelease-vanilla
|
|
|
|
cd linux-%kernelrelease-vanilla
|
2009-07-09 04:41:55 +02:00
|
|
|
bash -ex %my_builddir/apply-patches-vanilla.sh
|
|
|
|
rm -f $(find . -name ".gitignore")
|
2009-05-20 10:59:36 +02:00
|
|
|
cd ..
|
|
|
|
%endif
|
|
|
|
cd linux-%kernelrelease%variant
|
2009-07-09 04:41:55 +02:00
|
|
|
bash -ex %my_builddir/apply-patches.sh
|
|
|
|
rm -f $(find . -name ".gitignore")
|
2008-10-12 00:19:34 +02:00
|
|
|
if [ -f %_sourcedir/localversion ] ; then
|
|
|
|
cat %_sourcedir/localversion > localversion
|
|
|
|
fi
|
2008-09-29 18:18:36 +02:00
|
|
|
# Hardlink duplicate files automatically (from package fdupes).
|
|
|
|
%fdupes $RPM_BUILD_ROOT
|
2008-07-18 12:15:21 +02:00
|
|
|
|
|
|
|
%install
|
|
|
|
# Install the documentation and example Kernel Module Package.
|
|
|
|
DOC=$RPM_BUILD_ROOT/usr/share/doc/packages/%name
|
|
|
|
mkdir -p $DOC
|
|
|
|
cp %_sourcedir/README.SUSE $DOC
|
2009-05-20 10:59:36 +02:00
|
|
|
ln -s /usr/share/doc/packages/%name/README.SUSE %buildroot/%src_install_dir/
|
2008-07-18 12:15:21 +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
|
|
|
|
install -m 644 %_sourcedir/kernel-module-subpackage \
|
|
|
|
$RPM_BUILD_ROOT/usr/lib/rpm/
|
2009-05-20 10:59:36 +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
|
2009-01-14 01:50:57 +01:00
|
|
|
done
|
|
|
|
|
2009-05-20 10:59:36 +02:00
|
|
|
%post -f %name-post.sh
|
2008-07-18 12:15:21 +02:00
|
|
|
|
2009-05-20 10:59:36 +02:00
|
|
|
%files
|
|
|
|
%defattr(-, root, root)
|
|
|
|
%ghost /usr/src/linux%variant
|
|
|
|
/usr/share/doc/packages/%name
|
|
|
|
/etc/rpm/macros.kernel-source
|
|
|
|
/usr/lib/rpm/kernel-module-subpackage
|
|
|
|
/%src_install_dir
|
|
|
|
%if %do_vanilla
|
2008-10-08 11:08:56 +02:00
|
|
|
|
2009-05-20 10:59:36 +02:00
|
|
|
%files vanilla
|
|
|
|
%defattr(-, root, root)
|
|
|
|
/usr/src/linux-%kernelrelease-vanilla
|
|
|
|
%endif
|
2008-11-08 19:28:50 +01:00
|
|
|
|
2008-10-08 11:08:56 +02:00
|
|
|
%changelog
|