aur/salt to bypass the python2-msgpack bug on ARM. Using msgpack_pure from pip

This commit is contained in:
WarheadsSE 2012-06-21 18:28:23 -04:00
parent 6d9815c6d9
commit e8075accc1
5 changed files with 257 additions and 0 deletions

56
aur/salt/PKGBUILD Normal file
View file

@ -0,0 +1,56 @@
# Maintainer: Christer Edwards <christer.edwards@gmail.com>
# Contributor: Jason Plum <jplum@archlinuxarm.org>
pkgname=salt
pkgver=0.10.0
pkgrel=1
plugrel=1
pkgdesc="A remote execution and communication system built on zeromq"
arch=(any)
url="https://github.com/saltstack/salt"
license=("APACHE")
depends=('python2'
'python2-pyzmq'
'python-m2crypto'
'python2-yaml'
'pycrypto'
'python2-psutil'
'python2-jinja')
# 'python2-msgpack')
backup=('etc/salt/master.template'
'etc/salt/minion.template')
makedepends=()
optdepends=()
options=()
conflicts=('salt-git')
install=salt.install
source=("https://github.com/downloads/saltstack/salt/${pkgname}-${pkgver}.tar.gz"
"salt-master"
"salt-syndic"
"salt-minion"
"salt.install")
md5sums=('fc99b188b599729572fc744c9fffc8c7'
'1594591acb0a266854186a694da21103'
'09683ef4966e401761f7d2db6ad4b692'
'21ab2eac231e9f61bf002ba5f16f8a3d'
'eb0556c5b0e4e62f65a2ae459c2ec25d')
package() {
cd ${srcdir}/${pkgname}-${pkgver}
python2 setup.py install --root=${pkgdir}/ --optimize=1
mkdir -p ${pkgdir}/etc/rc.d/
cp ${srcdir}/salt-master ${pkgdir}/etc/rc.d/
cp ${srcdir}/salt-minion ${pkgdir}/etc/rc.d/
cp ${srcdir}/salt-syndic ${pkgdir}/etc/rc.d/
chmod +x ${pkgdir}/etc/rc.d/*
mkdir -p ${pkgdir}/etc/salt/
cp ${srcdir}/${pkgname}-${pkgver}/conf/master.template ${pkgdir}/etc/salt/
cp ${srcdir}/${pkgname}-${pkgver}/conf/minion.template ${pkgdir}/etc/salt/
}

63
aur/salt/salt-master Normal file
View file

@ -0,0 +1,63 @@
#!/bin/bash
daemon_name='salt-master'
. /etc/rc.conf
. /etc/rc.d/functions
[ -f /etc/conf.d/$daemon_name ] && . /etc/conf.d/$daemon_name
get_pid() {
ps aux | grep -v grep | grep '/usr/bin/python2 /usr/bin/salt-master' | awk '{print $2}'
}
case "$1" in
start)
stat_busy "Starting Salt Master"
PID=$(get_pid)
if [ -z "$PID" ]; then
[ -f /var/run/$daemon_name.pid ] && rm -f /var/run/$daemon_name.pid
# RUN
/usr/bin/$daemon_name -d
#
if [ $? -gt 0 ]; then
stat_fail
exit 1
else
echo $(get_pid) > /var/run/$daemon_name.pid
add_daemon $daemon_name
stat_done
fi
else
stat_fail
exit 1
fi
;;
stop)
stat_busy "Stopping Salt Master"
PID=$(get_pid)
# KILL
[ ! -z "$PID" ] && kill $PID &> /dev/null
#
if [ $? -gt 0 ]; then
stat_fail
exit 1
else
rm -f /var/run/$daemon_name.pid &> /dev/null
rm_daemon $daemon_name
stat_done
fi
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "usage: $0 {start|stop|restart|status}"
esac
exit 0

63
aur/salt/salt-minion Normal file
View file

@ -0,0 +1,63 @@
#!/bin/bash
daemon_name='salt-minion'
. /etc/rc.conf
. /etc/rc.d/functions
[ -f /etc/conf.d/$daemon_name ] && . /etc/conf.d/$daemon_name
get_pid() {
ps aux | grep -v grep | grep '/usr/bin/python2 /usr/bin/salt-minion' | awk '{print $2}'
}
case "$1" in
start)
stat_busy "Starting Salt Minion"
PID=$(get_pid)
if [ -z "$PID" ]; then
[ -f /var/run/$daemon_name.pid ] && rm -f /var/run/$daemon_name.pid
# RUN
/usr/bin/$daemon_name -d
#
if [ $? -gt 0 ]; then
stat_fail
exit 1
else
echo $(get_pid) > /var/run/$daemon_name.pid
add_daemon $daemon_name
stat_done
fi
else
stat_fail
exit 1
fi
;;
stop)
stat_busy "Stopping Salt Minion"
PID=$(get_pid)
# KILL
[ ! -z "$PID" ] && kill $PID &> /dev/null
#
if [ $? -gt 0 ]; then
stat_fail
exit 1
else
rm -f /var/run/$daemon_name.pid &> /dev/null
rm_daemon $daemon_name
stat_done
fi
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "usage: $0 {start|stop|restart|status}"
esac
exit 0

63
aur/salt/salt-syndic Normal file
View file

@ -0,0 +1,63 @@
#!/bin/bash
daemon_name='salt-syndic'
. /etc/rc.conf
. /etc/rc.d/functions
[ -f /etc/conf.d/$daemon_name ] && . /etc/conf.d/$daemon_name
get_pid() {
ps aux | grep -v grep | grep '/usr/bin/python2 /usr/bin/salt-syndic' | awk '{print $2}'
}
case "$1" in
start)
stat_busy "Starting Salt Syndic"
PID=$(get_pid)
if [ -z "$PID" ]; then
[ -f /var/run/$daemon_name.pid ] && rm -f /var/run/$daemon_name.pid
# RUN
/usr/bin/$daemon_name -d
#
if [ $? -gt 0 ]; then
stat_fail
exit 1
else
echo $(get_pid) > /var/run/$daemon_name.pid
add_daemon $daemon_name
stat_done
fi
else
stat_fail
exit 1
fi
;;
stop)
stat_busy "Stopping Salt Syndic"
PID=$(get_pid)
# KILL
[ ! -z "$PID" ] && kill $PID &> /dev/null
#
if [ $? -gt 0 ]; then
stat_fail
exit 1
else
rm -f /var/run/$daemon_name.pid &> /dev/null
rm_daemon $daemon_name
stat_done
fi
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "usage: $0 {start|stop|restart|status}"
esac
exit 0

12
aur/salt/salt.install Normal file
View file

@ -0,0 +1,12 @@
# there is a problem with python2-msgpack on ARM.
# msgpack_pure works but we'll need to just make sure it upgrades.
post_install() {
pip2 install msgpack_pure --upgrade
}
post_upgrade() {
post_install
}