1 Summary: Big Brother System and Network Monitor
2 Summary(pl): Wielki Brat - monitor systemów i sieci
7 License: Free for non-commercial use, 30-day trial for commercial use; not distributable
9 Source0: http://bb4.com/dnld/bb-%{version}.tar.gz
11 Patch0: %{name}-pld.patch
14 Prereq: /usr/sbin/groupadd
15 Prereq: /usr/sbin/useradd
16 Prereq: /usr/sbin/groupdel
17 Prereq: /usr/sbin/userdel
19 Prereq: /usr/bin/getgid
20 Prereq: /sbin/chkconfig
22 Requires: /usr/bin/setsid
23 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
25 %define _etcdir /etc/bb
26 %define _libdir /usr/lib/bb
27 %define _htmldir /home/httpd/html/bb
28 %define _cgidir /home/httpd/cgi-bin
29 %define _vardir /var/lib/bb
30 %define _sysconfdir /etc/dummy
33 Big Brother - network monitoring system.
36 Wielki Brat - monitor systemów i sieci.
70 %{__make} OPTCFLAGS="%{rpmcflags}"
76 for f in bbmv bbprune bbrm ; do
77 sed -e 's@&&BBHOME@%{_libdir}@' $f.DIST > $f
82 rm -rf $RPM_BUILD_ROOT
83 install -d $RPM_BUILD_ROOT{%{_libdir},%{_htmldir}/{html,notes,rep},%{_cgidir},%{_vardir}/tmp} \
84 $RPM_BUILD_ROOT{%{_etcdir},/etc/rc.d/init.d}
86 cp -rf bbvar/* $RPM_BUILD_ROOT%{_vardir}
88 for f in bb-ack.sh bb-hist.sh bb-histlog.sh bb-hostsvc.sh bb-rep.sh bb-replog.sh ; do
89 sed -e 's@&&BBHOME@%{_libdir}@' %{nshort}/web/$f.DIST > $RPM_BUILD_ROOT%{_cgidir}/$f
91 sed -e 's@&BBHOME@%{_libdir}@' %{nshort}/runbb.sh.DIST > $RPM_BUILD_ROOT%{_libdir}/runbb.sh
93 rm -f %{nshort}/web/*.DIST %{nshort}/www/help/*.DIST
95 cp -rf %{nshort}/{bin,ext,web} $RPM_BUILD_ROOT%{_libdir}
96 cp -rf %{nshort}/www/{gifs,gifs-bb13,psy,help} $RPM_BUILD_ROOT%{_htmldir}
98 install %{nshort}/etc/bbchk*.sh $RPM_BUILD_ROOT%{_libdir}/bin
100 ln -sf bb.html $RPM_BUILD_ROOT%{_htmldir}/index.html
101 ln -sf %{_etcdir} $RPM_BUILD_ROOT%{_libdir}/etc
102 ln -sf %{_htmldir} $RPM_BUILD_ROOT%{_libdir}/www
103 ln -sf %{_vardir}/tmp $RPM_BUILD_ROOT%{_libdir}/tmp
104 ln -sf %{_vardir} $RPM_BUILD_ROOT/usr/lib/bbvar
106 for f in bb-bbexttab bb-cputab bb-dftab bb-msgstab bb-proctab security ; do
107 sed -e 's/^[^#]/#\&/' %{nshort}/etc/$f.DIST > $RPM_BUILD_ROOT%{_etcdir}/$f
109 echo '0.0.0.0/0.0.0.0' >> $RPM_BUILD_ROOT%{_etcdir}/security
110 sed -e 's/^[^#]/#\&/' %{nshort}/etc/bb-hosts > $RPM_BUILD_ROOT%{_etcdir}/bb-hosts
111 install %{nshort}/etc/{bbdef.sh,bbinc.sh,bbsys.local,bbsys.sh,bbwarnrules.cfg,bbwarnsetup.cfg,*.scr} \
112 $RPM_BUILD_ROOT%{_etcdir}
114 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/bb
117 gzip -9nf LICENSE README README.CHANGES README.SECURITY README.SUPPORT
120 rm -rf $RPM_BUILD_ROOT
123 if [ -n "`/usr/bin/getgid bb`" ]; then
124 if [ "`/usr/bin/getgid bb`" != "73" ]; then
125 echo "Warning: group bb haven't gid=73. Correct this before installing bb" 1>&2
129 /usr/sbin/groupadd -g 73 -r -f bb
131 if [ -n "`/bin/id -u bb 2>/dev/null`" ]; then
132 if [ "`/bin/id -u bb`" != "73" ]; then
133 echo "Warning: user bb haven't uid=73. Correct this before installing bb" 1>&2
137 /usr/sbin/useradd -u 73 -r -d %{_vardir} -s /bin/sh -c "Big Brother" -g bb -G root,proc,adm bb 1>&2
141 /sbin/chkconfig --add bb
142 if [ -f /var/lock/subsys/bb ]; then
143 /etc/rc.d/init.d/bb restart >&2
145 echo "Run \"/etc/rc.d/init.d/bb start\" to start Big Brother daemon." >&2
149 if [ "$1" = "0" ]; then
150 if [ -f /var/lock/subsys/bb ]; then
151 /etc/rc.d/init.d/bb stop >&2
153 /sbin/chkconfig --del bb
157 if [ "$1" = "0" ]; then
159 /usr/sbin/groupdel bb
163 %defattr(644,root,root,755)
166 %config(noreplace) %verify(not size mtime md5) %{_etcdir}/*
167 %attr(755,root,root) %{_cgidir}/*
169 %attr(755,root,root) %{_libdir}/bin
171 %attr(755,root,root) %{_libdir}/ext
172 %dir %attr(755,root,root) %{_libdir}/web
174 %attr(755,root,root) %{_libdir}/web/bb-*
175 %attr(755,root,root) %{_libdir}/web/mk*
178 %attr(755,root,root) %{_libdir}/runbb.sh
180 %attr(775,root,bb) %dir %{_htmldir}
181 %attr(775,root,bb) %{_htmldir}/html
184 %{_htmldir}/index.html
187 %attr(775,root,http) %{_htmldir}/rep
189 %attr(775,root,bb) %{_vardir}/*
190 %attr(754,root,root) /etc/rc.d/init.d/bb