+# TODO: webapps
+%define nshort bb18d
Summary: Big Brother System and Network Monitor
-Summary(pl): Wielki Brat - monitor systemów i sieci
+Summary(pl.UTF-8): Wielki Brat - monitor systemów i sieci
Name: bb4
Version: 1.8d
-%define nshort bb18d
-Release: 1
-License: free for non commercial use, 30-day trial for commercial use; not distributable
+Release: 2
+License: Free for non-commercial use, 30-day trial for commercial use; not distributable
Group: Networking
-Group(de): Netzwerkwesen
-Group(es): Red
-Group(pl): Sieciowe
-Group(pt_BR): Rede
-Source0: http://bb4.com/dnld/bb-%{version}.tar.gz
+Source0: bb-%{version}.tar.gz
Source1: %{name}.init
Patch0: %{name}-pld.patch
NoSource: 0
URL: http://bb4.com/
-Prereq: /usr/sbin/groupadd
-Prereq: /usr/sbin/useradd
-Prereq: /usr/sbin/groupdel
-Prereq: /usr/sbin/userdel
-Prereq: /bin/id
-Prereq: /usr/bin/getgid
-Prereq: /sbin/chkconfig
-Prereq: rc-scripts
+BuildRequires: rpmbuild(macros) >= 1.268
+Requires(post,preun): /sbin/chkconfig
+Requires(postun): /usr/sbin/groupdel
+Requires(postun): /usr/sbin/userdel
+Requires(pre): /bin/id
+Requires(pre): /usr/bin/getgid
+Requires(pre): /usr/sbin/groupadd
+Requires(pre): /usr/sbin/useradd
Requires: /usr/bin/setsid
+Requires: rc-scripts
+Provides: group(bb)
+Provides: user(bb)
+Conflicts: iputils-ping < 1:ss020124
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%define _etcdir /etc/bb
%define _libdir /usr/lib/bb
-%define _htmldir /home/httpd/html/bb
-%define _cgidir /home/httpd/cgi-bin
+%define _htmldir /home/services/httpd/html/bb
+%define _cgidir /home/services/httpd/cgi-bin
%define _vardir /var/lib/bb
%define _sysconfdir /etc/dummy
%description
Big Brother - network monitoring system.
-%description -l pl
-Wielki Brat - monitor systemów i sieci.
+%description -l pl.UTF-8
+Wielki Brat - monitor systemów i sieci.
%prep
%setup -q -c
tar xf %{nshort}.tar
-%patch -p1
+%patch0 -p1
%build
cd %{nshort}
ln -sf %{_etcdir} $RPM_BUILD_ROOT%{_libdir}/etc
ln -sf %{_htmldir} $RPM_BUILD_ROOT%{_libdir}/www
ln -sf %{_vardir}/tmp $RPM_BUILD_ROOT%{_libdir}/tmp
-ln -sf %{_vardir} $RPM_BUILD_ROOT/usr/lib/bbvar
+ln -sf %{_vardir} $RPM_BUILD_ROOT%{_prefix}/lib/bbvar
for f in bb-bbexttab bb-cputab bb-dftab bb-msgstab bb-proctab security ; do
sed -e 's/^[^#]/#\&/' %{nshort}/etc/$f.DIST > $RPM_BUILD_ROOT%{_etcdir}/$f
install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/bb
-cd %{nshort}
-gzip -9nf LICENSE README README.CHANGES README.SECURITY README.SUPPORT
-
%clean
rm -rf $RPM_BUILD_ROOT
%pre
-if [ -n "`/usr/bin/getgid bb`" ]; then
- if [ "`/usr/bin/getgid bb`" != "73" ]; then
- echo "Warning: group bb haven't gid=73. Correct this before installing bb" 1>&2
- exit 1
- fi
-else
- /usr/sbin/groupadd -g 73 -r -f bb
-fi
-if [ -n "`/bin/id -u bb 2>/dev/null`" ]; then
- if [ "`/bin/id -u bb`" != "73" ]; then
- echo "Warning: user bb haven't uid=73. Correct this before installing bb" 1>&2
- exit 1
- fi
-else
- /usr/sbin/useradd -u 73 -r -d %{_vardir} -s /bin/sh -c "Big Brother" -g bb -G root,proc,adm bb 1>&2
-fi
+%groupadd -g 73 bb
+%useradd -u 73 -d %{_vardir} -s /bin/sh -c "Big Brother" -g bb -G root,proc,adm bb
%post
/sbin/chkconfig --add bb
-if [ -f /var/lock/subsys/bb ]; then
- /etc/rc.d/init.d/bb restart >&2
-else
- echo "Run \"/etc/rc.d/init.d/bb start\" to start Big Brother daemon." >&2
-fi
+%service bb restart "Big Brother daemon"
%preun
if [ "$1" = "0" ]; then
- if [ -f /var/lock/subsys/bb ]; then
- /etc/rc.d/init.d/bb stop >&2
- fi
+ %service bb stop
/sbin/chkconfig --del bb
fi
%postun
if [ "$1" = "0" ]; then
- /usr/sbin/userdel bb
- /usr/sbin/groupdel bb
+ %userremove bb
+ %groupremove bb
fi
%files
%defattr(644,root,root,755)
-%doc %{nshort}/*.gz
+%doc %{nshort}/{LICENSE,README,README.CHANGES,README.SECURITY,README.SUPPORT}
%dir %{_etcdir}
-%config(noreplace) %verify(not size mtime md5) %{_etcdir}/*
+%config(noreplace) %verify(not md5 mtime size) %{_etcdir}/*
%attr(755,root,root) %{_cgidir}/*
%dir %{_libdir}
%attr(755,root,root) %{_libdir}/bin
%{_libdir}/etc
%attr(755,root,root) %{_libdir}/ext
-%dir %attr(755,root,root) %{_libdir}/web
+%dir %{_libdir}/web
%{_libdir}/web/*_*er
%attr(755,root,root) %{_libdir}/web/bb-*
%attr(755,root,root) %{_libdir}/web/mk*
%{_libdir}/www
%{_libdir}/tmp
%attr(755,root,root) %{_libdir}/runbb.sh
-/usr/lib/bbvar
+%{_prefix}/lib/bbvar
%attr(775,root,bb) %dir %{_htmldir}
%attr(775,root,bb) %{_htmldir}/html
%{_htmldir}/gifs*