wok-next diff ndoutils/receipt @ rev 20551

Up libmatchbox
author Aleksej Bobylev <al.bobylev@gmail.com>
date Fri Apr 06 03:32:57 2018 +0300 (2018-04-06)
parents 9e01bc6321ea
children d6378d455338
line diff
     1.1 --- a/ndoutils/receipt	Sun Dec 20 15:13:45 2015 +0100
     1.2 +++ b/ndoutils/receipt	Fri Apr 06 03:32:57 2018 +0300
     1.3 @@ -1,24 +1,19 @@
     1.4 -# SliTaz package receipt.
     1.5 +# SliTaz package receipt v2.
     1.6  
     1.7  PACKAGE="ndoutils"
     1.8  VERSION="1.5.2"
     1.9  CATEGORY="network"
    1.10 -SHORT_DESC="Provide mysql access to nagios."
    1.11 +SHORT_DESC="Provide mysql access to nagios"
    1.12  MAINTAINER="pascal.bellard@slitaz.org"
    1.13  LICENSE="GPL2"
    1.14 +WEB_SITE="http://www.nagios.org/"
    1.15 +
    1.16  TARBALL="$PACKAGE-$VERSION.tar.gz"
    1.17 -WEB_SITE="http://www.nagios.org/"
    1.18  WGET_URL="$SF_MIRROR/nagios/$TARBALL"
    1.19 -CONFIG_FILES="/etc/nagios"
    1.20  
    1.21 -DEPENDS="nagios mysql"
    1.22  BUILD_DEPENDS="mysql-dev"
    1.23  
    1.24 -# Rules to configure and make the package.
    1.25 -compile_rules()
    1.26 -{
    1.27 -	cd $src
    1.28 -	
    1.29 +compile_rules() {
    1.30  	while read patch_file; do
    1.31  		if [ ! -f done.$patch_file ]; then
    1.32  			patch -p1 < $stuff/$patch_file || exit 1
    1.33 @@ -28,21 +23,19 @@
    1.34  $PACKAGE-$VERSION-Makefiles.in.u
    1.35  EOT
    1.36  
    1.37 -	./configure --prefix=/usr \
    1.38 -	--with-ndo2db-user=nagios \
    1.39 -	--with-ndo2db-group=nagios \
    1.40 -	--localstatedir=/var/run/nagios \
    1.41 -	--sysconfdir=/etc/nagios \
    1.42 -	--libexecdir=/usr/lib/$PACKAGE \
    1.43 -	--mandir=/usr/share/man $CONFIGURE_ARGS &&
    1.44 -	make && \
    1.45 -	make DESTDIR=$DESTDIR install && \
    1.46 +	./configure \
    1.47 +		--with-ndo2db-user=nagios \
    1.48 +		--with-ndo2db-group=nagios \
    1.49 +		--localstatedir=/var/run/nagios \
    1.50 +		--sysconfdir=/etc/nagios \
    1.51 +		--libexecdir=/usr/lib/$PACKAGE \
    1.52 +		$CONFIGURE_ARGS &&
    1.53 +	make &&
    1.54 +	make DESTDIR=$DESTDIR install &&
    1.55  	make DESTDIR=$DESTDIR install-config
    1.56 -}	
    1.57 +}
    1.58  
    1.59 -# Rules to gen a SliTaz package suitable for Tazpkg.
    1.60 -genpkg_rules()
    1.61 -{
    1.62 +genpkg_rules() {
    1.63  	mkdir -p $fs/usr/share/nagios/ndoutils \
    1.64  		$fs/etc/nagios \
    1.65  		$fs/etc/mysql.d
    1.66 @@ -68,46 +61,44 @@
    1.67  	
    1.68  	chmod 755 $fs/usr/bin/*
    1.69  	chmod 755 $fs/etc/mysql.d/*
    1.70 +	DEPENDS="nagios mysql"
    1.71 +	CONFIG_FILES="/etc/nagios"
    1.72  }
    1.73  
    1.74 -post_install()
    1.75 -{
    1.76 +post_install() {
    1.77  	if ! grep -q nagios "$1/etc/passwd"; then
    1.78 -		echo -n "Adding user nagios..."
    1.79  		chroot "$1/" adduser -S -D -H nagios
    1.80 -		status
    1.81  	fi
    1.82 -		
    1.83 +
    1.84  	if ! grep -q ndomod.cfg "$1/etc/nagios/nagios.cfg"; then
    1.85  		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.86  		chroot "$1/" chown nagios.nagios /etc/nagios/nagios.cfg
    1.87  	fi
    1.88 -	
    1.89 -	chroot "$1/" chown nagios.nagios /usr/lib/ndoutils/ndomod.o \
    1.90 -	 /etc/nagios/ndo2db.cfg /etc/nagios/ndomod.cfg \
    1.91 -	 /etc/nagios
    1.92 +
    1.93 +	chroot "$1/" chown nagios.nagios \
    1.94 +		/usr/lib/ndoutils/ndomod.o \
    1.95 +		/etc/nagios/ndo2db.cfg \
    1.96 +		/etc/nagios/ndomod.cfg \
    1.97 +		/etc/nagios
    1.98  
    1.99  	sed -i "s/nagios/ndo2db nagios/" "$1/etc/rcS.conf"
   1.100 -	
   1.101 -	if [ -z "$1" ]; then	
   1.102 +
   1.103 +	if [ -z "$1" ]; then
   1.104  		[ -f /var/run/mysqld/mysql.pid ] || /etc/init.d/mysql start
   1.105 -		/etc/mysql.d/$PACKAGE    
   1.106 +		/etc/mysql.d/$PACKAGE
   1.107  		#/usr/bin/ndo2db -c /etc/nagios/ndo2db.cfg
   1.108  		/etc/init.d/ndo2db start
   1.109  		/etc/init.d/nagios stop
   1.110  		/etc/init.d/nagios start
   1.111 -
   1.112 -	fi	
   1.113 +	fi
   1.114  }
   1.115  
   1.116 -pre_remove()
   1.117 -{
   1.118 +pre_remove() {
   1.119  	/etc/init.d/ndo2db stop
   1.120  }
   1.121  
   1.122 -post_remove()
   1.123 -{
   1.124 -		sed -i "s/ndo2db//" "$1/etc/rcS.conf"
   1.125 -		/etc/init.d/nagios restart
   1.126 -		sed -i 's|broker_module=/usr/lib/ndoutils/ndomod.o config_file=/etc/nagios/ndomod.cfg||' "$1/etc/nagios/nagios.cfg"
   1.127 +post_remove() {
   1.128 +	sed -i "s/ndo2db//" "$1/etc/rcS.conf"
   1.129 +	/etc/init.d/nagios restart
   1.130 +	sed -i 's|broker_module=/usr/lib/ndoutils/ndomod.o config_file=/etc/nagios/ndomod.cfg||' "$1/etc/nagios/nagios.cfg"
   1.131  }