aboutsummaryrefslogtreecommitdiffstats
path: root/main/busybox/APKBUILD
blob: 54b4f67ceee796f646d8c0c4f7cb056a714814f3 (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
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=busybox
pkgver=1.16.0
pkgrel=1
pkgdesc="Size optimized toolbox of many common UNIX utilities"
url=http://busybox.net
license="GPL-2"
depends=
install="$pkgname.post-install $pkgname.post-upgrade"
triggers="busybox.trigger:/bin /usr/bin /sbin /usr/sbin /lib/modules/*"
source="http://busybox.net/downloads/$pkgname-$pkgver.tar.bz2
	$pkgname-1.11.1-bb.patch
	wget-proxy-user.patch
	busyboxconfig"

_builddir="$srcdir"/$pkgname-$pkgver
prepare() {
	cd "$_builddir"
	#patches
	for i in ../*.patch; do
		msg "Applying $i"
		if ! patch -p1 -i $i; then
			error "$i failed"
			return 1
		fi
	done

	sed -i	-e 's/(ip, _BB_DIR_BIN/(ip, _BB_DIR_SBIN/' \
		-e 's/(vi, _BB_DIR_BIN/(vi, _BB_DIR_USR_BIN/' \
		include/applets.h || return 1

	# we set the install prefix with sed since it might differ depending
	# on abuild version
	sed -e "s:^CONFIG_PREFIX=.*:CONFIG_PREFIX=\"$pkgdir\":" \
		../busyboxconfig > .config
}

build() {
	cd "$_builddir"
	make silentoldconfig || return 1
	make || return 1
}

package() {
	cd "$_builddir"
	make install DESTDIR="$pkgdir"
	mkdir -p "$pkgdir"/usr/sbin "$pkgdir"/usr/bin "$pkgdir"/tmp \
		"$pkgdir"/var/cache/misc
	chmod 1777 "$pkgdir"/tmp
	# we need /bin/sh to be able to execute post-install
	ln -s /bin/busybox "$pkgdir"/bin/sh
}

md5sums="2130884e71a1648bfb63c3250c1d288c  busybox-1.16.0.tar.bz2
4c0f3b486eaa0674961b7ddcd0c60a9b  busybox-1.11.1-bb.patch
8e1c898ec233f6759bca72367ee934fd  wget-proxy-user.patch
9743e7ecd48f37b0d420f64bef7fb2a8  busyboxconfig"