2008-07-18 12:15:21 +02:00
|
|
|
#
|
2008-08-21 18:33:51 +02:00
|
|
|
# spec file for package kernel-source (Version 2.6.27)
|
2008-07-18 12:15:21 +02:00
|
|
|
#
|
|
|
|
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
2008-10-08 10:51:30 +02:00
|
|
|
# This file and all modifications and additions to the pristine
|
|
|
|
# package are under the same license as the package itself.
|
2008-07-18 12:15:21 +02:00
|
|
|
#
|
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
|
|
|
#
|
|
|
|
|
|
|
|
# norootforbuild
|
|
|
|
# icecream 0
|
|
|
|
|
2008-10-08 10:51:30 +02:00
|
|
|
# FIXME: this check will go before the next release ...
|
|
|
|
|
2008-07-18 12:15:21 +02:00
|
|
|
%if 0%{?opensuse_bs}
|
|
|
|
# Strip off the build number ("y") from the "x.y" release number
|
|
|
|
%define source_rel %(release=%release; echo ${release%.*})
|
|
|
|
%else
|
|
|
|
# We don't have build numbers internally
|
|
|
|
%define source_rel %release
|
|
|
|
%endif
|
|
|
|
|
2008-10-08 10:51:30 +02:00
|
|
|
Name: kernel-source
|
|
|
|
Summary: Dummy summary
|
|
|
|
Version: 2.6.27
|
|
|
|
Release: rc8.<RELEASE>
|
|
|
|
License: GPL
|
|
|
|
Group: Development/Sources
|
|
|
|
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
|
|
|
|
%if ! 0%{?opensuse_bs}
|
|
|
|
BuildRequires: kernel-dummy
|
|
|
|
%endif
|
2008-10-08 10:51:30 +02:00
|
|
|
ExclusiveArch: %ix86 ppc ppc64 s390 s390x ia64 x86_64
|
2008-07-18 12:15:21 +02:00
|
|
|
Provides: linux
|
2008-08-21 18:33:51 +02:00
|
|
|
Provides: kernel-source = 2.6.27-%source_rel
|
2008-07-18 12:15:21 +02:00
|
|
|
%if "kernel-source" == "kernel-source"
|
2008-10-08 10:51:30 +02:00
|
|
|
Provides: linux lx_suse lx_sus22 lx_sus24
|
|
|
|
Obsoletes: linux lx-gdt lx-hack lx-suse lx1162_1 lx1162_2 lx1212_1 lx1212_2 lx1213_1 lx1213_2 lx121_1 lx121_2 lx126_1 lx126_2 lx129_1 lx129_2 lx_large kernel_headers lx_suse lx_sus22 lx_sus24
|
2008-07-18 12:15:21 +02:00
|
|
|
%endif
|
2008-10-08 10:51:30 +02:00
|
|
|
Source0: http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.26.tar.bz2
|
|
|
|
Source1: functions.sh
|
|
|
|
Source2: source-post.sh
|
|
|
|
Source3: kernel-source.rpmlintrc
|
|
|
|
Source10: pre.sh
|
|
|
|
Source11: post.sh
|
|
|
|
Source12: postun.sh
|
|
|
|
Source13: series.conf
|
|
|
|
Source14: arch-symbols
|
|
|
|
Source15: guards
|
|
|
|
Source21: config.conf
|
|
|
|
Source23: supported.conf
|
|
|
|
Source30: config-subst
|
|
|
|
Source33: check-for-config-changes
|
|
|
|
Source34: check-supported-list
|
|
|
|
Source37: README.SUSE
|
|
|
|
Source38: kabi-checks
|
|
|
|
Source40: build-source-timestamp
|
|
|
|
Source41: built-in-where
|
|
|
|
Source42: make-symsets
|
|
|
|
Source43: find-provides
|
|
|
|
Source45: module-renames
|
|
|
|
Source46: modversions
|
|
|
|
Source47: extract-modaliases
|
|
|
|
Source48: macros.kernel-source
|
|
|
|
Source49: kernel-module-subpackage
|
|
|
|
Source50: kernel-syms.spec
|
|
|
|
Source51: kernel-debug.spec
|
|
|
|
Source52: kernel-default.spec
|
|
|
|
Source53: kernel-kdump.spec
|
|
|
|
Source54: kernel-pae.spec
|
|
|
|
Source55: kernel-ppc64.spec
|
|
|
|
Source56: kernel-ps3.spec
|
|
|
|
Source57: kernel-rt.spec
|
|
|
|
Source58: kernel-rt_debug.spec
|
|
|
|
Source59: kernel-s390.spec
|
|
|
|
Source60: kernel-trace.spec
|
|
|
|
Source61: kernel-vanilla.spec
|
|
|
|
Source62: kernel-xen.spec
|
|
|
|
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
|
|
|
|
Source106: patches.uml.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
|
|
|
|
Source120: kabi.tar.bz2
|
|
|
|
BuildRoot: %_tmppath/%name-%version-build
|
|
|
|
Prefix: /usr/src
|
|
|
|
|
2008-09-29 18:18:36 +02:00
|
|
|
# Build with bash instead of sh as the shell: this turns on bash
|
|
|
|
# extensions like <(...).
|
|
|
|
%define _buildshell /bin/bash
|
2008-10-08 10:51:30 +02:00
|
|
|
|
2008-10-06 18:52:37 +02:00
|
|
|
%define my_builddir %_builddir/%{name}-%{version}
|
2008-10-08 10:51:30 +02:00
|
|
|
|
2008-09-29 18:18:36 +02:00
|
|
|
%(chmod +x %_sourcedir/{arch-symbols,guards,config-subst,check-for-config-changes,kabi-checks})
|
2008-10-08 10:51:30 +02:00
|
|
|
|
2008-07-18 12:15:21 +02:00
|
|
|
%define symbols %(set -- $(%_sourcedir/arch-symbols %_target_cpu) $([ -e %_sourcedir/extra-symbols ] && cat %_sourcedir/extra-symbols) ; echo $*)
|
2008-10-08 10:51:30 +02:00
|
|
|
|
2008-07-18 12:15:21 +02:00
|
|
|
%define tolerate_unknown_new_config_options 0
|
|
|
|
|
|
|
|
%description
|
2008-10-08 10:51:30 +02:00
|
|
|
Dummy description.
|
2008-07-18 12:15:21 +02:00
|
|
|
|
|
|
|
%prep
|
2008-07-19 01:01:47 +02:00
|
|
|
if ! [ -e %_sourcedir/linux-2.6.26.tar.bz2 ]; then
|
|
|
|
echo "Please get a copy of linux-2.6.26.tar.bz2 from" \
|
2008-07-18 12:15:21 +02:00
|
|
|
"ftp://ftp.kernel.org/pub/linux/kernel/v2.6/."
|
|
|
|
fi
|
2008-10-08 10:51:30 +02:00
|
|
|
|
2008-07-18 12:15:21 +02:00
|
|
|
echo "Architecture symbol(s): %symbols"
|
2008-10-08 10:51:30 +02:00
|
|
|
|
2008-07-18 12:15:21 +02:00
|
|
|
# Unpack all sources and patches
|
2008-09-29 18:18:36 +02:00
|
|
|
%setup -q -c -T -a 100 -a 101 -a 102 -a 103 -a 104 -a 105 -a 106 -a 107 -a 108 -a 109 -a 110 -a 111 -a 112
|
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-10-08 10:51:30 +02:00
|
|
|
|
2008-10-06 18:52:37 +02:00
|
|
|
KERNELRELEASE=2.6.27-rc8-$RELEASE
|
2008-10-08 10:51:30 +02:00
|
|
|
|
2008-10-06 18:52:37 +02:00
|
|
|
case kernel-source in
|
|
|
|
(*-rt)
|
|
|
|
variant=-rt
|
|
|
|
variant_symbols=RT
|
|
|
|
;;
|
|
|
|
(*)
|
|
|
|
variant=
|
|
|
|
variant_symbols=
|
|
|
|
;;
|
|
|
|
esac
|
2008-10-08 10:51:30 +02:00
|
|
|
|
2008-07-18 12:15:21 +02:00
|
|
|
cat > %_builddir/%{name}-%{version}/.rpm-defs <<EOF
|
|
|
|
KERNELRELEASE=$KERNELRELEASE
|
2008-10-06 18:52:37 +02:00
|
|
|
variant=$variant
|
2008-07-18 12:15:21 +02:00
|
|
|
EOF
|
2008-10-08 10:51:30 +02:00
|
|
|
|
2008-09-29 18:18:36 +02:00
|
|
|
mkdir -p $RPM_BUILD_ROOT/usr/src
|
|
|
|
cd $RPM_BUILD_ROOT/usr/src
|
2008-10-08 10:51:30 +02:00
|
|
|
|
2008-09-29 18:18:36 +02:00
|
|
|
# Unpack the vanilla kernel sources
|
|
|
|
bzip2 -cd %_sourcedir/linux-2.6.26.tar.bz2 \
|
|
|
|
| tar xf -
|
2008-10-08 10:51:30 +02:00
|
|
|
|
2008-10-06 18:52:37 +02:00
|
|
|
mv linux-2.6.26 linux-$KERNELRELEASE$variant
|
|
|
|
cd linux-$KERNELRELEASE$variant
|
2008-10-08 10:51:30 +02:00
|
|
|
|
2008-10-06 18:52:37 +02:00
|
|
|
chmod -x arch/arm/mach-at91/board-yl-9200.c # executable by accident (fixed in 2.6.27)
|
2008-10-08 10:51:30 +02:00
|
|
|
|
2008-10-06 18:52:37 +02:00
|
|
|
%_sourcedir/guards $variant_symbols %symbols < %_sourcedir/series.conf \
|
|
|
|
> .patches
|
|
|
|
for patch in $(< .patches); do
|
|
|
|
if ! patch -s -F0 -E -p1 --no-backup-if-mismatch \
|
|
|
|
-i %_builddir/kernel-source-2.6.27/$patch; then
|
|
|
|
echo "*** Patch $patch failed ***"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
done
|
2008-10-08 10:51:30 +02:00
|
|
|
|
2008-10-06 18:52:37 +02:00
|
|
|
if [ -f %_sourcedir/localversion ] ; then
|
|
|
|
cat %_sourcedir/localversion > localversion
|
|
|
|
fi
|
2008-10-08 10:51:30 +02:00
|
|
|
|
2008-10-06 18:52:37 +02:00
|
|
|
cat > %my_builddir/kernel-source.files <<EOF
|
|
|
|
%%%%defattr(-, root, root)
|
|
|
|
%%%%ghost /usr/src/linux$variant
|
|
|
|
%%%%ghost /usr/src/linux$variant-obj
|
|
|
|
/usr/src/linux-$KERNELRELEASE$variant
|
|
|
|
/usr/src/linux-$KERNELRELEASE$variant-obj
|
|
|
|
/usr/share/doc/packages/%name
|
|
|
|
/etc/rpm/macros.kernel-source
|
|
|
|
/usr/lib/rpm/kernel-module-subpackage
|
|
|
|
/lib/modules/*
|
|
|
|
EOF
|
2008-10-08 10:51:30 +02:00
|
|
|
|
2008-07-18 12:15:21 +02:00
|
|
|
for config in $(%_sourcedir/guards %symbols < %_sourcedir/config.conf | grep -v vanilla); do
|
|
|
|
arch=${config%/*}
|
|
|
|
flavor=${config#*/}
|
2008-09-29 18:18:36 +02:00
|
|
|
config=%_builddir/%buildsubdir/config/$config
|
2008-10-08 10:51:30 +02:00
|
|
|
|
2008-07-18 12:15:21 +02:00
|
|
|
case "$flavor" in
|
|
|
|
*-*)
|
|
|
|
echo "Flavor '$flavor' must not contain dashes." >&2
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
2008-10-08 10:51:30 +02:00
|
|
|
|
2008-09-29 18:18:36 +02:00
|
|
|
set -- kernel-$flavor $flavor
|
|
|
|
case $flavor in
|
|
|
|
(rt|rt_*)
|
|
|
|
set -- "$@" RT
|
|
|
|
;;
|
|
|
|
esac
|
2008-10-08 10:51:30 +02:00
|
|
|
|
2008-10-06 18:52:37 +02:00
|
|
|
diff -q .patches \
|
|
|
|
<(%_sourcedir/guards $* %symbols < %_sourcedir/series.conf) \
|
|
|
|
|| continue
|
2008-10-08 10:51:30 +02:00
|
|
|
|
2008-10-06 18:52:37 +02:00
|
|
|
# source_tree=linux-$KERNELRELEASE$variant
|
|
|
|
o=$RPM_BUILD_ROOT/usr/src/linux-$KERNELRELEASE$variant-obj/$arch/$flavor
|
2008-07-18 12:15:21 +02:00
|
|
|
mkdir -p $o
|
2008-09-29 18:18:36 +02:00
|
|
|
cat $config \
|
2008-10-06 18:52:37 +02:00
|
|
|
| %_sourcedir/config-subst CONFIG_LOCALVERSION '"'-$RELEASE-$flavor'"' \
|
2008-09-29 18:18:36 +02:00
|
|
|
| %_sourcedir/config-subst CONFIG_SUSE_KERNEL y \
|
|
|
|
> $o/.config
|
2008-10-08 10:51:30 +02:00
|
|
|
|
2008-07-18 12:15:21 +02:00
|
|
|
case $flavor in
|
|
|
|
um)
|
|
|
|
MAKE_ARGS="ARCH=$flavor SUBARCH=$arch O=$o" ;;
|
|
|
|
*)
|
|
|
|
MAKE_ARGS="ARCH=$arch O=$o" ;;
|
|
|
|
esac
|
2008-10-08 10:51:30 +02:00
|
|
|
|
2008-07-18 12:15:21 +02:00
|
|
|
# Works around a "fix" in mainline that ends up causing the makefile
|
|
|
|
# to not be regenerated.
|
|
|
|
echo "Automatically" > $o/Makefile
|
2008-10-08 10:51:30 +02:00
|
|
|
|
2008-07-18 12:15:21 +02:00
|
|
|
%if %{tolerate_unknown_new_config_options}
|
|
|
|
yes '' | make oldconfig $MAKE_ARGS
|
|
|
|
%else
|
2008-10-06 18:52:37 +02:00
|
|
|
cp $o/.config $o/.config.before
|
|
|
|
make silentoldconfig $MAKE_ARGS < /dev/null
|
|
|
|
%_sourcedir/check-for-config-changes $o/.config.before $o/.config
|
|
|
|
rm -r $o/.config.before
|
2008-07-18 12:15:21 +02:00
|
|
|
%endif
|
2008-10-08 10:51:30 +02:00
|
|
|
|
2008-10-06 18:52:37 +02:00
|
|
|
make prepare $MAKE_ARGS
|
|
|
|
make scripts $MAKE_ARGS
|
|
|
|
krel=$(make -s kernelrelease $MAKE_ARGS)
|
2008-07-18 12:15:21 +02:00
|
|
|
if [ $KERNELRELEASE != "${krel%%-*}" ]; then
|
|
|
|
echo "Kernel release mismatch: $KERNELRELEASE != ${krel%%-*}" >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
2008-10-06 18:52:37 +02:00
|
|
|
make clean $MAKE_ARGS
|
2008-10-08 10:51:30 +02:00
|
|
|
|
2008-09-29 18:18:36 +02:00
|
|
|
mkdir -p $RPM_BUILD_ROOT/lib/modules/$krel
|
2008-10-06 18:52:37 +02:00
|
|
|
ln -s ../../../usr/src/linux-$KERNELRELEASE$variant \
|
2008-09-29 18:18:36 +02:00
|
|
|
$RPM_BUILD_ROOT/lib/modules/$krel/source
|
2008-10-08 10:51:30 +02:00
|
|
|
|
2008-08-07 01:33:54 +02:00
|
|
|
# Replace the absolute with a relative path
|
2008-10-06 18:52:37 +02:00
|
|
|
sed -e "s,$RPM_BUILD_ROOT/usr/src/linux-$KERNELRELEASE$variant,../../../linux-$KERNELRELEASE$variant,g" \
|
2008-07-18 12:15:21 +02:00
|
|
|
-i $o/Makefile
|
2008-09-29 18:18:36 +02:00
|
|
|
rm -f $o/.config.old
|
2008-07-18 12:15:21 +02:00
|
|
|
done
|
2008-10-08 10:51:30 +02:00
|
|
|
|
2008-10-06 18:52:37 +02:00
|
|
|
rm -f linux-$KERNELRELEASE$variant/.patches
|
2008-10-08 10:51:30 +02:00
|
|
|
|
2008-09-29 18:18:36 +02:00
|
|
|
# Hardlink duplicate files automatically (from package fdupes).
|
|
|
|
%fdupes $RPM_BUILD_ROOT
|
2008-10-08 10:51:30 +02:00
|
|
|
|
2008-10-06 18:52:37 +02:00
|
|
|
cd $RPM_BUILD_ROOT/usr/src/linux-$KERNELRELEASE$variant-obj
|
2008-07-18 12:15:21 +02:00
|
|
|
set -- *
|
|
|
|
[ -e %_target_cpu ] || ln -s $1 %_target_cpu
|
|
|
|
%ifarch ppc ppc64
|
|
|
|
[ -e ppc ] || ln -s $1 ppc
|
|
|
|
[ -e ppc64 ] || ln -s $1 ppc64
|
|
|
|
%endif
|
2008-10-08 10:51:30 +02:00
|
|
|
|
2008-07-18 12:15:21 +02:00
|
|
|
cd $RPM_BUILD_ROOT/usr/src
|
2008-10-08 10:51:30 +02:00
|
|
|
|
2008-10-06 18:52:37 +02:00
|
|
|
rm -f `find linux-$KERNELRELEASE$variant -name ".gitignore"`
|
2008-10-08 10:51:30 +02:00
|
|
|
|
2008-07-18 12:15:21 +02:00
|
|
|
# Remove $RPM_BUILD_ROOT prefix from symlinks.
|
2008-10-06 18:52:37 +02:00
|
|
|
for link in $(find $RPM_BUILD_ROOT/usr/src/linux-$KERNELRELEASE$variant-obj -type l); do
|
2008-07-18 12:15:21 +02:00
|
|
|
target=$(readlink $link)
|
|
|
|
rm -f $link
|
|
|
|
ln -s ${target/$RPM_BUILD_ROOT/} $link
|
|
|
|
done
|
2008-10-08 10:51:30 +02:00
|
|
|
|
2008-10-06 18:52:37 +02:00
|
|
|
ln -sf linux$variant linux$variant # dummy symlink
|
|
|
|
ln -sf linux$variant-obj linux$variant-obj # dummy symlink
|
2008-07-18 12:15:21 +02:00
|
|
|
|
|
|
|
%install
|
|
|
|
source .rpm-defs
|
2008-10-08 10:51:30 +02:00
|
|
|
|
2008-07-18 12:15:21 +02:00
|
|
|
# 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 \
|
2008-10-06 18:52:37 +02:00
|
|
|
$RPM_BUILD_ROOT/usr/src/linux-$KERNELRELEASE$variant/
|
2008-10-08 10:51:30 +02:00
|
|
|
|
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/
|
2008-10-08 10:51:30 +02:00
|
|
|
|
2008-10-06 18:52:37 +02:00
|
|
|
( cat %_sourcedir/functions.sh
|
|
|
|
sed -e "s:@KERNELRELEASE@:$KERNELRELEASE:g" \
|
|
|
|
-e "s:@VARIANT@:$variant:g" \
|
|
|
|
%_sourcedir/source-post.sh
|
|
|
|
) > kernel-source-post.sh
|
2008-07-18 12:15:21 +02:00
|
|
|
|
2008-10-06 18:52:37 +02:00
|
|
|
%post -f kernel-source-post.sh
|
2008-07-18 12:15:21 +02:00
|
|
|
%files -f kernel-source.files
|