summaryrefslogtreecommitdiffstats
path: root/testing/aconf/APKBUILD
blob: a2a9a88344df1af41f39ee8ccb7cccd46296f757 (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
# Contributor: Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>
# Maintainer:
pkgname=aconf
pkgver=0.4.0
pkgrel=0
pkgdesc="Alpine Configurator"
url="http://git.alpinelinux.org/cgit/kunkku/aconf/"
arch="noarch"
license="BSD"
depends="lua5.2-augeas lua5.2-b64 lua5.2-cjson lua5.2-crypto \
         lua5.2-file-magic lua5.2-openrc lua5.2-posix lua5.2-stringy uwsgi \
         uwsgi-lua"
makedepends=""
source="${url}snapshot/${pkgname}-${pkgver}.tar.bz2 $pkgname.initd"


_modules="dnsmasq network openssh"

subpackages=""
for _m in $_modules; do
	subpackages="$subpackages $pkgname-mod-$_m:_$_m"
	eval "_deps_$_m=$_m"
done

_deps_network=


_builddir=$srcdir/$pkgname-$pkgver
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
}

build() {
	return 0
}

package() {
	cd "$_builddir"
	make ROOT_DIR=$pkgdir install || return 1
	install -m755 -D "$srcdir"/$pkgname.initd \
		"$pkgdir"/etc/init.d/$pkgname || return 1
}


_moddir=usr/share/lua/5.2/$pkgname/modules
_augdir=usr/share/$pkgname/augeas

_module() {
	eval "depends=\"$pkgname \$_deps_$1\""
	mkdir -p "$subpkgdir/$_moddir" || return 1
	mv "$pkgdir/$_moddir/$1.lua" "$subpkgdir/$_moddir" || return 1

	_lens=$pkgdir/$_augdir/aconf_$1.aug
	[ -f "$_lens" ] || return 0
	mkdir -p "$subpkgdir/$_augdir" || return 1
	mv "$_lens" "$subpkgdir/$_augdir"
}

for _m in $_modules; do
	eval "_$_m() { _module $_m; }"
done

md5sums="e320eec530f477e4647111de40de5f35  aconf-master.tar.bz2
77004904f5d4637f807e2d084a0e2085  aconf.initd"
sha256sums="baee13ea13f9d0e81b9663c5998f377ed7262e6e93a4a9aacf245a1d1102ed4e  aconf-master.tar.bz2
76b01d0184dbd01ec712c362d7ef561d58b7cd59568833d5e6fa874ea4ac4f8e  aconf.initd"
sha512sums="1e13bf28d416314c4a122f92603a5b8871886e3c1c1c878cea16882a81ffcde6e4e0c090929f0defafb6e7ea3596500c355b4a855eb84c9bf795ed43eb5e3035  aconf-master.tar.bz2
aea5ac6daa63326b69920ad3ed7e36ed832caef34400b5a47b41fe20aed67a5975876739b483c0296fadcec8fbffbb60c80fb261950ce264fe29356fb17caebe  aconf.initd"