wok-next diff nagios/receipt @ rev 20463

Combine receipts
author Aleksej Bobylev <al.bobylev@gmail.com>
date Tue Mar 06 11:29:35 2018 +0200 (2018-03-06)
parents dd145c435e4b
children b278b2018965
line diff
     1.1 --- a/nagios/receipt	Wed Feb 28 17:32:31 2018 +0200
     1.2 +++ b/nagios/receipt	Tue Mar 06 11:29:35 2018 +0200
     1.3 @@ -1,4 +1,4 @@
     1.4 -# SliTaz package receipt.
     1.5 +# SliTaz package receipt v2.
     1.6  
     1.7  PACKAGE="nagios"
     1.8  VERSION="3.5.0"
     1.9 @@ -6,26 +6,15 @@
    1.10  SHORT_DESC="Host and network monitoring"
    1.11  MAINTAINER="erjo@slitaz.org"
    1.12  LICENSE="GPL2"
    1.13 +WEB_SITE="http://www.nagios.org/"
    1.14 +
    1.15  TARBALL="$PACKAGE-$VERSION.tar.gz"
    1.16 -WEB_SITE="http://www.nagios.org/"
    1.17  WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL"
    1.18 -SUGGESTED="nagios-nrpe"
    1.19  
    1.20 -DEPENDS="apache nagios-plugins libpng16 libjpeg libltdl"
    1.21  BUILD_DEPENDS="libgd-dev libpng16-dev jpeg-dev libtool"
    1.22 +SPLIT="nagios-dev"
    1.23  
    1.24 -# Rules to configure and make the package.
    1.25 -compile_rules()
    1.26 -{
    1.27 -	cd $src
    1.28 -	while read patch_file; do
    1.29 -		if [ ! -f done.$patch_file ]; then
    1.30 -			patch -p1 < $stuff/$patch_file || return 1
    1.31 -			touch done.$patch_file
    1.32 -		fi
    1.33 -	done <<EOT
    1.34 -$PACKAGE-$VERSION-Makefiles.u
    1.35 -EOT
    1.36 +compile_rules() {
    1.37  	./configure \
    1.38  		--prefix=/usr \
    1.39  		--infodir=/usr/share/info \
    1.40 @@ -40,79 +29,90 @@
    1.41  		--sbindir=/usr/lib/nagios/cgi \
    1.42  		--datadir=/usr/share/nagios \
    1.43  		--localstatedir=/var/lib/nagios \
    1.44 -		$CONFIGURE_ARGS 
    1.45 -		
    1.46 -	sed -i s!HTMLDIR=.*!HTMLDIR=/usr/share/nagios! html/Makefile
    1.47 -	
    1.48 +		$CONFIGURE_ARGS &&
    1.49 +	sed -i 's!HTMLDIR=.*!HTMLDIR=/usr/share/nagios!' html/Makefile &&
    1.50 +
    1.51  	#~ make all && make DESTDIR=$DESTDIR fullinstall \
    1.52  	#~ && make DESTDIR=$DESTDIR install-config
    1.53 -	make all && make install \
    1.54 -	&& make install-config \
    1.55 -	&& make install-commandmode \
    1.56 -	&& make install-webconf \
    1.57 -	&& make install-classicui 
    1.58 -	
    1.59 +	make all &&
    1.60 +	make install &&
    1.61 +	make install-config &&
    1.62 +	make install-commandmode &&
    1.63 +	make install-webconf &&
    1.64 +	make install-classicui
    1.65  }
    1.66  
    1.67 -# Rules to gen a SliTaz package suitable for Tazpkg.
    1.68 -genpkg_rules()
    1.69 -{
    1.70 -	mkdir -p $fs/usr $fs/etc/init.d \
    1.71 -	  $fs/var/lib/nagios/rw \
    1.72 -	  $fs/var/log/nagios \
    1.73 -	  $fs/var/spool/nagios/checkresults \
    1.74 -	  $fs/etc/apache
    1.75 -		
    1.76 -	cp -a $install/etc/apache $fs/etc
    1.77 -	cp -a $install/etc/nagios $fs/etc
    1.78 -	cp -a $stuff/nagios  $fs/etc/init.d
    1.79 -	install -o root -g root -m 644 $stuff/htpasswd.users  $fs/etc/nagios/
    1.80 -	
    1.81 -	cp -a $install/usr/bin $fs/usr
    1.82 -	cp -a $install/usr/lib $fs/usr
    1.83 -	cp -a $install/usr/share $fs/usr
    1.84 -	
    1.85 -	# Put doc in separate package
    1.86 -	rm -rf $fs/usr/share/nagios/docs
    1.87 -	
    1.88 -	# Fix Apache config for Nagvis
    1.89 -	sed -i 's/Options None/Options FollowSymLinks/' $fs/etc/apache/conf.d/nagios.conf
    1.90 -	
    1.91 -	# Fix permissions 
    1.92 -	chmod 755 $fs/usr/bin/nagios*
    1.93 +genpkg_rules() {
    1.94 +	case $PACKAGE in
    1.95 +		nagios)
    1.96 +			mkdir -p $fs/usr $fs/etc/init.d \
    1.97 +				$fs/var/lib/nagios/rw \
    1.98 +				$fs/var/log/nagios \
    1.99 +				$fs/var/spool/nagios/checkresults \
   1.100 +				$fs/etc/apache
   1.101 +
   1.102 +			cp -a $install/etc/apache $fs/etc
   1.103 +			cp -a $install/etc/nagios $fs/etc
   1.104 +			cp -a $stuff/nagios  $fs/etc/init.d
   1.105 +			install -m644 $stuff/htpasswd.users $fs/etc/nagios/
   1.106 +
   1.107 +			cp -a $install/usr/bin $fs/usr
   1.108 +			cp -a $install/usr/lib $fs/usr
   1.109 +			cp -a $install/usr/share $fs/usr
   1.110 +
   1.111 +			# Put doc in separate package
   1.112 +			rm -rf $fs/usr/share/nagios/docs
   1.113 +
   1.114 +			# Fix Apache config for Nagvis
   1.115 +			sed -i 's/Options None/Options FollowSymLinks/' $fs/etc/apache/conf.d/nagios.conf
   1.116 +
   1.117 +			# Fix permissions 
   1.118 +			chmod 755 $fs/usr/bin/nagios*
   1.119 +			DEPENDS="apache nagios-plugins libpng16 libjpeg libltdl"
   1.120 +			SUGGESTED="nagios-nrpe"
   1.121 +			;;
   1.122 +		nagios-dev)
   1.123 +			mkdir -p $fs/usr
   1.124 +			cp -pa $src/include $fs/usr
   1.125 +			;;
   1.126 +	esac
   1.127  }
   1.128  
   1.129 -post_install()
   1.130 -{
   1.131 +post_install_nagios() {
   1.132  	if ! grep -q nagios "$1/etc/passwd"; then
   1.133  		echo -n "Adding user/group nagios..."
   1.134  		chroot "$1/" addgroup -S nagios
   1.135  		chroot "$1/" adduser -S -D -H -G nagios nagios
   1.136  		status
   1.137  	fi
   1.138 -	
   1.139 +
   1.140  	# Fix perms for files and directories
   1.141  	chroot "$1/" chown -R nagios.nagios /var/log/nagios \
   1.142 -	  /var/spool/nagios \
   1.143 -	  /var/lib/nagios \
   1.144 -	  /usr/share/nagios \
   1.145 -	  /etc/nagios/*
   1.146 -	  
   1.147 -	
   1.148 +		/var/spool/nagios \
   1.149 +		/var/lib/nagios \
   1.150 +		/usr/share/nagios \
   1.151 +		/etc/nagios/*
   1.152 +
   1.153  	chmod 2775 "$1/var/lib/nagios/rw"
   1.154  	chroot "$1/" addgroup www nagios
   1.155 -	
   1.156 +
   1.157  	# Start Nagios daemon if we are  on running system
   1.158  	[ "$1" ] || /etc/init.d/nagios start
   1.159 -	
   1.160 -	# post_install messges
   1.161 -	echo -e "\nTo starts $PACKAGE server you can run :\n"
   1.162 -	echo "/etc/init.d/$PACKAGE start"
   1.163 -	echo -e "Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf\n"
   1.164 -	echo -e "Default login/password for the Web GUI is nagiosadmin/nagios"
   1.165 +
   1.166 +	# post_install messages
   1.167 +	[ -n "$quiet" ] || cat <<EOT
   1.168 +
   1.169 +	.--------------------------------------------------------------.
   1.170 +	| To starts nagios server you can run:                         |
   1.171 +	| /etc/init.d/$PACKAGE start                                   |
   1.172 +	|                                                              |
   1.173 +	| Or add nagios to RUN_DAEMONS in /etc/rcS.conf                |
   1.174 +	|--------------------------------------------------------------|
   1.175 +	| Default login/password for the Web GUI is nagiosadmin/nagios |
   1.176 +	'--------------------------------------------------------------'
   1.177 +EOT
   1.178  }
   1.179  
   1.180 -pre_remove()
   1.181 -{
   1.182 +pre_remove_nagios() {
   1.183  	[ "$1" ] || /etc/init.d/nagios stop
   1.184  }