aboutsummaryrefslogtreecommitdiffstats
path: root/main/busybox/APKBUILD
blob: 82d7e8b9ed85f34c58b541b5944fce0d651b47de (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
69
70
71
72
73
74
75
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=busybox
pkgver=1.16.0
pkgrel=4
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
	busybox-1.16.0-POLLHUP.patch
	busybox-1.16.0-ash.patch
	busybox-1.16.0-compat.patch
	busybox-1.16.0-defconfig.patch
	busybox-1.16.0-linux_swap.patch
	busybox-1.16.0-md5_sha_compat.patch
	busybox-1.16.0-syslogd.patch
	busybox-1.16.0-tftp.patch
	busybox-1.16.0-usage.patch
	busybox-1.16.0-wget.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
6d2d837cace2e681392fa1d1d430ed78  busybox-1.16.0-POLLHUP.patch
b788742e46a848c02913c9bd070025b7  busybox-1.16.0-ash.patch
940aff0065f875b165dac59cc7006c6a  busybox-1.16.0-compat.patch
118e94315a262a23af66c0d3ad83235e  busybox-1.16.0-defconfig.patch
1a406fb181aab8d9667498ea64116d50  busybox-1.16.0-linux_swap.patch
f4758daa8023f000228e9509cceb02d1  busybox-1.16.0-md5_sha_compat.patch
86a27167971333a0ddad4f0e8bc0acc6  busybox-1.16.0-syslogd.patch
e24dc9e56b5de4fff706cfbe5c75d9b2  busybox-1.16.0-tftp.patch
289c8ee19cc43fe175bbd7933c6b5cdf  busybox-1.16.0-usage.patch
928ca5a26599cd1dbb80e08132140832  busybox-1.16.0-wget.patch
9743e7ecd48f37b0d420f64bef7fb2a8  busyboxconfig"