# $Id: Portfile 79214 2011-06-05 22:18:39Z ryandesign@macports.org $

PortSystem 1.0

name			mipsel-linux-kernel-headers
version			2.4.30
revision		1
categories		cross
platforms		darwin
maintainers		nomaintainer
supported_archs	noarch

description		Linux kernel headers for mips-linux cross development
long_description	${description}

homepage		http://www.kernel.org/
master_sites	http://www.de.kernel.org/pub/linux/kernel/v2.4/
distname		linux-${version}
checksums		sha1 280768f529d018af44ced85b7c9d221d536ca1d7
use_bzip2		yes

dist_subdir		linux

set target		mipsel-linux-uclibc
set cprefix		${prefix}/cross/${target}

extract.post_args	"| tar -xf - ${distname}/include ${distname}/Makefile \
				${distname}/Rules.make ${distname}/arch/mips/Makefile \
				${distname}/scripts ${distname}/arch/mips/config*.in \
				${distname}/*/*/Config.in ${distname}/*/Config.in"
post-extract {
	file copy ${filespath}/config ${worksrcpath}/.config
}

patch {
	reinplace "s/@expr length/@-expr length/" ${worksrcpath}/Makefile
}

use_configure	no

build.target	oldconfig
build.args		ARCH=mips

destroot {
	xinstall -m 755 -d ${destroot}${cprefix}/include/
	file copy ${worksrcpath} ${destroot}${cprefix}/include/
	system "cd ${destroot}${cprefix}/include/ && ln -s ${distname} linux"
}

destroot.violate_mtree yes
