1 # Bacula Web GUI RPM spec file
2 # Copyright (C) 2004-2006 Kern Sibbald
7 %{?build_rhel:%define rhel 1}
10 %{?build_suse:%define suse 1}
13 %{?build_mdk:%define mdk 1}
15 # test for a platform definition
16 %if ! %{rhel} && ! %{suse} && ! %{mdk}
17 %{error: You must specify a platform. Please examine the spec file.}
21 # source package names
22 %define web bacula-web
23 %define bimagemgr bimagemgr
25 %define brestore brestore
27 # set destination directories
28 %define cgidir /var/www/cgi-bin
29 %define docdir /var/www/html
30 %define sysconfdir /etc/bacula
32 %define cgidir /srv/www/cgi-bin
33 %define docdir /srv/www/htdocs
36 # set ownership of files
39 %define dataowner apache
40 %define datagroup apache
42 %define dataowner wwwrun
46 %define groupmod /usr/sbin/groupmod
47 %define groupfile /etc/group
49 Summary: Bacula - The Network Backup Solution
53 Group: System Environment/Daemons
55 Source0: %{web}-%{version}.tar.gz
56 Source1: %{bimagemgr}-%{version}.tar.gz
57 Source2: bacula-docs-%{version}.tar.gz
58 Source3: %{bweb}-%{version}.tar.gz
59 Source4: %{brestore}-%{version}.tar.gz
60 BuildRoot: %{_tmppath}/%{name}-root
61 URL: http://www.bacula.org/
62 BuildArchitectures: noarch
63 Vendor: The Bacula Team
64 Distribution: The Bacula Team
65 Packager: D. Scott Barninger <barninger at fairfieldcomputers dot com>
68 Bacula is a set of computer programs that permit you (or the system
69 administrator) to manage backup, recovery, and verification of computer
70 data across a network of computers of different kinds. bacula-gui is a
71 set of web server based tools used to manage backups.
74 Summary: Bacula - The Network Backup Solution
75 Group: System Environment/Daemons
77 Requires: perl, perl-DBI, bacula-server, cdrecord, mkisofs
84 Obsoletes: bacula-bimagemgr
86 %description bimagemgr
87 Bacula is a set of computer programs that permit you (or the system
88 administrator) to manage backup, recovery, and verification of computer
89 data across a network of computers of different kinds. bimagemgr is a
90 utility to manage backups made to files intended for burning to CDR
91 disk. bimagemgr allows you to easily see which Volumes have been written
92 to more recently than they have been recorded to CDR disk and record those
96 Summary: Bacula - The Network Backup Solution
97 Group: System Environment/Daemons
99 Requires: php >= 4, bacula-server
107 Bacula is a set of computer programs that permit you (or the system
108 administrator) to manage backup, recovery, and verification of computer
109 data across a network of computers of different kinds. bacula-web is a
110 web server based utility to monitor your bacula server.
113 Summary: Bacula - The Network Backup Solution
114 Group: System Environment/Daemons
116 Requires: perl, perl-DBI, perl-DBD-mysql, perl-DBD-Pg, perl-GDGraph
117 Requires: perl-HTML-Template, perl-Time-modules
120 Requires: perl-CGI-Application
126 Bacula is a set of computer programs that permit you (or the system
127 administrator) to manage backup, recovery, and verification of computer
128 data across a network of computers of different kinds. libbweb is a set
129 of perl modules required by bacula-gui-bweb and bacula-gui-brestore utilities.
132 Summary: Bacula - The Network Backup Solution
133 Group: System Environment/Daemons
135 Requires: perl, perl-DBI, perl-DBD-mysql, perl-DBD-Pg, perl-Expect
136 Requires: perl-Gtk2-GladeXML, bacula-gui-libbweb = %{version}
138 %description brestore
139 Bacula is a set of computer programs that permit you (or the system
140 administrator) to manage backup, recovery, and verification of computer
141 data across a network of computers of different kinds. brestore is a file
142 restoration interface.
145 Summary: Bacula - The Network Backup Solution
146 Group: System Environment/Daemons
148 Requires: perl, perl-DBI, perl-DBD-mysql, perl-DBD-Pg, perl-GDGraph
149 Requires: perl-HTML-Template, perl-Time-modules, bacula-gui-libbweb
150 Requires: bacula-server
153 Requires: perl-CGI-Application
159 Bacula is a set of computer programs that permit you (or the system
160 administrator) to manage backup, recovery, and verification of computer
161 data across a network of computers of different kinds. bweb is a web based
162 interface for a bacula server.
166 # unpack both sources inside a directory with package name and version
167 %setup -c %{name} -D -b 1
168 %setup -c %{name} -T -D -b 2
169 %setup -c %{name} -T -D -b 3
170 %setup -c %{name} -T -D -b 4
176 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
179 mkdir -p $RPM_BUILD_ROOT%{cgidir}
180 mkdir -p $RPM_BUILD_ROOT%{docdir}/%{web}
181 mkdir -p $RPM_BUILD_ROOT%{sysconfdir}
182 mkdir -p $RPM_BUILD_ROOT%{perl_sitearch}
183 mkdir -p $RPM_BUILD_ROOT/usr/bin
184 mkdir -p $RPM_BUILD_ROOT/usr/share/brestore
185 mkdir -p $RPM_BUILD_ROOT/usr/share/applications
186 mkdir -p $RPM_BUILD_ROOT/usr/share/pixmaps
188 mkdir -p $RPM_BUILD_ROOT%{cgidir}/bweb
189 chmod 755 $RPM_BUILD_ROOT%{cgidir}/bweb
190 mkdir -p $RPM_BUILD_ROOT/etc/bweb
191 chmod 750 $RPM_BUILD_ROOT/etc/bweb
192 mkdir -p $RPM_BUILD_ROOT/usr/share/bweb/tpl
193 mkdir -p $RPM_BUILD_ROOT%{docdir}/%{bweb}
195 # install bimagemgr files
196 cp -p %{bimagemgr}-%{version}/bimagemgr.pl $RPM_BUILD_ROOT%{cgidir}/
197 cp -p %{bimagemgr}-%{version}/config.pm $RPM_BUILD_ROOT%{cgidir}/
198 cp -p %{bimagemgr}-%{version}/create_cdimage_table.pl $RPM_BUILD_ROOT%{sysconfdir}/
199 cp -p %{bimagemgr}-%{version}/README $RPM_BUILD_ROOT%{sysconfdir}/README.bimagemgr
200 cp -p %{bimagemgr}-%{version}/bimagemgr.gif $RPM_BUILD_ROOT%{docdir}/
201 cp -p %{bimagemgr}-%{version}/cdrom_spins.gif $RPM_BUILD_ROOT%{docdir}/
202 cp -p %{bimagemgr}-%{version}/clearpixel.gif $RPM_BUILD_ROOT%{docdir}/
203 cp -p %{bimagemgr}-%{version}/temp.html $RPM_BUILD_ROOT%{docdir}/
205 chmod 755 $RPM_BUILD_ROOT%{cgidir}/bimagemgr.pl
206 chmod 750 $RPM_BUILD_ROOT%{cgidir}/config.pm
207 chmod 750 $RPM_BUILD_ROOT%{sysconfdir}/create_cdimage_table.pl
208 chmod 644 $RPM_BUILD_ROOT%{sysconfdir}/README.bimagemgr
209 chmod 644 $RPM_BUILD_ROOT%{docdir}/*.gif
210 chmod 664 $RPM_BUILD_ROOT%{docdir}/temp.html
212 # install bacula-web files
213 cp -p %{web}-%{version}/README $RPM_BUILD_ROOT%{sysconfdir}/README.bacula-web
214 cp -r -p %{web}-%{version}/* $RPM_BUILD_ROOT%{docdir}/%{web}/
216 chmod 644 $RPM_BUILD_ROOT%{sysconfdir}/README.bacula-web
218 # install the libbweb files
219 cp -p %{bweb}-%{version}/lib/*.pm $RPM_BUILD_ROOT%{perl_sitearch}/
220 chmod 644 $RPM_BUILD_ROOT%{perl_site_arch}/*.pm
222 # install the brestore files
223 cp -p %{brestore}-%{version}/brestore.pl $RPM_BUILD_ROOT/usr/bin/
224 cp -p %{brestore}-%{version}/brestore.glade $RPM_BUILD_ROOT/usr/share/brestore/
225 cp -p %{brestore}-%{version}/brestore.desktop $RPM_BUILD_ROOT/usr/share/applications/
226 cp -p %{brestore}-%{version}/brestore.png $RPM_BUILD_ROOT/usr/share/pixmaps/
227 chmod 755 $RPM_BUILD_ROOT/usr/bin/brestore.pl
228 chmod 644 $RPM_BUILD_ROOT/usr/share/brestore/brestore.glade
229 chmod 644 $RPM_BUILD_ROOT/usr/share/applications/brestore.desktop
230 chmod 644 $RPM_BUILD_ROOT/usr/share/pixmaps/brestore.png
232 # install the bweb files
233 cp -p %{bweb}-%{version}/cgi/*.pl $RPM_BUILD_ROOT%{cgidir}/bweb/
234 chmod 755 $RPM_BUILD_ROOT%{cgidir}/bweb/*
235 echo "template_dir = /usr/share/bweb/tpl" > $RPM_BUILD_ROOT/etc/bweb/config
236 cp -p %{bweb}-%{version}/tpl/*.tpl $RPM_BUILD_ROOT/usr/share/bweb/tpl/
237 chmod 644 $RPM_BUILD_ROOT/usr/share/bweb/tpl/*
238 cp -p %{bweb}-%{version}/html/*.js $RPM_BUILD_ROOT%{docdir}/%{bweb}/
239 cp -p %{bweb}-%{version}/html/*.png $RPM_BUILD_ROOT%{docdir}/%{bweb}/
240 cp -p %{bweb}-%{version}/html/*.css $RPM_BUILD_ROOT%{docdir}/%{bweb}/
241 cp -p %{bweb}-%{version}/html/*.gif $RPM_BUILD_ROOT%{docdir}/%{bweb}/
242 chmod 644 $RPM_BUILD_ROOT%{docdir}/%{bweb}/*
243 cp -p %{bweb}-%{version}/script/bweb-postgresql.sql $RPM_BUILD_ROOT/etc/bweb/
244 chmod 644 $RPM_BUILD_ROOT/etc/bweb/bweb-postgresql.sql
247 # remove the standard doc files from the install directory
248 rm -f $RPM_BUILD_ROOT%{docdir}/%{web}/ChangeLog
249 rm -f $RPM_BUILD_ROOT%{docdir}/%{web}/CONTACT
250 rm -f $RPM_BUILD_ROOT%{docdir}/%{web}/COPYING
251 rm -f $RPM_BUILD_ROOT%{docdir}/%{web}/README
252 rm -f $RPM_BUILD_ROOT%{docdir}/%{web}/TODO
255 mkdir -p docs/%{bimagemgr}
257 mkdir docs/%{brestore}
260 cp -p %{bimagemgr}-%{version}/README docs/%{bimagemgr}/
261 cp -p %{bimagemgr}-%{version}/COPYING docs/%{bimagemgr}/
262 cp -p %{bimagemgr}-%{version}/ChangeLog docs/%{bimagemgr}/
263 cp -p %{bimagemgr}-%{version}/ReleaseNotes docs/%{bimagemgr}/
264 cp -p bacula-docs-%{version}/manual/%{bimagemgr}.pdf docs/%{bimagemgr}/
266 cp -p %{web}-%{version}/README docs/%{web}/
267 cp -p %{web}-%{version}/ChangeLog docs/%{web}/
268 cp -p %{web}-%{version}/CONTACT docs/%{web}/
269 cp -p %{web}-%{version}/COPYING docs/%{web}/
270 cp -p bacula-docs-%{version}/%{web}/%{web}.pdf docs/%{web}/
272 cp -p %{brestore}-%{version}/README docs/%{brestore}/
273 cp -p %{brestore}-%{version}/COPYING docs/%{brestore}/
274 cp -p %{brestore}-%{version}/ReleaseNotes docs/%{brestore}/
276 cp -p %{bweb}-%{version}/INSTALL docs/%{bweb}/
277 cp -p %{bweb}-%{version}/COPYING docs/%{bweb}/
278 cp -p %{bweb}-%{version}/ReleaseNotes docs/%{bweb}/
281 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
285 %defattr(-,root,root)
286 %doc docs/%{bimagemgr}/*
288 %defattr(-,%{binowner},%{bingroup})
289 %{cgidir}/bimagemgr.pl
290 %{sysconfdir}/create_cdimage_table.pl
291 %{sysconfdir}/README.bimagemgr
292 %{docdir}/bimagemgr.gif
293 %{docdir}/cdrom_spins.gif
294 %{docdir}/clearpixel.gif
296 %defattr(-,%{dataowner},%{datagroup})
298 %config(noreplace) %{cgidir}/config.pm
301 %defattr(-,root,root)
304 %defattr(-,%{binowner},%{bingroup})
305 %{sysconfdir}/README.bacula-web
307 %defattr(-,%{dataowner},%{datagroup})
308 %{docdir}/%{web}/*.php
309 %{docdir}/%{web}/*.po
310 %{docdir}/%{web}/*.inc
311 %config(noreplace) %{docdir}/%{web}/configs
312 %{docdir}/%{web}/external_packages
313 %{docdir}/%{web}/images
315 %{docdir}/%{web}/locale
316 %{docdir}/%{web}/templates
317 %{docdir}/%{web}/templates_c
320 %defattr(-,root,root)
321 %{perl_sitearch}/*.pm
324 %defattr(-,root,root)
326 /usr/share/brestore/brestore.glade
327 /usr/share/applications/brestore.desktop
328 /usr/share/pixmaps/brestore.png
329 %doc docs/%{brestore}/*
332 %defattr(-,%{binowner},%{bingroup})
334 /usr/share/bweb/tpl/*.tpl
336 /etc/bweb/bweb-postgresql.sql
339 %defattr(-,%{binowner},%{datagroup})
342 %defattr(-,%{dataowner},%{datagroup})
347 # add the web server user to group bacula
348 %{groupmod} -A %{dataowner} bacula
351 cp -p %{groupfile} %{groupfile}.old
352 awk '{if (/bacula:/) print $0",%{dataowner}"; else print $0}' %{groupfile}.old > %{groupfile}
357 # remove the web server user to group bacula
358 %{groupmod} -R %{dataowner} bacula
361 echo "You should remove user %{dataowner} from group bacula."
367 # add the web server user to group bacula
368 %{groupmod} -A %{dataowner} bacula
371 cp -p %{groupfile} %{groupfile}.old
372 awk '{if (/bacula:/) print $0",%{dataowner}"; else print $0}' %{groupfile}.old > %{groupfile}
377 # remove the web server user to group bacula
378 %{groupmod} -R %{dataowner} bacula
381 echo "You should remove user %{dataowner} from group bacula."
386 * Sun Sep 03 2006 D. Scott Barninger <barninger at fairfieldcomputers.com>
387 - seems that groupmod -A or -R is only available on SuSE
388 - use awk or add warning for other platforms
389 * Sat Aug 26 2006 D. Scott Barninger <barninger at fairfieldcomputers.com>
390 - add brestore menu entry and post script
391 - add /etc/bweb/bweb-postgresql.sql
392 - add bweb and brestore docs
393 * Sun Aug 20 2006 D. Scott Barninger <barninger at fairfieldcomputers.com>
394 - add libbweb, bweb and brestore packages
395 * Sun May 14 2006 D. Scott Barninger <barninger at fairfieldcomputers.com>
396 - add bimagemgr manual
397 * Sun May 07 2006 D. Scott Barninger <barninger at fairfieldcomputers.com>
398 - refine files section for web
400 - add config.pm for bimagemgr
401 - add post script bimagemgr to add web server user to group bacula
402 * Sat May 06 2006 D. Scott Barninger <barninger at fairfieldcomputers.com>
403 - was bimagemgr spec convert to bacula-gui spec. include bacula-web
404 * Thu Dec 09 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
405 - ASSIGNMENT OF COPYRIGHT
406 - FOR VALUE RECEIVED, D. Scott Barninger hereby sells, transfers and
407 - assigns unto Kern Sibbald, his successors, assigns and personal representatives,
408 - all right, title and interest in and to the copyright in this software RPM
409 - spec file. D. Scott Barninger warrants good title to said copyright, that it is
410 - free of all liens, encumbrances or any known claims against said copyright.
411 * Sun Nov 14 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>