SPECS (Titanium): kernel-bare-grsecurity.spec - reworked from current kerne...

hawk hawk at pld-linux.org
Mon Jun 9 19:42:43 CEST 2008


Author: hawk                         Date: Mon Jun  9 17:42:43 2008 GMT
Module: SPECS                         Tag: Titanium
---- Log message:
- reworked from current kernel.spec:LINUX_2_6

---- Files affected:
SPECS:
   kernel-bare-grsecurity.spec (1.1.2.38 -> 1.1.2.39) 

---- Diffs:

================================================================
Index: SPECS/kernel-bare-grsecurity.spec
diff -u SPECS/kernel-bare-grsecurity.spec:1.1.2.38 SPECS/kernel-bare-grsecurity.spec:1.1.2.39
--- SPECS/kernel-bare-grsecurity.spec:1.1.2.38	Sat Jun  7 15:00:42 2008
+++ SPECS/kernel-bare-grsecurity.spec	Mon Jun  9 19:42:38 2008
@@ -1,33 +1,42 @@
 # $Revision$, $Date$
 #
 # Conditional build:
-%bcond_without	source		# don't build kernel-source package
+%bcond_without	source		# don't build kernel-bare-grsecurity-source package
+%bcond_without	pcmcia		# don't build pcmcia
 %bcond_with	verbose		# verbose build (V=1)
 %bcond_with	pae		# build PAE (HIGHMEM64G) support on uniprocessor
-%bcond_with	preempt		# build preemptable no realtime kernel
 %bcond_with	pax		# build PaX
 
 %{?debug:%define with_verbose 1}
 
-%ifarch %{ix86}
+%define		have_drm	1
+%define		have_oss	1
+%define		have_sound	1
 %define		have_isa	1
-%endif
 
-%define		have_pcmcia	1
-%define		have_oss	1
+%define		_basever		2.6.25
+%define		_postver		.5
+%define		_rel			2
 
-%define		have_sound	1
+%define		_enable_debug_packages			0
 
 %define		alt_kernel	bare%{?with_pax:-pax}-grsecurity%{?with_pae:-pae}
 
-%define		_basever	2.6.25
-%define		_postver	.5
-%define		_rel		1
+# 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 %{KABI}
+%define		kernel_release %{version}-%{alt_kernel}-%{_localversion}
+
+# Our Kernel ABI, increase this when you want the out of source modules being rebuilt
+# Usually same as %{_rel}
+%define		KABI		1
 
 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
+Summary(de.UTF-8):	Der Linux-Kernel (Kern des Linux-Betriebssystems)
+Summary(et.UTF-8):	Linuxi kernel (ehk operatsioonisĂźsteemi tuum)
+Summary(fr.UTF-8):	Le Kernel-Linux (La partie centrale du systeme)
+Summary(pl.UTF-8):	JÄ
dro Linuksa
 Name:		kernel-%{alt_kernel}
 Version:	%{_basever}%{_postver}
 Release:	%{_rel}
@@ -37,17 +46,17 @@
 Source0:	http://www.kernel.org/pub/linux/kernel/v2.6/linux-%{_basever}.tar.bz2
 # Source0-md5:	db95a49a656a3247d4995a797d333153
 %if "%{_postver}" != "%{nil}"
-Source1:	http://www.kernel.org/pub/linux/kernel/v2.6/patch-%{_basever}%{_postver}.bz2
+Source1:	http://www.kernel.org/pub/linux/kernel/v2.6/patch-%{version}.bz2
 # Source1-md5:	7aa6fbadb357f92f26c9063ea6a490a4
 %endif
 
-Source2:	kernel-bare-grsecurity-module-build.pl
+Source2:	kernel-bare-grsecurity-autoconf.h
 Source3:	kernel-bare-grsecurity-config.h
+Source4:	kernel-bare-grsecurity-module-build.pl
 
-Source20:	kernel-bare-grsecurity-x86.config
-Source21:	kernel-bare-grsecurity-x86_64.config
-
-Source30:	kernel-bare-grsecurity-pax.config
+Source10:	kernel-bare-grsecurity-x86.config
+Source11:	kernel-bare-grsecurity-x86_64.config
+Source12:	kernel-bare-grsecurity-pax.config
 
 # from http://www.grsecurity.net/~spender/
 Patch100:	linux-2.6-grsecurity.patch
@@ -56,29 +65,32 @@
 
 URL:		http://www.kernel.org/
 BuildRequires:	binutils >= 3:2.14.90.0.7
