]> git.sur5r.net Git - bacula/bacula/blob - gui/bacula-gui.spec.in
ae8963357d5dd89030495ff0683230d414bfa320
[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
25 # set destination directories
26 %define cgidir /var/www/cgi-bin
27 %define docdir /var/www/html
28 %define sysconfdir /etc/bacula
29 %if %{suse}
30 %define cgidir /srv/www/cgi-bin
31 %define docdir /srv/www/htdocs
32 %endif
33
34 # set ownership of files
35 %define binowner root
36 %define bingroup root
37 %define dataowner apache
38 %define datagroup apache
39 %if %{suse}
40 %define dataowner wwwrun
41 %define datagroup www
42 %endif
43
44 %define groupmod /usr/sbin/groupmod
45
46 Summary: Bacula - The Network Backup Solution
47 Name: bacula-gui
48 Version: @VERSION@
49 Release: 1
50 Group: System Environment/Daemons
51 Copyright: GPL v2
52 Source0: %{web}-%{version}.tar.gz
53 Source1: %{bimagemgr}-%{version}.tar.gz
54 Source2: bacula-docs-%{version}.tar.gz
55 BuildRoot: %{_tmppath}/%{name}-root
56 URL: http://www.bacula.org/
57 BuildArchitectures: noarch
58 Vendor: The Bacula Team
59 Distribution: The Bacula Team 
60 Packager: D. Scott Barninger <barninger at fairfieldcomputers dot com>
61
62 %description
63 Bacula is a set of computer programs that permit you (or the system 
64 administrator) to manage backup, recovery, and verification of computer 
65 data across a network of computers of different kinds. bacula-gui is a 
66 set of web server based tools used to manage backups.
67
68 %package bimagemgr
69 Summary: Bacula - The Network Backup Solution
70 Group: System Environment/Daemons
71
72 Requires: perl, perl-DBI, bacula-server, cdrecord, mkisofs
73 %if %{mdk}
74 Requires: apache
75 %else
76 Requires: httpd
77 %endif
78
79 Obsoletes: bacula-bimagemgr
80
81 %description bimagemgr
82 Bacula is a set of computer programs that permit you (or the system 
83 administrator) to manage backup, recovery, and verification of computer 
84 data across a network of computers of different kinds. bimagemgr is a 
85 utility to manage backups made to files intended for burning to CDR 
86 disk. bimagemgr allows you to easily see which Volumes have been written 
87 to more recently than they have been recorded to CDR disk and record those 
88 which have.
89
90 %package web
91 Summary: Bacula - The Network Backup Solution
92 Group: System Environment/Daemons
93
94 Requires: php >= 4, bacula-server
95 %if %{mdk}
96 Requires: apache
97 %else
98 Requires: httpd
99 %endif
100
101 %description web
102 Bacula is a set of computer programs that permit you (or the system 
103 administrator) to manage backup, recovery, and verification of computer 
104 data across a network of computers of different kinds. bacula-web is a 
105 web server based utility to monitor your bacula server.
106
107 %prep
108
109 # unpack both sources inside a directory with package name and version
110 %setup -c %{name} -D -b 1
111 %setup -c %{name} -T -D -b 2
112
113 %build
114
115 %install
116
117 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
118 rm -rf docs
119
120 mkdir -p $RPM_BUILD_ROOT%{cgidir}
121 mkdir -p $RPM_BUILD_ROOT%{docdir}/%{web}
122 mkdir -p $RPM_BUILD_ROOT%{sysconfdir}
123
124 # install bimagemgr files
125 cp -p %{bimagemgr}-%{version}/bimagemgr.pl $RPM_BUILD_ROOT%{cgidir}/
126 cp -p %{bimagemgr}-%{version}/config.pm $RPM_BUILD_ROOT%{cgidir}/
127 cp -p %{bimagemgr}-%{version}/create_cdimage_table.pl $RPM_BUILD_ROOT%{sysconfdir}/
128 cp -p %{bimagemgr}-%{version}/README $RPM_BUILD_ROOT%{sysconfdir}/README.bimagemgr
129 cp -p %{bimagemgr}-%{version}/bimagemgr.gif $RPM_BUILD_ROOT%{docdir}/
130 cp -p %{bimagemgr}-%{version}/cdrom_spins.gif $RPM_BUILD_ROOT%{docdir}/
131 cp -p %{bimagemgr}-%{version}/clearpixel.gif $RPM_BUILD_ROOT%{docdir}/
132 cp -p %{bimagemgr}-%{version}/temp.html $RPM_BUILD_ROOT%{docdir}/
133
134 chmod 755 $RPM_BUILD_ROOT%{cgidir}/bimagemgr.pl
135 chmod 750 $RPM_BUILD_ROOT%{cgidir}/config.pm
136 chmod 750 $RPM_BUILD_ROOT%{sysconfdir}/create_cdimage_table.pl
137 chmod 644 $RPM_BUILD_ROOT%{sysconfdir}/README.bimagemgr
138 chmod 644 $RPM_BUILD_ROOT%{docdir}/*.gif
139 chmod 664 $RPM_BUILD_ROOT%{docdir}/temp.html
140
141 # install bacula-web files
142 cp -p %{web}-%{version}/README $RPM_BUILD_ROOT%{sysconfdir}/README.bacula-web
143 cp -r -p %{web}-%{version}/* $RPM_BUILD_ROOT%{docdir}/%{web}/
144
145 chmod 644 $RPM_BUILD_ROOT%{sysconfdir}/README.bacula-web
146
147 # remove the standard doc files from the install directory
148 rm -f $RPM_BUILD_ROOT%{docdir}/%{web}/ChangeLog
149 rm -f $RPM_BUILD_ROOT%{docdir}/%{web}/CONTACT
150 rm -f $RPM_BUILD_ROOT%{docdir}/%{web}/COPYING
151 rm -f $RPM_BUILD_ROOT%{docdir}/%{web}/README
152 rm -f $RPM_BUILD_ROOT%{docdir}/%{web}/TODO
153
154 # setup the docs dir
155 mkdir -p docs/%{bimagemgr}
156 mkdir docs/%{web}
157
158 cp -p %{bimagemgr}-%{version}/README docs/%{bimagemgr}/
159 cp -p %{bimagemgr}-%{version}/COPYING docs/%{bimagemgr}/
160 cp -p %{bimagemgr}-%{version}/ChangeLog docs/%{bimagemgr}/
161 cp -p %{bimagemgr}-%{version}/ReleaseNotes docs/%{bimagemgr}/
162 cp -p bacula-docs-%{version}/manual/%{bimagemgr}.pdf docs/%{bimagemgr}/
163
164 cp -p %{web}-%{version}/README docs/%{web}/
165 cp -p %{web}-%{version}/ChangeLog docs/%{web}/
166 cp -p %{web}-%{version}/CONTACT docs/%{web}/
167 cp -p %{web}-%{version}/COPYING docs/%{web}/
168 cp -p bacula-docs-%{version}/%{web}/%{web}.pdf docs/%{web}/
169
170 %clean
171 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
172 rm -rf docs
173
174 %files bimagemgr
175 %defattr(-,root,root)
176 %doc docs/%{bimagemgr}/*
177
178 %defattr(-,%{binowner},%{bingroup})
179 %{cgidir}/bimagemgr.pl
180 %{sysconfdir}/create_cdimage_table.pl
181 %{sysconfdir}/README.bimagemgr
182 %{docdir}/bimagemgr.gif
183 %{docdir}/cdrom_spins.gif
184 %{docdir}/clearpixel.gif
185
186 %defattr(-,%{dataowner},%{datagroup})
187 %{docdir}/temp.html
188 %config(noreplace) %{cgidir}/config.pm
189
190 %files web
191 %defattr(-,root,root)
192 %doc docs/%{web}/*
193
194 %defattr(-,%{binowner},%{bingroup})
195 %{sysconfdir}/README.bacula-web
196
197 %defattr(-,%{dataowner},%{datagroup})
198 %{docdir}/%{web}/*.php
199 %{docdir}/%{web}/*.po
200 %{docdir}/%{web}/*.inc
201 %config(noreplace) %{docdir}/%{web}/configs
202 %{docdir}/%{web}/external_packages
203 %{docdir}/%{web}/images
204 %{docdir}/%{web}/js
205 %{docdir}/%{web}/locale
206 %{docdir}/%{web}/templates
207 %{docdir}/%{web}/templates_c
208
209 %post bimagemgr
210
211 # add the web server user to group bacula
212 %{groupmod} -A %{dataowner} bacula
213
214 %postun bimagemgr
215 # remove the web server user to group bacula
216 %{groupmod} -R %{dataowner} bacula
217
218 %changelog
219 * Sun May 14 2006 D. Scott Barninger <barninger at fairfieldcomputers.com>
220 - add bimagemgr manual
221 * Sun May 07 2006 D. Scott Barninger <barninger at fairfieldcomputers.com>
222 - refine files section for web
223 - add documentation
224 - add config.pm for bimagemgr
225 - add post script bimagemgr to add web server user to group bacula
226 * Sat May 06 2006 D. Scott Barninger <barninger at fairfieldcomputers.com>
227 - was bimagemgr spec convert to bacula-gui spec. include bacula-web
228 * Thu Dec 09 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
229 - ASSIGNMENT OF COPYRIGHT
230 - FOR VALUE RECEIVED, D. Scott Barninger hereby sells, transfers and 
231 - assigns unto Kern Sibbald, his successors, assigns and personal representatives, 
232 - all right, title and interest in and to the copyright in this software RPM
233 - spec file. D. Scott Barninger warrants good title to said copyright, that it is 
234 - free of all liens, encumbrances or any known claims against said copyright.
235 * Sun Nov 14 2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
236 - initial spec file