%define ver 2.6.9 # What parts do we want to build? We must build at least one kernel. # These are the kernels that are built IF the architecture allows it. %define buildsmp 0 %define distcc 1 Name: kernel Summary: The Linux Kernel Version: %{ver} Release: 1mgc License: GPL Group: System Environment/Kernel Vendor: The Linux Community URL: http://www.kernel.org BuildArchitectures: i686 Source0: linux-%{ver}.tar.bz2 Source1: config-i686 Source2: config-i686-smp BuildRoot: /var/tmp/%{name}-%{PACKAGE_VERSION}-root Provides: kernel-drm kernel-%{ver} %define __spec_install_post /usr/lib/rpm/brp-compress || : %define debug_package %{nil} %description The Linux Kernel, the operating system core itself %package sourcecode Summary: The source code for the Linux kernel. Group: Development/System Prereq: fileutils Requires: make >= 3.78 Requires: gcc >= 3.2 Requires: /usr/bin/strip # for xconfig and gconfig Requires: qt-devel, gtk2-devel readline-devel ncurses-devel Provides: kernel-sourcecode Patch1: patch-2.6.9-cko3-bootsplash.bz2 Patch2: usbadsl-2.6.9.patch %description sourcecode The kernel-sourcecode package contains the source code files for the Linux kernel. The source files can be used to build a custom kernel that is smaller by virtue of only including drivers for your particular hardware, if you are so inclined and you know what you are doing. The customisation guide in the documentation describes in detail how to do this. This package is neither needed nor usable for building external kernel modules for linking such modules into the default operating system kernels. %prep %setup -q -n %{name}-%{ver} -c cd linux-%{ver} # Apply CKO patch %patch1 -p1 # USB ADSL patch %patch2 -p1 # Copy the specified config file %if %buildsmp cp $RPM_SOURCE_DIR/config-%_target_cpu-smp .config %else cp $RPM_SOURCE_DIR/config-%_target_cpu .config %endif %build cd linux-%{ver} %if %distcc make -j6 CC="ccache gcc" %else make %endif %install cd linux-%{ver} mkdir -p $RPM_BUILD_ROOT/boot $RPM_BUILD_ROOT/lib $RPM_BUILD_ROOT/lib/modules mkdir -p $RPM_BUILD_ROOT/usr/include/linux make -s INSTALL_MOD_PATH=$RPM_BUILD_ROOT modules_install KERNELRELEASE=%{ver} cp arch/i386/boot/bzImage $RPM_BUILD_ROOT/boot/vmlinuz-%{ver} cp System.map $RPM_BUILD_ROOT/boot/System.map-%{ver} cp .config $RPM_BUILD_ROOT/boot/config-%{ver} cp .version $RPM_BUILD_ROOT/usr/include/linux/ mkdir -p $RPM_BUILD_ROOT/usr/src/linux-%{ver} chmod -R a+r * # clean up the source tree so that it is ready for users to build their own # kernel make -s mrproper # copy the source over tar cf - . | tar xf - -C $RPM_BUILD_ROOT/usr/src/linux-%{ver} %post new-kernel-pkg --install --mkinitrd --depmod %{ver} /sbin/splash -s -f /etc/bootsplash/themes/current/config/bootsplash-1024x768.cfg >> /boot/initrd-%{ver}.img if [ -f /boot/grub/grub.conf ] ; then rm -f /boot/grub/grub.conf.old mv -f /boot/grub/grub.conf /boot/grub/grub.conf.old sed -e "s/title Red Hat Linux (%{ver})/title MagicLinux (%{ver})/" /boot/grub/grub.conf.old > /boot/grub/grub.conf fi %post sourcecode ln -s /usr/src/linux-%{ver} /usr/src/linux ln -s /usr/src/linux/include/asm-i386 /usr/src/linux/include/asm %clean echo -rf $RPM_BUILD_ROOT %files %defattr (-, root, root) %dir /lib/modules /lib/modules/%{ver} /boot/* #/usr/include/linux/autoconf.h #/usr/include/linux/version.h %files sourcecode %defattr(-,root,root) /usr/src/linux-%{ver}