aboutsummaryrefslogtreecommitdiffstats
path: root/main/aconf/APKBUILD
blob: 8dd50c3d2c303566810cfb2fbc0760d1e9e35e7c (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
# Contributor: Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>
# Maintainer: Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>
pkgname=aconf
pkgver=0.6.5
pkgrel=0
pkgdesc="Alpine Configurator"
url="http://git.alpinelinux.org/cgit/user/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="ldoc"
source="http://dev.alpinelinux.org/archive/aconf/aconf-$pkgver.tar.xz
	$pkgname.initd"


_modules="dnsmasq dns-zone network openssh"
_escape() {
	  echo ${1//-/_}
}

subpackages="$pkgname-doc"
for _m in $_modules; do
	_e=$(_escape $_m)
	subpackages="$subpackages $pkgname-mod-$_m:_$_e"
	eval "_deps_$_e=$_m"
done

_deps_dns_zone=
_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() {
	local m=$(_escape $1)
	eval "depends=\"$pkgname \$_deps_$m\""
	mkdir -p "$subpkgdir/$_moddir" || return 1
	mv "$pkgdir/$_moddir/$1.lua" "$subpkgdir/$_moddir" || return 1

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

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

md5sums="4151b21132def8b3e62b10aec4bda932  aconf-0.6.5.tar.xz
7970bdf80b9d3003b6824804ca52c42d  aconf.initd"
sha256sums="6fa8c299a648cd2dd70587cba66e0e30983bf0f284794a0817782f5c3fb335ca  aconf-0.6.5.tar.xz
b44d65922c98f3e3b5f2a41e76c1f67eb95c5d547d7095246c3b2bb308cf8538  aconf.initd"
sha512sums="a417d47137f7466de2a499d497f9384fb948b18186c0cc6f6caa4fd907301bddbfcd8050e43b16c9e789f3f2dc03ef173c128093c4e20295592f22230bab12c6  aconf-0.6.5.tar.xz
2706ff356ee8ab72d5b0ac0b6f1bcb3996e7e66457ddc4dbf9745cc6d93a3d9051d141cf0dd28e6b73a422b2d67a0952ed1633471ef7c4bb7393e1ae17e3aa9d  aconf.initd"