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