Sophie

Sophie

distrib > Mandriva > 8.2 > i586 > by-pkgid > bce935f61d4a8bd7f5813df16c79b507 > files > 5

kernel-linus2.4-2.4.18-1mdk.src.rpm

# -*- Mode: rpm-spec -*-
# 	$Id: kernel-2.4.spec,v 1.2 2001/04/05 20:07:18 chmou Exp $	

%define sublevel 18
%define release 1mdk

%define version 2.4.%{sublevel}
%define KVERREL %{version}-%{release}linus

Summary: The Linux kernel (the core of the Linux operating system).
Name: kernel-linus2.4
Version: %{version}
Release: %{release}
License: GPL
Group: System/Kernel and hardware
ExclusiveArch: %{ix86} alpha sparc sparc64 ppc
ExclusiveOS: Linux
URL: http://www.kernel.org/

####################################################################
#
# Sources
#
Source0: ftp://ftp.kernel.org/pub/linux/kernel/v2.4/linux-%{version}.tar.bz2
Source1: README.kernel-linus

Source21: kernel-%{version}-alpha.config
Source22: kernel-%{version}-i586.config
Source23: kernel-%{version}-ppc.config

# Patches
#
# Please don't remove this line, sometimes we want to release a linus kernel
# for a prerelease or release candidate
#
# Patches for problems in linus kernel
#Patch0: patch-2.4.17-rc2.bz2

#END
####################################################################

BuildRoot: %{_tmppath}/%{name}-%{version}-build
Provides: module-info, kernel = %{version}
Autoreqprov: no
Prereq: initscripts >= 5.83-4mdk
Requires: modutils >= 2.4.3-2mdk, devfsd
BuildRequires: libbinutils2-devel, bison
BuildRequires: netpbm, libnetpbm-devel
BuildRequires: gcc, gcc-cpp

%description
The kernel package contains the Linux kernel (vmlinuz), the core of your
Mandrake Linux operating system.  The kernel handles the basic functions
of the operating system:  memory allocation, process allocation, device
input and output, etc.


#
# End packages - here begins build stage
#
%prep
%setup -q -n linux

# Patch party begins now
#%patch0 -p1

# make sure the kernel has the sublevel we know it has...
perl -p -i -e "s/^SUBLEVEL.*/SUBLEVEL = %{sublevel}/" Makefile

%setup -q -n linux -D -T

# get rid of unwanted files
find . -name '*~' -o -name '*.orig'|xargs rm -f

install -m 644 %SOURCE1 .

# install the config files for all the archs

install -m 644 %SOURCE21 .config
make ARCH=alpha oldconfig
install -m 644 .config arch/alpha/defconfig

install -m 644 %SOURCE22 .config
make ARCH=i386 oldconfig
install -m 644 .config arch/i386/defconfig

install -m 644 %SOURCE23 .config
make ARCH=ppc oldconfig
install -m 644 .config arch/ppc/defconfig

###
### build
###

%build

# Common target directories
%define _bootdir /boot
%define _modulesdir /lib/modules

# Directories definition needed for building
%define target_boot %{buildroot}%{_bootdir}
%define target_modules %{buildroot}%{_modulesdir}

DependKernel() {
	flavour=$1
	echo "Make dep for kernel $flavour"
	%make -s mrproper

	# it is safest that trusting in defconfig
	cp arch/%{_arch}/defconfig .config

	ext=$flavour
	# make sure ETXRAVERSION says what we want it to say
	perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = -%{release}$ext/" Makefile
	%make oldconfig
	%make dep
}

BuildKernel() {
	KernelVer=$1
	echo "Building kernel $KernelVer"
	
	%ifarch alpha
	%make boot
	%endif    

	%ifarch ppc
	%make vmlinux
	%endif

	%ifarch %{ix86}
	%make bzImage
	%endif

	%make modules
}

CreateKernel() {
	flavour=$1
	KernelVer=%{KVERREL}
	DependKernel $flavour
	BuildKernel $KernelVer
}

###
# DO it...
###

# Make new ARCH config files if we don't have them.
CreateKernel linus

###
### install
###
%install

rm -rf %{buildroot}

## Start installing stuff
KernelVer=%{KVERREL}
install -d %{target_boot}
install -m 644 System.map %{target_boot}/System.map-$KernelVer
install -m 644 .config %{target_boot}/config-$KernelVer

