74 lines
2.4 KiB
Cheetah
74 lines
2.4 KiB
Cheetah
|
# Template file for 'kernel-headers'
|
||
|
pkgname=kernel-headers
|
||
|
version=2.6.27.9
|
||
|
# Vanilla kernel + UnionFS + SquashFS patches.
|
||
|
patch_files="
|
||
|
unionfs-2.5_for_2.6.27-rc6.diff.bz2
|
||
|
unionfs-2.5_fix_for_2.6.27.diff
|
||
|
squashfs3.4-2.6.27-rc4.diff.bz2"
|
||
|
patch_args="-p1"
|
||
|
wrksrc="linux-$version"
|
||
|
distfiles="http://www.kernel.org/pub/linux/kernel/v2.6/linux-$version.tar.bz2"
|
||
|
build_style=custom-install
|
||
|
short_desc="The Linux kernel headers"
|
||
|
maintainer="Juan RP <xtraeme@gmail.com>"
|
||
|
checksum=fd710a841be6119cdd2c42f92ca405265fb156e279006bb89bb874e4198b3e5e
|
||
|
long_desc="
|
||
|
This package provides the linux kernel headers."
|
||
|
|
||
|
build_depends="perl-5.10.0 module-init-tools-3.5"
|
||
|
|
||
|
do_install()
|
||
|
{
|
||
|
local destdir=$XBPS_DESTDIR/$pkgname-$version
|
||
|
local arch=
|
||
|
local incdirs="acpi asm-generic asm-x86 config linux math-emu media \
|
||
|
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
|
||
|
|
||
|
cp -f $XBPS_TEMPLATESDIR/kernel-$arch-dotconfig $wrksrc/.config
|
||
|
make oldconfig
|
||
|
|
||
|
install -D -m 644 Makefile $destdir/usr/src/linux-$version/Makefile
|
||
|
install -D -m 644 kernel/Makefile \
|
||
|
$destdir/usr/src/linux-$version/kernel/Makefile
|
||
|
install -D -m 644 .config $destdir/usr/src/linux-$version/.config
|
||
|
for i in ${incdirs}; do
|
||
|
cp -a include/$i $destdir/usr/src/linux-$version/include
|
||
|
done
|
||
|
cp -a scripts $destdir/usr/src/linux-$version
|
||
|
|
||
|
mkdir -p $destdir/usr/src/linux-$version/arch/x86/kernel
|
||
|
if [ "$xbps_machine" != "x86_64" ]; then
|
||
|
install -D -m 644 arch/x86/Makefile_32.cpu \
|
||
|
$destdir/usr/src/linux-$version/arch/x86/Makefile_32.cpu
|
||
|
fi
|
||
|
for i in $(find . -name "Kconfig*"); do
|
||
|
mkdir -p $destdir/usr/src/linux-$version/$(echo $i | sed 's|/Kconfig.*||')
|
||
|
cp $i $destdir/usr/src/linux-$version/$i
|
||
|
done
|
||
|
for i in $(find . -name "Makefile*"); do
|
||
|
mkdir -p $destdir/usr/src/linux-$version/$(echo $i | sed 's|/Makefile.*||')
|
||
|
cp $i $destdir/usr/src/linux-$version/$i
|
||
|
done
|
||
|
cd $destdir/usr/src/linux-$version/include && ln -s asm-x86 asm
|
||
|
cd $destdir/usr/src && ln -s linux-$version linux
|
||
|
for arch in ${archs}; do
|
||
|
rm -rf $destdir/usr/src/linux-$version/arch/${arch}
|
||
|
done
|
||
|
}
|