diff options
author | Jakub Jirutka <jakub@jirutka.cz> | 2016-09-16 00:37:19 +0200 |
---|---|---|
committer | Jakub Jirutka <jakub@jirutka.cz> | 2016-09-16 00:44:21 +0200 |
commit | 126b09e0c412a94a0f8185099ac63751592c2334 (patch) | |
tree | 91ecb45d9ffb3e0329d4bbb01c74cabd58193b95 /community/salt/APKBUILD | |
parent | ed318eef3659db66bc5308dae20b1a2932dd2258 (diff) | |
download | aports-126b09e0c412a94a0f8185099ac63751592c2334.tar.bz2 aports-126b09e0c412a94a0f8185099ac63751592c2334.tar.xz |
community/salt: improve abuild, remove code dup and implicit makedepends
Diffstat (limited to 'community/salt/APKBUILD')
-rw-r--r-- | community/salt/APKBUILD | 81 |
1 files changed, 35 insertions, 46 deletions
diff --git a/community/salt/APKBUILD b/community/salt/APKBUILD index 3f14beb028..81b52d900e 100644 --- a/community/salt/APKBUILD +++ b/community/salt/APKBUILD @@ -10,8 +10,7 @@ arch="noarch" license="ASL-2.0" depends="py-tornado py2-yaml py-jinja2 py2-markupsafe py2-msgpack py2-crypto py2-zmq py2-six py2-requests py2-futures py2-pygit2 procps" -makedepends="python2-dev py-tornado py2-yaml py-jinja2 py2-markupsafe - py2-msgpack py2-crypto py2-zmq py2-six py2-requests py2-futures py2-libcloud" +makedepends="python2-dev py2-libcloud" subpackages="$pkgname-doc $pkgname-master $pkgname-minion $pkgname-syndic $pkgname-api $pkgname-cloud $pkgname-ssh" source="$pkgname-$pkgver.tar.gz::https://codeload.github.com/saltstack/$pkgname/tar.gz/v$pkgver @@ -28,58 +27,40 @@ builddir="$srcdir/$pkgname-$pkgver" build() { cd "$builddir" + python2 setup.py build || return 1 } package() { cd "$builddir" - python2 setup.py install --root="$pkgdir"/ --optimize=1 || return 1 - mkdir -p "${pkgdir}"/var/log/$pkgname || return 1 -} - -_init_copy() { - local type="$1" - install -m 755 -D "$srcdir"/salt-$type.initd "$subpkgdir"/etc/init.d/salt-$type || return 1 - install -m 644 -D "$srcdir"/salt-$type.confd "$subpkgdir"/etc/conf.d/salt-$type || return 1 -} -_conf_copy() { - local type="$1" - mkdir -p "$subpkgdir"/etc/salt/ || return 1 - cp -rf "$builddir"/conf/$type* "$subpkgdir"/etc/salt/ || return 1 + python2 setup.py install --root="$pkgdir"/ --optimize=1 || return 1 + mkdir -p "$pkgdir"/var/log/$pkgname } master() { pkgdesc="Management component for salt, a parallel remote execution system" depends="$pkgname" - _init_copy master - _conf_copy master - - mkdir -p "$subpkgdir"/usr/bin || return 1 - mv "$pkgdir"/usr/bin/salt "$subpkgdir"/usr/bin/salt || return 1 + _init_copy master || return 1 + _conf_copy master || return 1 - local i - for i in cp key master run unity - do - mv "$pkgdir"/usr/bin/salt-$i "$subpkgdir"/usr/bin || return 1 + local i; for i in cp key master run unity; do + _submv usr/bin/salt-$i || return 1 done + _submv usr/bin/salt } minion() { pkgdesc="Client component for Salt, a parallel remote execution system" depends="$pkgname" - _init_copy minion - _conf_copy minion - _conf_copy proxy - - mkdir -p "${subpkgdir}"/usr/bin || return 1 + _init_copy minion || return 1 + _conf_copy minion || return 1 + _conf_copy proxy || return 1 - local i - for i in call minion proxy - do - mv "${pkgdir}"/usr/bin/salt-$i "${subpkgdir}"/usr/bin || return 1 + local i; for i in call minion proxy; do + _submv usr/bin/salt-$i || return 1 done } @@ -87,38 +68,46 @@ syndic() { pkgdesc="Master-of-master component for Salt, a parallel remote execution system" depends="$pkgname-master" - mkdir -p "$subpkgdir"/usr/bin || return 1 - mv "$pkgdir"/usr/bin/salt-syndic "$subpkgdir"/usr/bin || return 1 + _submv usr/bin/salt-syndic } api() { pkgdesc="REST API for Salt, a parallel remote execution system" depends="$pkgname-master" - _init_copy api - - mkdir -p "$subpkgdir"/usr/bin || return 1 - mv "$pkgdir"/usr/bin/salt-api "$subpkgdir"/usr/bin || return 1 + _init_copy api && _submv usr/bin/salt-api } cloud() { pkgdesc="Cloud provisioner for Salt, a parallel remote execution system" depends="$pkgname-master py2-libcloud" - _conf_copy cloud - - mkdir -p "$subpkgdir"/usr/bin || return 1 - mv "$pkgdir"/usr/bin/salt-cloud "$subpkgdir"/usr/bin || return 1 + _conf_copy cloud && _submv usr/bin/salt-cloud } ssh() { pkgdesc="Agentless SSH-based version of Salt, a parallel remote execution system" depends="$pkgname" - _conf_copy roster + _conf_copy roster && _submv usr/bin/salt-ssh +} - mkdir -p "$subpkgdir"/usr/bin || return 1 - mv "$pkgdir"/usr/bin/salt-ssh "$subpkgdir"/usr/bin || return 1 +_submv() { + local path="$1" + mkdir -p "$subpkgdir"/${path%/*} + mv "$pkgdir"/$path "$subpkgdir"/$path +} + +_init_copy() { + local type="$1" + install -m 755 -D "$srcdir"/salt-$type.initd "$subpkgdir"/etc/init.d/salt-$type || return 1 + install -m 644 -D "$srcdir"/salt-$type.confd "$subpkgdir"/etc/conf.d/salt-$type || return 1 +} + +_conf_copy() { + local type="$1" + mkdir -p "$subpkgdir"/etc/salt/ + cp -r "$builddir"/conf/$type* "$subpkgdir"/etc/salt/ } md5sums="5db25ad762a0780ff5d74561516a97fa salt-2016.3.3.tar.gz |