]> git.pld-linux.org Git - packages/bb4.git/blob - bb4.spec
a56f34a0a183c4f906cbda07f6d33ade1e1a3290
[packages/bb4.git] / bb4.spec
1 %define nshort  bb18d
2 Summary:        Big Brother System and Network Monitor
3 Summary(pl):    Wielki Brat - monitor systemów i sieci
4 Name:           bb4
5 Version:        1.8d
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 BuildRequires:  rpmbuild(macros) >= 1.268
15 Requires(post,preun):   /sbin/chkconfig
16 Requires(postun):       /usr/sbin/groupdel
17 Requires(postun):       /usr/sbin/userdel
18 Requires(pre):  /bin/id
19 Requires(pre):  /usr/bin/getgid
20 Requires(pre):  /usr/sbin/groupadd
21 Requires(pre):  /usr/sbin/useradd
22 Requires:       /usr/bin/setsid
23 Requires:       rc-scripts
24 Provides:       group(bb)
25 Provides:       user(bb)
26 Conflicts:      iputils-ping < 1:ss020124
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/services/httpd/html/bb
32 %define         _cgidir         /home/services/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 %patch0 -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%{_prefix}/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 %clean
121 rm -rf $RPM_BUILD_ROOT
122
123 %pre
124 %groupadd -g 73 bb
125 %useradd -u 73 -d %{_vardir} -s /bin/sh -c "Big Brother" -g bb -G root,proc,adm bb
126
127 %post
128 /sbin/chkconfig --add bb
129 %service bb restart "Big Brother daemon"
130
131 %preun
132 if [ "$1" = "0" ]; then
133         %service bb stop
134         /sbin/chkconfig --del bb
135 fi
136
137 %postun
138 if [ "$1" = "0" ]; then
139         %userremove bb
140         %groupremove bb
141 fi
142
143 %files
144 %defattr(644,root,root,755)
145 %doc %{nshort}/{LICENSE,README,README.CHANGES,README.SECURITY,README.SUPPORT}
146 %dir %{_etcdir}
147 %config(noreplace) %verify(not md5 mtime size) %{_etcdir}/*
148 %attr(755,root,root) %{_cgidir}/*
149 %dir %{_libdir}
150 %attr(755,root,root) %{_libdir}/bin
151 %{_libdir}/etc
152 %attr(755,root,root) %{_libdir}/ext
153 %dir %{_libdir}/web
154 %{_libdir}/web/*_*er
155 %attr(755,root,root) %{_libdir}/web/bb-*
156 %attr(755,root,root) %{_libdir}/web/mk*
157 %{_libdir}/www
158 %{_libdir}/tmp
159 %attr(755,root,root) %{_libdir}/runbb.sh
160 %{_prefix}/lib/bbvar
161 %attr(775,root,bb) %dir %{_htmldir}
162 %attr(775,root,bb) %{_htmldir}/html
163 %{_htmldir}/gifs*
164 %{_htmldir}/help
165 %{_htmldir}/index.html
166 %{_htmldir}/notes
167 %{_htmldir}/psy
168 %attr(775,root,http) %{_htmldir}/rep
169 %dir %{_vardir}
170 %attr(775,root,bb) %{_vardir}/*
171 %attr(754,root,root) /etc/rc.d/init.d/bb
This page took 0.105014 seconds and 2 git commands to generate.