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: bb-%{version}.tar.gz
11 Patch0: %{name}-pld.patch
15 Requires(pre): /bin/id
16 Requires(pre): /usr/bin/getgid
17 Requires(pre): /usr/sbin/groupadd
18 Requires(pre): /usr/sbin/useradd
19 Requires(post,preun): /sbin/chkconfig
20 Requires(postun): /usr/sbin/groupdel
21 Requires(postun): /usr/sbin/userdel
22 Requires: /usr/bin/setsid
23 Conflicts: iputils-ping < 1:ss020124
24 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
26 %define _etcdir /etc/bb
27 %define _libdir /usr/lib/bb
28 %define _htmldir /home/httpd/html/bb
29 %define _cgidir /home/httpd/cgi-bin
30 %define _vardir /var/lib/bb
31 %define _sysconfdir /etc/dummy
34 Big Brother - network monitoring system.
37 Wielki Brat - monitor systemów i sieci.
71 %{__make} OPTCFLAGS="%{rpmcflags}"
77 for f in bbmv bbprune bbrm ; do
78 sed -e 's@&&BBHOME@%{_libdir}@' $f.DIST > $f
83 rm -rf $RPM_BUILD_ROOT
84 install -d $RPM_BUILD_ROOT{%{_libdir},%{_htmldir}/{html,notes,rep},%{_cgidir},%{_vardir}/tmp} \
85 $RPM_BUILD_ROOT{%{_etcdir},/etc/rc.d/init.d}
87 cp -rf bbvar/* $RPM_BUILD_ROOT%{_vardir}
89 for f in bb-ack.sh bb-hist.sh bb-histlog.sh bb-hostsvc.sh bb-rep.sh bb-replog.sh ; do
90 sed -e 's@&&BBHOME@%{_libdir}@' %{nshort}/web/$f.DIST > $RPM_BUILD_ROOT%{_cgidir}/$f
92 sed -e 's@&BBHOME@%{_libdir}@' %{nshort}/runbb.sh.DIST > $RPM_BUILD_ROOT%{_libdir}/runbb.sh
94 rm -f %{nshort}/web/*.DIST %{nshort}/www/help/*.DIST
96 cp -rf %{nshort}/{bin,ext,web} $RPM_BUILD_ROOT%{_libdir}
97 cp -rf %{nshort}/www/{gifs,gifs-bb13,psy,help} $RPM_BUILD_ROOT%{_htmldir}
99 install %{nshort}/etc/bbchk*.sh $RPM_BUILD_ROOT%{_libdir}/bin
101 ln -sf bb.html $RPM_BUILD_ROOT%{_htmldir}/index.html
102 ln -sf %{_etcdir} $RPM_BUILD_ROOT%{_libdir}/etc
103 ln -sf %{_htmldir} $RPM_BUILD_ROOT%{_libdir}/www
104 ln -sf %{_vardir}/tmp $RPM_BUILD_ROOT%{_libdir}/tmp
105 ln -sf %{_vardir} $RPM_BUILD_ROOT/usr/lib/bbvar
107 for f in bb-bbexttab bb-cputab bb-dftab bb-msgstab bb-proctab security ; do
108 sed -e 's/^[^#]/#\&/' %{nshort}/etc/$f.DIST > $RPM_BUILD_ROOT%{_etcdir}/$f
110 echo '0.0.0.0/0.0.0.0' >> $RPM_BUILD_ROOT%{_etcdir}/security
111 sed -e 's/^[^#]/#\&/' %{nshort}/etc/bb-hosts > $RPM_BUILD_ROOT%{_etcdir}/bb-hosts
112 install %{nshort}/etc/{bbdef.sh,bbinc.sh,bbsys.local,bbsys.sh,bbwarnrules.cfg,bbwarnsetup.cfg,*.scr} \
113 $RPM_BUILD_ROOT%{_etcdir}
115 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/bb
118 rm -rf $RPM_BUILD_ROOT
121 if [ -n "`/usr/bin/getgid bb`" ]; then
122 if [ "`/usr/bin/getgid bb`" != "73" ]; then
123 echo "Error: group bb doesn't have gid=73. Correct this before installing BB." 1>&2
127 /usr/sbin/groupadd -g 73 -r -f bb
129 if [ -n "`/bin/id -u bb 2>/dev/null`" ]; then
130 if [ "`/bin/id -u bb`" != "73" ]; then
131 echo "Error: user bb doesn't have uid=73. Correct this before installing BB." 1>&2
135 /usr/sbin/useradd -u 73 -r -d %{_vardir} -s /bin/sh -c "Big Brother" -g bb -G root,proc,adm bb 1>&2
139 /sbin/chkconfig --add bb
140 if [ -f /var/lock/subsys/bb ]; then
141 /etc/rc.d/init.d/bb restart >&2
143 echo "Run \"/etc/rc.d/init.d/bb start\" to start Big Brother daemon." >&2
147 if [ "$1" = "0" ]; then
148 if [ -f /var/lock/subsys/bb ]; then
149 /etc/rc.d/init.d/bb stop >&2
151 /sbin/chkconfig --del bb
155 if [ "$1" = "0" ]; then
157 /usr/sbin/groupdel bb
161 %defattr(644,root,root,755)
162 %doc %{nshort}/{LICENSE,README,README.CHANGES,README.SECURITY,README.SUPPORT}
164 %config(noreplace) %verify(not size mtime md5) %{_etcdir}/*
165 %attr(755,root,root) %{_cgidir}/*
167 %attr(755,root,root) %{_libdir}/bin
169 %attr(755,root,root) %{_libdir}/ext
170 %dir %attr(755,root,root) %{_libdir}/web
172 %attr(755,root,root) %{_libdir}/web/bb-*
173 %attr(755,root,root) %{_libdir}/web/mk*
176 %attr(755,root,root) %{_libdir}/runbb.sh
178 %attr(775,root,bb) %dir %{_htmldir}
179 %attr(775,root,bb) %{_htmldir}/html
182 %{_htmldir}/index.html
185 %attr(775,root,http) %{_htmldir}/rep
187 %attr(775,root,bb) %{_vardir}/*
188 %attr(754,root,root) /etc/rc.d/init.d/bb