updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / nagvis / PKGBUILD
blob62865af9bca96c058252bec9750aa8723e042422
1 # Maintainer: Mariusz Derela <mariusz.derela@gmail.com>
3 pkgname=nagvis
4 pkgver=1.5.10
5 pkgrel=1
6 pkgdesc="NagVis is a visualization addon for the well known network managment system Nagios"
7 license=('GPL')
8 arch=('i686' 'x86_64')
9 url="http://www.nagvis.org"
10 source=("http://downloads.sourceforge.net/nagvis/$pkgname-$pkgver.tar.gz")
11 md5sums=('2a40d1dfcc1b5320c90ca0d6b1a1351a') 
12 install=nagvis.install
13 depends=(graphviz php-sqlite apache)
15 build() {
16         _httpuser="http"
17         _httpgroup="http"
18         _nagvisdir="usr/share/nagvis"   
19         _docdir="usr/share/doc/$pkgname/"
20         _httpdextradir="etc/httpd/conf/extra"
21         mkdir -p $pkgdir/{$_httpdextradir,$_docdir}
22         cp -a $srcdir/$pkgname-$pkgver $pkgdir/$_nagvisdir
23         cp $pkgdir/$_nagvisdir/etc/apache2-nagvis.conf-sample $pkgdir/$_httpdextradir/$pkgname.conf-sample
24         cd $pkgdir/$_nagvisdir
25         for i in INSTALL README LICENCE; do
26                 mv $i $pkgdir/$_docdir && gzip $pkgdir/$_docdir/$i
27         done
28         mkdir -p $pkgdir/$_nagvisdir/var/tmpl/{cache,compile}
29         mkdir -p $pkgdir/$_nagvisdir/share/var
30         chmod 775 $pkgdir/$_nagvisdir/etc/maps || return 1
31         chmod 664 $pkgdir/$_nagvisdir/etc/maps/* || return 1
32         chmod 775 $pkgdir/$_nagvisdir/etc/automaps || return 1
33         chmod 664 $pkgdir/$_nagvisdir/etc/automaps/* || return 1
34         chmod 775 $pkgdir/$_nagvisdir/share/userfiles/images/maps || return 1
35         chmod 664 $pkgdir/$_nagvisdir/share/userfiles/images/maps/* || return 1
36         chmod 775 $pkgdir/$_nagvisdir/var || return 1
37         chmod 664 $pkgdir/$_nagvisdir/var/* || return 1
38         chmod -R 775 $pkgdir/$_nagvisdir/var/tmpl || return 1
39         chmod 775 $pkgdir/$_nagvisdir/share/var || return 1
40         
41         getent group $_httpgroup &>/dev/null || _httpuser=33
42         getent passwd $_httpuser &>/dev/null || _httpgroup=33
44         chown -R $_httpuser:$_httpgroup $pkgdir/$_nagvisdir