# Maintainer: Thomas S Hatch <thatch45 at gmail dot com>
# Build the salt package from local files.
# Use this to test Arch installation before committing changes.
pkgname=salt
pkgver=$(date +%Y%m%d)
pkgrel=1
pkgdesc="A remote execution and communication system built on zeromq"
arch=('any')
url="https://github.com/thatch45/salt"
license=('APACHE')
groups=()
depends=('python2'
         'python2-pyzmq'
         'python-m2crypto'
         'python2-yaml'
         'pycrypto'
         'python2-psutil')
makedepends=('git')
provides=()
backup=('etc/salt/master' 
        'etc/salt/minion')
options=()
srcdir="$PWD/../.."

package() {
  cd "$srcdir"

  python2 setup.py install --root=$pkgdir/ --optimize=1
  
  mkdir -p $pkgdir/etc/rc.d/
  cp $srcdir/pkg/arch/salt-master $pkgdir/etc/rc.d/
  cp $srcdir/pkg/arch/salt-minion $pkgdir/etc/rc.d/
  chmod +x $pkgdir/etc/rc.d/*
} 
