]> git.sur5r.net Git - bacula/bacula/blob - gui/bacula-gui.spec.in
4d8c9be1f9ca5e65319e216dc06c6e03a1015478
[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
185 mkdir -p $RPM_BUILD_ROOT%{cgidir}/bweb
186 chmod 755 $RPM_BUILD_ROOT%{cgidir}/bweb
187 mkdir -p $RPM_BUILD_ROOT/etc/bweb
188 chmod 750 $RPM_BUILD_ROOT/etc/bweb
189 mkdir -p $RPM_BUILD_ROOT/usr/share/bweb/tpl
190 mkdir -p $RPM_BUILD_ROOT%{docdir}/%{bweb}
191
192 # install bimagemgr files
193 cp -p %{bimagemgr}-%{version}/bimagemgr.pl $RPM_BUILD_ROOT%{cgidir}/
194 cp -p %{bimagemgr}-%{version}/config.pm $RPM_BUILD_ROOT%{cgidir}/
195 cp -p %{bimagemgr}-%{version}/create_cdimage_table.pl $RPM_BUILD_ROOT%{sysconfdir}/
196 cp -p %{bimagemgr}-%{version}/README $RPM_BUILD_ROOT%{sysconfdir}/README.bimagemgr
197 cp -p %{bimagemgr}-%{version}/bimagemgr.gif $RPM_BUILD_ROOT%{docdir}/
198 cp -p %{bimagemgr}-%{version}/cdrom_spins.gif $RPM_BUILD_ROOT%{docdir}/
199 cp -p %{bimagemgr}-%{version}/clearpixel.gif $RPM_BUILD_ROOT%{docdir}/
200 cp -p %{bimagemgr}-%{version}/temp.html $RPM_BUILD_ROOT%{docdir}/
201
202 chmod 755 $RPM_BUILD_ROOT%{cgidir}/bimagemgr.pl
203 chmod 750 $RPM_BUILD_ROOT%{cgidir}/config.pm
204 chmod 750 $RPM_BUILD_ROOT%{sysconfdir}/create_cdimage_table.pl
205 chmod 644 $RPM_BUILD_ROOT%{sysconfdir}/README.bimagemgr
206 chmod 644 $RPM_BUILD_ROOT%{docdir}/*.gif
207 chmod 664 $RPM_BUILD_ROOT%{docdir}/temp.html
208
209 # install bacula-web files
210 cp -p %{web}-%{version}/README $RPM_BUILD_ROOT%{sysconfdir}/README.bacula-web
211 cp -r -p %{web}-%{version}/* $RPM_BUILD_ROOT%{docdir}/%{web}/
212
213 chmod 644 $RPM_BUILD_ROOT%{sysconfdir}/README.bacula-web
214
215 # install the libbweb files
216 cp -p %{bweb}-%{version}/lib/*.pm $RPM_BUILD_ROOT%{perl_sitearch}/
217 chmod 644 $RPM_BUILD_ROOT%{perl_site_arch}/*.pm
218
219 # install the brestore files
220 cp -p %{brestore}-%{version}/brestore.pl $RPM_BUILD_ROOT/usr/bin/
221 cp -p %{brestore}-%{version}/brestore.glade $RPM_BUILD_ROOT/usr/share/brestore/
222 chmod 755 $RPM_BUILD_ROOT/usr/bin/brestore.pl
223 chmod 644 $RPM_BUILD_ROOT/usr/share/brestore/brestore.glade
224
225 # install the bweb files
226 cp -p %{bweb}-%{version}/cgi/*.pl $RPM_BUILD_ROOT%{cgidir}/bweb/
227 chmod 755 $RPM_BUILD_ROOT%{cgidir}/bweb/*
228 echo '$VAR1 = { template_dir => "/usr/share/bweb/tpl"};' > $RPM_BUILD_ROOT/etc/bweb/config
229 cp -p %{bweb}-%{version}/tpl/*.tpl $RPM_BUILD_ROOT/usr/share/bweb/tpl/
230 chmod 644 $RPM_BUILD_ROOT/usr/share/bweb/tpl/*
231 cp -p %{bweb}-%{version}/html/*.js $RPM_BUILD_ROOT%{docdir}/%{bweb}/
232 cp -p %{bweb}-%{version}/html/*.png $RPM_BUILD_ROOT%{docdir}/%{bweb}/
233 cp -p %{bweb}-%{version}/html/*.css $RPM_BUILD_ROOT%{docdir}/%{bweb}/
234 cp -p %{bweb}-%{version}/html/*.gif $RPM_BUILD_ROOT%{docdir}/%{bweb}/
235 cp -p %{bweb}-%{version}/html/*.ico $RPM_BUILD_ROOT%{docdir}/%{bweb}/
236 chmod 644 $RPM_BUILD_ROOT%{docdir}/%{bweb}/*
237
238
239 # remove the standard doc files from the install directory
240 rm -f $RPM_BUILD_ROOT%{docdir}/%{web}/ChangeLog
241 rm -f $RPM_BUILD_ROOT%{docdir}/%{web}/CONTACT
242 rm -f $RPM_BUILD_ROOT%{docdir}/%{web}/COPYING
243 rm -f $RPM_BUILD_ROOT%{docdir}/%{web}/README
244 rm -f $RPM_BUILD_ROOT%{docdir}/%{web}/TODO
245
246 # setup the docs dir
247 mkdir -p docs/%{bimagemgr}
248 mkdir docs/%{web}
249
250 cp -p %{bimagemgr}-%{version}/README docs/%{bimagemgr}/
251 cp -p %{bimagemgr}-%{version}/COPYING docs/%{bimagemgr}/
252 cp -p %{bimagemgr}-%{version}/ChangeLog docs/%{bimagemgr}/
253 cp -p %{bimagemgr}-%{version}/ReleaseNotes docs/%{bimagemgr}/
254 cp -p bacula-docs-%{version}/manual/%{bimagemgr}.pdf docs/%{bimagemgr}/
255
256 cp -p %{web}-%{version}/README docs/%{web}/
257 cp -p %{web}-%{version}/ChangeLog docs/%{web}/
258 cp -p %{web}-%{version}/CONTACT docs/%{web}/
259 cp -p %{web}-%{version}/COPYING docs/%{web}/
260 cp -p bacula-docs-%{version}/%{web}/%{web}.pdf docs/%{web}/
261
262 %clean
263 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
264 rm -rf docs
265
266 %files bimagemgr
267 %defattr(-,root,root)
268 %doc docs/%{bimagemgr}/*
269
270 %defattr(-,%{binowner},%{bingroup})
271 %{cgidir}/bimagemgr.pl
272 %{sysconfdir}/create_cdimage_table.pl
273 %{sysconfdir}/README.bimagemgr
274 %{docdir}/bimagemgr.gif
275 %{docdir}/cdrom_spins.gif
276 %{docdir}/clearpixel.gif
277
278 %defattr(-,%{dataowner},%{datagroup})
279 %{docdir}/temp.html
280 %config(noreplace) %{cgidir}/config.pm
281
282 %files web
283 %defattr(-,root,root)
284 %doc docs/%{web}/*
285
286 %defattr(-,%{binowner},%{bingroup})
287 %{sysconfdir}/README.bacula-web
288
289 %defattr(-,%{dataowner},%{datagroup})
290 %{docdir}/%{web}/*.php
291 %{docdir}/%{web}/*.po
292 %{docdir}/%{web}/*.inc
293 %config(noreplace) %{docdir}/%{web}/configs
294 %{docdir}/%{web}/external_packages
295 %{docdir}/%{web}/images
296 %{docdir}/%{web}/js
297 %{docdir}/%{web}/locale
298 %{docdir}/%{web}/templates
299 %{docdir}/%{web}/templates_c
300
301 %files libbweb
302 %defattr(-,root,root)
303 %{perl_sitearch}/*.pm
304
305 %files brestore
306 %defattr(-,root,root)
307 /usr/bin/brestore.pl
308 /usr/share/brestore/brestore.glade
309
310 %files bweb
311 %defattr(-,%{binowner},%{bingroup})
312 %{cgidir}/bweb/*.pl
313 /usr/share/bweb/tpl/*.tpl
314 %{docdir}/bweb/*
315
316 %defattr(-,%{binowner},%{datagroup})
317 %dir /etc/bweb
318
319 %defattr(-,%{dataowner},%{datagroup})
320 /etc/bweb/config
321
322 %post bimagemgr
323
324 # add the web server user to group bacula
325 %{groupmod} -A %{dataowner} bacula
326
327 %postun bimagemgr
328 # remove the web server user to group bacula
329 %{groupmod} -R %{dataowner} bacula
330
331 %changelog
332 * Sun Aug 20 2006 D. Scott Barninger <barninger at fairfieldcomputers.com>
333 - add libbweb, bweb and brestore packages
334 * Sun May 14 2006 D. Scott Barninger <barninger at fairfieldcomputers.com>
335 - add bimagemgr manual
336 * Sun May 07 2006 D. Scott Barninger <barninger at fairfieldcomputers.com>
337 - refine files section for web
338 - add documentation
339 - add config.pm for bimagemgr
340 - add post script bimagemgr to add web server user to group bacula
341 * Sat May 06 2006 D. Scott Barninger <barninger at fairfieldcomputers.com>
342 - was bimagemgr spec convert to bacula-gui spec. include bacula-web
343 * Thu Dec 09 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
344 - ASSIGNMENT OF COPYRIGHT
345 - FOR VALUE RECEIVED, D. Scott Barninger hereby sells, transfers and 
346 - assigns unto Kern Sibbald, his successors, assigns and personal representatives, 
347 - all right, title and interest in and to the copyright in this software RPM
348 - spec file. D. Scott Barninger warrants good title to said copyright, that it is 
349 - free of all liens, encumbrances or any known claims against said copyright.
350 * Sun Nov 14 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
351 - initial spec file