%ifarch alpha
cp -f arch/alpha/boot/vmlinux.gz %{target_boot}//vmlinuz-$KernelVer
%endif
%ifarch ppc
cp -f vmlinux %{target_boot}/vmlinuz-$KernelVer
%endif
%ifarch %{ix86}
cp -f arch/i386/boot/bzImage %{target_boot}/vmlinuz-$KernelVer
%endif
# modules
install -d %{target_modules}/$KernelVer
%make INSTALL_MOD_PATH=%{buildroot} KERNELRELEASE=$KernelVer modules_install 

echo "GZIPPING Modules"
find %{target_modules} -type f -name '*.o'|xargs gzip -9f
for i in $(find %{target_modules} -type l -name '*.o');do
    link=$(perl -e 'print readlink shift, "\n"' $i)
    ln -s $link.gz $i.gz
    rm -f $i
done
# we want nice modules.dep files, and we need to regenerate them due to 
# the compression (change date)
/sbin/depmod -u -ae -b %{buildroot} -r -F %{target_boot}/System.map-$KernelVer $KernelVer

###
### clean
###

%clean
rm -rf %{buildroot}

###
### scripts
###

# do this for upgrades...in case the old modules get removed we have
# loopback in the kernel so that mkinitrd will work.
%preun
/sbin/modprobe loop 2> /dev/null > /dev/null
rm -f %{_modulesdir}/%{KVERREL}/modules.*

REMOVE=
if [ -f /etc/sysconfig/system ];then
		source /etc/sysconfig/system
		[[ "$CLASS" = "beginner" ]] && REMOVE=yes
fi
if [ -f /etc/sysconfig/installkernel ];then
		source /etc/sysconfig/installkernel
		[[ "$AUTOREMOVE" = [Yy][Ee][Ss] ]] && REMOVE=yes
		[[ "$AUTOREMOVE" = [Nn][Oo] ]] && REMOVE=
fi

[[ -n $REMOVE ]] && /sbin/installkernel -a -R -c %{KVERREL}secure

exit 0

%post
cd %{_bootdir}
if [ -x /sbin/installkernel ];then
	      /sbin/installkernel -a -c %{KVERREL}
fi

%postun
cd %{_bootdir}
if [ -f initrd-%{KVERREL}.img ];then
		rm -f initrd-%{KVERREL}.img
fi

###
### file lists
###

%files
%defattr(-,root,root)
%doc README.linus
%{_bootdir}/config-%{KVERREL}
%{_bootdir}/vmlinuz-%{KVERREL}
%{_bootdir}/System.map-%{KVERREL}
%{_modulesdir}/%{KVERREL}/kernel
%{_modulesdir}/%{KVERREL}/build
%{_modulesdir}/%{KVERREL}/pcmcia
%{_modulesdir}/%{KVERREL}/modules.*

%changelog
* Tue Feb 26 2002 Juan Quintela <quintela@mandrakesoft.com> 2.4.%{sublevel}-1mdk
- create actualized modules.* info.
- make all the build system more similar to the one for mdk kernels.
- remove the InstallConfigs thing, now it is more similar to normal kernel
  (we need a best way to deal with it).
- update %pre, %post scripts to the ones in kernel-mdk.
- README.linus is its own package now.
- remove vestigies of kgcc, it is known that it misscompiles some modules.
- s/kversion/version/.
- remove unused source files.
- remove rhkmvtag.c, not used.
- remove our only patch, now this is a _real_ linus kernel.
- remove alsa.
- 2.4.18.

* Sat Jan  5 2002 Juan Quintela <quintela@mandrakesoft.com> 2.4.17-1mdk
- remove devfs creation of /dev/root.
- alsa 0.5.12a.
- 2.4.17.

* Wed Dec 19 2001 Juan Quintela <quintela@mandrakesoft.com> 2.4.16-5mdk
- 2.4.17-rc1.

* Fri Dec 14 2001 Juan Quintela <quintela@mandrakesoft.com> 2.4.16-4mdk
- fix the modules building problem.
- add PCMCIA support.

* Tue Dec 11 2001 Jeff Garzik <jgarzik@mandrakesoft.com> 2.4.16-3mdk
- add i686 config

* Wed Dec  5 2001 Jeff Garzik <jgarzik@mandrakesoft.com> 2.4.16-2mdk
- update alpha config to fix build

* Mon Nov 26 2001 Juan Quintela <quintela@mandrakesoft.com> 2.4.16-1mdk
- 2.4.16.

* Mon Nov 26 2001 Juan Quintela <quintela@mandrakesoft.com> 2.4.15-4mdk
- add patch for fixing compilation in ppc (P101).

