2 Summary: Big Brother System and Network Monitor
3 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
14 BuildRequires: rpmbuild(macros) >= 1.268
15 Requires(post,preun): /sbin/chkconfig
16 Requires(postun): /usr/sbin/groupdel
17 Requires(postun): /usr/sbin/userdel
18 Requires(pre): /bin/id
19 Requires(pre): /usr/bin/getgid
20 Requires(pre): /usr/sbin/groupadd
21 Requires(pre): /usr/sbin/useradd
22 Requires: /usr/bin/setsid
26 Conflicts: iputils-ping < 1:ss020124
27 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
29 %define _etcdir /etc/bb
30 %define _libdir /usr/lib/bb
31 %define _htmldir /home/services/httpd/html/bb
32 %define _cgidir /home/services/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%{_prefix}/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 rm -rf $RPM_BUILD_ROOT
125 %useradd -u 73 -d %{_vardir} -s /bin/sh -c "Big Brother" -g bb -G root,proc,adm bb
128 /sbin/chkconfig --add bb
129 %service bb restart "Big Brother daemon"
132 if [ "$1" = "0" ]; then
134 /sbin/chkconfig --del bb
138 if [ "$1" = "0" ]; then
144 %defattr(644,root,root,755)
145 %doc %{nshort}/{LICENSE,README,README.CHANGES,README.SECURITY,README.SUPPORT}
147 %config(noreplace) %verify(not md5 mtime size) %{_etcdir}/*
148 %attr(755,root,root) %{_cgidir}/*
150 %attr(755,root,root) %{_libdir}/bin
152 %attr(755,root,root) %{_libdir}/ext
155 %attr(755,root,root) %{_libdir}/web/bb-*
156 %attr(755,root,root) %{_libdir}/web/mk*
159 %attr(755,root,root) %{_libdir}/runbb.sh
161 %attr(775,root,bb) %dir %{_htmldir}
162 %attr(775,root,bb) %{_htmldir}/html
165 %{_htmldir}/index.html
168 %attr(775,root,http) %{_htmldir}/rep
170 %attr(775,root,bb) %{_vardir}/*
171 %attr(754,root,root) /etc/rc.d/init.d/bb