summaryrefslogtreecommitdiffstats
path: root/main/util-vserver/APKBUILD
blob: 651a6e9d7f0305f4ef45162ccacff45c5cc877e5 (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
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=util-vserver
pkgver=0.30.216_pre2921
_realver=0.30.216-pre2921
pkgrel=1
pkgdesc="Linux-VServer admin utilities"
url="http://www.nongnu.org/util-vserver/"
license="GPL"
install="$pkgname.post-install $pkgname.post-upgrade"
makedepends="iptables-dev e2fsprogs-dev beecrypt-dev autoconf automake
	pkgconfig libtool"
depends="bash make"

source="http://people.linux-vserver.org/~dhozac/t/uv-testing/util-vserver-$_realver.tar.bz2
	busybox.patch
	chmod.patch
	ensc_pathprog.patch
	validate.patch
	alpine.patch
	setup-vs-template
	setup-vs-guest
	"
subpackages="$pkgname-doc $pkgname-dev"

_builddir="$srcdir"/$pkgname-$_realver

prepare() {
	cd "$_builddir"
	for i in ../*.patch; do
		[ -r "$i" ] || continue
		msg "Applying $i"
		patch -p1 -i $i || return 1
	done
	msg "Running autotools..."
	aclocal -I m4 && autoconf && automake && libtoolize || return 1

	# this is an ugly workaround
	sed -i -e "s:as_echo=.*:as_echo=echo:g" configure

	# issue 305
	sed -i -e 's/^function //' gentoo/util-vserver
}

build() {
	local i
	cd "$_builddir"
	./configure --prefix=/usr \
		--mandir=/usr/share/man \
		--sysconfdir=/etc \
		--with-initscripts=gentoo \
		--localstatedir=/var \
		|| return 1

	# use busybox ionice rather than util-linux-ng
	sed -i -e 's:/usr/bin/ionice:/bin/ionice:' Makefile
	make || return 1
}

package() {
	cd "$_builddir"
	make -j1 DESTDIR="$pkgdir/" install install-distribution
	install -Dm755 ../setup-vs-template "$pkgdir"/usr/sbin/setup-vs-template
	install -Dm755 ../setup-vs-guest "$pkgdir"/usr/sbin/setup-vs-guest
}

md5sums="21b9cbdcd4943b469d8e720826337edd  util-vserver-0.30.216-pre2921.tar.bz2
62b7b9bbe5902b95f4614272af003dfd  busybox.patch
73c7437dea6937a57cf38d166ef83c09  chmod.patch
ff8f561f672524eb46fe633f584ef60e  ensc_pathprog.patch
da8b70c4fd40e68894b3903ffd121397  validate.patch
04000261fd990a3963b0e98260b481bd  alpine.patch
49bca7969cc284adf68e0ef284c0660e  setup-vs-template
253253a488a632d834c1e1ac5424f55b  setup-vs-guest"