]> git.pld-linux.org Git - packages/bb4.git/blob - bb4.spec
- new spec: system/network monitoring system (not distributable)
[packages/bb4.git] / bb4.spec
1 Summary:        Big Brother System and Network Monitor
2 Summary(pl):    Wielki Brat - monitor systemów i sieci
3 Name:           bb4
4 Version:        1.8d
5 %define nshort  bb18d
6 Release:        1
7 License:        free for non commercial use, 30-day trial for commercial use; not distributable
8 Group:          Networking
9 Group(de):      Netzwerkwesen
10 Group(es):      Red
11 Group(pl):      Sieciowe
12 Group(pt_BR):   Rede
13 Source0:        http://bb4.com/dnld/bb-%{version}.tar.gz
14 Source1:        %{name}.init
15 Patch0:         %{name}-pld.patch
16 NoSource:       0
17 URL:            http://bb4.com/
18 Prereq:         /usr/sbin/groupadd
19 Prereq:         /usr/sbin/useradd
20 Prereq:         /usr/sbin/groupdel
21 Prereq:         /usr/sbin/userdel
22 Prereq:         /bin/id
23 Prereq:         /usr/bin/getgid
24 Prereq:         /sbin/chkconfig
25 Prereq:         rc-scripts
26 Requires:       /usr/bin/setsid
27 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
28
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
35
36 %description
37 Big Brother - network monitoring system.
38
39 %description -l pl
40 Wielki Brat - monitor systemów i sieci.
41
42 %prep
43 %setup -q -c
44 tar xf %{nshort}.tar
45 %patch -p1
46
47 %build
48 cd %{nshort}
49 touch tmp/.license
50 mkdir cgi-bin
51 CGIDIR=`pwd`/cgi-bin
52 MYID=`id -nu`
53 MYGR=`id -ng`
54 cd install
55 ./bbconfig pld <<EOF
56
57 y
58 bb
59 n
60 y
61 pldmachine
62 pldmachine
63 y
64 y
65 bb@localhost
66 /bb
67 $CGIDIR
68 /cgi-bin
69 $MYID
70 $MYGR
71 EOF
72
73 cd ../src
74 %{__make} OPTCFLAGS="%{rpmcflags}"
75
76 # installs to ../bin
77 %{__make} install
78
79 cd ../bin
80 for f in bbmv bbprune bbrm ; do
81         sed -e 's@&&BBHOME@%{_libdir}@' $f.DIST > $f
82 done
83 rm -f *.DIST
84
85 %install
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}
89
90 cp -rf bbvar/* $RPM_BUILD_ROOT%{_vardir}
91
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
94 done
95 sed -e 's@&BBHOME@%{_libdir}@' %{nshort}/runbb.sh.DIST > $RPM_BUILD_ROOT%{_libdir}/runbb.sh
96
97 rm -f %{nshort}/web/*.DIST %{nshort}/www/help/*.DIST
98
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}
101
102 install %{nshort}/etc/bbchk*.sh $RPM_BUILD_ROOT%{_libdir}/bin
103
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
109
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
112 done
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}
117
118 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/bb
119
120 cd %{nshort}
121 gzip -9nf LICENSE README README.CHANGES README.SECURITY README.SUPPORT
122
123 %clean
124 rm -rf $RPM_BUILD_ROOT
125
126 %pre
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
130                 exit 1
131         fi
132 else
133         /usr/sbin/groupadd -g 73 -r -f bb
134 fi
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
138                 exit 1
139         fi
140 else
141         /usr/sbin/useradd -u 73 -r -d %{_vardir} -s /bin/sh -c "Big Brother" -g bb -G root,proc,adm bb 1>&2
142 fi
143
144 %post
145 /sbin/chkconfig --add bb
146 if [ -f /var/lock/subsys/bb ]; then
147         /etc/rc.d/init.d/bb restart >&2
148 else
149         echo "Run \"/etc/rc.d/init.d/bb start\" to start Big Brother daemon." >&2
150 fi
151
152 %preun
153 if [ "$1" = "0" ]; then
154         if [ -f /var/lock/subsys/bb ]; then
155                  /etc/rc.d/init.d/bb stop >&2
156         fi
157         /sbin/chkconfig --del bb
158 fi
159
160 %postun
161 if [ "$1" = "0" ]; then
162         /usr/sbin/userdel bb
163         /usr/sbin/groupdel bb
164 fi
165
166 %files
167 %defattr(644,root,root,755)
168 %doc %{nshort}/*.gz
169 %dir %{_etcdir}
170 %config(noreplace) %verify(not size mtime md5) %{_etcdir}/*
171 %attr(755,root,root) %{_cgidir}/*
172 %dir %{_libdir}
173 %attr(755,root,root) %{_libdir}/bin
174 %{_libdir}/etc
175 %attr(755,root,root) %{_libdir}/ext
176 %dir %attr(755,root,root) %{_libdir}/web
177 %{_libdir}/web/*_*er
178 %attr(755,root,root) %{_libdir}/web/bb-*
179 %attr(755,root,root) %{_libdir}/web/mk*
180 %{_libdir}/www
181 %{_libdir}/tmp
182 %attr(755,root,root) %{_libdir}/runbb.sh
183 /usr/lib/bbvar
184 %attr(775,root,bb) %dir %{_htmldir}
185 %attr(775,root,bb) %{_htmldir}/html
186 %{_htmldir}/gifs*
187 %{_htmldir}/help
188 %{_htmldir}/index.html
189 %{_htmldir}/notes
190 %{_htmldir}/psy
191 %attr(775,root,http) %{_htmldir}/rep
192 %dir %{_vardir}
193 %attr(775,root,bb) %{_vardir}/*
194 %attr(754,root,root) /etc/rc.d/init.d/bb
This page took 0.082653 seconds and 4 git commands to generate.