]> git.pld-linux.org Git - packages/bb4.git/blame - bb4.spec
- tabs in preamble
[packages/bb4.git] / bb4.spec
CommitLineData
13c53e5f 1# TODO: webapps
c42f1483 2%define nshort bb18d
1493ce86 3Summary: Big Brother System and Network Monitor
924563dc 4Summary(pl.UTF-8): Wielki Brat - monitor systemów i sieci
1493ce86
JB
5Name: bb4
6Version: 1.8d
9de9fbaa 7Release: 2
b1f32bcb 8License: Free for non-commercial use, 30-day trial for commercial use; not distributable
1493ce86 9Group: Networking
80244880 10Source0: bb-%{version}.tar.gz
1493ce86
JB
11Source1: %{name}.init
12Patch0: %{name}-pld.patch
13NoSource: 0
14URL: http://bb4.com/
c42f1483 15BuildRequires: rpmbuild(macros) >= 1.268
b10a78de
ER
16Requires(post,preun): /sbin/chkconfig
17Requires(postun): /usr/sbin/groupdel
18Requires(postun): /usr/sbin/userdel
ad3fa1d0 19Requires(pre): /bin/id
20Requires(pre): /usr/bin/getgid
21Requires(pre): /usr/sbin/groupadd
22Requires(pre): /usr/sbin/useradd
1493ce86 23Requires: /usr/bin/setsid
c42f1483 24Requires: rc-scripts
bfddd49e 25Provides: group(bb)
26Provides: user(bb)
385addf3 27Conflicts: iputils-ping < 1:ss020124
1493ce86
JB
28BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
29
30%define _etcdir /etc/bb
31%define _libdir /usr/lib/bb
b92de372
AA
32%define _htmldir /home/services/httpd/html/bb
33%define _cgidir /home/services/httpd/cgi-bin
1493ce86
JB
34%define _vardir /var/lib/bb
35%define _sysconfdir /etc/dummy
36
37%description
38Big Brother - network monitoring system.
39
e87c29ac
JR
40%description -l pl.UTF-8
41Wielki Brat - monitor systemów i sieci.
1493ce86
JB
42
43%prep
44%setup -q -c
45tar xf %{nshort}.tar
5f2b67fb 46%patch0 -p1
1493ce86
JB
47
48%build
49cd %{nshort}
50touch tmp/.license
51mkdir cgi-bin
52CGIDIR=`pwd`/cgi-bin
53MYID=`id -nu`
54MYGR=`id -ng`
55cd install
56./bbconfig pld <<EOF
57
58y
59bb
60n
61y
62pldmachine
63pldmachine
64y
65y
66bb@localhost
67/bb
68$CGIDIR
69/cgi-bin
70$MYID
71$MYGR
72EOF
73
74cd ../src
75%{__make} OPTCFLAGS="%{rpmcflags}"
76
77# installs to ../bin
78%{__make} install
79
80cd ../bin
81for f in bbmv bbprune bbrm ; do
82 sed -e 's@&&BBHOME@%{_libdir}@' $f.DIST > $f
83done
84rm -f *.DIST
85
86%install
87rm -rf $RPM_BUILD_ROOT
88install -d $RPM_BUILD_ROOT{%{_libdir},%{_htmldir}/{html,notes,rep},%{_cgidir},%{_vardir}/tmp} \
89 $RPM_BUILD_ROOT{%{_etcdir},/etc/rc.d/init.d}
90
91cp -rf bbvar/* $RPM_BUILD_ROOT%{_vardir}
92
93for f in bb-ack.sh bb-hist.sh bb-histlog.sh bb-hostsvc.sh bb-rep.sh bb-replog.sh ; do
94 sed -e 's@&&BBHOME@%{_libdir}@' %{nshort}/web/$f.DIST > $RPM_BUILD_ROOT%{_cgidir}/$f
95done
96sed -e 's@&BBHOME@%{_libdir}@' %{nshort}/runbb.sh.DIST > $RPM_BUILD_ROOT%{_libdir}/runbb.sh
97
98rm -f %{nshort}/web/*.DIST %{nshort}/www/help/*.DIST
99
100cp -rf %{nshort}/{bin,ext,web} $RPM_BUILD_ROOT%{_libdir}
101cp -rf %{nshort}/www/{gifs,gifs-bb13,psy,help} $RPM_BUILD_ROOT%{_htmldir}
102
103install %{nshort}/etc/bbchk*.sh $RPM_BUILD_ROOT%{_libdir}/bin
104
105ln -sf bb.html $RPM_BUILD_ROOT%{_htmldir}/index.html
106ln -sf %{_etcdir} $RPM_BUILD_ROOT%{_libdir}/etc
107ln -sf %{_htmldir} $RPM_BUILD_ROOT%{_libdir}/www
108ln -sf %{_vardir}/tmp $RPM_BUILD_ROOT%{_libdir}/tmp
c42f1483 109ln -sf %{_vardir} $RPM_BUILD_ROOT%{_prefix}/lib/bbvar
1493ce86
JB
110
111for f in bb-bbexttab bb-cputab bb-dftab bb-msgstab bb-proctab security ; do
112 sed -e 's/^[^#]/#\&/' %{nshort}/etc/$f.DIST > $RPM_BUILD_ROOT%{_etcdir}/$f
113done
114echo '0.0.0.0/0.0.0.0' >> $RPM_BUILD_ROOT%{_etcdir}/security
115sed -e 's/^[^#]/#\&/' %{nshort}/etc/bb-hosts > $RPM_BUILD_ROOT%{_etcdir}/bb-hosts
116install %{nshort}/etc/{bbdef.sh,bbinc.sh,bbsys.local,bbsys.sh,bbwarnrules.cfg,bbwarnsetup.cfg,*.scr} \
117 $RPM_BUILD_ROOT%{_etcdir}
118
119install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/bb
120
1493ce86
JB
121%clean
122rm -rf $RPM_BUILD_ROOT
123
f7b125ea 124%pre
54e7ce54
ER
125%groupadd -g 73 bb
126%useradd -u 73 -d %{_vardir} -s /bin/sh -c "Big Brother" -g bb -G root,proc,adm bb
f7b125ea 127
1493ce86
JB
128%post
129/sbin/chkconfig --add bb
c42f1483 130%service bb restart "Big Brother daemon"
1493ce86
JB
131
132%preun
133if [ "$1" = "0" ]; then
c42f1483 134 %service bb stop
1493ce86
JB
135 /sbin/chkconfig --del bb
136fi
137
f7b125ea 138%postun
139if [ "$1" = "0" ]; then
bfddd49e 140 %userremove bb
141 %groupremove bb
f7b125ea 142fi
143
1493ce86
JB
144%files
145%defattr(644,root,root,755)
c2608f60 146%doc %{nshort}/{LICENSE,README,README.CHANGES,README.SECURITY,README.SUPPORT}
1493ce86 147%dir %{_etcdir}
b10a78de 148%config(noreplace) %verify(not md5 mtime size) %{_etcdir}/*
1493ce86
JB
149%attr(755,root,root) %{_cgidir}/*
150%dir %{_libdir}
151%attr(755,root,root) %{_libdir}/bin
152%{_libdir}/etc
153%attr(755,root,root) %{_libdir}/ext
2cc7823c 154%dir %{_libdir}/web
1493ce86
JB
155%{_libdir}/web/*_*er
156%attr(755,root,root) %{_libdir}/web/bb-*
157%attr(755,root,root) %{_libdir}/web/mk*
158%{_libdir}/www
159%{_libdir}/tmp
160%attr(755,root,root) %{_libdir}/runbb.sh
c42f1483 161%{_prefix}/lib/bbvar
1493ce86
JB
162%attr(775,root,bb) %dir %{_htmldir}
163%attr(775,root,bb) %{_htmldir}/html
164%{_htmldir}/gifs*
165%{_htmldir}/help
166%{_htmldir}/index.html
167%{_htmldir}/notes
168%{_htmldir}/psy
169%attr(775,root,http) %{_htmldir}/rep
170%dir %{_vardir}
171%attr(775,root,bb) %{_vardir}/*
172%attr(754,root,root) /etc/rc.d/init.d/bb
This page took 0.084305 seconds and 4 git commands to generate.