summaryrefslogtreecommitdiffstats
path: root/testing/kbuild/APKBUILD
blob: 5688647e0508b390b1232bed42fed21edf61898d (plain)
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
60
61
62
63
64
65
66
67
68
# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=kbuild
pkgver=0.1.5_p2
_ver=${pkgver/_/-}
pkgrel=0
pkgdesc="A makefile framework for writing simple makefiles for complex tasks"
url="http://svn.netlabs.org/kbuild/wiki"
arch="all"
license="GPL-3"
depends=""
depends_dev=""
makedepends="autoconf automake flex bison"
install=""
subpackages="$pkgname-doc"
source="ftp://ftp.netlabs.org/pub/kbuild/kBuild-$_ver-src.tar.gz
	kbuild-0.1.5_p2-qa.patch
	lchmod.patch
	strlcpy.patch
	underlinking.patch
	sys_siglist.patch
	uclibc.patch"

_builddir="$srcdir"/kBuild-$_ver
prepare() {
	local i
	cd "$_builddir"
	for i in $source; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done
	cd "$_builddir"/src/kmk
	aclocal -I config && autoheader && autoconf && automake --add-missing \
		|| return 1
	cd "$_builddir"/src/sed
	aclocal -I config && autoheader && autoconf && automake --add-missing \
		|| return 1
	
	# the bootstrap process will create a symlink to the system shell,
	# which happens to be (/bin/sh) a symlink to /bin/busybox
	# and busybox will get confused since there are no applet named
	# kmk_ash.
	echo '#!/bin/sh' >"$srcdir"/sh
	echo 'exec /bin/busybox sh "$@"' >> "$srcdir"/sh
	chmod +x "$srcdir"/sh
	sed -i -e "s:/bin/sh:$srcdir/sh:" "$_builddir"/bootstrap.gmk
}

build() {
	cd "$_builddir"
	kBuild/env.sh --full make -f bootstrap.gmk AUTORECONF=true \
		|| return 1
}

package() {
	cd "$_builddir"
	kBuild/env.sh kmk NIX_INSTALL_DIR=/usr PATH_INS="$pkgdir" install \
		|| return 1
}

md5sums="5e4e2193aa6cb3f095af2f99bf90d01d  kBuild-0.1.5-p2-src.tar.gz
79d4d445b28f0c50f2a7a8ca12bbed4b  kbuild-0.1.5_p2-qa.patch
b3dd26cc185c96658d9b554eef2f811c  lchmod.patch
90cae3b53b4ec6fc5f1c336922083df0  strlcpy.patch
ca09174d7c885fdea1e3c2dc580d80b3  underlinking.patch
234e03febb8eb35106ecf85682e9233a  sys_siglist.patch
4bf9eead328a38059dadb56317e7aaa4  uclibc.patch"