2005-04-17 02:20:36 +04:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
2010-03-29 17:41:47 +04:00
|
|
|
# Output a simple RPM spec file that uses no fancy features requiring
|
2005-04-17 02:20:36 +04:00
|
|
|
# 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"
|
2011-05-05 00:48:11 +04:00
|
|
|
__KERNELRELEASE=`echo $KERNELRELEASE | sed -e "s/-/_/g"`
|
2005-04-17 02:20:36 +04:00
|
|
|
|
|
|
|
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
|
|
|
|
|
2010-02-01 03:18:58 +03:00
|
|
|
echo "BuildRoot: %{_tmppath}/%{name}-%{PACKAGE_VERSION}-root"
|
2005-04-17 02:20:36 +04:00
|
|
|
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 ""
|
2011-05-17 21:36:16 +04:00
|
|
|
echo "%package headers"
|
|
|
|
echo "Summary: Header files for the Linux kernel for use by glibc"
|
|
|
|
echo "Group: Development/System"
|
|
|
|
echo "Obsoletes: kernel-headers"
|
|
|
|
echo "Provides: kernel-headers = %{version}"
|
|
|
|
echo "%description headers"
|
|
|
|
echo "Kernel-headers includes the C header files that specify the interface"
|
|
|
|
echo "between the Linux kernel and userspace libraries and programs. The"
|
|
|
|
echo "header files define structures and constants that are needed for"
|
|
|
|
echo "building most standard programs and are also needed for rebuilding the"
|
|
|
|
echo "glibc package."
|
|
|
|
echo ""
|
2005-04-17 02:20:36 +04:00
|
|
|
|
|
|
|
if ! $PREBUILT; then
|
|
|
|
echo "%prep"
|
|
|
|
echo "%setup -q"
|
|
|
|
echo ""
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "%build"
|
|
|
|
|
|
|
|
if ! $PREBUILT; then
|
2008-10-26 02:02:47 +04:00
|
|
|
echo "make clean && make %{?_smp_mflags}"
|
2005-04-17 02:20:36 +04:00
|
|
|
echo ""
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "%install"
|
2004-07-29 22:07:32 +04:00
|
|
|
echo "%ifarch ia64"
|
2006-08-14 10:16:47 +04:00
|
|
|
echo 'mkdir -p $RPM_BUILD_ROOT/boot/efi $RPM_BUILD_ROOT/lib/modules'
|
2008-10-15 21:37:26 +04:00
|
|
|
echo 'mkdir -p $RPM_BUILD_ROOT/lib/firmware'
|
2004-07-29 22:07:32 +04:00
|
|
|
echo "%else"
|
2006-08-14 10:16:47 +04:00
|
|
|
echo 'mkdir -p $RPM_BUILD_ROOT/boot $RPM_BUILD_ROOT/lib/modules'
|
2008-10-15 21:37:26 +04:00
|
|
|
echo 'mkdir -p $RPM_BUILD_ROOT/lib/firmware'
|
2004-07-29 22:07:32 +04:00
|
|
|
echo "%endif"
|
2005-04-17 02:20:36 +04:00
|
|
|
|
2010-10-13 21:39:45 +04:00
|
|
|
echo 'INSTALL_MOD_PATH=$RPM_BUILD_ROOT make %{?_smp_mflags} KBUILD_SRC= modules_install'
|
2004-07-29 22:07:32 +04:00
|
|
|
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"
|
2006-06-02 18:53:42 +04:00
|
|
|
echo "%ifarch ppc64"
|
|
|
|
echo "cp vmlinux arch/powerpc/boot"
|
|
|
|
echo "cp arch/powerpc/boot/"'$KBUILD_IMAGE $RPM_BUILD_ROOT'"/boot/vmlinuz-$KERNELRELEASE"
|
|
|
|
echo "%else"
|
2005-04-17 02:20:36 +04:00
|
|
|
echo 'cp $KBUILD_IMAGE $RPM_BUILD_ROOT'"/boot/vmlinuz-$KERNELRELEASE"
|
2004-07-29 22:07:32 +04:00
|
|
|
echo "%endif"
|
2006-06-02 18:53:42 +04:00
|
|
|
echo "%endif"
|
2005-04-17 02:20:36 +04:00
|
|
|
|
2011-05-17 21:36:16 +04:00
|
|
|
echo 'make %{?_smp_mflags} INSTALL_HDR_PATH=$RPM_BUILD_ROOT/usr headers_install'
|
2005-04-17 02:20:36 +04:00
|
|
|
echo 'cp System.map $RPM_BUILD_ROOT'"/boot/System.map-$KERNELRELEASE"
|
|
|
|
|
|
|
|
echo 'cp .config $RPM_BUILD_ROOT'"/boot/config-$KERNELRELEASE"
|
2009-02-12 08:10:57 +03:00
|
|
|
|
|
|
|
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"
|
|
|
|
|
2005-04-17 02:20:36 +04:00
|
|
|
echo ""
|
|
|
|
echo "%clean"
|
2009-02-22 21:54:55 +03:00
|
|
|
echo 'rm -rf $RPM_BUILD_ROOT'
|
2005-04-17 02:20:36 +04:00
|
|
|
echo ""
|
|
|
|
echo "%files"
|
|
|
|
echo '%defattr (-, root, root)'
|
|
|
|
echo "%dir /lib/modules"
|
|
|
|
echo "/lib/modules/$KERNELRELEASE"
|
2008-10-15 21:37:26 +04:00
|
|
|
echo "/lib/firmware"
|
2005-04-17 02:20:36 +04:00
|
|
|
echo "/boot/*"
|
|
|
|
echo ""
|
2011-05-17 21:36:16 +04:00
|
|
|
echo "%files headers"
|
|
|
|
echo '%defattr (-, root, root)'
|
|
|
|
echo "/usr/include"
|
|
|
|
echo ""
|