+BuildRequires:	/sbin/depmod
 BuildRequires:	gcc >= 5:3.2
-BuildRequires:	module-init-tools
+# for hostname command
 BuildRequires:	net-tools
 BuildRequires:	perl-base
+BuildRequires:	python
+BuildRequires:	python-modules
 BuildRequires:	rpmbuild(macros) >= 1.217
-BuildRequires:	sed >= 4.0
 Autoreqprov:	no
+Requires(post):	coreutils
+Requires(post):	geninitrd >= 2.57
+Requires(post):	module-init-tools >= 0.9.9
+Requires:	/sbin/depmod
 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
+Obsoletes:	kernel-misc-fuse
+Obsoletes:	kernel-modules
+Obsoletes:	kernel-net-hostap
+Obsoletes:	kernel-net-ieee80211
+Obsoletes:	kernel-net-ipp2p
+Obsoletes:	kernel-smp
 Conflicts:	e2fsprogs < 1.29
 Conflicts:	isdn4k-utils < 3.1pre1
 Conflicts:	jfsutils < 1.1.3
-Conflicts:	module-init-tool < 0.9.10
+Conflicts:	module-init-tools < 0.9.10
 Conflicts:	nfs-utils < 1.0.5
 Conflicts:	oprofile < 0.9
 Conflicts:	ppp < 1:2.4.0
@@ -89,7 +101,7 @@
 Conflicts:	util-linux < 2.10o
 Conflicts:	xfsprogs < 2.6.0
 %if %{with pae}
-ExclusiveArch:	%{ix86}
+ExclusiveArch:  %{ix86}
 ExcludeArch:	i386 i486 i586
 %else
 ExclusiveArch:	%{ix86} %{x8664}
@@ -97,36 +109,37 @@
 ExclusiveOS:	Linux
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
+%ifarch %{ix86} %{x8664}
+%define		target_arch_dir		x86
+%endif
+%ifnarch %{ix86} %{x8664}
+%define		target_arch_dir		%{_target_base_arch}
+%endif
+
+%define		defconfig	arch/%{target_arch_dir}/defconfig
+
 # No ELF objects there to strip (skips processing 27k files)
 %define		_noautostrip	.*%{_kernelsrcdir}/.*
+%define		_noautochrpath	.*%{_kernelsrcdir}/.*
 
-%define		x86_target_base_arch	x86
 %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 CrossOpts 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	CrossOpts ARCH=%{_target_base_arch} CC="%{__cc}"
 	%define	DepMod /sbin/depmod
 	%endif
 
 %else
-	%define MakeOpts %{CommonOpts} CC="%{__cc}"
+	%define CrossOpts ARCH=%{_target_base_arch} CC="%{__cc}"
 	%define	DepMod /sbin/depmod
 %endif
 
-%define __features Enabled features:\
-%{?debug: - DEBUG}\
 %define Features %(echo "%{__features}" | sed '/^$/d')
 
 %description
@@ -136,131 +149,145 @@
 
 %{Features}
 
-%description -l de
-Das Kernel-Packet enthält den Linux-Kernel (vmlinuz), den Kern des
-Linux-Betriebssystems. Der Kernel ist für grundliegende
+%description -l de.UTF-8
+Das Kernel-Paket 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.
+ProzeĂŸ-Management, Geräte Ein- und Ausgaben, usw.
 
 %{Features}
 
-%description -l fr
+%description -l fr.UTF-8
 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.
+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.
+%description -l pl.UTF-8
+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
+Summary(de.UTF-8):	vmlinux - dekompressiertes Kernel Bild
+Summary(pl.UTF-8):	vmlinux - rozpakowany obraz jÄ
dra
 Group:		Base/Kernel
+Obsoletes:	kernel-smp-vmlinux
 
 %description vmlinux
 vmlinux - uncompressed kernel image.
 
-%description vmlinux -l de
+%description vmlinux -l de.UTF-8
 vmlinux - dekompressiertes Kernel Bild.
 
-%description vmlinux -l pl
-vmlinux - rozpakowany obraz jądra.
+%description vmlinux -l pl.UTF-8
+vmlinux - rozpakowany obraz jÄ
dra.
 
 %package drm
 Summary:	DRM kernel modules
-Summary(de):	DRM Kernel Treiber
-Summary(pl):	Sterowniki DRM
+Summary(de.UTF-8):	DRM Kernel Treiber
+Summary(pl.UTF-8):	Sterowniki DRM
 Group:		Base/Kernel
