wok diff nagios/receipt @ rev 8520

Up: git to 1.7.4.1.
author Christopher Rogers <slaxemulator@gmail.com>
date Sat Feb 12 12:13:52 2011 +0000 (2011-02-12)
parents
children 1adca870d3e0
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/nagios/receipt	Sat Feb 12 12:13:52 2011 +0000
     1.3 @@ -0,0 +1,102 @@
     1.4 +# SliTaz package receipt.
     1.5 +
     1.6 +PACKAGE="nagios"
     1.7 +VERSION="3.2.3"
     1.8 +CATEGORY="network"
     1.9 +SHORT_DESC="Host and network monitoring"
    1.10 +MAINTAINER="erjo@slitaz.org"
    1.11 +DEPENDS="apache nagios-plugins libpng libjpeg"
    1.12 +BUILD_DEPENDS="libgd-dev libpng-dev libjpeg-dev"
    1.13 +TARBALL="$PACKAGE-$VERSION.tar.gz"
    1.14 +WEB_SITE="http://www.nagios.org/"
    1.15 +WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL"
    1.16 +SUGGESTED="nagios-nrpe"
    1.17 +
    1.18 +# Rules to configure and make the package.
    1.19 +compile_rules()
    1.20 +{
    1.21 +	cd $src
    1.22 +	while read patch_file; do
    1.23 +		if [ ! -f done.$patch_file ]; then
    1.24 +			patch -p1 < ../stuff/$patch_file || exit 1
    1.25 +			touch done.$patch_file
    1.26 +		fi
    1.27 +	done <<EOT
    1.28 +$PACKAGE-$VERSION-Makefiles.u
    1.29 +EOT
    1.30 +	#patch -p1 < ../stuff/nagios-3.2.1-Makefiles.u || exit 1
    1.31 +	./configure \
    1.32 +		--prefix=/usr \
    1.33 +		--infodir=/usr/share/info \
    1.34 +		--mandir=/usr/share/man \
    1.35 +		--with-nagios-user=nagios \
    1.36 +		--with-nagios-group=nagios \
    1.37 +		--with-lockfile=/var/run/nagios/nagios.pid \
    1.38 +		--with-checkresult-dir=/var/spool/nagios/checkresults \
    1.39 +		--sysconfdir=/etc/nagios \
    1.40 +		--with-httpd-conf=/etc/apache/conf.d \
    1.41 +		--libexecdir=/usr/lib/nagios/plugins \
    1.42 +		--sbindir=/usr/lib/nagios/cgi \
    1.43 +		--datadir=/usr/share/nagios \
    1.44 +		--localstatedir=/var/log/nagios \
    1.45 +		$CONFIGURE_ARGS 
    1.46 +		
    1.47 +	make all && make DESTDIR=$PWD/_pkg fullinstall \
    1.48 +	&& make DESTDIR=$PWD/_pkg install-config
    1.49 +}
    1.50 +
    1.51 +# Rules to gen a SliTaz package suitable for Tazpkg.
    1.52 +genpkg_rules()
    1.53 +{
    1.54 +	mkdir -p $fs/usr $fs/etc/init.d \
    1.55 +	  $fs/var/log/nagios/rw \
    1.56 +	  $fs/var/run/nagios \
    1.57 +	  $fs/var/spool/nagios/checkresults \
    1.58 +	  $fs/etc/apache
    1.59 +		
    1.60 +	cp -a $_pkg/etc/apache $fs/etc
    1.61 +	cp -a $_pkg/etc/nagios $fs/etc
    1.62 +	cp -a stuff/nagios  $fs/etc/init.d
    1.63 +	install -o root -g root -m 644 stuff/htpasswd.users  $fs/etc/nagios/
    1.64 +	
    1.65 +	cp -a $_pkg/usr/bin $fs/usr
    1.66 +	cp -a $_pkg/usr/lib $fs/usr
    1.67 +	cp -a $_pkg/usr/share $fs/usr
    1.68 +	
    1.69 +	# Put doc in separate package
    1.70 +	rm -rf $fs/usr/share/nagios/docs
    1.71 +	
    1.72 +	# Fix Apache config for Nagvis
    1.73 +	sed -i 's/Options None/Options FollowSymLinks/' $fs/etc/apache/conf.d/nagios.conf
    1.74 +}
    1.75 +
    1.76 +post_install()
    1.77 +{
    1.78 +	if ! grep -q nagios $1/etc/passwd; then
    1.79 +		echo -n "Adding user/group nagios..."
    1.80 +		chroot $1/ addgroup -S nagios
    1.81 +		chroot $1/ adduser -S -D -H -G nagios nagios
    1.82 +		status
    1.83 +	fi
    1.84 +	
    1.85 +	# Fix perms for files and directories
    1.86 +	chroot $1/ chown -R nagios.nagios /var/log/nagios \
    1.87 +	  /var/run/nagios \
    1.88 +	  /var/spool/nagios \
    1.89 +	  /usr/share/nagios \
    1.90 +	  /etc/nagios/*
    1.91 +	  
    1.92 +	
    1.93 +	chmod 2775 $1/var/log/nagios/rw
    1.94 +	chroot $1/ addgroup www nagios
    1.95 +	
    1.96 +	# Start Nagios daemon if we are  on running system
    1.97 +	[ -z $1 ] && /etc/init.d/nagios start
    1.98 +	
    1.99 +	# post_install messges
   1.100 +	echo -e "\nTo starts $PACKAGE server you can run :\n"
   1.101 +	echo "/etc/init.d/$PACKAGE start"
   1.102 +	echo -e "Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf\n"
   1.103 +	echo -e "Default login/password for the Web GUI is nagiosadmin/nagios"
   1.104 +}
   1.105 +