2 # spec file for package kernel-source-26
4 # Copyright (c) 2002 SuSE Linux AG, Nuernberg, Germany.
5 # This file and all modifications and additions to the pristine
6 # package are under the same license as the package itself.
8 # Please submit bugfixes or comments via http://www.suse.de/feedback/
11 # neededforbuild modutils
12 # usedforbuild aaa_base acl attr bash bind9-utils bison cpio cpp cvs cyrus-sasl db devs diffutils e2fsprogs file filesystem fileutils fillup findutils flex gawk gdbm-devel glibc glibc-devel glibc-locale gpm grep groff gzip kbd less libacl libattr libgcc libstdc++ libxcrypt m4 make man mktemp modutils ncurses ncurses-devel net-tools netcfg pam pam-devel pam-modules patch permissions ps rcs readline sed sendmail sh-utils shadow strace syslogd sysvinit tar texinfo textutils timezone unzip util-linux vim zlib-devel autoconf automake binutils bzip2 cracklib gcc gdbm gettext libtool perl rpm zlib
14 Name: kernel-source-26
17 BuildRequires: modutils
19 Summary: The Linux kernel (the core of the Linux operating system)
20 Group: Development/Sources
21 Requires: make c_compiler
22 # rpm doesn't like '-' in Version ...
24 %define kversion 2.6.0-test1
26 Source0: linux-%{kversion}.tar.bz2
28 Source11: arch-symbols
30 Source20: config.tar.bz2
32 Source100: patches.arch.tar.bz2
33 Source101: patches.fixes.tar.bz2
34 Source102: patches.drivers.tar.bz2
35 Source103: patches.rpmify.tar.bz2
36 %define ver_str %{kversion}-%release
37 BuildRoot: %_tmppath/linux-%ver_str-build
41 Linux Kernel sources with many Improvements and Fixes.
45 Linus Torvalds <torvalds@transmeta.com>
47 see /usr/src/linux/CREDITS for more details.
51 ###################################################################
52 # This package builds the SuSE Linux kernel source tree by adding
53 # up the vanillia kernelsource, a lot of patches and kernel
56 # _target_cpu can be set manually with the --target=XXX option to
57 # rpm. default _target_cpu is $RPM_ARCH
58 # you may use this to test build the package for say s390 on a ia32
60 ###################################################################
62 # Determine which symbols to use for controlling the patch/file
63 # selection mechanism.
65 export PATCH_ARCH=%_target_cpu
67 chmod +x %_sourcedir/arch-symbols
68 SYMBOLS="$(%_sourcedir/arch-symbols)"
69 if [ -z "$SYMBOLS" ]; then
70 echo "Unsupported architecture \`$ARCH'" >&2
73 if [ -e %_sourcedir/extra-symbols ]; then
74 SYMBOLS="$SYMBOLS $(cat %_sourcedir/extra-symbols)"
76 echo "Architecture symbol(s): $SYMBOLS"
78 # Write symbols to %_builddir/symbols so that other RPM sections
79 # can use the identical symbols. (Currently not needed!)
80 #echo $SYMBOLS > %_builddir/symbols
82 # Unpack all sources and patches
84 %setup -q -T -n config -b 20
85 %setup -q -T -n patches.arch -b 100
86 %setup -q -T -n patches.fixes -b 101
87 %setup -q -T -n patches.drivers -b 102
88 %setup -q -T -n patches.rpmify -b 103
90 # the kernel source tree is unpacked last so that RPM_BUILD_DIR
91 # points to the right path, /usr/src/packages/BUILD/linux-%version
92 %setup -q -n linux-%{kversion}
94 # Apply the patches needed for this architecture.
96 chmod +x %_sourcedir/guards
97 for patch in $(%_sourcedir/guards $SYMBOLS < %_sourcedir/series.conf); do
98 if ! patch -s -E -p1 --no-backup-if-mismatch -i ../$patch; then
99 echo "*** Patch $patch failed ***"
104 # config_subst makes sure that CONFIG_CFGNAME and CONFIG_RELEASE are
109 local name=$1 release=$2
111 function print_name(force)
113 if (!done_name || force)
114 printf "CONFIG_CFGNAME=\"%s\"\n", "'"$name"'"
117 function print_release(force)
119 if (!done_release || force)
120 printf "CONFIG_RELEASE=%d\n", '"$release"'
124 /\<CONFIG_CFGNAME\>/ { print_name(1) ; next }
125 /\<CONFIG_RELEASE\>/ { print_release(1) ; next }
127 END { print_name(0) ; print_release(0) }
129 #echo "CONFIG_MODVERSIONS=y"
132 # Install all config files that make sense for that particular
135 for config in $(%_sourcedir/guards $SYMBOLS < %_sourcedir/config.conf); do
136 name=$(basename $config)
137 path=arch/$(dirname $config)/defconfig.$name
138 mkdir -p $(dirname $path)
139 if [ "${config/*\//}" = "default" ]; then
140 config_subst $name %release \
141 < %_builddir/config/$config \
144 config_subst $name %release \
145 < %_builddir/config/$config \
148 chmod +x arch/ia64/scripts/toolchain-flags
152 ###################################################################
153 export RPM_TARGET=%_target_cpu
159 if [ "$RPM_TARGET" != "$HOSTTYPE" ]; then
160 echo "CONFIG_CROSSCOMPILE=y" >> .config
161 MAKE_ARGS="ARCH=$RPM_TARGET"
163 yes "" | make $MAKE_ARGS oldconfig
165 make -s $MAKE_ARGS include/linux/version.h
167 # Collect the filelist. (Not needed at the moment.)
168 #find . -mindepth 1 -not -path ./linux.files > linux.files
172 ###################################################################
173 export RPM_TARGET=%_target_cpu
179 if [ "$RPM_TARGET" != "$HOSTTYPE" ]; then
180 MAKE_ARGS="$MAKE_ARGS ARCH=$RPM_TARGET"
183 # Set up $RPM_BUILD_ROOT
185 rm -rf $RPM_BUILD_ROOT
186 mkdir -p $RPM_BUILD_ROOT/usr/src/linux-%ver_str
187 ln -sf linux-%ver_str $RPM_BUILD_ROOT/usr/src/linux
188 #cpio -p $RPM_BUILD_ROOT/usr/src/linux-%ver_str < linux.files
189 cp -dpR --parents . $RPM_BUILD_ROOT/usr/src/linux-%ver_str
191 # Do a test build to catch the most stupid mistakes early.
193 if [ ! -e %_sourcedir/skip-build ]; then
194 make $MAKE_ARGS vmlinux
200 /usr/src/linux-%ver_str