-Requires(postun):	%{name}-up = %{epoch}:%{version}-%{release}
-Requires:	%{name}-up = %{epoch}:%{version}-%{release}
-Provides:	kernel-drm = %{drm_xfree_version}
+Requires(postun):	%{name} = %{epoch}:%{version}-%{release}
+Requires:	%{name} = %{epoch}:%{version}-%{release}
+Obsoletes:	kernel-smp-drm
 Autoreqprov:	no
 
 %description drm
-DRM kernel modules (%{drm_xfree_version}).
+DRM kernel modules.
 
-%description drm -l de
-DRM Kernel Treiber (%{drm_xfree_version}).
+%description drm -l de.UTF-8
+DRM Kernel Treiber.
 
-%description drm -l pl
-Sterowniki DRM (%{drm_xfree_version}).
+%description drm -l pl.UTF-8
+Sterowniki DRM.
 
 %package pcmcia
 Summary:	PCMCIA modules
-Summary(de):	PCMCIA Module
-Summary(pl):	Moduły PCMCIA
+Summary(de.UTF-8):	PCMCIA Module
+Summary(pl.UTF-8):	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}
+Requires(postun):	%{name} = %{epoch}:%{version}-%{release}
+Requires:	%{name} = %{epoch}:%{version}-%{release}
+Obsoletes:	kernel-smp-pcmcia
 Conflicts:	pcmcia-cs < 3.1.21
 Conflicts:	pcmciautils < 004
 Autoreqprov:	no
 
 %description pcmcia
-PCMCIA modules (%{pcmcia_version}).
+PCMCIA modules.
+
+%description pcmcia -l de.UTF-8
+PCMCIA Module.
 
-%description pcmcia -l de
-PCMCIA Module (%{pcmcia_version})
+%description pcmcia -l pl.UTF-8
+Moduły PCMCIA.
 
-%description pcmcia -l pl
-Moduły PCMCIA (%{pcmcia_version}).
+%package libs
+Summary:	Libraries for preparing bootable kernel on PowerPCs
+Summary(pl.UTF-8):	Biblioteki do przygotowania bootowalnego jÄ
dra dla PowerPC
+Group:		Base/Kernel
+Requires:	%{name} = %{epoch}:%{version}-%{release}
+Requires:	mkvmlinuz >= 1.3
+Obsoletes:	kernel-smp-libs
+Autoreqprov:	no
+
+%description libs
+Libraries for preparing bootable kernel on PowerPCs. Script called
+mkvmlinuz may be useful for this.
+
+%description libs -l pl.UTF-8
+Biblioteki do przygotowania bootowalnego jÄ
dra dla PowerPC. Skrypt
+mkvmlinuz moşe być do tego przydatny.
 
 %package sound-alsa
 Summary:	ALSA kernel modules
-Summary(de):	ALSA Kernel Module
-Summary(pl):	Sterowniki dźwięku ALSA
+Summary(de.UTF-8):	ALSA Kernel Module
+Summary(pl.UTF-8):	Sterowniki dźwięku ALSA
 Group:		Base/Kernel
-Requires(postun):	%{name}-up = %{epoch}:%{version}-%{release}
-Requires:	%{name}-up = %{epoch}:%{version}-%{release}
+Requires(postun):	%{name} = %{epoch}:%{version}-%{release}
+Requires:	%{name} = %{epoch}:%{version}-%{release}
+Obsoletes:	kernel-smp-sound-alsa
 Autoreqprov:	no
 
 %description sound-alsa
 ALSA (Advanced Linux Sound Architecture) sound drivers.
 
-%description sound-alsa -l de
+%description sound-alsa -l de.UTF-8
 ALSA (Advanced Linux Sound Architecture) Sound-Treiber.
 
-%description sound-alsa -l pl
-Sterowniki dźwięku ALSA (Advanced Linux Sound Architecture).
+%description sound-alsa -l pl.UTF-8
+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
+Summary(de.UTF-8):	OSS Kernel Module
+Summary(pl.UTF-8):	Sterowniki dźwięku OSS
 Group:		Base/Kernel
-Requires(postun):	%{name}-up = %{epoch}:%{version}-%{release}
-Requires:	%{name}-up = %{epoch}:%{version}-%{release}
+Requires(postun):	%{name} = %{epoch}:%{version}-%{release}
+Requires:	%{name} = %{epoch}:%{version}-%{release}
+Obsoletes:	kernel-smp-sound-oss
 Autoreqprov:	no
 
 %description sound-oss
 OSS (Open Sound System) drivers.
 
