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