]> git.pld-linux.org Git - packages/bb4.git/blob - bb4.spec
- fixed a typo in License:
[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:        2
7 License:        Free for non-commercial use, 30-day trial for commercial use; not distributable
8 Group:          Networking
9 Source0:        http://bb4.com/dnld/bb-%{version}.tar.gz
10 Source1:        %{name}.init
11 Patch0:         %{name}-pld.patch
12 NoSource:       0
13 URL:            http://bb4.com/
14 Prereq:         /usr/sbin/groupadd
15 Prereq:         /usr/sbin/useradd
16 Prereq:         /usr/sbin/groupdel
17 Prereq:         /usr/sbin/userdel
18 Prereq:         /bin/id
19 Prereq:         /usr/bin/getgid
20 Prereq:         /sbin/chkconfig
21 Prereq:         rc-scripts
22 Requires:       /usr/bin/setsid
23 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
24
25 %define         _etcdir         /etc/bb
26 %define         _libdir         /usr/lib/bb
27 %define         _htmldir        /home/httpd/html/bb
28 %define         _cgidir         /home/httpd/cgi-bin
29 %define         _vardir         /var/lib/bb
30 %define         _sysconfdir     /etc/dummy
31
32 %description
33 Big Brother - network monitoring system.
34
35 %description -l pl
36 Wielki Brat - monitor systemów i sieci.
37
38 %prep
39 %setup -q -c
40 tar xf %{nshort}.tar
41 %patch -p1
42
43 %build
44 cd %{nshort}
45 touch tmp/.license
46 mkdir cgi-bin
47 CGIDIR=`pwd`/cgi-bin
48 MYID=`id -nu`
49 MYGR=`id -ng`
50 cd install
51 ./bbconfig pld <<EOF
52
53 y
54 bb
55 n
56 y
57 pldmachine
58 pldmachine
59 y
60 y
61 bb@localhost
62 /bb
63 $CGIDIR
64 /cgi-bin
65 $MYID
66 $MYGR
67 EOF
68
69 cd ../src
70 %{__make} OPTCFLAGS="%{rpmcflags}"
71
72 # installs to ../bin
73 %{__make} install
74
75 cd ../bin
76 for f in bbmv bbprune bbrm ; do
77         sed -e 's@&&BBHOME@%{_libdir}@' $f.DIST > $f
78 done
79 rm -f *.DIST
80
81 %install
82 rm -rf $RPM_BUILD_ROOT
83 install -d $RPM_BUILD_ROOT{%{_libdir},%{_htmldir}/{html,notes,rep},%{_cgidir},%{_vardir}/tmp} \
84         $RPM_BUILD_ROOT{%{_etcdir},/etc/rc.d/init.d}
85
86 cp -rf bbvar/* $RPM_BUILD_ROOT%{_vardir}
87
88 for f in bb-ack.sh bb-hist.sh bb-histlog.sh bb-hostsvc.sh bb-rep.sh bb-replog.sh ; do
89         sed -e 's@&&BBHOME@%{_libdir}@' %{nshort}/web/$f.DIST > $RPM_BUILD_ROOT%{_cgidir}/$f
90 done
91 sed -e 's@&BBHOME@%{_libdir}@' %{nshort}/runbb.sh.DIST > $RPM_BUILD_ROOT%{_libdir}/runbb.sh
92
93 rm -f %{nshort}/web/*.DIST %{nshort}/www/help/*.DIST
94
95 cp -rf %{nshort}/{bin,ext,web} $RPM_BUILD_ROOT%{_libdir}
96 cp -rf %{nshort}/www/{gifs,gifs-bb13,psy,help} $RPM_BUILD_ROOT%{_htmldir}
97
98 install %{nshort}/etc/bbchk*.sh $RPM_BUILD_ROOT%{_libdir}/bin
99
100 ln -sf bb.html $RPM_BUILD_ROOT%{_htmldir}/index.html
101 ln -sf %{_etcdir} $RPM_BUILD_ROOT%{_libdir}/etc
102 ln -sf %{_htmldir} $RPM_BUILD_ROOT%{_libdir}/www
103 ln -sf %{_vardir}/tmp $RPM_BUILD_ROOT%{_libdir}/tmp
104 ln -sf %{_vardir} $RPM_BUILD_ROOT/usr/lib/bbvar
105
106 for f in bb-bbexttab bb-cputab bb-dftab bb-msgstab bb-proctab security ; do
107         sed -e 's/^[^#]/#\&/' %{nshort}/etc/$f.DIST > $RPM_BUILD_ROOT%{_etcdir}/$f
108 done
109 echo '0.0.0.0/0.0.0.0' >> $RPM_BUILD_ROOT%{_etcdir}/security
110 sed -e 's/^[^#]/#\&/' %{nshort}/etc/bb-hosts > $RPM_BUILD_ROOT%{_etcdir}/bb-hosts
111 install %{nshort}/etc/{bbdef.sh,bbinc.sh,bbsys.local,bbsys.sh,bbwarnrules.cfg,bbwarnsetup.cfg,*.scr} \
112         $RPM_BUILD_ROOT%{_etcdir}
113
114 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/bb
115
116 cd %{nshort}
117 gzip -9nf LICENSE README README.CHANGES README.SECURITY README.SUPPORT
118
119 %clean
120 rm -rf $RPM_BUILD_ROOT
121
122 %pre
123 if [ -n "`/usr/bin/getgid bb`" ]; then
124         if [ "`/usr/bin/getgid bb`" != "73" ]; then
125                 echo "Warning: group bb haven't gid=73. Correct this before installing bb" 1>&2
126                 exit 1
127         fi
128 else
129         /usr/sbin/groupadd -g 73 -r -f bb
130 fi
131 if [ -n "`/bin/id -u bb 2>/dev/null`" ]; then
132         if [ "`/bin/id -u bb`" != "73" ]; then
133                 echo "Warning: user bb haven't uid=73. Correct this before installing bb" 1>&2
134                 exit 1
135         fi
136 else
137         /usr/sbin/useradd -u 73 -r -d %{_vardir} -s /bin/sh -c "Big Brother" -g bb -G root,proc,adm bb 1>&2
138 fi
139
140 %post
141 /sbin/chkconfig --add bb
142 if [ -f /var/lock/subsys/bb ]; then
143         /etc/rc.d/init.d/bb restart >&2
144 else
145         echo "Run \"/etc/rc.d/init.d/bb start\" to start Big Brother daemon." >&2
146 fi
147
148 %preun
149 if [ "$1" = "0" ]; then
150         if [ -f /var/lock/subsys/bb ]; then
151                  /etc/rc.d/init.d/bb stop >&2
152         fi
153         /sbin/chkconfig --del bb
154 fi
155
156 %postun
157 if [ "$1" = "0" ]; then
158         /usr/sbin/userdel bb
159         /usr/sbin/groupdel bb
160 fi
161
162 %files
163 %defattr(644,root,root,755)
164 %doc %{nshort}/*.gz
165 %dir %{_etcdir}
166 %config(noreplace) %verify(not size mtime md5) %{_etcdir}/*
167 %attr(755,root,root) %{_cgidir}/*
168 %dir %{_libdir}
169 %attr(755,root,root) %{_libdir}/bin
170 %{_libdir}/etc
171 %attr(755,root,root) %{_libdir}/ext
172 %dir %attr(755,root,root) %{_libdir}/web
173 %{_libdir}/web/*_*er
174 %attr(755,root,root) %{_libdir}/web/bb-*
175 %attr(755,root,root) %{_libdir}/web/mk*
176 %{_libdir}/www
177 %{_libdir}/tmp
178 %attr(755,root,root) %{_libdir}/runbb.sh
179 /usr/lib/bbvar
180 %attr(775,root,bb) %dir %{_htmldir}
181 %attr(775,root,bb) %{_htmldir}/html
182 %{_htmldir}/gifs*
183 %{_htmldir}/help
184 %{_htmldir}/index.html
185 %{_htmldir}/notes
186 %{_htmldir}/psy
187 %attr(775,root,http) %{_htmldir}/rep
188 %dir %{_vardir}
189 %attr(775,root,bb) %{_vardir}/*
190 %attr(754,root,root) /etc/rc.d/init.d/bb
This page took 0.039583 seconds and 3 git commands to generate.