-%description sound-oss -l de
+%description sound-oss -l de.UTF-8
 OSS (Open Sound System) Treiber.
 
-%description sound-oss -l pl
-Sterowniki dźwięku OSS (Open Sound System).
+%description sound-oss -l pl.UTF-8
+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
+Summary(de.UTF-8):	Header Dateien fĂźr den Linux-Kernel
+Summary(pl.UTF-8):	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
@@ -268,93 +295,91 @@
 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.
+%description headers -l de.UTF-8
+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.UTF-8
+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
+Summary(de.UTF-8):	Development Dateien die beim Kernel Modul kompilationen gebraucht werden
+Summary(pl.UTF-8):	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}
+Conflicts:	rpmbuild(macros) < 1.321
 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
+%description module-build -l de.UTF-8
 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.
+%description module-build -l pl.UTF-8
+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
+Summary(de.UTF-8):	Der Kernel Quelltext
+Summary(pl.UTF-8):	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
+%description source -l de.UTF-8
+Das Kernel-Source-Paket 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
+%description source -l fr.UTF-8
 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
+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.
+%description source -l pl.UTF-8
+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
+Summary(de.UTF-8):	Kernel Dokumentation
+Summary(pl.UTF-8):	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.
+/usr/src/linux/Documentation directory.
 
-%description doc -l de
+%description doc -l de.UTF-8
 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.
+%description doc -l pl.UTF-8
+Pakiet zawiera dokumentacjÄ™ do jÄ
dra Linuksa pochodzÄ
cÄ
 z katalogu
+/usr/src/linux/Documentation.
 
 %prep
 %setup -q -n linux-%{_basever}
 
 %if "%{_postver}" != "%{nil}"
-%{__bzip2} -dc %{SOURCE1} | %{__patch} -p1 -s
+%{__bzip2} -dc %{SOURCE1} | patch -p1 -s
 %endif
 
 %patch100 -p1
@@ -363,17 +388,20 @@
 # Fix EXTRAVERSION in main Makefile
 sed -i 's#EXTRAVERSION =.*#EXTRAVERSION = %{_postver}-%{alt_kernel}#g' Makefile
 
+# on sparc this line causes CONFIG_INPUT=m (instead of =y), thus breaking build
 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
+# cleanup backups after patching
+find '(' -name '*~' -o -name '*.orig' -o -name '.gitignore' ')' -print0 | xargs -0 -r -l512 rm -f
 
 %build
 TuneUpConfigForIX86 () {
+	set -x
 %ifarch %{ix86}
 	pae=
+	[ "$2" = "yes" ] && pae=yes
 	%if %{with pae}
-		pae=yes
+	pae=yes
 	%endif
 	%ifnarch i386
 	sed -i 's:CONFIG_M386=y:# CONFIG_M386 is not set:' $1
@@ -418,117 +446,101 @@
 	return 0
 }
 
-rm -f .config
 BuildConfig() {
 	%{?debug:set -x}
-%ifarch %{ix86}
-	Config="%{x86_target_base_arch}"
-%else
-	Config="%{_target_base_arch}"
-%endif
+	# is this a special kernel we want to build?
+	Config="%{target_arch_dir}"
 	KernelVer=%{kernel_release}
-
-	echo "Building config file [using $Config.conf] for KERNEL ..."
-
-	echo "" > .config
-	cat $RPM_SOURCE_DIR/kernel-bare-grsecurity-$Config.config >> .config
-	sed -i "/CONFIG_LOCALVERSION=.*/d" .config
-	echo "CONFIG_LOCALVERSION=\"-%{_localversion}\"" >> .config
-
-	TuneUpConfigForIX86 .config
-
-	%if %{with preempt}
-		echo "# CONFIG_DEBUG_PREEMPT is not set" >> .config
-		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
+	echo "Building config file using $Config.conf..."
+	cat $RPM_SOURCE_DIR/kernel-bare-grsecurity-$Config.config > %{defconfig}
+	TuneUpConfigForIX86 %{defconfig}
 
 	%if %{with pax}
-		cat %{SOURCE30} >> .config
-		PaXconfig .config
+		cat %{SOURCE12} >> %{defconfig}
+		PaXconfig %{defconfig}
 	%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/%{x86_target_base_arch}/defconfig
-	install -d $KERNEL_INSTALL_DIR%{_kernelsrcdir}/include/linux
<<Diff was trimmed, longer than 597 lines>>

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SPECS/kernel-bare-grsecurity.spec?r1=1.1.2.38&r2=1.1.2.39&f=u



More information about the pld-cvs-commit mailing list