This commit was manufactured by cvs2svn to create branch 'vserver'.
[linux-2.6.git] / scripts / package / mkspec
1 #!/bin/sh
2 #
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.
5 #
6 #       The only gothic bit here is redefining install_post to avoid
7 #       stripping the symbols from files in the kernel which we want
8 #
9 #       Patched for non-x86 by Opencon (L) 2002 <opencon@rio.skydome.net>
10 #
11
12 # starting to output the spec
13 if [ "`grep CONFIG_DRM=y .config | cut -f2 -d\=`" = "y" ]; then
14         PROVIDES=kernel-drm
15 fi
16
17 PROVIDES="$PROVIDES kernel-$VERSION.$PATCHLEVEL.$SUBLEVEL$EXTRAVERSION"
18
19 echo "Name: kernel"
20 echo "Summary: The Linux Kernel"
21 echo "Version: "$VERSION.$PATCHLEVEL.$SUBLEVEL$EXTRAVERSION | sed -e "s/-//g"
22 # we need to determine the NEXT version number so that uname and
23 # rpm -q will agree
24 echo "Release: `. $srctree/scripts/mkversion`"
25 echo "License: GPL"
26 echo "Group: System Environment/Kernel"
27 echo "Vendor: The Linux Community"
28 echo "URL: http://www.kernel.org"
29 echo -n "Source: kernel-$VERSION.$PATCHLEVEL.$SUBLEVEL"
30 echo "$EXTRAVERSION.tar.gz" | sed -e "s/-//g"
31 echo "BuildRoot: /var/tmp/%{name}-%{PACKAGE_VERSION}-root"
32 echo "Provides: $PROVIDES"
33 echo "%define __spec_install_post /usr/lib/rpm/brp-compress || :"
34 echo "%define debug_package %{nil}"
35 echo ""
36 echo "%description"
37 echo "The Linux Kernel, the operating system core itself"
38 echo ""
39 echo "%prep"
40 echo "%setup -q"
41 echo ""
42 echo "%build"
43 echo "make clean && make"
44 echo ""
45 echo "%install"
46 echo 'mkdir -p $RPM_BUILD_ROOT/boot $RPM_BUILD_ROOT/lib $RPM_BUILD_ROOT/lib/modules'
47
48 echo 'INSTALL_MOD_PATH=$RPM_BUILD_ROOT make modules_install'
49 echo 'cp $KBUILD_IMAGE $RPM_BUILD_ROOT'"/boot/vmlinuz-$VERSION.$PATCHLEVEL.$SUBLEVEL$EXTRAVERSION"
50
51 echo 'cp System.map $RPM_BUILD_ROOT'"/boot/System.map-$VERSION.$PATCHLEVEL.$SUBLEVEL$EXTRAVERSION"
52
53 echo 'cp .config $RPM_BUILD_ROOT'"/boot/config-$VERSION.$PATCHLEVEL.$SUBLEVEL$EXTRAVERSION"
54 echo ""
55 echo "%clean"
56 echo '#echo -rf $RPM_BUILD_ROOT'
57 echo ""
58 echo "%files"
59 echo '%defattr (-, root, root)'
60 echo "%dir /lib/modules"
61 echo "/lib/modules/$VERSION.$PATCHLEVEL.$SUBLEVEL$EXTRAVERSION"
62 echo "/boot/*"
63 echo ""