]> git.sur5r.net Git - bacula/bacula/blob - gui/bacula-gui.spec.in
ebl drop bacula log patch
[bacula/bacula] / gui / bacula-gui.spec.in
1 # Bacula Web GUI RPM spec file
2 # Copyright (C) 2004-2006 Kern Sibbald
3
4 # Platform defines
5
6 %define rhel 0
7 %{?build_rhel:%define rhel 1}
8
9 %define suse 0
10 %{?build_suse:%define suse 1}
11
12 %define mdk 0
13 %{?build_mdk:%define mdk 1}
14
15 # test for a platform definition
16 %if ! %{rhel} && ! %{suse} && ! %{mdk}
17 %{error: You must specify a platform. Please examine the spec file.}
18 exit 1
19 %endif
20
21 # source package names
22 %define web bacula-web
23 %define bimagemgr bimagemgr
24 %define bweb bweb
25 %define brestore brestore
26
27 # set destination directories
28 %define cgidir /var/www/cgi-bin
29 %define docdir /var/www/html
30 %define sysconfdir /etc/bacula
31 %if %{suse}
32 %define cgidir /srv/www/cgi-bin
33 %define docdir /srv/www/htdocs
34 %endif
35
36 # set ownership of files
37 %define binowner root
38 %define bingroup root
39 %define dataowner apache
40 %define datagroup apache
41 %if %{suse}
42 %define dataowner wwwrun
43 %define datagroup www
44 %endif
45
46 %define groupmod /usr/sbin/groupmod
47 %define groupfile /etc/group
48
49 Summary: Bacula - The Network Backup Solution
50 Name: bacula-gui
51 Version: @VERSION@
52 Release: 1
53 Group: System Environment/Daemons
54 License: GPL v2
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>
66
67 %description
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.
72
73 %package bimagemgr
74 Summary: Bacula - The Network Backup Solution
75 Group: System Environment/Daemons
76
77 Requires: perl, perl-DBI, bacula-server, cdrecord, mkisofs
78 %if %{mdk}
79 Requires: apache
80 %else
81 Requires: httpd
82 %endif
83
84 Obsoletes: bacula-bimagemgr
85
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 
93 which have.
94
95 %package web
96 Summary: Bacula - The Network Backup Solution
97 Group: System Environment/Daemons
98
99 Requires: php >= 4, bacula-server
100 %if %{mdk}
101 Requires: apache
102 %else
103 Requires: httpd
104 %endif
105
106 %description web
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.
111
112 %package libbweb
113 Summary: Bacula - The Network Backup Solution
114 Group: System Environment/Daemons
115
116 Requires: perl, perl-DBI, perl-DBD-mysql, perl-DBD-Pg, perl-GDGraph
117 Requires: perl-HTML-Template, perl-Time-modules
118
119 %if %{suse}
120 Requires: perl-CGI-Application
121 %else
122 Requires: perl-CGI
123 %endif
124
125 %description libbweb
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.
130
131 %package brestore
132 Summary: Bacula - The Network Backup Solution
133 Group: System Environment/Daemons
134
135 Requires: perl, perl-DBI, perl-DBD-mysql, perl-DBD-Pg, perl-Expect
136 Requires: perl-Gtk2-GladeXML, bacula-gui-libbweb = %{version}
137
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.
143
144 %package bweb
145 Summary: Bacula - The Network Backup Solution
146 Group: System Environment/Daemons
147
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
151
152 %if %{suse}
153 Requires: perl-CGI-Application
154 %else
155 Requires: perl-CGI
156 %endif
157
158 %description bweb
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.
163
164 %prep
165
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
171
172 %build
173
174 %install
175
176 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
177 rm -rf docs
178
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
187
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}
194
195 %if !%{suse}
196 mkdir -p $RPM_BUILD_ROOT/etc/security/console.apps
197 mkdir -p $RPM_BUILD_ROOT/etc/pam.d
198 %endif
199
200 # install bimagemgr files
201 cp -p %{bimagemgr}-%{version}/bimagemgr.pl $RPM_BUILD_ROOT%{cgidir}/
202 cp -p %{bimagemgr}-%{version}/config.pm $RPM_BUILD_ROOT%{cgidir}/
203 cp -p %{bimagemgr}-%{version}/create_cdimage_table.pl $RPM_BUILD_ROOT%{sysconfdir}/
204 cp -p %{bimagemgr}-%{version}/README $RPM_BUILD_ROOT%{sysconfdir}/README.bimagemgr
205 cp -p %{bimagemgr}-%{version}/bimagemgr.gif $RPM_BUILD_ROOT%{docdir}/
206 cp -p %{bimagemgr}-%{version}/cdrom_spins.gif $RPM_BUILD_ROOT%{docdir}/
207 cp -p %{bimagemgr}-%{version}/clearpixel.gif $RPM_BUILD_ROOT%{docdir}/
208 cp -p %{bimagemgr}-%{version}/temp.html $RPM_BUILD_ROOT%{docdir}/
209
210 chmod 755 $RPM_BUILD_ROOT%{cgidir}/bimagemgr.pl
211 chmod 750 $RPM_BUILD_ROOT%{cgidir}/config.pm
212 chmod 750 $RPM_BUILD_ROOT%{sysconfdir}/create_cdimage_table.pl
213 chmod 644 $RPM_BUILD_ROOT%{sysconfdir}/README.bimagemgr
214 chmod 644 $RPM_BUILD_ROOT%{docdir}/*.gif
215 chmod 664 $RPM_BUILD_ROOT%{docdir}/temp.html
216
217 # install bacula-web files
218 cp -p %{web}-%{version}/README $RPM_BUILD_ROOT%{sysconfdir}/README.bacula-web
219 cp -r -p %{web}-%{version}/* $RPM_BUILD_ROOT%{docdir}/%{web}/
220
221 chmod 644 $RPM_BUILD_ROOT%{sysconfdir}/README.bacula-web
222
223 # install the libbweb files
224 cp -p %{bweb}-%{version}/lib/*.pm $RPM_BUILD_ROOT%{perl_sitearch}/
225 chmod 644 $RPM_BUILD_ROOT%{perl_sitearch}/*.pm
226
227 # install the brestore files
228 cp -p %{brestore}-%{version}/brestore.pl $RPM_BUILD_ROOT/usr/bin/
229 cp -p %{brestore}-%{version}/brestore.glade $RPM_BUILD_ROOT/usr/share/brestore/
230 %if %{suse}
231 cp -p %{brestore}-%{version}/brestore.desktop.xsu $RPM_BUILD_ROOT/usr/share/applications/brestore.desktop
232 %else
233 cp -p %{brestore}-%{version}/brestore.desktop.consolehelper $RPM_BUILD_ROOT/usr/share/applications/brestore.desktop
234 cp -p %{brestore}-%{version}/brestore.console_apps $RPM_BUILD_ROOT/etc/security/console.apps/brestore
235 cp -p %{brestore}-%{version}/brestore.pamd $RPM_BUILD_ROOT/etc/pam.d/brestore
236 ln -sf consolehelper $RPM_BUILD_ROOT/usr/bin/brestore
237 %endif
238 cp -p %{brestore}-%{version}/brestore.png $RPM_BUILD_ROOT/usr/share/pixmaps/
239 chmod 755 $RPM_BUILD_ROOT/usr/bin/brestore.pl
240 chmod 644 $RPM_BUILD_ROOT/usr/share/brestore/brestore.glade
241 chmod 644 $RPM_BUILD_ROOT/usr/share/applications/brestore.desktop
242 chmod 644 $RPM_BUILD_ROOT/usr/share/pixmaps/brestore.png
243
244 # install the bweb files
245 cp -p %{bweb}-%{version}/cgi/*.pl $RPM_BUILD_ROOT%{cgidir}/bweb/
246 chmod 755 $RPM_BUILD_ROOT%{cgidir}/bweb/*
247 echo "template_dir = /usr/share/bweb/tpl" > $RPM_BUILD_ROOT/etc/bweb/config
248 cp -p %{bweb}-%{version}/tpl/*.tpl $RPM_BUILD_ROOT/usr/share/bweb/tpl/
249 chmod 644 $RPM_BUILD_ROOT/usr/share/bweb/tpl/*
250 cp -p %{bweb}-%{version}/html/*.js $RPM_BUILD_ROOT%{docdir}/%{bweb}/
251 cp -p %{bweb}-%{version}/html/*.png $RPM_BUILD_ROOT%{docdir}/%{bweb}/
252 cp -p %{bweb}-%{version}/html/*.css $RPM_BUILD_ROOT%{docdir}/%{bweb}/
253 cp -p %{bweb}-%{version}/html/*.gif $RPM_BUILD_ROOT%{docdir}/%{bweb}/
254 chmod 644 $RPM_BUILD_ROOT%{docdir}/%{bweb}/*
255 cp -p %{bweb}-%{version}/script/bweb-postgresql.sql $RPM_BUILD_ROOT/etc/bweb/
256 chmod 644 $RPM_BUILD_ROOT/etc/bweb/bweb-postgresql.sql
257
258
259 # remove the standard doc files from the install directory
260 rm -f $RPM_BUILD_ROOT%{docdir}/%{web}/ChangeLog
261 rm -f $RPM_BUILD_ROOT%{docdir}/%{web}/CONTACT
262 rm -f $RPM_BUILD_ROOT%{docdir}/%{web}/COPYING
263 rm -f $RPM_BUILD_ROOT%{docdir}/%{web}/README
264 rm -f $RPM_BUILD_ROOT%{docdir}/%{web}/TODO
265
266 # setup the docs dir
267 mkdir -p docs/%{bimagemgr}
268 mkdir docs/%{web}
269 mkdir docs/%{brestore}
270 mkdir docs/%{bweb}
271
272 cp -p %{bimagemgr}-%{version}/README docs/%{bimagemgr}/
273 cp -p %{bimagemgr}-%{version}/COPYING docs/%{bimagemgr}/
274 cp -p %{bimagemgr}-%{version}/ChangeLog docs/%{bimagemgr}/
275 cp -p %{bimagemgr}-%{version}/ReleaseNotes docs/%{bimagemgr}/
276 cp -p bacula-docs-%{version}/manual/%{bimagemgr}.pdf docs/%{bimagemgr}/
277
278 cp -p %{web}-%{version}/README docs/%{web}/
279 cp -p %{web}-%{version}/ChangeLog docs/%{web}/
280 cp -p %{web}-%{version}/CONTACT docs/%{web}/
281 cp -p %{web}-%{version}/COPYING docs/%{web}/
282 cp -p bacula-docs-%{version}/%{web}/%{web}.pdf docs/%{web}/
283
284 cp -p %{brestore}-%{version}/README docs/%{brestore}/
285 cp -p %{brestore}-%{version}/COPYING docs/%{brestore}/
286 cp -p %{brestore}-%{version}/ReleaseNotes docs/%{brestore}/
287
288 cp -p %{bweb}-%{version}/INSTALL docs/%{bweb}/
289 cp -p %{bweb}-%{version}/COPYING docs/%{bweb}/
290 cp -p %{bweb}-%{version}/ReleaseNotes docs/%{bweb}/
291
292 %clean
293 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
294 rm -rf docs
295
296 %files bimagemgr
297 %defattr(-,root,root)
298 %doc docs/%{bimagemgr}/*
299
300 %defattr(-,%{binowner},%{bingroup})
301 %{cgidir}/bimagemgr.pl
302 %{sysconfdir}/create_cdimage_table.pl
303 %{sysconfdir}/README.bimagemgr
304 %{docdir}/bimagemgr.gif
305 %{docdir}/cdrom_spins.gif
306 %{docdir}/clearpixel.gif
307
308 %defattr(-,%{dataowner},%{datagroup})
309 %{docdir}/temp.html
310 %config(noreplace) %{cgidir}/config.pm
311
312 %files web
313 %defattr(-,root,root)
314 %doc docs/%{web}/*
315
316 %defattr(-,%{binowner},%{bingroup})
317 %{sysconfdir}/README.bacula-web
318
319 %defattr(-,%{dataowner},%{datagroup})
320 %{docdir}/%{web}/*.php
321 %{docdir}/%{web}/*.po
322 %{docdir}/%{web}/*.inc
323 %config(noreplace) %{docdir}/%{web}/configs
324 %{docdir}/%{web}/external_packages
325 %{docdir}/%{web}/images
326 %{docdir}/%{web}/js
327 %{docdir}/%{web}/locale
328 %{docdir}/%{web}/templates
329 %{docdir}/%{web}/templates_c
330
331 %files libbweb
332 %defattr(-,root,root)
333 %{perl_sitearch}/*.pm
334
335 %files brestore
336 %defattr(-,root,root)
337 /usr/bin/brestore.pl
338 /usr/share/brestore/brestore.glade
339 /usr/share/applications/brestore.desktop
340 /usr/share/pixmaps/brestore.png
341 %doc docs/%{brestore}/*
342 %if !%{suse}
343 # add the console helper files
344 %config(noreplace,missingok) /etc/pam.d/brestore
345 %config(noreplace,missingok) /etc/security/console.apps/brestore
346 /usr/bin/brestore
347 %endif
348
349 %files bweb
350 %defattr(-,%{binowner},%{bingroup})
351 %{cgidir}/bweb/*.pl
352 /usr/share/bweb/tpl/*.tpl
353 %{docdir}/bweb/*
354 /etc/bweb/bweb-postgresql.sql
355 %doc docs/%{bweb}/*
356
357 %defattr(-,%{binowner},%{datagroup})
358 %dir /etc/bweb
359
360 %defattr(-,%{dataowner},%{datagroup})
361 /etc/bweb/config
362
363 %post bimagemgr
364 %if %{suse}
365 # add the web server user to group bacula
366 %{groupmod} -A %{dataowner} bacula
367 %else
368 # do it the hard way
369 cp -p %{groupfile} %{groupfile}.old
370 awk '{if (/bacula:/) print $0",%{dataowner}"; else print $0}' %{groupfile}.old > %{groupfile}
371 %endif
372
373 %postun bimagemgr
374 %if %{suse}
375 # remove the web server user to group bacula
376 %{groupmod} -R %{dataowner} bacula
377 %else
378 echo
379 echo "You should remove user %{dataowner} from group bacula."
380 echo
381 %endif
382
383 %post bweb
384 %if %{suse}
385 # add the web server user to group bacula
386 %{groupmod} -A %{dataowner} bacula
387 %else
388 # do it the hard way
389 cp -p %{groupfile} %{groupfile}.old
390 awk '{if (/bacula:/) print $0",%{dataowner}"; else print $0}' %{groupfile}.old > %{groupfile}
391 %endif
392
393 %postun bweb
394 %if %{suse}
395 # remove the web server user to group bacula
396 %{groupmod} -R %{dataowner} bacula
397 %else
398 echo
399 echo "You should remove user %{dataowner} from group bacula."
400 echo
401 %endif
402
403 %changelog
404 * Sun Sep 24 2006 D. Scott Barninger <barninger at fairfieldcomputers.com>
405 - it's bweb not brestore that needs to add dataowner to group bacula
406 - brestore will need to run xsu or consolehelper
407 * Sun Sep 03 2006 D. Scott Barninger <barninger at fairfieldcomputers.com>
408 - seems that groupmod -A or -R is only available on SuSE
409 - use awk or add warning for other platforms
410 * Sat Aug 26 2006 D. Scott Barninger <barninger at fairfieldcomputers.com>
411 - add brestore menu entry and post script
412 - add /etc/bweb/bweb-postgresql.sql
413 - add bweb and brestore docs
414 * Sun Aug 20 2006 D. Scott Barninger <barninger at fairfieldcomputers.com>
415 - add libbweb, bweb and brestore packages
416 * Sun May 14 2006 D. Scott Barninger <barninger at fairfieldcomputers.com>
417 - add bimagemgr manual
418 * Sun May 07 2006 D. Scott Barninger <barninger at fairfieldcomputers.com>
419 - refine files section for web
420 - add documentation
421 - add config.pm for bimagemgr
422 - add post script bimagemgr to add web server user to group bacula
423 * Sat May 06 2006 D. Scott Barninger <barninger at fairfieldcomputers.com>
424 - was bimagemgr spec convert to bacula-gui spec. include bacula-web
425 * Thu Dec 09 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
426 - ASSIGNMENT OF COPYRIGHT
427 - FOR VALUE RECEIVED, D. Scott Barninger hereby sells, transfers and 
428 - assigns unto Kern Sibbald, his successors, assigns and personal representatives, 
429 - all right, title and interest in and to the copyright in this software RPM
430 - spec file. D. Scott Barninger warrants good title to said copyright, that it is 
431 - free of all liens, encumbrances or any known claims against said copyright.
432 * Sun Nov 14 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
433 - initial spec file