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 Group(de): Netzwerkwesen
13 Source0: http://bb4.com/dnld/bb-%{version}.tar.gz
15 Patch0: %{name}-pld.patch
18 Prereq: /usr/sbin/groupadd
19 Prereq: /usr/sbin/useradd
20 Prereq: /usr/sbin/groupdel
21 Prereq: /usr/sbin/userdel
23 Prereq: /usr/bin/getgid
24 Prereq: /sbin/chkconfig
26 Requires: /usr/bin/setsid
27 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
29 %define _etcdir /etc/bb
30 %define _libdir /usr/lib/bb
31 %define _htmldir /home/httpd/html/bb
32 %define _cgidir /home/httpd/cgi-bin
33 %define _vardir /var/lib/bb
34 %define _sysconfdir /etc/dummy
37 Big Brother - network monitoring system.
40 Wielki Brat - monitor systemów i sieci.
74 %{__make} OPTCFLAGS="%{rpmcflags}"
80 for f in bbmv bbprune bbrm ; do
81 sed -e 's@&&BBHOME@%{_libdir}@' $f.DIST > $f
86 rm -rf $RPM_BUILD_ROOT
87 install -d $RPM_BUILD_ROOT{%{_libdir},%{_htmldir}/{html,notes,rep},%{_cgidir},%{_vardir}/tmp} \
88 $RPM_BUILD_ROOT{%{_etcdir},/etc/rc.d/init.d}
90 cp -rf bbvar/* $RPM_BUILD_ROOT%{_vardir}
92 for f in bb-ack.sh bb-hist.sh bb-histlog.sh bb-hostsvc.sh bb-rep.sh bb-replog.sh ; do
93 sed -e 's@&&BBHOME@%{_libdir}@' %{nshort}/web/$f.DIST > $RPM_BUILD_ROOT%{_cgidir}/$f
95 sed -e 's@&BBHOME@%{_libdir}@' %{nshort}/runbb.sh.DIST > $RPM_BUILD_ROOT%{_libdir}/runbb.sh
97 rm -f %{nshort}/web/*.DIST %{nshort}/www/help/*.DIST
99 cp -rf %{nshort}/{bin,ext,web} $RPM_BUILD_ROOT%{_libdir}
100 cp -rf %{nshort}/www/{gifs,gifs-bb13,psy,help} $RPM_BUILD_ROOT%{_htmldir}
102 install %{nshort}/etc/bbchk*.sh $RPM_BUILD_ROOT%{_libdir}/bin
104 ln -sf bb.html $RPM_BUILD_ROOT%{_htmldir}/index.html
105 ln -sf %{_etcdir} $RPM_BUILD_ROOT%{_libdir}/etc
106 ln -sf %{_htmldir} $RPM_BUILD_ROOT%{_libdir}/www
107 ln -sf %{_vardir}/tmp $RPM_BUILD_ROOT%{_libdir}/tmp
108 ln -sf %{_vardir} $RPM_BUILD_ROOT/usr/lib/bbvar
110 for f in bb-bbexttab bb-cputab bb-dftab bb-msgstab bb-proctab security ; do
111 sed -e 's/^[^#]/#\&/' %{nshort}/etc/$f.DIST > $RPM_BUILD_ROOT%{_etcdir}/$f
113 echo '0.0.0.0/0.0.0.0' >> $RPM_BUILD_ROOT%{_etcdir}/security
114 sed -e 's/^[^#]/#\&/' %{nshort}/etc/bb-hosts > $RPM_BUILD_ROOT%{_etcdir}/bb-hosts
115 install %{nshort}/etc/{bbdef.sh,bbinc.sh,bbsys.local,bbsys.sh,bbwarnrules.cfg,bbwarnsetup.cfg,*.scr} \
116 $RPM_BUILD_ROOT%{_etcdir}
118 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/bb
121 gzip -9nf LICENSE README README.CHANGES README.SECURITY README.SUPPORT
124 rm -rf $RPM_BUILD_ROOT
127 if [ -n "`/usr/bin/getgid bb`" ]; then
128 if [ "`/usr/bin/getgid bb`" != "73" ]; then
129 echo "Warning: group bb haven't gid=73. Correct this before installing bb" 1>&2
133 /usr/sbin/groupadd -g 73 -r -f bb
135 if [ -n "`/bin/id -u bb 2>/dev/null`" ]; then
136 if [ "`/bin/id -u bb`" != "73" ]; then
137 echo "Warning: user bb haven't uid=73. Correct this before installing bb" 1>&2
141 /usr/sbin/useradd -u 73 -r -d %{_vardir} -s /bin/sh -c "Big Brother" -g bb -G root,proc,adm bb 1>&2
145 /sbin/chkconfig --add bb
146 if [ -f /var/lock/subsys/bb ]; then
147 /etc/rc.d/init.d/bb restart >&2
149 echo "Run \"/etc/rc.d/init.d/bb start\" to start Big Brother daemon." >&2
153 if [ "$1" = "0" ]; then
154 if [ -f /var/lock/subsys/bb ]; then
155 /etc/rc.d/init.d/bb stop >&2
157 /sbin/chkconfig --del bb
161 if [ "$1" = "0" ]; then
163 /usr/sbin/groupdel bb
167 %defattr(644,root,root,755)
170 %config(noreplace) %verify(not size mtime md5) %{_etcdir}/*
171 %attr(755,root,root) %{_cgidir}/*
173 %attr(755,root,root) %{_libdir}/bin
175 %attr(755,root,root) %{_libdir}/ext
176 %dir %attr(755,root,root) %{_libdir}/web
178 %attr(755,root,root) %{_libdir}/web/bb-*
179 %attr(755,root,root) %{_libdir}/web/mk*
182 %attr(755,root,root) %{_libdir}/runbb.sh
184 %attr(775,root,bb) %dir %{_htmldir}
185 %attr(775,root,bb) %{_htmldir}/html
188 %{_htmldir}/index.html
191 %attr(775,root,http) %{_htmldir}/rep
193 %attr(775,root,bb) %{_vardir}/*
194 %attr(754,root,root) /etc/rc.d/init.d/bb