]> git.sur5r.net Git - bacula/bacula/blob - gui/bacula-gui.spec.in
b35765e2f42551816c64336dd2c8d97846b88117
[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
48 Summary: Bacula - The Network Backup Solution
49 Name: bacula-gui
50 Version: @VERSION@
51 Release: 1
52 Group: System Environment/Daemons
53 License: GPL v2
54 Source0: %{web}-%{version}.tar.gz
55 Source1: %{bimagemgr}-%{version}.tar.gz
56 Source2: bacula-docs-%{version}.tar.gz
57 Source3: %{bweb}-%{version}.tar.gz
58 Source4: %{brestore}-%{version}.tar.gz
59 BuildRoot: %{_tmppath}/%{name}-root
60 URL: http://www.bacula.org/
61 BuildArchitectures: noarch
62 Vendor: The Bacula Team
63 Distribution: The Bacula Team 
64 Packager: D. Scott Barninger <barninger at fairfieldcomputers dot com>
65
66 %description
67 Bacula is a set of computer programs that permit you (or the system 
68 administrator) to manage backup, recovery, and verification of computer 
69 data across a network of computers of different kinds. bacula-gui is a 
70 set of web server based tools used to manage backups.
71
72 %package bimagemgr
73 Summary: Bacula - The Network Backup Solution
74 Group: System Environment/Daemons
75
76 Requires: perl, perl-DBI, bacula-server, cdrecord, mkisofs
77 %if %{mdk}
78 Requires: apache
79 %else
80 Requires: httpd
81 %endif
82
83 Obsoletes: bacula-bimagemgr
84
85 %description bimagemgr
86 Bacula is a set of computer programs that permit you (or the system 
87 administrator) to manage backup, recovery, and verification of computer 
88 data across a network of computers of different kinds. bimagemgr is a 
89 utility to manage backups made to files intended for burning to CDR 
90 disk. bimagemgr allows you to easily see which Volumes have been written 
91 to more recently than they have been recorded to CDR disk and record those 
92 which have.
93
94 %package web
95 Summary: Bacula - The Network Backup Solution
96 Group: System Environment/Daemons
97
98 Requires: php >= 4, bacula-server
99 %if %{mdk}
100 Requires: apache
101 %else
102 Requires: httpd
103 %endif
104
105 %description web
106 Bacula is a set of computer programs that permit you (or the system 
107 administrator) to manage backup, recovery, and verification of computer 
108 data across a network of computers of different kinds. bacula-web is a 
109 web server based utility to monitor your bacula server.
110
111 %package libbweb
112 Summary: Bacula - The Network Backup Solution
113 Group: System Environment/Daemons
114
115 Requires: perl, perl-DBI, perl-DBD-mysql, perl-DBD-Pg, perl-GDGraph
116 Requires: perl-HTML-Template, perl-Time-modules
117
118 %if %{suse}
119 Requires: perl-CGI-Application
120 %else
121 Requires: perl-CGI
122 %endif
123
124 %description libbweb
125 Bacula is a set of computer programs that permit you (or the system 
126 administrator) to manage backup, recovery, and verification of computer 
127 data across a network of computers of different kinds. libbweb is a set 
128 of perl modules required by bacula-gui-bweb and bacula-gui-brestore utilities.
129
130 %package brestore
131 Summary: Bacula - The Network Backup Solution
132 Group: System Environment/Daemons
133
134 Requires: perl, perl-DBI, perl-DBD-mysql, perl-DBD-Pg, perl-Expect
135 Requires: perl-Gtk2-GladeXML, bacula-gui-libbweb = %{version}
136
137 %description brestore
138 Bacula is a set of computer programs that permit you (or the system 
139 administrator) to manage backup, recovery, and verification of computer 
140 data across a network of computers of different kinds. brestore is a file 
141 restoration interface.
142
143 %package bweb
144 Summary: Bacula - The Network Backup Solution
145 Group: System Environment/Daemons
146
147 Requires: perl, perl-DBI, perl-DBD-mysql, perl-DBD-Pg, perl-GDGraph
148 Requires: perl-HTML-Template, perl-Time-modules, bacula-gui-libbweb
149 Requires: bacula-server
150
151 %if %{suse}
152 Requires: perl-CGI-Application
153 %else
154 Requires: perl-CGI
155 %endif
156
157 %description bweb
158 Bacula is a set of computer programs that permit you (or the system 
159 administrator) to manage backup, recovery, and verification of computer 
160 data across a network of computers of different kinds. bweb is a web based 
161 interface for a bacula server.
162
163 %prep
164
165 # unpack both sources inside a directory with package name and version
166 %setup -c %{name} -D -b 1
167 %setup -c %{name} -T -D -b 2
168 %setup -c %{name} -T -D -b 3
169 %setup -c %{name} -T -D -b 4
170
171 %build
172
173 %install
174
175 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
176 rm -rf docs
177
178 mkdir -p $RPM_BUILD_ROOT%{cgidir}
179 mkdir -p $RPM_BUILD_ROOT%{docdir}/%{web}
180 mkdir -p $RPM_BUILD_ROOT%{sysconfdir}
181 mkdir -p $RPM_BUILD_ROOT%{perl_sitearch}
182 mkdir -p $RPM_BUILD_ROOT/usr/bin
183 mkdir -p $RPM_BUILD_ROOT/usr/share/brestore
184 mkdir -p $RPM_BUILD_ROOT/usr/share/applications
185 mkdir -p $RPM_BUILD_ROOT/usr/share/pixmaps
186
187 mkdir -p $RPM_BUILD_ROOT%{cgidir}/bweb
188 chmod 755 $RPM_BUILD_ROOT%{cgidir}/bweb
189 mkdir -p $RPM_BUILD_ROOT/etc/bweb
190 chmod 750 $RPM_BUILD_ROOT/etc/bweb
191 mkdir -p $RPM_BUILD_ROOT/usr/share/bweb/tpl
192 mkdir -p $RPM_BUILD_ROOT%{docdir}/%{bweb}
193
194 # install bimagemgr files
195 cp -p %{bimagemgr}-%{version}/bimagemgr.pl $RPM_BUILD_ROOT%{cgidir}/
196 cp -p %{bimagemgr}-%{version}/config.pm $RPM_BUILD_ROOT%{cgidir}/
197 cp -p %{bimagemgr}-%{version}/create_cdimage_table.pl $RPM_BUILD_ROOT%{sysconfdir}/
198 cp -p %{bimagemgr}-%{version}/README $RPM_BUILD_ROOT%{sysconfdir}/README.bimagemgr
199 cp -p %{bimagemgr}-%{version}/bimagemgr.gif $RPM_BUILD_ROOT%{docdir}/
200 cp -p %{bimagemgr}-%{version}/cdrom_spins.gif $RPM_BUILD_ROOT%{docdir}/
201 cp -p %{bimagemgr}-%{version}/clearpixel.gif $RPM_BUILD_ROOT%{docdir}/
202 cp -p %{bimagemgr}-%{version}/temp.html $RPM_BUILD_ROOT%{docdir}/
203
204 chmod 755 $RPM_BUILD_ROOT%{cgidir}/bimagemgr.pl
205 chmod 750 $RPM_BUILD_ROOT%{cgidir}/config.pm
206 chmod 750 $RPM_BUILD_ROOT%{sysconfdir}/create_cdimage_table.pl
207 chmod 644 $RPM_BUILD_ROOT%{sysconfdir}/README.bimagemgr
208 chmod 644 $RPM_BUILD_ROOT%{docdir}/*.gif
209 chmod 664 $RPM_BUILD_ROOT%{docdir}/temp.html
210
211 # install bacula-web files
212 cp -p %{web}-%{version}/README $RPM_BUILD_ROOT%{sysconfdir}/README.bacula-web
213 cp -r -p %{web}-%{version}/* $RPM_BUILD_ROOT%{docdir}/%{web}/
214
215 chmod 644 $RPM_BUILD_ROOT%{sysconfdir}/README.bacula-web
216
217 # install the libbweb files
218 cp -p %{bweb}-%{version}/lib/*.pm $RPM_BUILD_ROOT%{perl_sitearch}/
219 chmod 644 $RPM_BUILD_ROOT%{perl_site_arch}/*.pm
220
221 # install the brestore files
222 cp -p %{brestore}-%{version}/brestore.pl $RPM_BUILD_ROOT/usr/bin/
223 cp -p %{brestore}-%{version}/brestore.glade $RPM_BUILD_ROOT/usr/share/brestore/
224 cp -p %{brestore}-%{version}/brestore.desktop $RPM_BUILD_ROOT/usr/share/applications/
225 cp -p %{brestore}-%{version}/brestore.png $RPM_BUILD_ROOT/usr/share/pixmaps/
226 chmod 755 $RPM_BUILD_ROOT/usr/bin/brestore.pl
227 chmod 644 $RPM_BUILD_ROOT/usr/share/brestore/brestore.glade
228 chmod 644 $RPM_BUILD_ROOT/usr/share/applications/brestore.desktop
229 chmod 644 $RPM_BUILD_ROOT/usr/share/pixmaps/brestore.png
230
231 # install the bweb files
232 cp -p %{bweb}-%{version}/cgi/*.pl $RPM_BUILD_ROOT%{cgidir}/bweb/
233 chmod 755 $RPM_BUILD_ROOT%{cgidir}/bweb/*
234 echo "template_dir = /usr/share/bweb/tpl" > $RPM_BUILD_ROOT/etc/bweb/config
235 cp -p %{bweb}-%{version}/tpl/*.tpl $RPM_BUILD_ROOT/usr/share/bweb/tpl/
236 chmod 644 $RPM_BUILD_ROOT/usr/share/bweb/tpl/*
237 cp -p %{bweb}-%{version}/html/*.js $RPM_BUILD_ROOT%{docdir}/%{bweb}/
238 cp -p %{bweb}-%{version}/html/*.png $RPM_BUILD_ROOT%{docdir}/%{bweb}/
239 cp -p %{bweb}-%{version}/html/*.css $RPM_BUILD_ROOT%{docdir}/%{bweb}/
240 cp -p %{bweb}-%{version}/html/*.gif $RPM_BUILD_ROOT%{docdir}/%{bweb}/
241 chmod 644 $RPM_BUILD_ROOT%{docdir}/%{bweb}/*
242 cp -p %{bweb}-%{version}/script/bweb-postgresql.sql $RPM_BUILD_ROOT/etc/bweb/
243 chmod 644 $RPM_BUILD_ROOT/etc/bweb/bweb-postgresql.sql
244
245
246 # remove the standard doc files from the install directory
247 rm -f $RPM_BUILD_ROOT%{docdir}/%{web}/ChangeLog
248 rm -f $RPM_BUILD_ROOT%{docdir}/%{web}/CONTACT
249 rm -f $RPM_BUILD_ROOT%{docdir}/%{web}/COPYING
250 rm -f $RPM_BUILD_ROOT%{docdir}/%{web}/README
251 rm -f $RPM_BUILD_ROOT%{docdir}/%{web}/TODO
252
253 # setup the docs dir
254 mkdir -p docs/%{bimagemgr}
255 mkdir docs/%{web}
256 mkdir docs/%{brestore}
257 mkdir docs/%{bweb}
258
259 cp -p %{bimagemgr}-%{version}/README docs/%{bimagemgr}/
260 cp -p %{bimagemgr}-%{version}/COPYING docs/%{bimagemgr}/
261 cp -p %{bimagemgr}-%{version}/ChangeLog docs/%{bimagemgr}/
262 cp -p %{bimagemgr}-%{version}/ReleaseNotes docs/%{bimagemgr}/
263 cp -p bacula-docs-%{version}/manual/%{bimagemgr}.pdf docs/%{bimagemgr}/
264
265 cp -p %{web}-%{version}/README docs/%{web}/
266 cp -p %{web}-%{version}/ChangeLog docs/%{web}/
267 cp -p %{web}-%{version}/CONTACT docs/%{web}/
268 cp -p %{web}-%{version}/COPYING docs/%{web}/
269 cp -p bacula-docs-%{version}/%{web}/%{web}.pdf docs/%{web}/
270
271 cp -p %{brestore}-%{version}/README docs/%{brestore}/
272 cp -p %{brestore}-%{version}/COPYING docs/%{brestore}/
273 cp -p %{brestore}-%{version}/ReleaseNotes docs/%{brestore}/
274
275 cp -p %{bweb}-%{version}/INSTALL docs/%{bweb}/
276 cp -p %{bweb}-%{version}/COPYING docs/%{bweb}/
277 cp -p %{bweb}-%{version}/ReleaseNotes docs/%{bweb}/
278
279 %clean
280 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
281 rm -rf docs
282
283 %files bimagemgr
284 %defattr(-,root,root)
285 %doc docs/%{bimagemgr}/*
286
287 %defattr(-,%{binowner},%{bingroup})
288 %{cgidir}/bimagemgr.pl
289 %{sysconfdir}/create_cdimage_table.pl
290 %{sysconfdir}/README.bimagemgr
291 %{docdir}/bimagemgr.gif
292 %{docdir}/cdrom_spins.gif
293 %{docdir}/clearpixel.gif
294
295 %defattr(-,%{dataowner},%{datagroup})
296 %{docdir}/temp.html
297 %config(noreplace) %{cgidir}/config.pm
298
299 %files web
300 %defattr(-,root,root)
301 %doc docs/%{web}/*
302
303 %defattr(-,%{binowner},%{bingroup})
304 %{sysconfdir}/README.bacula-web
305
306 %defattr(-,%{dataowner},%{datagroup})
307 %{docdir}/%{web}/*.php
308 %{docdir}/%{web}/*.po
309 %{docdir}/%{web}/*.inc
310 %config(noreplace) %{docdir}/%{web}/configs
311 %{docdir}/%{web}/external_packages
312 %{docdir}/%{web}/images
313 %{docdir}/%{web}/js
314 %{docdir}/%{web}/locale
315 %{docdir}/%{web}/templates
316 %{docdir}/%{web}/templates_c
317
318 %files libbweb
319 %defattr(-,root,root)
320 %{perl_sitearch}/*.pm
321
322 %files brestore
323 %defattr(-,root,root)
324 /usr/bin/brestore.pl
325 /usr/share/brestore/brestore.glade
326 /usr/share/applications/brestore.desktop
327 /usr/share/pixmaps/brestore.png
328 %doc docs/%{brestore}/*
329
330 %files bweb
331 %defattr(-,%{binowner},%{bingroup})
332 %{cgidir}/bweb/*.pl
333 /usr/share/bweb/tpl/*.tpl
334 %{docdir}/bweb/*
335 /etc/bweb/bweb-postgresql.sql
336 %doc docs/%{bweb}/*
337
338 %defattr(-,%{binowner},%{datagroup})
339 %dir /etc/bweb
340
341 %defattr(-,%{dataowner},%{datagroup})
342 /etc/bweb/config
343
344 %post bimagemgr
345 %if %{suse}
346 # add the web server user to group bacula
347 %{groupmod} -A %{dataowner} bacula
348 %else
349 echo
350 echo "You must add user %{dataowner} to group bacula."
351 echo
352 %endif
353
354 %postun bimagemgr
355 %if %{suse}
356 # remove the web server user to group bacula
357 %{groupmod} -R %{dataowner} bacula
358 %else
359 echo
360 echo "You should remove user %{dataowner} from group bacula."
361 echo
362 %endif
363
364 %post brestore
365 %if %{suse}
366 # add the web server user to group bacula
367 %{groupmod} -A %{dataowner} bacula
368 %else
369 echo
370 echo "You must add user %{dataowner} to group bacula."
371 echo
372 %endif
373
374 %postun brestore
375 %if %{suse}
376 # remove the web server user to group bacula
377 %{groupmod} -R %{dataowner} bacula
378 %else
379 echo
380 echo "You should remove user %{dataowner} from group bacula."
381 echo
382 %endif
383
384 %changelog
385 * Sun Sep 03 2006 D. Scott Barninger <barninger at fairfieldcomputers.com>
386 - seems that groupmod -A or -R is only available on SuSE
387 - add warning for other platforms
388 * Sat Aug 26 2006 D. Scott Barninger <barninger at fairfieldcomputers.com>
389 - add brestore menu entry and post script
390 - add /etc/bweb/bweb-postgresql.sql
391 - add bweb and brestore docs
392 * Sun Aug 20 2006 D. Scott Barninger <barninger at fairfieldcomputers.com>
393 - add libbweb, bweb and brestore packages
394 * Sun May 14 2006 D. Scott Barninger <barninger at fairfieldcomputers.com>
395 - add bimagemgr manual
396 * Sun May 07 2006 D. Scott Barninger <barninger at fairfieldcomputers.com>
397 - refine files section for web
398 - add documentation
399 - add config.pm for bimagemgr
400 - add post script bimagemgr to add web server user to group bacula
401 * Sat May 06 2006 D. Scott Barninger <barninger at fairfieldcomputers.com>
402 - was bimagemgr spec convert to bacula-gui spec. include bacula-web
403 * Thu Dec 09 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
404 - ASSIGNMENT OF COPYRIGHT
405 - FOR VALUE RECEIVED, D. Scott Barninger hereby sells, transfers and 
406 - assigns unto Kern Sibbald, his successors, assigns and personal representatives, 
407 - all right, title and interest in and to the copyright in this software RPM
408 - spec file. D. Scott Barninger warrants good title to said copyright, that it is 
409 - free of all liens, encumbrances or any known claims against said copyright.
410 * Sun Nov 14 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
411 - initial spec file