summaryrefslogtreecommitdiffstats
path: root/main/busybox/APKBUILD
blob: 025806628f884dc2e024df51b00eb53be84b1eeb (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
76
77
78
79
80
81
82
83
84
85
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=busybox
pkgver=1.17.0
pkgrel=3
pkgdesc="Size optimized toolbox of many common UNIX utilities"
url=http://busybox.net
license="GPL-2"
depends=
install="$pkgname.post-install $pkgname.post-upgrade"
subpackages="$pkgname-static"
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
	http://busybox.net/downloads/fixes-1.17.0/busybox-1.17.0-acpid.patch
	http://busybox.net/downloads/fixes-1.17.0/busybox-1.17.0-build_system.patch
	http://busybox.net/downloads/fixes-1.17.0/busybox-1.17.0-diff.patch
	http://busybox.net/downloads/fixes-1.17.0/busybox-1.17.0-mktemp.patch
	http://busybox.net/downloads/fixes-1.17.0/busybox-1.17.0-modprobe-l.patch
	http://busybox.net/downloads/fixes-1.17.0/busybox-1.17.0-volumeid.patch
	http://busybox.net/downloads/fixes-1.17.0/busybox-1.17.0-wget.patch
	busyboxconfig"

_builddir="$srcdir"/$pkgname-$pkgver
_config="$srcdir"/busyboxconfig
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.src.h || return 1
}

build() {
	cd "$_builddir"
	msg "Building static busybox"
	sed -e "s/.*CONFIG_PIE.*/\# CONFIG_PIE is not set/" \
		-e "s/.*CONFIG_STATIC.*/CONFIG_STATIC=y/" \
		"$_config" > .config
	make silentoldconfig || return 1
	make || return 1
	mv busybox busybox.static

	# build dynamic
	msg "Building dynamic busybox"
	cp "$_config" .config
	make silentoldconfig || return 1
	make || return 1
}

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

static() {
	triggers=	
	mkdir -p "$subpkgdir"/bin
	install -m755 "$_builddir"/busybox.static \
		"$subpkgdir"/bin/busybox.static
	
}

md5sums="2908d1d1ca83ff12bc0b05f0d2a3335c  busybox-1.17.0.tar.bz2
4c0f3b486eaa0674961b7ddcd0c60a9b  busybox-1.11.1-bb.patch
0cf814dbe1f62c8c8e891697c896952d  busybox-1.17.0-acpid.patch
ea127206741f9785dd2e8fcce2c32ad8  busybox-1.17.0-build_system.patch
094cde9990b5c6b02e631c08c91a5b30  busybox-1.17.0-diff.patch
2f4c29e5fbd3c9527da9ecbd9e9e699f  busybox-1.17.0-mktemp.patch
b159ecc8954369ec3d2320212c075a69  busybox-1.17.0-modprobe-l.patch
97cccda27dbf4181ca32a58f5d61e5a9  busybox-1.17.0-volumeid.patch
aecc8dcaff560e1334d2788d588f6ea5  busybox-1.17.0-wget.patch
e4c9f09bcc27b57f8f0344c69607f4c4  busyboxconfig"