wok-next view 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 source
1 # SliTaz package receipt v2.
3 PACKAGE="nagios"
4 VERSION="3.5.0"
5 CATEGORY="network"
6 SHORT_DESC="Host and network monitoring"
7 MAINTAINER="erjo@slitaz.org"
8 LICENSE="GPL2"
9 WEB_SITE="http://www.nagios.org/"
11 TARBALL="$PACKAGE-$VERSION.tar.gz"
12 WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL"
14 BUILD_DEPENDS="libgd-dev libpng16-dev jpeg-dev libtool"
15 SPLIT="nagios-dev"
17 compile_rules() {
18 ./configure \
19 --prefix=/usr \
20 --infodir=/usr/share/info \
21 --mandir=/usr/share/man \
22 --with-nagios-user=nagios \
23 --with-nagios-group=nagios \
24 --with-lockfile=/var/run/nagios/nagios.pid \
25 --with-checkresult-dir=/var/spool/nagios/checkresults \
26 --sysconfdir=/etc/nagios \
27 --with-httpd-conf=/etc/apache/conf.d \
28 --libexecdir=/usr/lib/nagios/plugins \
29 --sbindir=/usr/lib/nagios/cgi \
30 --datadir=/usr/share/nagios \
31 --localstatedir=/var/lib/nagios \
32 $CONFIGURE_ARGS &&
33 sed -i 's!HTMLDIR=.*!HTMLDIR=/usr/share/nagios!' html/Makefile &&
35 #~ make all && make DESTDIR=$DESTDIR fullinstall \
36 #~ && make DESTDIR=$DESTDIR install-config
37 make all &&
38 make install &&
39 make install-config &&
40 make install-commandmode &&
41 make install-webconf &&
42 make install-classicui
43 }
45 genpkg_rules() {
46 case $PACKAGE in
47 nagios)
48 mkdir -p $fs/usr $fs/etc/init.d \
49 $fs/var/lib/nagios/rw \
50 $fs/var/log/nagios \
51 $fs/var/spool/nagios/checkresults \
52 $fs/etc/apache
54 cp -a $install/etc/apache $fs/etc
55 cp -a $install/etc/nagios $fs/etc
56 cp -a $stuff/nagios $fs/etc/init.d
57 install -m644 $stuff/htpasswd.users $fs/etc/nagios/
59 cp -a $install/usr/bin $fs/usr
60 cp -a $install/usr/lib $fs/usr
61 cp -a $install/usr/share $fs/usr
63 # Put doc in separate package
64 rm -rf $fs/usr/share/nagios/docs
66 # Fix Apache config for Nagvis
67 sed -i 's/Options None/Options FollowSymLinks/' $fs/etc/apache/conf.d/nagios.conf
69 # Fix permissions
70 chmod 755 $fs/usr/bin/nagios*
71 DEPENDS="apache nagios-plugins libpng16 libjpeg libltdl"
72 SUGGESTED="nagios-nrpe"
73 ;;
74 nagios-dev)
75 mkdir -p $fs/usr
76 cp -pa $src/include $fs/usr
77 ;;
78 esac
79 }
81 post_install_nagios() {
82 if ! grep -q nagios "$1/etc/passwd"; then
83 echo -n "Adding user/group nagios..."
84 chroot "$1/" addgroup -S nagios
85 chroot "$1/" adduser -S -D -H -G nagios nagios
86 status
87 fi
89 # Fix perms for files and directories
90 chroot "$1/" chown -R nagios.nagios /var/log/nagios \
91 /var/spool/nagios \
92 /var/lib/nagios \
93 /usr/share/nagios \
94 /etc/nagios/*
96 chmod 2775 "$1/var/lib/nagios/rw"
97 chroot "$1/" addgroup www nagios
99 # Start Nagios daemon if we are on running system
100 [ "$1" ] || /etc/init.d/nagios start
102 # post_install messages
103 [ -n "$quiet" ] || cat <<EOT
105 .--------------------------------------------------------------.
106 | To starts nagios server you can run: |
107 | /etc/init.d/$PACKAGE start |
108 | |
109 | Or add nagios to RUN_DAEMONS in /etc/rcS.conf |
110 |--------------------------------------------------------------|
111 | Default login/password for the Web GUI is nagiosadmin/nagios |
112 '--------------------------------------------------------------'
113 EOT
114 }
116 pre_remove_nagios() {
117 [ "$1" ] || /etc/init.d/nagios stop
118 }