2008-12-17 10:05:13 +01:00
|
|
|
# Template file for 'kernel-headers'
|
|
|
|
pkgname=kernel-headers
|
2009-07-27 17:10:23 +02:00
|
|
|
version=2.6.30.3
|
2008-12-17 10:05:13 +01:00
|
|
|
wrksrc="linux-$version"
|
2009-04-19 00:31:39 +02:00
|
|
|
distfiles="${KERNEL_SITE}/kernel/v2.6/linux-$version.tar.bz2"
|
2008-12-17 10:05:13 +01:00
|
|
|
build_style=custom-install
|
|
|
|
short_desc="The Linux kernel headers"
|
|
|
|
maintainer="Juan RP <xtraeme@gmail.com>"
|
2009-07-27 17:10:23 +02:00
|
|
|
checksum=b628c14683b9ab36f28edc69bfcbf1e463ee1af909899ad4f49cf052db1e80d2
|
2008-12-17 10:05:13 +01:00
|
|
|
long_desc="
|
|
|
|
This package provides the linux kernel headers."
|
|
|
|
|
2009-02-25 06:15:20 +01:00
|
|
|
Add_dependency build perl
|
|
|
|
Add_dependency build module-init-tools
|
|
|
|
Add_dependency run kernel-libc-headers ${version}
|
2008-12-17 10:05:13 +01:00
|
|
|
|
|
|
|
do_install()
|
|
|
|
{
|
2009-03-11 06:31:56 +01:00
|
|
|
local destdir=${DESTDIR}/usr/src/$pkgname-$version
|
2008-12-17 10:05:13 +01:00
|
|
|
local arch=
|
2009-01-25 23:40:41 +01:00
|
|
|
local incdirs="acpi asm-generic config linux math-emu media \
|
2008-12-17 10:05:13 +01:00
|
|
|
net pcmcia scsi sound video"
|
|
|
|
local archs="alpha arm arm26 avr32 blackfin cris frv h8300 ia64 m32r \
|
|
|
|
m68k* mips mn10300 parisc powerpc ppc s390 sh* sparc* \
|
|
|
|
um v850 xtensa"
|
|
|
|
#
|
|
|
|
# Install necessary stuff to build packages that require this.
|
|
|
|
# This is based in the kernel26 pkgbuild from Arch Linux.
|
|
|
|
#
|
|
|
|
|
|
|
|
cd $wrksrc || exit 1
|
|
|
|
|
|
|
|
if [ "$xbps_machine" != "x86_64" ]; then
|
|
|
|
arch=i386
|
|
|
|
else
|
|
|
|
arch=x86_64
|
|
|
|
fi
|
|
|
|
|
2009-02-03 21:35:57 +01:00
|
|
|
cp -f $XBPS_TEMPLATESDIR/kernel/$arch-dotconfig $wrksrc/.config
|
2008-12-17 10:05:13 +01:00
|
|
|
make oldconfig
|
|
|
|
|
2008-12-17 10:21:28 +01:00
|
|
|
install -D -m 644 Makefile $destdir/Makefile
|
|
|
|
install -D -m 644 kernel/Makefile $destdir/kernel/Makefile
|
2009-01-25 23:40:41 +01:00
|
|
|
install -D -m 644 .config $destdir/.config
|
2008-12-17 10:05:13 +01:00
|
|
|
for i in ${incdirs}; do
|
2008-12-17 10:21:28 +01:00
|
|
|
cp -a include/$i $destdir/include
|
2008-12-17 10:05:13 +01:00
|
|
|
done
|
2009-03-11 06:31:56 +01:00
|
|
|
cp -a arch/x86/include/asm $destdir/include
|
2008-12-17 10:21:28 +01:00
|
|
|
cp -a scripts $destdir
|
2008-12-17 10:05:13 +01:00
|
|
|
|
2008-12-17 10:21:28 +01:00
|
|
|
mkdir -p $destdir/arch/x86/kernel
|
2008-12-17 10:05:13 +01:00
|
|
|
if [ "$xbps_machine" != "x86_64" ]; then
|
|
|
|
install -D -m 644 arch/x86/Makefile_32.cpu \
|
2008-12-17 10:21:28 +01:00
|
|
|
$destdir/arch/x86/Makefile_32.cpu
|
2008-12-17 10:05:13 +01:00
|
|
|
fi
|
|
|
|
for i in $(find . -name "Kconfig*"); do
|
2008-12-17 10:21:28 +01:00
|
|
|
mkdir -p $destdir/$(echo $i | sed 's|/Kconfig.*||')
|
|
|
|
cp $i $destdir/$i
|
2008-12-17 10:05:13 +01:00
|
|
|
done
|
|
|
|
for i in $(find . -name "Makefile*"); do
|
2008-12-17 10:21:28 +01:00
|
|
|
mkdir -p $destdir/$(echo $i | sed 's|/Makefile.*||')
|
|
|
|
cp $i $destdir/$i
|
2008-12-17 10:05:13 +01:00
|
|
|
done
|
2008-12-17 10:21:28 +01:00
|
|
|
cd $XBPS_DESTDIR/$pkgname-$version/usr/src && \
|
|
|
|
ln -s $pkgname-$version linux
|
2008-12-17 10:05:13 +01:00
|
|
|
for arch in ${archs}; do
|
2008-12-17 10:21:28 +01:00
|
|
|
rm -rf $destdir/arch/${arch}
|
2008-12-17 10:05:13 +01:00
|
|
|
done
|
|
|
|
}
|