* Sat Nov 24 2001 Juan Quintela <quintela@mandrakesoft.com> 2.4.15-3mdk
- added patch100 to fix inode corruption.
- remove saved headers black magic.
- move removal of the kernel from %postun to %preun.
- remove 3rdparty vestiges.
- inline defines that was used only one (prereq, requires, provides).
- use gcc-2.96 by default.
- remove boot_logo (was unused).
- remove %build_boot.
- remove %build_up.
- remove %build_smp.
- remove %build_enterprise.
- remove %build_pcmcia.
- remove %build_80.

* Fri Nov 23 2001 Juan Quintela <quintela@mandrakesoft.com> 2.4.15-2mdk
- remove P1 (applied upstream).
- add Provides to make rpmlint happy.
- remove last use of $RPM_SOURCE_DIR.
- add URL tag.

* Fri Nov 23 2001 Juan Quintela <quintela@mandrakesoft.com> 2.4.15-1mdk
- fix places that used %{KVERREL} instead of %{KVERREL}linus.
- update all the configs.
- alsa-0.5.12.
- 2.4.15.

* Sat Oct 27 2001 Stew Benedict <sbenedict@mandrakesoft.com> 2.4.13-2mdk
- modify config for PPC build (disable SUNGEM)

* Fri Oct 26 2001 Jeff Garzik <jgarzik@mandrakesoft.com> 2.4.13-1mdk
- Version 2.4.13.
- Update arch configs.

* Fri Oct 19 2001 Stew Benedict <sbenedict@mandrakesoft.com> 2.4.12-1mdk
- 2.4.12, update ARCH config files for build - UpdateConfigs
- remove $RPM_SOURCE_DIR, s/Linux Mandrake/Mandrake Linux/

* Thu Oct  4 2001 Chmouel Boudjnah <chmouel@mandrakesoft.com> 2.4.10-1mdk
- 2.4.10.
- Fix postscripts

* Thu Aug 16 2001 Thierry Vignaud <tvignaud@mandrakesoft.com> 2.4.8-1mdk
- remove logo (no patch at all)
- new release
- sync with main kernel spec
- add alsa (after all, it doesn't alter any kernel source bit)

* Tue Aug 07 2001 Thierry Vignaud <tvignaud@mandrakesoft.com> 2.4.7-1mdk
- enable to build more than a kernel at a time
- new release

* Mon Jul 16 2001 Thierry Vignaud <tvignaud@mandrakesoft.com> 2.4.6-3mdk
- add a README.linus

* Sun Jul 15 2001 Jeff Garzik <jgarzik@mandrakesoft.com> 2.4.6-2mdk
- update alpha config

* Wed Jul  4 2001 Jeff Garzik <jgarzik@mandrakesoft.com> 2.4.6-1mdk
- new release
- remove use of RPM_SOURCE_DIR (fix rpmlint errors)

* Thu Jun 21 2001 Stefan van der Eijk <stefan@eijk.nu> 2.4.5-2mdk
- BuildRequires: libgr-devel

* Tue Jun 19 2001 Thierry Vignaud <tvignaud@mandrakesoft.com> 2.4.5-1mdk
- new release

* Thu May 03 2001 Stefan van der Eijk <s.vandereijk@chello.nl> 2.4.4-2mdk
- update alpha .config

* Wed May 02 2001 Thierry Vignaud <tvignaud@mandrakesoft.com> 2.4.4-1mdk
- new version
- last %%post fix (which simplify the spec by the way)

* Fri Apr 13 2001 Thierry Vignaud <tvignaud@mandrakesoft.com> 2.4.3-2mdk
- remove documentation (already in kernel-doc)
- readd dead %%post
- update logo

* Mon Apr 02 2001 Thierry Vignaud <tvignaud@mandrakesoft.com> 2.4.3-1mdk
- new release
- fix buz.c compilation
- reduce the number of places where to alter release number

* Tue Mar 15 2001 Stefan van der Eijk <s.vandereijk@chello.nl> 2.4.2-2mdk
- update alpha + i586 .config

* Wed Feb 28 2001 Thierry Vignaud <tvignaud@mandrakesoft.com> 2.4.2-1mdk
- fix 6pack driver
- new stable version

* Wed Jan 31 2001 Stefan van der Eijk <s.vandereijk@chello.nl> 2.4.1-2mdk
- add alpha .config file

* Tue Jan 30 2001 Thierry Vignaud <tvignaud@mandrakesoft.com> 2.4.1-1mdk
- first release as requested by Chmouel