This instance of Gitlab will be upgraded to 13.9 at 13.00 CEST / 11.00 UTC. It will be unavailable for some moment. Thanks for your understanding.

Commit 126b09e0 authored by Jakub Jirutka's avatar Jakub Jirutka

community/salt: improve abuild, remove code dup and implicit makedepends

parent ed318eef
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment