2009-05-20 10:59:36 +02:00
|
|
|
#
|
|
|
|
# spec file for package kernel-source@VARIANT@ (Version @RPMVERSION@)
|
|
|
|
#
|
2009-06-20 01:58:35 +02:00
|
|
|
# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
2009-05-20 10:59:36 +02:00
|
|
|
#
|
2009-06-20 01:58:35 +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.
|
|
|
|
|
2009-05-20 10:59:36 +02:00
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
|
|
|
#
|
|
|
|
|
|
|
|
# norootforbuild
|
|
|
|
# icecream 0
|
|
|
|
|
|
|
|
%define srcversion @SRCVERSION@
|
|
|
|
%define patchversion @PATCHVERSION@
|
|
|
|
%define variant @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
|
|
|
|
|
2009-06-20 01:58:35 +02:00
|
|
|
Name: kernel-source@VARIANT@
|
|
|
|
Summary: The Linux Kernel Sources
|
|
|
|
Version: @RPMVERSION@
|
2009-05-20 10:59:36 +02:00
|
|
|
%if %using_buildservice
|
|
|
|
Release: @RELEASE_PREFIX@<RELEASE>
|
|
|
|
%else
|
|
|
|
Release: @RELEASE_PREFIX@0
|
|
|
|
%endif
|
2009-06-20 01:58:35 +02:00
|
|
|
License: GPL v2 only
|
|
|
|
Group: Development/Sources
|
|
|
|
Url: http://www.kernel.org/
|
|
|
|
AutoReqProv: off
|
2009-05-20 10:59:36 +02:00
|
|
|
BuildRequires: coreutils sed
|
2010-04-08 15:15:36 +02:00
|
|
|
BuildRequires: fdupes pcre-tools
|
2009-05-20 10:59:36 +02:00
|
|
|
Requires(post): coreutils sed
|
2009-11-27 14:28:36 +01:00
|
|
|
Provides: multiversion(kernel)
|
2009-05-20 10:59:36 +02:00
|
|
|
Provides: linux
|
|
|
|
Provides: %name = %version-%source_rel
|
2009-06-20 01:58:35 +02:00
|
|
|
Source0: http://www.kernel.org/pub/linux/kernel/v2.6/linux-%srcversion.tar.bz2
|
|
|
|
Source2: source-post.sh
|
2009-08-18 12:35:53 +02:00
|
|
|
Source3: kernel-source.rpmlintrc
|
2009-06-20 01:58:35 +02:00
|
|
|
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
|
2010-02-05 14:14:36 +01:00
|
|
|
Source17: apply-patches
|
2009-06-20 01:58:35 +02:00
|
|
|
Source21: config.conf
|
|
|
|
Source23: supported.conf
|
|
|
|
Source33: check-for-config-changes
|
|
|
|
Source34: check-supported-list
|
2010-04-08 15:15:36 +02:00
|
|
|
Source35: group-source-files.pl
|
2009-06-20 01:58:35 +02:00
|
|
|
Source37: README.SUSE
|
|
|
|
Source38: README.KSYMS
|
|
|
|
Source40: source-timestamp
|
|
|
|
Source44: find-provides
|
2009-11-04 11:29:42 +01:00
|
|
|
Source45: split-modules
|
2009-06-20 01:58:35 +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-06-20 01:58:35 +02:00
|
|
|
Source51: mkspec
|
|
|
|
Source52: kernel-source%variant.changes
|
|
|
|
Source53: kernel-source.spec.in
|
|
|
|
Source54: kernel-binary.spec.in
|
|
|
|
Source55: kernel-syms.spec.in
|
2010-01-29 14:27:16 +01:00
|
|
|
Source56: kernel-docs.spec.in
|
|
|
|
Source60: config.sh
|
|
|
|
Source61: compute-PATCHVERSION.sh
|
|
|
|
Source62: old-packages.conf
|
|
|
|
Source63: arch-symbols
|
|
|
|
Source64: package-descriptions
|
|
|
|
Source65: kernel-spec-macros
|
2010-04-08 15:15:36 +02:00
|
|
|
Source66: configtool.pl
|
2009-06-20 01:58:35 +02:00
|
|
|
Source100: config.tar.bz2
|
2010-04-08 15:15:36 +02:00
|
|
|
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
|
2009-06-20 01:58:35 +02:00
|
|
|
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
|
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
|
|
|
BuildArch: noarch
|
|
|
|
Prefix: /usr/src
|
2010-04-08 15:15:36 +02:00
|
|
|
# Source is only complete with devel files.
|
|
|
|
Requires: kernel-devel = %version-%release
|
2009-05-20 10:59:36 +02:00
|
|
|
|
2010-04-08 15:15:36 +02:00
|
|
|
%(chmod +x %_sourcedir/{@SCRIPTS@})
|
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" == ""
|
|
|
|
|
|
|
|
%description
|
|
|
|
Linux kernel sources with many fixes and improvements.
|
|
|
|
|
|
|
|
%source_timestamp
|
|
|
|
|
2010-04-08 15:15:36 +02:00
|
|
|
%package -n kernel-devel%variant
|
|
|
|
Summary: Development files needed for building kernel modules
|
|
|
|
License: GPL v2 only
|
|
|
|
Group: Development/Sources
|
|
|
|
AutoReqProv: off
|
|
|
|
Provides: multiversion(kernel)
|
|
|
|
Provides: kernel-devel%variant = %version-%source_rel
|
|
|
|
|
|
|
|
%description -n kernel-devel%variant
|
|
|
|
Kernel-level headers and Makefiles required for development of
|
|
|
|
external kernel modules.
|
|
|
|
|
|
|
|
%source_timestamp
|
|
|
|
|
2009-05-20 10:59:36 +02:00
|
|
|
%package vanilla
|
2009-06-20 01:58:35 +02:00
|
|
|
Summary: Vanilla Linux kernel sources with minor build fixes.
|
|
|
|
License: GPL v2 only
|
|
|
|
Group: Development/Sources
|
|
|
|
AutoReqProv: off
|
2009-11-27 14:28:36 +01:00
|
|
|
Provides: multiversion(kernel)
|
2010-04-08 15:15:36 +02:00
|
|
|
Provides: %name-vanilla = %version-%source_rel
|
2009-05-20 10:59:36 +02:00
|
|
|
|
|
|
|
%description vanilla
|
|
|
|
Vanilla Linux kernel sources with minor build fixes.
|
|
|
|
|
|
|
|
%source_timestamp
|
|
|
|
|
|
|
|
%prep
|
|
|
|
if ! [ -e %_sourcedir/linux-%srcversion.tar.bz2 ]; then
|
|
|
|
echo "Please get a copy of linux-%srcversion.tar.bz2 from" \
|
|
|
|
"ftp://ftp.kernel.org/pub/linux/kernel/v2.6/."
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Symbol(s): %symbols"
|
|
|
|
|
|
|
|
# Unpack all sources and patches
|
2010-04-08 15:15:36 +02:00
|
|
|
%setup -q -c -T @UNPACK_PATCHES@
|
2009-05-20 10:59:36 +02:00
|
|
|
|
|
|
|
%build
|
|
|
|
# Release number without the EXTRAVERSION
|
|
|
|
RELEASE=%source_rel
|
|
|
|
while [ "$RELEASE" != "${RELEASE#[^0-9]*.}" ]; do
|
|
|
|
RELEASE=${RELEASE#[^0-9]*.}
|
|
|
|
done
|
|
|
|
|
|
|
|
mkdir -p $RPM_BUILD_ROOT/usr/src
|
|
|
|
cd $RPM_BUILD_ROOT/usr/src
|
|
|
|
|
|
|
|
ln -sf linux%variant linux%variant # dummy symlink
|
|
|
|
|
|
|
|
# Unpack the vanilla kernel sources
|
2010-04-08 15:15:36 +02:00
|
|
|
tar -xjf %_sourcedir/linux-%srcversion.tar.bz2
|
|
|
|
mv linux-%srcversion "%buildroot/%src_install_dir"
|
2009-07-09 04:41:55 +02:00
|
|
|
|
|
|
|
|
2009-05-20 10:59:36 +02:00
|
|
|
%if %do_vanilla
|
2010-04-08 15:15:36 +02:00
|
|
|
cp -al "%buildroot/%src_install_dir" linux-%kernelrelease-vanilla
|
2009-05-20 10:59:36 +02:00
|
|
|
cd linux-%kernelrelease-vanilla
|
2010-02-05 14:14:36 +01:00
|
|
|
%_sourcedir/apply-patches --vanilla %_sourcedir/series.conf %my_builddir %symbols
|
2009-07-09 04:41:55 +02:00
|
|
|
rm -f $(find . -name ".gitignore")
|
2009-05-20 10:59:36 +02:00
|
|
|
cd ..
|
|
|
|
%endif
|
|
|
|
|
2010-04-08 15:15:36 +02:00
|
|
|
cd "%buildroot/%src_install_dir"
|
2010-02-05 14:14:36 +01:00
|
|
|
%_sourcedir/apply-patches %_sourcedir/series.conf %my_builddir %symbols
|
2009-07-09 04:41:55 +02:00
|
|
|
rm -f $(find . -name ".gitignore")
|
2009-05-20 10:59:36 +02:00
|
|
|
|
|
|
|
if [ -f %_sourcedir/localversion ] ; then
|
|
|
|
cat %_sourcedir/localversion > localversion
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Hardlink duplicate files automatically (from package fdupes).
|
|
|
|
%fdupes $RPM_BUILD_ROOT
|
|
|
|
|
|
|
|
%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
|
|
|
|
ln -s /usr/share/doc/packages/%name/README.SUSE %buildroot/%src_install_dir/
|
|
|
|
|
|
|
|
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/
|
|
|
|
|
|
|
|
for script in post; do
|
|
|
|
sed -e "s:@KERNELRELEASE@:%kernelrelease:g" \
|
|
|
|
-e "s:@SRCVARIANT@:%variant:g" \
|
|
|
|
%_sourcedir/source-$script.sh > %name-$script.sh
|
|
|
|
done
|
|
|
|
|
2010-04-08 15:15:36 +02:00
|
|
|
pushd "%buildroot"
|
|
|
|
perl "%_sourcedir/group-source-files.pl" \
|
|
|
|
-D "$OLDPWD/devel.files" -N "$OLDPWD/nondevel.files" \
|
|
|
|
-L "%src_install_dir"
|
|
|
|
popd
|
2009-05-20 10:59:36 +02:00
|
|
|
|
|
|
|
%post -f %name-post.sh
|
2010-04-08 15:15:36 +02:00
|
|
|
|
|
|
|
%post -n kernel-devel%variant -f %name-post.sh
|
|
|
|
|
|
|
|
%files -f nondevel.files
|
2009-05-20 10:59:36 +02:00
|
|
|
%defattr(-, root, root)
|
|
|
|
%ghost /usr/src/linux%variant
|
2010-04-08 15:15:36 +02:00
|
|
|
/usr/src/linux%variant-%kernelrelease/README.SUSE
|
|
|
|
|
|
|
|
%files -n kernel-devel%variant -f devel.files
|
|
|
|
%defattr(-,root,root)
|
|
|
|
%ghost /usr/src/linux%variant
|
2009-05-20 10:59:36 +02:00
|
|
|
/usr/share/doc/packages/%name
|
|
|
|
/etc/rpm/macros.kernel-source
|
|
|
|
/usr/lib/rpm/kernel-module-subpackage
|
|
|
|
|
|
|
|
%if %do_vanilla
|
|
|
|
%files vanilla
|
|
|
|
%defattr(-, root, root)
|
|
|
|
/usr/src/linux-%kernelrelease-vanilla
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%changelog
|