]> git.sur5r.net Git - bacula/bacula/blob - bacula/platforms/redhat/bacula.spec.in
Update spec and desktop files
[bacula/bacula] / bacula / platforms / redhat / bacula.spec.in
1
2 %define depkgs ../depkgs
3
4
5 # You must build the package with at least one define
6 #  e.g.  rpmbuild -ba --define "build_rh7 1" bacula.spec
7 #
8 # If you want the MySQL version, use:
9 #        rpmbuild -ba --define "build_mysql 1" --define "build_rh7 1" bacula.spec
10 #
11
12 %define rh7 0
13 %{?build_rh7:%define rh7 1}
14
15 %define rh8 0
16 %{?build_rh8:%define rh8 1}
17
18 %define rh9 0
19 %{?build_rh9:%define rh9 1}
20
21 %define mysql 0
22 %{?build_mysql:%define mysql 1}
23
24
25 %if %{rh7}
26 %define rh_version rh7
27 %endif
28 %if %{rh8}
29 %define rh_version rh8
30 %endif
31 %if %{rh9}
32 %define rh_version rh9
33 %endif
34
35 Summary: Bacula - The Network Backup Solution
36 Name: bacula
37 Version: @VERSION@
38 Release: 1
39 Group: System Environment/Daemons
40 Copyright: GPL v2
41 Source: http://www.prdownloads.sourceforge.net/bacula/%{name}-%{version}.tar.gz
42 BuildRoot: %{_tmppath}/%{name}-root
43 URL: http://www.bacula.org/
44 Vendor: The Bacula Team
45 Distribution: The Bacula Team
46 Packager: D. Scott Barninger <barninger@fairfieldcomputers.com>
47 Requires: gnome-libs >= 1.4
48 Requires: readline
49 BuildRequires: gnome-libs-devel >= 1.4
50 BuildRequires: readline-devel
51 %if %{mysql}
52 Requires: mysql >= 3.23
53 Requires: mysql-server >= 3.23
54 BuildRequires: mysql-devel >= 3.23
55 %endif
56
57
58 %description
59 Bacula - It comes by night and sucks the vital essence from your computers.
60
61 Bacula is a set of computer programs that permit you (or the system 
62 administrator) to manage backup, recovery, and verification of computer 
63 data across a network of computers of different kinds. In technical terms, 
64 it is a network client/server based backup program. Bacula is relatively 
65 easy to use and efficient, while offering many advanced storage management 
66 features that make it easy to find and recover lost or damaged files. 
67 Bacula source code has been released under the GPL version 2 license.
68
69 %if %{mysql}
70 %package mysql-%{rh_version}
71 %else
72 %package sqlite-%{rh_version}
73 %endif
74
75 Summary: Bacula - The Network Backup Solution
76 Group: System Environment/Daemons
77
78 %if %{mysql}
79 %description mysql-%{rh_version}
80 %else
81 %description sqlite-%{rh_version}
82 %endif
83
84 Bacula - It comes by night and sucks the vital essence from your computers.
85
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. In technical terms, 
89 it is a network client/server based backup program. Bacula is relatively 
90 easy to use and efficient, while offering many advanced storage management 
91 features that make it easy to find and recover lost or damaged files. 
92 Bacula source code has been released under the GPL version 2 license.
93
94 %if %{mysql}
95 This build requires MySQL to be installed separately as the catalog database.
96 %else
97 This build incorporates sqlite as the catalog database, statically compiled.
98 %endif
99
100 %package client-%{rh_version}
101 Summary: Bacula - The Network Backup Solution
102 Group: System Environment/Daemons
103 %description client-%{rh_version}
104 Bacula - It comes by night and sucks the vital essence from your computers.
105
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. In technical terms, 
109 it is a network client/server based backup program. Bacula is relatively 
110 easy to use and efficient, while offering many advanced storage management 
111 features that make it easy to find and recover lost or damaged files. 
112 Bacula source code has been released under the GPL version 2 license.
113
114 This is the File daemon (Client) only package.
115
116
117 %prep
118
119 %setup
120
121 %build
122
123 cwd=${PWD}
124 cd %{depkgs}
125 %if ! %{mysql}
126 make sqlite
127 %endif
128 make mtx
129 cd ${cwd}
130
131 # patch the make_sqlite_tables script for installation bindir
132 patch src/cats/make_sqlite_tables.in src/cats/make_sqlite_tables.in.patch
133
134 %configure \
135         --prefix=/usr \
136         --sbindir=/usr/sbin \
137         --sysconfdir=/etc/bacula \
138         --with-scriptdir=/etc/bacula \
139         --enable-smartalloc \
140         --enable-gnome \
141 %if %{mysql}
142         --with-mysql \
143 %else
144         --with-sqlite=${cwd}/../depkgs/sqlite \
145 %endif
146         --with-working-dir=/var/bacula \
147         --with-pid-dir=/var/run \
148         --with-subsys-dir=/var/lock/subsys
149 make
150
151 %install
152  
153 cwd=${PWD}
154 mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d
155 mkdir -p $RPM_BUILD_ROOT/usr/share/pixmaps
156
157 mkdir -p $RPM_BUILD_ROOT/usr/share/gnome/apps/System
158 mkdir -p $RPM_BUILD_ROOT/usr/share/applications
159
160 %if ! %{mysql}
161 mkdir -p $RPM_BUILD_ROOT/usr/lib/sqlite
162 %endif
163
164 make \
165         prefix=$RPM_BUILD_ROOT/usr \
166         sbindir=$RPM_BUILD_ROOT/usr/sbin \
167         sysconfdir=$RPM_BUILD_ROOT/etc/bacula \
168         scriptdir=$RPM_BUILD_ROOT/etc/bacula \
169         working_dir=$RPM_BUILD_ROOT/var/bacula \
170         install
171
172 cd %{depkgs}
173 make \
174         prefix=$RPM_BUILD_ROOT/usr \
175         sbindir=$RPM_BUILD_ROOT/usr/sbin \
176         sysconfdir=$RPM_BUILD_ROOT/etc/bacula \
177         working_dir=$RPM_BUILD_ROOT/var/bacula \
178         mandir=$RPM_BUILD_ROOT/usr/man \
179         mtx-install
180 cd ${cwd}
181
182 %if ! %{mysql}
183 # fixme - make installs the mysql start/stop scripts for sqlite build
184 rm -f $RPM_BUILD_ROOT/etc/bacula/startmysql
185 rm -f $RPM_BUILD_ROOT/etc/bacula/stopmysql
186 rm -f $RPM_BUILD_ROOT/etc/bacula/grant_mysql_privileges
187 %endif
188
189 # fixme - make installs test script /etc/bacula/gconsole
190 rm -f $RPM_BUILD_ROOT/etc/bacula/gconsole
191
192 # install the init scripts
193 cp platforms/redhat/bacula-dir $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-dir
194 cp platforms/redhat/bacula-fd $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-fd
195 cp platforms/redhat/bacula-sd $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-sd
196
197 # install the menu stuff
198 cp scripts/bacula.png $RPM_BUILD_ROOT/usr/share/pixmaps/bacula.png
199 cp scripts/bacula.desktop.gnome1 $RPM_BUILD_ROOT/usr/share/gnome/apps/System/bacula.desktop
200 cp scripts/bacula.desktop.gnome2 $RPM_BUILD_ROOT/usr/share/applications/bacula.desktop
201
202 # install sqlite
203 %if ! %{mysql}
204 cp ../depkgs/sqlite/sqlite $RPM_BUILD_ROOT/usr/lib/sqlite/sqlite
205 cp ../depkgs/sqlite/sqlite.h $RPM_BUILD_ROOT/usr/lib/sqlite/sqlite.h
206 cp ../depkgs/sqlite/libsqlite.a $RPM_BUILD_ROOT/usr/lib/sqlite/libsqlite.a
207 %endif
208
209 %clean
210 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
211
212 %if %{mysql}
213
214 %files mysql-%{rh_version}
215 %defattr(-,root,root)
216
217 %attr(0754,root,root) /etc/bacula/bacula
218 %attr(0754,root,root) /etc/bacula/console
219 %attr(0754,root,root) /etc/bacula/fd
220 %attr(0754,root,root) /etc/bacula/create_mysql_database
221 %attr(0754,root,root) /etc/bacula/delete_catalog_backup
222 %attr(0754,root,root) /etc/bacula/drop_bacula_tables
223 %attr(0754,root,root) /etc/bacula/drop_mysql_tables
224 %attr(0754,root,root) /etc/bacula/make_bacula_tables
225 %attr(0754,root,root) /etc/bacula/make_catalog_backup
226 %attr(0754,root,root) /etc/bacula/make_mysql_tables
227 %attr(0754,root,root) /etc/bacula/grant_mysql_privileges
228 %attr(0754,root,root) /etc/bacula/startmysql
229 %attr(0754,root,root) /etc/bacula/stopmysql
230 %attr(0754,root,root) /etc/bacula/mtx-changer
231 %attr(0754,root,root) /etc/rc.d/init.d/bacula-dir
232 %attr(0754,root,root) /etc/rc.d/init.d/bacula-fd
233 %attr(0754,root,root) /etc/rc.d/init.d/bacula-sd
234
235 %attr(0644,root,root) %doc COPYING ChangeLog INSTALL README ReleaseNotes doc/*
236 %attr(0644,root,root) /usr/man/man1/*
237 %attr(0644,root,root) /usr/share/pixmaps/bacula.png
238
239 %attr(0644,root,root) /usr/share/gnome/apps/System/bacula.desktop
240 %attr(0644,root,root) /usr/share/applications/bacula.desktop
241
242 %attr(0644,root,root) %config(noreplace) /etc/bacula/gnome-console.conf
243
244 %attr(0640,root,root) %config(noreplace) /etc/bacula/bacula-dir.conf
245 %attr(0640,root,root) %config(noreplace) /etc/bacula/bacula-fd.conf
246 %attr(0640,root,root) %config(noreplace) /etc/bacula/bacula-sd.conf
247 %attr(0640,root,root) %config(noreplace) /etc/bacula/console.conf
248 %attr(0640,root,root) /etc/bacula/query.sql
249 %attr(0640,root,root) %dir /var/bacula
250
251 %attr(0750,root,root) /usr/sbin/*
252
253 %post mysql-%{rh_version}
254 # delete then add our links
255 /sbin/chkconfig --del bacula-dir
256 /sbin/chkconfig --del bacula-fd
257 /sbin/chkconfig --del bacula-sd
258 /sbin/chkconfig --add bacula-dir
259 /sbin/chkconfig --add bacula-fd
260 /sbin/chkconfig --add bacula-sd
261
262 # add execute permissions for console
263 chmod 0755 /usr/sbin/gnome-console
264
265 # grant privileges and create tables
266 # this will error out harmlessly if tables already exist
267 echo "Granting privileges for MySQL user bacula..."
268 /etc/bacula/grant_mysql_privileges
269 echo "Creating MySQL bacula database..."
270 /etc/bacula/create_mysql_database
271 echo "Creating bacula tables..."
272 /etc/bacula/make_mysql_tables
273
274 %preun mysql-%{rh_version}
275 # delete our links
276 /sbin/chkconfig --del bacula-dir
277 /sbin/chkconfig --del bacula-fd
278 /sbin/chkconfig --del bacula-sd
279
280 %else
281
282 %files sqlite-%{rh_version}
283 %defattr(-,root,root)
284
285 %attr(0754,root,root) /etc/bacula/bacula
286 %attr(0754,root,root) /etc/bacula/console
287 %attr(0754,root,root) /etc/bacula/fd
288 %attr(0754,root,root) /etc/bacula/create_sqlite_database
289 %attr(0754,root,root) /etc/bacula/delete_catalog_backup
290 %attr(0754,root,root) /etc/bacula/drop_bacula_tables
291 %attr(0754,root,root) /etc/bacula/drop_sqlite_tables
292 %attr(0754,root,root) /etc/bacula/make_bacula_tables
293 %attr(0754,root,root) /etc/bacula/make_catalog_backup
294 %attr(0754,root,root) /etc/bacula/make_sqlite_tables
295 %attr(0754,root,root) /etc/bacula/mtx-changer
296 %attr(0754,root,root) /etc/rc.d/init.d/bacula-dir
297 %attr(0754,root,root) /etc/rc.d/init.d/bacula-fd
298 %attr(0754,root,root) /etc/rc.d/init.d/bacula-sd
299
300 %attr(0644,root,root) %doc COPYING ChangeLog INSTALL README ReleaseNotes doc/*
301 %attr(0644,root,root) /usr/man/man1/*
302 %attr(0644,root,root) /usr/share/pixmaps/bacula.png
303
304 %attr(0644,root,root) /usr/share/gnome/apps/System/bacula.desktop
305 %attr(0644,root,root) /usr/share/applications/bacula.desktop
306
307 %attr(0644,root,root) %config(noreplace) /etc/bacula/gnome-console.conf
308
309 %attr(0640,root,root) %config(noreplace) /etc/bacula/bacula-dir.conf
310 %attr(0640,root,root) %config(noreplace) /etc/bacula/bacula-fd.conf
311 %attr(0640,root,root) %config(noreplace) /etc/bacula/bacula-sd.conf
312 %attr(0640,root,root) %config(noreplace) /etc/bacula/console.conf
313 %attr(0640,root,root) /etc/bacula/query.sql
314 %attr(0640,root,root) /usr/lib/sqlite/libsqlite.a
315 %attr(0640,root,root) /usr/lib/sqlite/sqlite.h
316 %attr(0640,root,root) %dir /var/bacula
317
318 %attr(0750,root,root) /usr/sbin/*
319 %attr(0750,root,root) /usr/lib/sqlite/sqlite
320
321 %post sqlite-%{rh_version}
322 # delete then add our links
323 /sbin/chkconfig --del bacula-dir
324 /sbin/chkconfig --del bacula-fd
325 /sbin/chkconfig --del bacula-sd
326 /sbin/chkconfig --add bacula-dir
327 /sbin/chkconfig --add bacula-fd
328 /sbin/chkconfig --add bacula-sd
329
330 # add execute permission for console
331 chmod 0755 /usr/sbin/gnome-console
332
333 # create the tables
334 /etc/bacula/make_sqlite_tables
335
336 %preun sqlite-%{rh_version}
337 # delete our links
338 /sbin/chkconfig --del bacula-dir
339 /sbin/chkconfig --del bacula-fd
340 /sbin/chkconfig --del bacula-sd
341
342 %endif
343
344 %files client-%{rh_version}
345 %defattr(-,root,root)
346
347 %attr(0754,root,root) /etc/bacula/fd
348 %attr(0754,root,root) /etc/rc.d/init.d/bacula-fd
349
350 %attr(0644,root,root) %doc COPYING ChangeLog INSTALL README ReleaseNotes doc/*
351
352 %attr(0640,root,root) %config(noreplace) /etc/bacula/bacula-fd.conf
353 %attr(0640,root,root) %dir /var/bacula
354
355 %attr(0750,root,root) /usr/sbin/bacula-fd
356 %attr(0750,root,root) /usr/sbin/btraceback
357 %attr(0750,root,root) /usr/sbin/btraceback.gdb
358 %attr(0750,root,root) /usr/sbin/smtp
359
360
361 %post client-%{rh_version}
362 # delete then add our links
363 /sbin/chkconfig --del bacula-fd
364 /sbin/chkconfig --add bacula-fd
365
366 %preun client-%{rh_version}
367 # delete our links
368 /sbin/chkconfig --del bacula-fd
369
370 %changelog
371 * Mon May 11 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
372 - Misc changes to mysql/sqlite build and rh7/8 menu differences
373 - Added rh_version to sub-package names
374 * Thu May 08 2003 Kern Sibbald <kern at sibbald.com>
375 - Update spec for version 1.31 and combine client
376 * Sun Mar 30 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
377 - Initial spec file