PKGBUILD 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. # Contributor: Idares <idares@seznam.cz>
  2. # Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe>
  3. pkgname=nagios
  4. pkgver=4.0.8
  5. pkgrel=1
  6. pkgdesc="Nagios is an open source host, service and network monitoring program."
  7. license=('GPL')
  8. arch=('i686' 'x86_64')
  9. url="http://www.nagios.org"
  10. depends=('gd' 'freetype2' 'libtool' 'glib2')
  11. optdepends=('monitoring-plugins: a bundle of standard plugins')
  12. source=("http://downloads.sourceforge.net/nagios/$pkgname-$pkgver.tar.gz"
  13. "nagios.install"
  14. "nagios.service")
  15. install='nagios.install'
  16. _nagios_user="nagios"
  17. _nagios_group="nagios"
  18. _instdir="usr/share/nagios"
  19. _bindir="usr/bin"
  20. _vardir="var/nagios"
  21. _confdir="etc/nagios"
  22. _httpdconfdir="etc/webapps/$pkgname/"
  23. _checkresultdir="var/nagios/spool/checkresults"
  24. _perldir="$_instdir/bin"
  25. getent group $_nagios_group > /dev/null || _nagios_group=30
  26. getent passwd $_nagios_user > /dev/null || _nagios_user=30
  27. build() {
  28. cd $srcdir/$pkgname-$pkgver
  29. ./configure \
  30. --with-nagios-user=$_nagios_user \
  31. --with-nagios-group=$_nagios_group \
  32. --prefix="/$_instdir" \
  33. --bindir="/$_bindir" \
  34. --localstatedir="/$_vardir" \
  35. --sysconfdir="/$_confdir" \
  36. --with-httpd-conf="/$_httpdconfdir" \
  37. --with-checkresultdir="/$_checkresultdir" \
  38. --enable-embedded-perl
  39. make all
  40. }
  41. package() {
  42. cd $srcdir/$pkgname-$pkgver
  43. make \
  44. prefix=$pkgdir/$_instdir \
  45. BINDIR=$pkgdir/$_bindir \
  46. LOGDIR=$pkgdir/$_vardir \
  47. CFGDIR=$pkgdir/$_confdir \
  48. HTTPD_CONF=$pkgdir/$_httpdconfdir \
  49. CHECKRESULTDIR=$pkgdir/$_checkresultdir \
  50. install install-config
  51. install -D -m 755 daemon-init $pkgdir/etc/nagios/
  52. # install -D -m 644 sample-config/httpd.conf $pkgdir/$_httpdconfdir/nagios.conf
  53. install -D -m 644 sample-config/httpd.conf $pkgdir/$_httpdconfdir/apache.example.conf
  54. install -D -m 644 $srcdir/nagios.service $pkgdir/usr/lib/systemd/system/nagios.service
  55. mkdir $pkgdir/var/nagios/rw
  56. chown $_nagios_user.$_nagios_group $pkgdir/var/nagios/rw
  57. chmod 755 $pkgdir/var/nagios/rw
  58. chmod 755 $pkgdir/usr/bin
  59. chmod 755 $pkgdir/usr/bin/nagios
  60. find $pkgdir/etc/nagios -name '*cfg' -exec mv "{}" "{}.sample" \; > /dev/null
  61. }
  62. md5sums=('4bba4eef427cfb113fb513b6166a6af6'
  63. 'e11fa7de430ed858269f82e179fc87ca'
  64. '49e077f2d61ede589f55bfd03b597ab0')
  65. sha1sums=('d49586db6905a8e58a082251d8f89ef5c2cab872'
  66. '04008cee208226e60b099550bd9ec7dc78cb1457'
  67. '0df0b4c6976c1562b03e261926b7c2cae6061595')