Original kernel 2.4.37.5
[tomato.git] / release / src / linux / linux / scripts / mkspec
blob5c4eb7b71a9097504dcd3334aca3b1ee8b160513
1 #!/bin/sh
3 # Output a simple RPM spec file that uses no fancy features requring
4 # RPM v4. This is intended to work with any RPM distro.
6 # The only gothic bit here is redefining install_post to avoid
7 # stripping the symbols from files in the kernel which we want
9 # Patched for non-x86 by Opencon (L) 2002 <opencon@rio.skydome.net>
11 # That's the voodoo to see if it's a x86.
12 ISX86=`arch | grep -ie i.86`
13 if [ ! -z $ISX86 ]; then
14 PC=1
15 else
16 PC=0
18 # starting to output the spec
19 if [ "`grep CONFIG_DRM=y .config | cut -f2 -d\=`" = "y" ]; then
20 PROVIDES=kernel-drm
23 PROVIDES="$PROVIDES kernel-$VERSION.$PATCHLEVEL.$SUBLEVEL$EXTRAVERSION"
25 echo "Name: kernel"
26 echo "Summary: The Linux Kernel"
27 echo "Version: "$VERSION.$PATCHLEVEL.$SUBLEVEL$EXTRAVERSION | sed -e "s/-//g"
28 # we need to determine the NEXT version number so that uname and
29 # rpm -q will agree
30 echo "Release: `. scripts/mkversion`"
31 echo "License: GPL"
32 echo "Group: System Environment/Kernel"
33 echo "Vendor: The Linux Community"
34 echo "URL: http://www.kernel.org"
35 echo -n "Source: kernel-$VERSION.$PATCHLEVEL.$SUBLEVEL"
36 echo "$EXTRAVERSION.tar.gz" | sed -e "s/-//g"
37 echo "BuildRoot: /var/tmp/%{name}-%{PACKAGE_VERSION}-root"
38 echo "Provides: $PROVIDES"
39 echo "%define __spec_install_post /usr/lib/rpm/brp-compress || :"
40 echo "%define debug_package %{nil}"
41 echo ""
42 echo "%description"
43 echo "The Linux Kernel, the operating system core itself"
44 echo ""
45 echo "%prep"
46 echo "%setup -q"
47 echo ""
48 echo "%build"
49 # This is the first 'disagreement' between x86 and other archs.
50 if [ $PC = 1 ]; then
51 echo "make oldconfig dep clean bzImage modules"
52 else
53 echo "make oldconfig dep clean vmlinux modules"
55 # Back on track
56 echo ""
57 echo "%install"
58 echo 'mkdir -p $RPM_BUILD_ROOT/boot $RPM_BUILD_ROOT/lib $RPM_BUILD_ROOT/lib/modules'
59 echo 'INSTALL_MOD_PATH=$RPM_BUILD_ROOT make modules_install'
60 # And that's the second
61 if [ $PC = 1 ]; then
62 echo 'cp arch/i386/boot/bzImage $RPM_BUILD_ROOT'"/boot/vmlinuz-$VERSION.$PATCHLEVEL.$SUBLEVEL$EXTRAVERSION"
63 else
64 echo 'cp vmlinux $RPM_BUILD_ROOT'"/boot/vmlinux-$VERSION.$PATCHLEVEL.$SUBLEVEL$EXTRAVERSION"
66 # Back on track, again
67 echo 'cp System.map $RPM_BUILD_ROOT'"/boot/System.map-$VERSION.$PATCHLEVEL.$SUBLEVEL$EXTRAVERSION"
68 echo 'cp .config $RPM_BUILD_ROOT'"/boot/config-$VERSION.$PATCHLEVEL.$SUBLEVEL$EXTRAVERSION"
69 echo ""
70 echo "%clean"
71 echo '#echo -rf $RPM_BUILD_ROOT'
72 echo ""
73 echo "%files"
74 echo '%defattr (-, root, root)'
75 echo "%dir /lib/modules"
76 echo "/lib/modules/$VERSION.$PATCHLEVEL.$SUBLEVEL$EXTRAVERSION"
77 echo "/boot/*"
78 echo ""