SPECS (Titanium): kernel-bare-grsecurity.spec (NEW) - started work...

hawk hawk at pld-linux.org
Sat Nov 10 20:09:58 CET 2007


Author: hawk                         Date: Sat Nov 10 19:09:58 2007 GMT
Module: SPECS                         Tag: Titanium
---- Log message:
- started work on my own grsecurity kernel for PLD Titanium, if you want
  to add some patches/changes, ask me first or use kernel.spec

---- Files affected:
SPECS:
   kernel-bare-grsecurity.spec (NONE -> 1.1.2.1)  (NEW)

---- Diffs:

================================================================
Index: SPECS/kernel-bare-grsecurity.spec
diff -u /dev/null SPECS/kernel-bare-grsecurity.spec:1.1.2.1
--- /dev/null	Sat Nov 10 20:09:58 2007
+++ SPECS/kernel-bare-grsecurity.spec	Sat Nov 10 20:09:53 2007
@@ -0,0 +1,841 @@
+# $Revision$, $Date$
+#
+# Conditional build:
+%bcond_without	source		# don't build kernel-source package
+%bcond_with	verbose		# verbose build (V=1)
+%bcond_with	pae		# build PAE (HIGHMEM64G) support on uniprocessor
+%bcond_with	preempt-nort	# build preemptable no realtime kernel
+
+%{?debug:%define with_verbose 1}
+
+%ifnarch %{ix86}
+%undefine	with_pae
+%endif
+
+%ifarch %{ix86}
+%define		have_isa	1
+%endif
+
+%define		have_pcmcia	1
+%define		have_oss	1
+
+%define		have_sound	1
+
+## Program required by kernel to work.
+%define		_binutils_ver		2.12.1
+%define		_util_linux_ver		2.10o
+%define		_module_init_tool_ver	0.9.10
+%define		_e2fsprogs_ver		1.29
+%define		_jfsutils_ver		1.1.3
+%define		_reiserfsprogs_ver	3.6.3
+%define		_xfsprogs_ver		2.6.0
+%define		_pcmcia_cs_ver		3.1.21
+%define		_pcmciautils_ver	004
+%define		_quota_tools_ver	3.09
+%define		_ppp_ver		1:2.4.0
+%define		_isdn4k_utils_ver	3.1pre1
+%define		_nfs_utils_ver		1.0.5
+%define		_procps_ver		3.2.0
+%define		_oprofile_ver		0.9
+%define		_udev_ver		071
+
+%define		alt_kernel	bare-grsecurity
+
+%define		_basever	2.6.23
+%define		_postver	.1
+%define		_rel		1
+
+# for rc kernels basever is the version patch (source1) should be applied to
+#%define		_ver		2.6.20
+#%define		_rc			rc4
+# for non rc-kernels these should be %{nil}
+%define		_ver		%{nil}
+%define		_rc			%{nil}
+
+Summary:	The Linux kernel (the core of the Linux operating system)
+Summary(de):	Der Linux-Kernel (Kern des Linux-Betriebssystems)
+Summary(fr):	Le Kernel-Linux (La partie centrale du systeme)
+Summary(pl):	Jądro Linuksa
+Name:		kernel-%{alt_kernel}
+Version:	%{?_ver:%{_ver}}%{_basever}%{_postver}
+Release:	%{?_rc:%{_rc}}%{_rel}
+Epoch:		3
+License:	GPL v2
+Group:		Base/Kernel
+Source0:	http://www.kernel.org/pub/linux/kernel/v2.6/linux-%{_basever}.tar.bz2
+# Source0-md5:	2cc2fd4d521dc5d7cfce0d8a9d1b3472
+%if "%{_postver}" != "%{nil}"
+Source1:	http://www.kernel.org/pub/linux/kernel/v2.6/patch-%{_basever}%{_postver}.bz2
+# Source1-md5:	896c5d4e7fd68d37b8c16e5d2842563b
+%endif
+%if "%{_ver}" != "%{nil}"
+Source10:	http://www.kernel.org/pub/linux/kernel/v2.6/testing/patch-%{_ver}-%{_rc}.bz2
+# Source10-md5:	9b325c6086ad2a3fcde643f01a4c4640
+%endif
+
+Source2:	kernel-bare-grsecurity-module-build.pl
+Source3:	kernel-bare-grsecurity-config.h
+
+Source20:	kernel-bare-grsecurity-i386.config
+Source21:	kernel-bare-grsecurity-x86_64.config
+
+# from http://www.grsecurity.net/~spender/
+Patch100:	linux-2.6-grsecurity.patch
+
+URL:		http://www.kernel.org/
+BuildRequires:	binutils >= 3:2.14.90.0.7
+BuildRequires:	gcc >= 5:3.2
+BuildRequires:	module-init-tools
+# for hostname command
+BuildRequires:	net-tools
+BuildRequires:	perl-base
+BuildRequires:	rpmbuild(macros) >= 1.217
+BuildRequires:	sed >= 4.0
+Autoreqprov:	no
+Requires:	coreutils
+Requires:	geninitrd >= 2.57
+Requires:	module-init-tools >= 0.9.9
+Provides:	%{name}-up = %{epoch}:%{version}-%{release}
+Provides:	kernel = %{epoch}:%{version}-%{release}
+Provides:	kernel(realtime-lsm) = 0.1.1
+Provides:	kernel-misc-fuse
+Provides:	kernel-net-hostap = 0.4.4
+Provides:	kernel-net-ieee80211
+Provides:	kernel-net-ipw2100 = 1.1.3
+Provides:	kernel-net-ipw2200 = 1.0.8
+Provides:	module-info
+Conflicts:	e2fsprogs < %{_e2fsprogs_ver}
+Conflicts:	isdn4k-utils < %{_isdn4k_utils_ver}
+Conflicts:	jfsutils < %{_jfsutils_ver}
+Conflicts:	module-init-tool < %{_module_init_tool_ver}
+Conflicts:	nfs-utils < %{_nfs_utils_ver}
+Conflicts:	oprofile < %{_oprofile_ver}
+Conflicts:	ppp < %{_ppp_ver}
+Conflicts:	procps < %{_procps_ver}
+Conflicts:	quota-tools < %{_quota_tools_ver}
+Conflicts:	reiserfsprogs < %{_reiserfsprogs_ver}
+Conflicts:	udev < %{_udev_ver}
+Conflicts:	util-linux < %{_util_linux_ver}
+Conflicts:	xfsprogs < %{_xfsprogs_ver}
+ExclusiveArch:	%{ix86} %{x8664}
+ExclusiveOS:	Linux
+BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+# No ELF objects there to strip (skips processing 27k files)
+%define		_noautostrip	.*%{_kernelsrcdir}/.*
+
+%define		initrd_dir	/boot
+
+# kernel release (used in filesystem and eventually in uname -r)
+# modules will be looked from /lib/modules/%{kernel_release}
+# _localversion is just that without version for "> localversion"
+%define		_localversion %{release}
+%define		kernel_release %{version}_%{alt_kernel}-%{_localversion}
+%define		_kernelsrcdir	/usr/src/linux-%{version}_%{alt_kernel}
+
+%define	CommonOpts	HOSTCC="%{__cc}" HOSTCFLAGS="-Wall -Wstrict-prototypes %{rpmcflags} -fomit-frame-pointer"
+%if "%{_target_base_arch}" != "%{_arch}"
+	%define	MakeOpts %{CommonOpts} ARCH=%{_target_base_arch} CROSS_COMPILE=%{_target_cpu}-pld-linux-
+	%define	DepMod /bin/true
+
+	%if "%{_arch}" == "x86_64" && "%{_target_base_arch}" == "i386"
+	%define	MakeOpts %{CommonOpts} CC="%{__cc}" ARCH=%{_target_base_arch}
+	%define	DepMod /sbin/depmod
+	%endif
+
+%else
+	%define MakeOpts %{CommonOpts} CC="%{__cc}"
+	%define	DepMod /sbin/depmod
+%endif
+
+%define __features Enabled features:\
+%{?debug:- DEBUG}\
+%define Features %(echo "%{__features}" | sed '/^$/d')
+# vim: "
+
+%description
+This package contains the Linux kernel that is used to boot and run
+your system. It contains few device drivers for specific hardware.
+Most hardware is instead supported by modules loaded after booting.
+
+%{Features}
+
+%description -l de
+Das Kernel-Packet enthält den Linux-Kernel (vmlinuz), den Kern des
+Linux-Betriebssystems. Der Kernel ist für grundliegende
+Systemfunktionen verantwortlich: Speicherreservierung,
+Prozeß-Management, Geräte Ein- und Ausgaben, usw.
+
+%{Features}
+
+%description -l fr
+Le package kernel contient le kernel linux (vmlinuz), la partie
+centrale d'un systčme d'exploitation Linux. Le noyau traite les
+fonctions basiques d'un systčme d'exploitation: allocation mémoire,
+allocation de process, entrée/sortie de peripheriques, etc.
+
+%{Features}
+
+%description -l pl
+Pakiet zawiera jądro Linuksa niezbędne do prawidłowego działania
+Twojego komputera. Zawiera w sobie sterowniki do sprzętu znajdującego
+się w komputerze, takiego jak sterowniki dysków itp.
+
+%{Features}
+
+%package vmlinux
+Summary:	vmlinux - uncompressed kernel image
+Summary(de):	vmlinux - dekompressiertes Kernel Bild
+Summary(pl):	vmlinux - rozpakowany obraz jądra
+Group:		Base/Kernel
+
+%description vmlinux
+vmlinux - uncompressed kernel image.
+
+%description vmlinux -l de
+vmlinux - dekompressiertes Kernel Bild.
+
+%description vmlinux -l pl
+vmlinux - rozpakowany obraz jądra.
+
+%package drm
+Summary:	DRM kernel modules
+Summary(de):	DRM Kernel Treiber
+Summary(pl):	Sterowniki DRM
+Group:		Base/Kernel
+Requires(postun):	%{name}-up = %{epoch}:%{version}-%{release}
+Requires:	%{name}-up = %{epoch}:%{version}-%{release}
+Provides:	kernel-drm = %{drm_xfree_version}
+Autoreqprov:	no
+
+%description drm
+DRM kernel modules (%{drm_xfree_version}).
+
+%description drm -l de
+DRM Kernel Treiber (%{drm_xfree_version}).
+
+%description drm -l pl
+Sterowniki DRM (%{drm_xfree_version}).
+
+%package pcmcia
+Summary:	PCMCIA modules
+Summary(de):	PCMCIA Module
+Summary(pl):	Moduły PCMCIA
+Group:		Base/Kernel
+Requires(postun):	%{name}-up = %{epoch}:%{version}-%{release}
+Requires:	%{name}-up = %{epoch}:%{version}-%{release}
+Provides:	kernel(pcmcia)
+Provides:	kernel-pcmcia = %{pcmcia_version}
+Conflicts:	pcmcia-cs < %{_pcmcia_cs_ver}
+Conflicts:	pcmciautils < %{_pcmciautils_ver}
+Autoreqprov:	no
+
+%description pcmcia
+PCMCIA modules (%{pcmcia_version}).
+
+%description pcmcia -l de
+PCMCIA Module (%{pcmcia_version})
+
+%description pcmcia -l pl
+Moduły PCMCIA (%{pcmcia_version}).
+
+%package sound-alsa
+Summary:	ALSA kernel modules
+Summary(de):	ALSA Kernel Module
+Summary(pl):	Sterowniki dźwięku ALSA
+Group:		Base/Kernel
+Requires(postun):	%{name}-up = %{epoch}:%{version}-%{release}
+Requires:	%{name}-up = %{epoch}:%{version}-%{release}
+Autoreqprov:	no
+
+%description sound-alsa
+ALSA (Advanced Linux Sound Architecture) sound drivers.
+
+%description sound-alsa -l de
+ALSA (Advanced Linux Sound Architecture) Sound-Treiber.
+
+%description sound-alsa -l pl
+Sterowniki dźwięku ALSA (Advanced Linux Sound Architecture).
+
+%package sound-oss
+Summary:	OSS kernel modules
+Summary(de):	OSS Kernel Module
+Summary(pl):	Sterowniki dźwięku OSS
+Group:		Base/Kernel
+Requires(postun):	%{name}-up = %{epoch}:%{version}-%{release}
+Requires:	%{name}-up = %{epoch}:%{version}-%{release}
+Autoreqprov:	no
+
+%description sound-oss
+OSS (Open Sound System) drivers.
+
+%description sound-oss -l de
+OSS (Open Sound System) Treiber.
+
+%description sound-oss -l pl
+Sterowniki dźwięku OSS (Open Sound System).
+
+%package headers
+Summary:	Header files for the Linux kernel
+Summary(de):	Header Dateien für den Linux-Kernel
+Summary(pl):	Pliki nagłówkowe jądra Linuksa
+Group:		Development/Building
+Provides:	kernel-headers = %{epoch}:%{version}-%{release}
+Provides:	kernel-headers(agpgart) = %{version}
+Provides:	kernel-headers(alsa-drivers)
+Provides:	kernel-headers(bridging) = %{version}
+Provides:	kernel-headers(reiserfs) = %{version}
+Autoreqprov:	no
+
+%description headers
+These are the C header files for the Linux kernel, which define
+structures and constants that are needed when rebuilding the kernel or
+building kernel modules.
+
+%description headers -l de
+Dies sind die C Header Dateien für den Linux-Kernel, die definierte
+Strukturen und Konstante beinhalten die beim rekompilieren des Kernels
+oder bei Kernel Modul kompilationen gebraucht werden.
+
+%description headers -l pl
+Pakiet zawiera pliki nagłówkowe jądra, niezbędne do rekompilacji jądra
+oraz budowania modułów jądra.
+
+%package module-build
+Summary:	Development files for building kernel modules
+Summary(de):	Development Dateien die beim Kernel Modul kompilationen gebraucht werden
+Summary(pl):	Pliki służące do budowania modułów jądra
+Group:		Development/Building
+Requires:	%{name}-headers = %{epoch}:%{version}-%{release}
+Provides:	kernel-module-build = %{epoch}:%{version}-%{release}
+Autoreqprov:	no
+
+%description module-build
+Development files from kernel source tree needed to build Linux kernel
+modules from external packages.
+
+%description module-build -l de
+Development Dateien des Linux-Kernels die beim kompilieren externer
+Kernel Module gebraucht werden.
+
+%description module-build -l pl
+Pliki ze drzewa źródeł jądra potrzebne do budowania modułów jądra
+Linuksa z zewnętrznych pakietów.
+
+%package source
+Summary:	Kernel source tree
+Summary(de):	Der Kernel Quelltext
+Summary(pl):	Kod źródłowy jądra Linuksa
+Group:		Development/Building
+Requires:	%{name}-module-build = %{epoch}:%{version}-%{release}
+Provides:	kernel-source = %{epoch}:%{version}-%{release}
+Autoreqprov:	no
+
+%description source
+This is the source code for the Linux kernel. You can build a custom
+kernel that is better tuned to your particular hardware.
+
+%description source -l de
+Das Kernel-Source-Packet enthält den source code (C/Assembler-Code)
+des Linux-Kernels. Die Source-Dateien werden gebraucht, um viele
+C-Programme zu kompilieren, da sie auf Konstanten zurückgreifen, die
+im Kernel-Source definiert sind. Die Source-Dateien können auch
+benutzt werden, um einen Kernel zu kompilieren, der besser auf Ihre
+Hardware ausgerichtet ist.
+
+%description source -l fr
+Le package pour le kernel-source contient le code source pour le noyau
+linux. Ces sources sont nécessaires pour compiler la plupart des
+programmes C, car il dépend de constantes définies dans le code
+source. Les sources peuvent ętre aussi utilisée pour compiler un noyau
+personnalisé pour avoir de meilleures performances sur des matériels
+particuliers.
+
+%description source -l pl
+Pakiet zawiera kod źródłowy jądra systemu.
+
+%package doc
+Summary:	Kernel documentation
+Summary(de):	Kernel Dokumentation
+Summary(pl):	Dokumentacja do jądra Linuksa
+Group:		Documentation
+Provides:	kernel-doc = %{version}
+Autoreqprov:	no
+
+%description doc
+This is the documentation for the Linux kernel, as found in
+Documentation directory.
+
+%description doc -l de
+Dies ist die Kernel Dokumentation wie sie im 'Documentation'
+Verzeichniss vorgefunden werden kann.
+
+%description doc -l pl
+Pakiet zawiera dokumentację do jądra Linuksa pochodzącą z katalogu
+Documentation.
+
+%prep
+%setup -q -n linux-%{_basever}
+
+%if "%{_postver}" != "%{nil}"
+%{__bzip2} -dc %{SOURCE1} | %{__patch} -p1 -s
+%endif
+%if "%{_ver}" != "%{nil}"
+%{__bzip2} -dc %{SOURCE10} | %{__patch} -p1 -s
+%endif
+
+%patch100 -p1
+
+# Fix EXTRAVERSION in main Makefile
+sed -i 's#EXTRAVERSION =.*#EXTRAVERSION = %{_postver}_%{alt_kernel}#g' Makefile
+
+sed -i -e '/select INPUT/d' net/bluetooth/hidp/Kconfig
+
+# remove unwanted files after patching (if any)
+find . '(' -name '*~' -o -name '*.orig' -o -name '.gitignore' ')' -print0 | xargs -0 -r -l512 rm -f
+
+%build
+TuneUpConfigForIX86 () {
+%ifarch %{ix86}
+	pae=
+	%if %{with pae}
+		pae=yes
+	%endif
+	%ifnarch i386
+	sed -i 's:CONFIG_M386=y:# CONFIG_M386 is not set:' $1
+	%endif
+	%ifarch i486
+	sed -i 's:# CONFIG_M486 is not set:CONFIG_M486=y:' $1
+	%endif
+	%ifarch i586
+	sed -i 's:# CONFIG_M586 is not set:CONFIG_M586=y:' $1
+	%endif
+	%ifarch i686
+	sed -i 's:# CONFIG_M686 is not set:CONFIG_M686=y:' $1
+	%endif
+	%ifarch pentium3
+	sed -i 's:# CONFIG_MPENTIUMIII is not set:CONFIG_MPENTIUMIII=y:' $1
+	%endif
+	%ifarch pentium4
+	sed -i 's:# CONFIG_MPENTIUM4 is not set:CONFIG_MPENTIUM4=y:' $1
+	%endif
+	%ifarch athlon
+	sed -i 's:# CONFIG_MK7 is not set:CONFIG_MK7=y:' $1
+	%endif
+	%ifarch i686 athlon pentium3 pentium4
+	if [ "$pae" = "yes" ]; then
+		sed -i "s:CONFIG_HIGHMEM4G=y:# CONFIG_HIGHMEM4G is not set:" $1
+		sed -i "s:# CONFIG_HIGHMEM64G is not set:CONFIG_HIGHMEM64G=y\nCONFIG_X86_PAE=y:" $1
+	fi
+	sed -i 's:CONFIG_MATH_EMULATION=y:# CONFIG_MATH_EMULATION is not set:' $1
+	%endif
+	return 0
+%endif
+}
+
+rm -f .config
+BuildConfig() {
+	%{?debug:set -x}
+	Config="%{_target_base_arch}"
+	KernelVer=%{kernel_release}$1
+
+	echo "Building config file [using $Config.conf] for KERNEL $1..."
+
+	echo "" > .config
+	cat $RPM_SOURCE_DIR/kernel-bare-grsecurity-$Config.config >> .config
+	echo "CONFIG_LOCALVERSION=\"-%{_localversion}smp\"" >> .config
+
+	TuneUpConfigForIX86 .config
+
+	%if %{with preempt-nort}
+		sed -i "s:CONFIG_PREEMPT_NONE=y:# CONFIG_PREEMPT_NONE is not set:" .config
+		sed -i "s:# CONFIG_PREEMPT is not set:CONFIG_PREEMPT=y:" .config
+		sed -i "s:# CONFIG_PREEMPT_BKL is not set:CONFIG_PREEMPT_BKL=y:" .config
+	%endif
+
+%{?debug:sed -i "s:# CONFIG_DEBUG_SLAB is not set:CONFIG_DEBUG_SLAB=y:" .config}
+%{?debug:sed -i "s:# CONFIG_DEBUG_PREEMPT is not set:CONFIG_DEBUG_PREEMPT=y:" .config}
+%{?debug:sed -i "s:# CONFIG_RT_DEADLOCK_DETECT is not set:CONFIG_RT_DEADLOCK_DETECT=y:" .config}
+
+	install .config arch/%{_target_base_arch}/defconfig
+	install -d $KERNEL_INSTALL_DIR%{_kernelsrcdir}/include/linux
+	rm -f include/linux/autoconf.h
+	%{__make} %{MakeOpts} include/linux/autoconf.h
+	install include/linux/autoconf.h \
+		$KERNEL_INSTALL_DIR%{_kernelsrcdir}/include/linux/autoconf-dist.h
+	install .config \
+		$KERNEL_INSTALL_DIR%{_kernelsrcdir}/config-dist
+	install .config arch/%{_target_base_arch}/defconfig
+}
+
+BuildKernel() {
+	%{?debug:set -x}
+	echo "Building kernel $1 ..."
+	%{__make} %{MakeOpts} mrproper \
+		RCS_FIND_IGNORE='-name build-done -prune -o'
+	install arch/%{_target_base_arch}/defconfig .config
+
+	%{__make} %{MakeOpts} clean \
+		RCS_FIND_IGNORE='-name build-done -prune -o'
+
+	%{__make} %{MakeOpts} include/linux/version.h \
+		%{?with_verbose:V=1}
+
+	%{__make} %{MakeOpts} \
+		%{?with_verbose:V=1}
+}
+
+PreInstallKernel() {
+	Config="%{_target_base_arch}"
+	KernelVer=%{kernel_release}
+
+	mkdir -p $KERNEL_INSTALL_DIR/boot
+	install System.map $KERNEL_INSTALL_DIR/boot/System.map-$KernelVer
+%ifarch %{ix86} %{x8664}
+	install arch/%{_target_base_arch}/boot/bzImage $KERNEL_INSTALL_DIR/boot/vmlinuz-$KernelVer
+%endif
+
+	install vmlinux $KERNEL_INSTALL_DIR/boot/vmlinux-$KernelVer
+
+	%{__make} %{MakeOpts} modules_install \
+		%{?with_verbose:V=1} \
+		DEPMOD=%{DepMod} \
+		INSTALL_MOD_PATH=$KERNEL_INSTALL_DIR \
+		KERNELRELEASE=$KernelVer
+
+	install Module.symvers \
+		$KERNEL_INSTALL_DIR%{_kernelsrcdir}/Module.symvers-dist
+
+	echo "CHECKING DEPENDENCIES FOR KERNEL MODULES"
+	%if "%{_target_base_arch}" != "%{_arch}"
+		touch $KERNEL_INSTALL_DIR/lib/modules/$KernelVer/modules.dep
+	%else
+		/sbin/depmod --basedir $KERNEL_INSTALL_DIR -ae \
+			-F $KERNEL_INSTALL_DIR/boot/System.map-$KernelVer -r $KernelVer \
+			|| echo
+	%endif
+	echo "KERNEL RELEASE $KernelVer DONE"
+}
+
+KERNEL_BUILD_DIR=`pwd`
+
+KERNEL_INSTALL_DIR="$KERNEL_BUILD_DIR/build-done/kernel"
+rm -rf $KERNEL_INSTALL_DIR
+BuildConfig
+BuildKernel
+PreInstallKernel
+
+%install
+rm -rf $RPM_BUILD_ROOT
+umask 022
+export DEPMOD=%{DepMod}
+
+install -d $RPM_BUILD_ROOT%{_kernelsrcdir}
+install -d $RPM_BUILD_ROOT%{_sysconfdir}/modprobe.d/%{kernel_release}
+
+# test if we can hardlink -- %{_builddir} and $RPM_BUILD_ROOT on same partition
+if cp -al COPYING $RPM_BUILD_ROOT/COPYING 2>/dev/null; then
+	l=l
+	rm -f $RPM_BUILD_ROOT/COPYING
+fi
+
+KERNEL_BUILD_DIR=`pwd`
+
+cp -a$l $KERNEL_BUILD_DIR/build-done/kernel/* $RPM_BUILD_ROOT
+
+if [ -e  $RPM_BUILD_ROOT/lib/modules/%{kernel_release}$i ] ; then
+	rm -f $RPM_BUILD_ROOT/lib/modules/%{kernel_release}$i/build
+	ln -sf %{_kernelsrcdir} \
+		$RPM_BUILD_ROOT/lib/modules/%{kernel_release}$i/build
+	install -d $RPM_BUILD_ROOT/lib/modules/%{kernel_release}$i/{cluster,misc}
+fi
+
+find . -maxdepth 1 ! -name "build-done" ! -name "." -exec cp -a$l "{}" "$RPM_BUILD_ROOT%{_kernelsrcdir}/" ";"
+
+cd $RPM_BUILD_ROOT%{_kernelsrcdir}
+
+%{__make} %{MakeOpts} mrproper \
+	RCS_FIND_IGNORE='-name build-done -prune -o'
+
+find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
+
+if [ -e $KERNEL_BUILD_DIR/build-done/kernel-UP%{_kernelsrcdir}/include/linux/autoconf-dist.h ]; then
+install $KERNEL_BUILD_DIR/build-done/kernel-UP%{_kernelsrcdir}/include/linux/autoconf-dist.h \
+	$RPM_BUILD_ROOT%{_kernelsrcdir}/include/linux
+install	$KERNEL_BUILD_DIR/build-done/kernel-UP%{_kernelsrcdir}/config-dist \
+	$RPM_BUILD_ROOT%{_kernelsrcdir}
+fi
+
+install $KERNEL_BUILD_DIR/build-done/kernel%{_kernelsrcdir}/include/linux/* \
+	$RPM_BUILD_ROOT%{_kernelsrcdir}/include/linux
+
+install $KERNEL_BUILD_DIR/build-done/kernel%{_kernelsrcdir}/config-dist \
+	.config
+
+%{__make} %{MakeOpts} include/linux/version.h include/linux/utsrelease.h
+mv include/linux/version.h{,.save}
+mv include/linux/utsrelease.h{,.save}
+%{__make} %{MakeOpts} mrproper
+mv include/linux/version.h{.save,}
+mv include/linux/utsrelease.h{.save,}
+#install %{SOURCE3} $RPM_BUILD_ROOT%{_kernelsrcdir}/include/linux/autoconf.h
+install %{SOURCE3} $RPM_BUILD_ROOT%{_kernelsrcdir}/include/linux/config.h
+
+# collect module-build files and directories
+%{__perl} %{SOURCE2} %{_kernelsrcdir} $KERNEL_BUILD_DIR
+
+# ghosted initrd
+touch $RPM_BUILD_ROOT/boot/initrd-%{kernel_release}.gz
+
+%clean
+rm -rf $RPM_BUILD_ROOT
<<Diff was trimmed, longer than 597 lines>>


More information about the pld-cvs-commit mailing list