wok-6.x rev 23232
updated ndoutils (1.5.2 -> 2.1.3)
author | Hans-G?nter Theisgen |
---|---|
date | Tue Mar 24 14:08:32 2020 +0100 (2020-03-24) |
parents | a7abacf75d6d |
children | fba21b999b62 |
files | ndoutils/receipt |
line diff
1.1 --- a/ndoutils/receipt Tue Mar 24 09:52:40 2020 +0100 1.2 +++ b/ndoutils/receipt Tue Mar 24 14:08:32 2020 +0100 1.3 @@ -1,85 +1,91 @@ 1.4 # SliTaz package receipt. 1.5 1.6 PACKAGE="ndoutils" 1.7 -VERSION="1.5.2" 1.8 +VERSION="2.1.3" 1.9 CATEGORY="network" 1.10 SHORT_DESC="Provide mysql access to nagios." 1.11 MAINTAINER="pascal.bellard@slitaz.org" 1.12 LICENSE="GPL2" 1.13 +WEB_SITE="https://www.nagios.org/" 1.14 + 1.15 TARBALL="$PACKAGE-$VERSION.tar.gz" 1.16 -WEB_SITE="https://www.nagios.org/" 1.17 WGET_URL="$SF_MIRROR/nagios/$TARBALL" 1.18 + 1.19 +DEPENDS="mysql nagios" 1.20 +BUILD_DEPENDS="mysql-dev procps" 1.21 + 1.22 CONFIG_FILES="/etc/nagios" 1.23 1.24 -DEPENDS="nagios mysql" 1.25 -BUILD_DEPENDS="mysql-dev" 1.26 - 1.27 # Rules to configure and make the package. 1.28 compile_rules() 1.29 { 1.30 - cd $src 1.31 - 1.32 - while read patch_file; do 1.33 - if [ ! -f done.$patch_file ]; then 1.34 - patch -p1 < $stuff/$patch_file || exit 1 1.35 - touch done.$patch_file 1.36 - fi 1.37 - done <<EOT 1.38 -$PACKAGE-$VERSION-Makefiles.in.u 1.39 -EOT 1.40 + patch --input=$stuff/patches/Makefile.in-$VERSION \ 1.41 + Makefile.in || exit 1 1.42 + patch --input=$stuff/patches/src_Makefile.in-$VERSION \ 1.43 + src/Makefile.in || exit 1 1.44 1.45 - ./configure --prefix=/usr \ 1.46 - --with-ndo2db-user=nagios \ 1.47 - --with-ndo2db-group=nagios \ 1.48 - --localstatedir=/var/run/nagios \ 1.49 - --sysconfdir=/etc/nagios \ 1.50 - --libexecdir=/usr/lib/$PACKAGE \ 1.51 - --mandir=/usr/share/man $CONFIGURE_ARGS && 1.52 - make && \ 1.53 - make DESTDIR=$DESTDIR install && \ 1.54 + addgroup nagios 1.55 + adduser -D -G nagios nagios 1.56 + 1.57 + ./configure \ 1.58 + --prefix=/usr \ 1.59 + --with-ndo2db-user=nagios \ 1.60 + --with-ndo2db-group=nagios \ 1.61 + --localstatedir=/var/run/nagios \ 1.62 + --sysconfdir=/etc/nagios \ 1.63 + --libexecdir=/usr/lib/$PACKAGE \ 1.64 + --mandir=/usr/share/man \ 1.65 + $CONFIGURE_ARGS && 1.66 + make all && 1.67 + make DESTDIR=$DESTDIR install && 1.68 make DESTDIR=$DESTDIR install-config 1.69 } 1.70 1.71 # Rules to gen a SliTaz package suitable for Tazpkg. 1.72 genpkg_rules() 1.73 { 1.74 - mkdir -p $fs/usr/share/nagios/ndoutils \ 1.75 - $fs/etc/nagios \ 1.76 - $fs/etc/mysql.d 1.77 + mkdir -p $fs/usr/lib 1.78 + mkdir -p $fs/usr/share/nagios/ndoutils 1.79 + mkdir -p $fs/etc/nagios 1.80 + mkdir -p $fs/etc/mysql.d 1.81 + 1.82 + cp -a $install/usr/bin $fs/usr 1.83 + cp -a $install/ndomod.o $fs/usr/lib 1.84 + cp -a $install/etc $fs 1.85 1.86 - cp -a $install/usr/bin $fs/usr 1.87 - cp -a $install/usr/lib $fs/usr 1.88 - cp -a $install/etc $fs 1.89 - 1.90 - # config ndo2db.cfg 1.91 + # configuration file ndo2db.cfg 1.92 sed -i -e 's/ndo2db_user=nagios/ndo2db_user=nagios/' \ 1.93 -e 's/ndo2db_group=nagios/ndo2db_group=nagios/' \ 1.94 -e 's|/usr/local/nagios/var/|/var/run/nagios/|' \ 1.95 -e 's/db_user=ndouser/db_user=root/' \ 1.96 - -e 's/db_pass=ndopassword/db_pass=/' $fs/etc/nagios/ndo2db.cfg 1.97 + -e 's/db_pass=ndopassword/db_pass=/' \ 1.98 + $fs/etc/nagios/ndo2db.cfg 1.99 1.100 - # config ndomod.cfg 1.101 + # configuration file ndomod.cfg 1.102 sed -i -e 's|output=/usr/local/nagios/var/|output=/var/run/nagios/|' \ 1.103 -e 's|buffer_file=/usr/local/nagios/var/|buffer_file=/var/tmp/|' \ 1.104 $fs/etc/nagios/ndomod.cfg 1.105 1.106 - cp -a $src/db/mysql.sql $fs/usr/share/nagios/ndoutils/nagios.sql 1.107 - cp -a stuff/etc $fs 1.108 + cp -a $src/db/mysql.sql \ 1.109 + $fs/usr/share/nagios/ndoutils/nagios.sql 1.110 + cp -a stuff/etc $fs 1.111 1.112 - chmod 755 $fs/usr/bin/* 1.113 - chmod 755 $fs/etc/mysql.d/* 1.114 + chmod 755 $fs/usr/bin/* 1.115 + chmod 755 $fs/etc/mysql.d/* 1.116 } 1.117 1.118 post_install() 1.119 { 1.120 - if ! grep -q nagios "$1/etc/passwd"; then 1.121 + if ! grep -q nagios "$1/etc/passwd" 1.122 + then 1.123 echo 1.124 echo -n "Adding user nagios..." 1.125 chroot "$1/" adduser -S -D -H nagios 1.126 status 1.127 fi 1.128 1.129 - if ! grep -q ndomod.cfg "$1/etc/nagios/nagios.cfg"; then 1.130 + if ! grep -q ndomod.cfg "$1/etc/nagios/nagios.cfg" 1.131 + then 1.132 sed -i '/LOG ROTATION METHOD/i\broker_module=/usr/lib/ndoutils/ndomod.o config_file=/etc/nagios/ndomod.cfg' "$1/etc/nagios/nagios.cfg" 1.133 chroot "$1/" chown nagios.nagios /etc/nagios/nagios.cfg 1.134 fi 1.135 @@ -90,7 +96,8 @@ 1.136 1.137 sed -i "s/nagios/ndo2db nagios/" "$1/etc/rcS.conf" 1.138 1.139 - if [ -z "$1" ]; then 1.140 + if [ -z "$1" ] 1.141 + then 1.142 [ -f /var/run/mysqld/mysql.pid ] || /etc/init.d/mysql start 1.143 /etc/mysql.d/$PACKAGE 1.144 #/usr/bin/ndo2db -c /etc/nagios/ndo2db.cfg