Blame view
scripts/package/mkspec
2.83 KB
1da177e4c
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
#!/bin/sh # # Output a simple RPM spec file that uses no fancy features requring # RPM v4. This is intended to work with any RPM distro. # # The only gothic bit here is redefining install_post to avoid # stripping the symbols from files in the kernel which we want # # Patched for non-x86 by Opencon (L) 2002 <opencon@rio.skydome.net> # # how we were called determines which rpms we build and how we build them if [ "$1" = "prebuilt" ]; then PREBUILT=true else PREBUILT=false fi # starting to output the spec if [ "`grep CONFIG_DRM=y .config | cut -f2 -d\=`" = "y" ]; then PROVIDES=kernel-drm fi PROVIDES="$PROVIDES kernel-$KERNELRELEASE" __KERNELRELEASE=`echo $KERNELRELEASE | sed -e "s/-//g"` echo "Name: kernel" echo "Summary: The Linux Kernel" echo "Version: $__KERNELRELEASE" # we need to determine the NEXT version number so that uname and # rpm -q will agree echo "Release: `. $srctree/scripts/mkversion`" echo "License: GPL" echo "Group: System Environment/Kernel" echo "Vendor: The Linux Community" echo "URL: http://www.kernel.org" if ! $PREBUILT; then echo "Source: kernel-$__KERNELRELEASE.tar.gz" fi echo "BuildRoot: /var/tmp/%{name}-%{PACKAGE_VERSION}-root" echo "Provides: $PROVIDES" echo "%define __spec_install_post /usr/lib/rpm/brp-compress || :" echo "%define debug_package %{nil}" echo "" echo "%description" echo "The Linux Kernel, the operating system core itself" echo "" if ! $PREBUILT; then echo "%prep" echo "%setup -q" echo "" fi echo "%build" if ! $PREBUILT; then |
13797b77d
|
60 |
echo "make clean && make %{?_smp_mflags}" |
1da177e4c
|
61 62 63 64 |
echo "" fi echo "%install" |
d2cb1a95c
|
65 |
echo "%ifarch ia64" |
a5fa393b5
|
66 |
echo 'mkdir -p $RPM_BUILD_ROOT/boot/efi $RPM_BUILD_ROOT/lib/modules' |
46dca86cb
|
67 |
echo 'mkdir -p $RPM_BUILD_ROOT/lib/firmware' |
d2cb1a95c
|
68 |
echo "%else" |
a5fa393b5
|
69 |
echo 'mkdir -p $RPM_BUILD_ROOT/boot $RPM_BUILD_ROOT/lib/modules' |
46dca86cb
|
70 |
echo 'mkdir -p $RPM_BUILD_ROOT/lib/firmware' |
d2cb1a95c
|
71 |
echo "%endif" |
1da177e4c
|
72 73 |
echo 'INSTALL_MOD_PATH=$RPM_BUILD_ROOT make %{_smp_mflags} modules_install' |
d2cb1a95c
|
74 75 76 77 |
echo "%ifarch ia64" echo 'cp $KBUILD_IMAGE $RPM_BUILD_ROOT'"/boot/efi/vmlinuz-$KERNELRELEASE" echo 'ln -s '"efi/vmlinuz-$KERNELRELEASE" '$RPM_BUILD_ROOT'"/boot/" echo "%else" |
1a0f3d422
|
78 79 80 81 |
echo "%ifarch ppc64" echo "cp vmlinux arch/powerpc/boot" echo "cp arch/powerpc/boot/"'$KBUILD_IMAGE $RPM_BUILD_ROOT'"/boot/vmlinuz-$KERNELRELEASE" echo "%else" |
1da177e4c
|
82 |
echo 'cp $KBUILD_IMAGE $RPM_BUILD_ROOT'"/boot/vmlinuz-$KERNELRELEASE" |
d2cb1a95c
|
83 |
echo "%endif" |
1a0f3d422
|
84 |
echo "%endif" |
1da177e4c
|
85 86 87 88 |
echo 'cp System.map $RPM_BUILD_ROOT'"/boot/System.map-$KERNELRELEASE" echo 'cp .config $RPM_BUILD_ROOT'"/boot/config-$KERNELRELEASE" |
fc370ecfd
|
89 90 91 92 93 94 95 |
echo "%ifnarch ppc64" echo 'cp vmlinux vmlinux.orig' echo 'bzip2 -9 vmlinux' echo 'mv vmlinux.bz2 $RPM_BUILD_ROOT'"/boot/vmlinux-$KERNELRELEASE.bz2" echo 'mv vmlinux.orig vmlinux' echo "%endif" |
1da177e4c
|
96 97 |
echo "" echo "%clean" |
a2ebcc7a8
|
98 |
echo 'rm -rf $RPM_BUILD_ROOT' |
1da177e4c
|
99 100 101 102 103 |
echo "" echo "%files" echo '%defattr (-, root, root)' echo "%dir /lib/modules" echo "/lib/modules/$KERNELRELEASE" |
46dca86cb
|
104 |
echo "/lib/firmware" |
1da177e4c
|
105 106 |
echo "/boot/*" echo "" |