wok-6.x annotate nagisk/receipt @ rev 17875
Up: tazpkg (757): fix installed.info bug, please, make new ISO to check it up.
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Fri Mar 27 10:42:34 2015 +0200 (2015-03-27) |
parents | b5f37c66eddd |
children | 82816c8eb08b |
rev | line source |
---|---|
pascal@16740 | 1 # SliTaz package receipt. |
pascal@16740 | 2 |
pascal@16740 | 3 PACKAGE="nagisk" |
pascal@16740 | 4 VERSION="1.2.5" |
pascal@16740 | 5 CATEGORY="network" |
pascal@16740 | 6 SHORT_DESC="Simple tool to monitor Asterisk from a Nagios server." |
pascal@16740 | 7 MAINTAINER="pascal.bellard@slitaz.org" |
pascal@16740 | 8 LICENSE="GPL3" |
pascal@16740 | 9 TARBALL="$PACKAGE-$VERSION.tar.gz" |
pascal@16740 | 10 WEB_SITE="https://github.com/nicolargo/nagisk" |
pascal@16740 | 11 WGET_URL="https://codeload.github.com/nicolargo/nagisk/tar.gz/v$VERSION" |
pascal@16740 | 12 |
pascal@16740 | 13 DEPENDS="nagios-nrpe perl sudo" |
pascal@16740 | 14 BUILD_DEPENDS="wget" |
pascal@16740 | 15 |
pascal@16740 | 16 # Rules to gen a SliTaz package suitable for Tazpkg. |
pascal@16740 | 17 genpkg_rules() |
pascal@16740 | 18 { |
pascal@16740 | 19 mkdir -p $fs/usr/share/nagios/libexec |
pascal@16740 | 20 cp -a $src/nagisk.pl $fs/usr/share/nagios/libexec |
pascal@16740 | 21 sed -i 's/^elsif/} &/' $fs/usr/share/nagios/libexec/nagisk.pl |
pascal@16740 | 22 } |
pascal@16740 | 23 |
pascal@16740 | 24 # Pre and post install commands for Tazpkg. |
pascal@16740 | 25 post_install() |
pascal@16740 | 26 { |
pascal@16740 | 27 grep -qs check_asterisk_version $1/etc/nagios/nrpe.cfg || |
pascal@16740 | 28 cat >> $1/etc/nagios/nrpe.cfg <<EOT |
pascal@16740 | 29 command[check_asterisk_version]=/usr/share/nagios/libexec/nagisk.pl -c version |
pascal@16740 | 30 command[check_asterisk_peers]=/usr/share/nagios/libexec/nagisk.pl -c peers -w \$ARG1\$ -x \$ARG2\$ |
pascal@16740 | 31 command[check_asterisk_peer]=/usr/share/nagios/libexec/nagisk.pl -c peer -p \$ARG1\$ -w \$ARG2\$ -x \$ARG3\$ |
pascal@16740 | 32 command[check_asterisk_channels]=/usr/share/nagios/libexec/nagisk.pl -c channels -w \$ARG1\$ -x \$ARG2\$ |
pascal@16740 | 33 command[check_asterisk_konference]=/usr/share/nagios/libexec/nagisk.pl -c konference -w \$ARG1\$ -x \$ARG2\$ |
pascal@16740 | 34 command[check_asterisk_jabber]=/usr/share/nagios/libexec/nagisk.pl -c jabber -b \$ARG1\$ |
pascal@16740 | 35 #command[check_asterisk_zaptel]=/usr/share/nagios/libexec/nagisk.pl -c zaptel |
pascal@16740 | 36 #command[check_asterisk_span]=/usr/share/nagios/libexec/nagisk.pl -c span -s \$ARG1\$ |
pascal@16740 | 37 #command[check_asterisk_dahdi]=/usr/share/nagios/libexec/nagisk.pl -c dahdi |
pascal@16740 | 38 #command[check_asterisk_dahdi_span]=/usr/share/nagios/libexec/nagisk.pl -c dahdi_span -s \$ARG1\$ |
pascal@16740 | 39 #command[check_asterisk_pri_span]=/usr/share/nagios/libexec/nagisk.pl -c pri_span -s \$ARG1\$ |
pascal@16740 | 40 #command[check_asterisk_pri_spans]=/usr/share/nagios/libexec/nagisk.pl -c pri_spans |
pascal@16740 | 41 command[check_asterisk_registry]=/usr/share/nagios/libexec/nagisk.pl -c registry |
pascal@16740 | 42 EOT |
pascal@17694 | 43 grep '^nagios ALL=NOPASSWD' $1/etc/sudoers | grep -q asterisk || |
pascal@16740 | 44 cat >> $1/etc/sudoers <<EOT |
pascal@17694 | 45 nagios ALL=NOPASSWD: /usr/sbin/asterisk |
pascal@16740 | 46 EOT |
pascal@16740 | 47 chown nagios:nagios $1/usr/share/nagios/libexec/nagisk.pl |
pascal@16740 | 48 } |