summaryrefslogtreecommitdiffstats
path: root/main/lxc/APKBUILD
blob: 154d1569f538f687a6065f3b80288ec285543547 (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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# Contributor: William Pitcock <nenolod@dereferenced.org>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=lxc
pkgver=1.0.3
_mypkgver=${pkgver/_rc/.rc}
pkgrel=0
pkgdesc="linux containers - tools"
url="http://lxc.sourceforge.net/"
arch="all"
license="GPL"
depends="bash"
depends_dev="libcap-dev"
makedepends="$depends_dev lvm2 util-linux automake autoconf libtool lua5.2-dev"
install=""
subpackages="$pkgname-dev $pkgname-doc $pkgname-lvm lua5.2-lxc:_lua52
	$pkgname-templates $pkgname-libs"
source="https://github.com/lxc/lxc/archive/lxc-$_mypkgver.tar.gz
	version.patch
	lxc.initd
	0001-alpinelinux-set-correct-lxc_arch-for-x86.patch
	"

_builddir="${srcdir}/lxc-lxc-${_mypkgver}"
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
	./autogen.sh
}

build() {
	cd "$_builddir"
	LUA_VERSION=5.2 \
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--localstatedir=/var \
		--disable-apparmor \
		--enable-lua \
		--with-lua-pc=lua5.2 \
		--with-distro=alpine \
		|| return 1
	make VERSION=$pkgver || return 1
}

package() {
	cd "$_builddir"
	make DESTDIR="$pkgdir" install || return 1
	install -d "$pkgdir"/var/lib/lxc
	install -Dm755 "$srcdir"/lxc.initd "$pkgdir"/etc/init.d/lxc
}

lvm() {
	pkgdesc="linux containers lvm support"
	depends="lvm2 util-linux lxc"
	arch="noarch"
	mkdir "$subpkgdir"
}

_lua52() {
	pkgdesc="Lua 5.2 module for LXC"
	for i in lib share; do
		mkdir -p "$subpkgdir"/usr/$i || return 1
		mv "$pkgdir"/usr/$i/lua "$subpkgdir"/usr/$i/ || return 1
	done
}

templates() {
	pkgdesc="Templates for LXC"
	arch="noarch"
	mkdir -p "$subpkgdir"/usr/share/lxc
	mv "$pkgdir"/usr/share/lxc/templates "$subpkgdir"/usr/share/lxc/
}

dev() {
	default_dev
	#fix abuild smartness
	mv "$subpkgdir"/usr/bin/lxc-config \
		"$pkgdir"/usr/bin/ || return 1
}

md5sums="4ebce63536f157125ed953e5836767d6  lxc-1.0.3.tar.gz
79e90616b5049a472ccdcb5b1dcdd8b1  version.patch
1268d4b3e6ed004a47216b8714d09bfd  lxc.initd
b93cda6f092211535cf87fa841d611aa  0001-alpinelinux-set-correct-lxc_arch-for-x86.patch"
sha256sums="9fc4ac60a842058e4ad0fe6a281dc0079ee9830afa1852a10fa044219f2c6412  lxc-1.0.3.tar.gz
b6d85fb23940d2511b3951de56b2532843c0e03ec1613548366361cc0c1a46b9  version.patch
bc108a722dc359a24c48837ef7012c776b1d20a533ae0e2231f75081dad4e2f5  lxc.initd
64bf7588bb0b7c4cd214eb1b89bd8426173dedec16e90b791d795a5d1234ad2b  0001-alpinelinux-set-correct-lxc_arch-for-x86.patch"
sha512sums="95d7080cdb34776b601959bbc95572b1d6defeaec6820a38d9b09eb05bb43eaa4a2c4d9fae26f4d1a7ee13ad6cd104c36dd5cbe6ee5e44f274135e42370cc983  lxc-1.0.3.tar.gz
e2ffcbf55447291a8434a4f37255c3a6a119bc4116c75d205006aa2b070bf6be28535cf6107bead14bbf64bf9fa415346ab544bd1c15e1add7d1c6380e6b2def  version.patch
6618ceb59f1927bb82ad1a0fe0a7d4c452ced7855d8f0953556fce9154f30a4c5afbd7a2ab07fb26e6e793b07d4c8f906f8dc27c1defe0580dcf1545c80d1d60  lxc.initd
65f688f98b0b6879c6616006f8a39cce7e406c19976487f8ed41fba27beeda4a13f0182960f677d919d4441d436f0cc79a2d34fa0fff86183553e4c266cc5e70  0001-alpinelinux-set-correct-lxc_arch-for-x86.patch"