2 %define depkgs ../depkgs
5 # You must build the package with at least one define
6 # e.g. rpmbuild -ba --define "build_rh7 1" bacula.spec
8 # If you want the MySQL version, use:
9 # rpmbuild -ba --define "build_mysql 1" --define "build_rh7 1" bacula.spec
13 %{?build_rh7:%define rh7 1}
16 %{?build_rh8:%define rh8 1}
19 %{?build_rh9:%define rh9 1}
22 %{?build_mysql:%define mysql 1}
26 %define rh_version rh7
29 %define rh_version rh8
32 %define rh_version rh9
35 Summary: Bacula - The Network Backup Solution
39 Group: System Environment/Daemons
41 Source0:http://www.prdownloads.sourceforge.net/bacula/%{name}-%{version}.tar.gz
42 Source1:http://www.prdownloads.sourceforge.net/bacula/depkgs-24Jul03.tar.gz
43 BuildRoot: %{_tmppath}/%{name}-root
44 URL: http://www.bacula.org/
45 Vendor: The Bacula Team
46 Distribution: The Bacula Team
47 Packager: D. Scott Barninger <barninger@fairfieldcomputers.com>
48 Requires: gnome-libs >= 1.4
50 BuildRequires: gnome-libs-devel >= 1.4
51 BuildRequires: readline-devel
53 Requires: mysql >= 3.23
54 Requires: mysql-server >= 3.23
55 BuildRequires: mysql-devel >= 3.23
60 Bacula - It comes by night and sucks the vital essence from your computers.
62 Bacula is a set of computer programs that permit you (or the system
63 administrator) to manage backup, recovery, and verification of computer
64 data across a network of computers of different kinds. In technical terms,
65 it is a network client/server based backup program. Bacula is relatively
66 easy to use and efficient, while offering many advanced storage management
67 features that make it easy to find and recover lost or damaged files.
68 Bacula source code has been released under the GPL version 2 license.
71 %package mysql-%{rh_version}
73 %package sqlite-%{rh_version}
76 Summary: Bacula - The Network Backup Solution
77 Group: System Environment/Daemons
80 %description mysql-%{rh_version}
82 %description sqlite-%{rh_version}
85 Bacula - It comes by night and sucks the vital essence from your computers.
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. In technical terms,
90 it is a network client/server based backup program. Bacula is relatively
91 easy to use and efficient, while offering many advanced storage management
92 features that make it easy to find and recover lost or damaged files.
93 Bacula source code has been released under the GPL version 2 license.
96 This build requires MySQL to be installed separately as the catalog database.
98 This build incorporates sqlite as the catalog database, statically compiled.
101 %package client-%{rh_version}
102 Summary: Bacula - The Network Backup Solution
103 Group: System Environment/Daemons
104 %description client-%{rh_version}
105 Bacula - It comes by night and sucks the vital essence from your computers.
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. In technical terms,
110 it is a network client/server based backup program. Bacula is relatively
111 easy to use and efficient, while offering many advanced storage management
112 features that make it easy to find and recover lost or damaged files.
113 Bacula source code has been released under the GPL version 2 license.
115 This is the File daemon (Client) only package.
132 # patch the make_sqlite_tables script for installation bindir
133 patch src/cats/make_sqlite_tables.in src/cats/make_sqlite_tables.in.patch
135 # patch the make_catalog_backup script for installation bindir
136 patch src/cats/make_catalog_backup.in src/cats/make_catalog_backup.in.patch
140 --sbindir=/usr/sbin \
141 --sysconfdir=/etc/bacula \
142 --with-scriptdir=/etc/bacula \
143 --enable-smartalloc \
148 --with-sqlite=${cwd}/../depkgs/sqlite \
150 --with-working-dir=/var/bacula \
151 --with-pid-dir=/var/run \
152 --with-subsys-dir=/var/lock/subsys
158 mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d
159 mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d
160 mkdir -p $RPM_BUILD_ROOT/usr/share/pixmaps
161 mkdir -p $RPM_BUILD_ROOT/usr/share/gnome/apps/System
162 mkdir -p $RPM_BUILD_ROOT/usr/share/applications
165 mkdir -p $RPM_BUILD_ROOT/usr/lib/sqlite
169 prefix=$RPM_BUILD_ROOT/usr \
170 sbindir=$RPM_BUILD_ROOT/usr/sbin \
171 sysconfdir=$RPM_BUILD_ROOT/etc/bacula \
172 scriptdir=$RPM_BUILD_ROOT/etc/bacula \
173 working_dir=$RPM_BUILD_ROOT/var/bacula \
178 prefix=$RPM_BUILD_ROOT/usr \
179 sbindir=$RPM_BUILD_ROOT/usr/sbin \
180 sysconfdir=$RPM_BUILD_ROOT/etc/bacula \
181 working_dir=$RPM_BUILD_ROOT/var/bacula \
182 mandir=$RPM_BUILD_ROOT/usr/man \
187 # fixme - make installs the mysql scripts for sqlite build
188 rm -f $RPM_BUILD_ROOT/etc/bacula/startmysql
189 rm -f $RPM_BUILD_ROOT/etc/bacula/stopmysql
190 rm -f $RPM_BUILD_ROOT/etc/bacula/grant_mysql_privileges
193 # install the init scripts
194 cp platforms/redhat/bacula-dir $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-dir
195 cp platforms/redhat/bacula-fd $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-fd
196 cp platforms/redhat/bacula-sd $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-sd
198 # install the menu stuff
199 cp scripts/bacula.png $RPM_BUILD_ROOT/usr/share/pixmaps/bacula.png
200 cp scripts/bacula.desktop.gnome1 $RPM_BUILD_ROOT/usr/share/gnome/apps/System/bacula.desktop
201 cp scripts/bacula.desktop.gnome2 $RPM_BUILD_ROOT/usr/share/applications/bacula.desktop
205 cp ../depkgs/sqlite/sqlite $RPM_BUILD_ROOT/usr/lib/sqlite/sqlite
206 cp ../depkgs/sqlite/sqlite.h $RPM_BUILD_ROOT/usr/lib/sqlite/sqlite.h
207 cp ../depkgs/sqlite/libsqlite.a $RPM_BUILD_ROOT/usr/lib/sqlite/libsqlite.a
210 # install the logrotate file
211 cp scripts/logrotate $RPM_BUILD_ROOT/etc/logrotate.d/bacula
214 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
218 %files mysql-%{rh_version}
219 %defattr(-,root,root)
221 %attr(0754,root,root) /etc/bacula/bacula
222 %attr(0754,root,root) /etc/bacula/console
223 %attr(0754,root,root) /etc/bacula/fd
224 %attr(0754,root,root) /etc/bacula/gconsole
225 %attr(0754,root,root) /etc/bacula/create_mysql_database
226 %attr(0754,root,root) /etc/bacula/delete_catalog_backup
227 %attr(0754,root,root) /etc/bacula/drop_bacula_tables
228 %attr(0754,root,root) /etc/bacula/drop_mysql_tables
229 %attr(0754,root,root) /etc/bacula/make_bacula_tables
230 %attr(0754,root,root) /etc/bacula/make_catalog_backup
231 %attr(0754,root,root) /etc/bacula/make_mysql_tables
232 %attr(0754,root,root) /etc/bacula/grant_mysql_privileges
233 %attr(0754,root,root) /etc/bacula/startmysql
234 %attr(0754,root,root) /etc/bacula/stopmysql
235 %attr(0754,root,root) /etc/bacula/mtx-changer
236 %attr(0754,root,root) /etc/rc.d/init.d/bacula-dir
237 %attr(0754,root,root) /etc/rc.d/init.d/bacula-fd
238 %attr(0754,root,root) /etc/rc.d/init.d/bacula-sd
240 %attr(0644,root,root) %doc COPYING ChangeLog INSTALL README ReleaseNotes doc/*
241 %attr(0644,root,root) /usr/man/man1/*
242 %attr(0644,root,root) /usr/share/pixmaps/bacula.png
243 %attr(0644,root,root) /usr/share/gnome/apps/System/bacula.desktop
244 %attr(0644,root,root) /usr/share/applications/bacula.desktop
245 %attr(0644,root,root) %config(noreplace) /etc/bacula/gnome-console.conf
246 %attr(0644,root,root) /etc/logrotate.d/bacula
248 %attr(0640,root,root) %config(noreplace) /etc/bacula/bacula-dir.conf
249 %attr(0640,root,root) %config(noreplace) /etc/bacula/bacula-fd.conf
250 %attr(0640,root,root) %config(noreplace) /etc/bacula/bacula-sd.conf
251 %attr(0640,root,root) %config(noreplace) /etc/bacula/console.conf
252 %attr(0640,root,root) /etc/bacula/query.sql
253 %attr(0640,root,root) %dir /var/bacula
255 %attr(0750,root,root) /usr/sbin/*
257 %post mysql-%{rh_version}
258 # delete then add our links
259 /sbin/chkconfig --del bacula-dir
260 /sbin/chkconfig --del bacula-fd
261 /sbin/chkconfig --del bacula-sd
262 /sbin/chkconfig --add bacula-dir
263 /sbin/chkconfig --add bacula-fd
264 /sbin/chkconfig --add bacula-sd
266 # add execute permissions for console
267 chmod 0755 /usr/sbin/gnome-console
269 # grant privileges and create tables
270 # this will error out harmlessly if tables already exist
271 echo "Granting privileges for MySQL user bacula..."
272 /etc/bacula/grant_mysql_privileges
273 echo "Creating MySQL bacula database..."
274 /etc/bacula/create_mysql_database
275 echo "Creating bacula tables..."
276 /etc/bacula/make_mysql_tables
278 %preun mysql-%{rh_version}
280 /sbin/chkconfig --del bacula-dir
281 /sbin/chkconfig --del bacula-fd
282 /sbin/chkconfig --del bacula-sd
286 %files sqlite-%{rh_version}
287 %defattr(-,root,root)
289 %attr(0754,root,root) /etc/bacula/bacula
290 %attr(0754,root,root) /etc/bacula/console
291 %attr(0754,root,root) /etc/bacula/fd
292 %attr(0754,root,root) /etc/bacula/gconsole
293 %attr(0754,root,root) /etc/bacula/create_sqlite_database
294 %attr(0754,root,root) /etc/bacula/delete_catalog_backup
295 %attr(0754,root,root) /etc/bacula/drop_bacula_tables
296 %attr(0754,root,root) /etc/bacula/drop_sqlite_tables
297 %attr(0754,root,root) /etc/bacula/make_bacula_tables
298 %attr(0754,root,root) /etc/bacula/make_catalog_backup
299 %attr(0754,root,root) /etc/bacula/make_sqlite_tables
300 %attr(0754,root,root) /etc/bacula/mtx-changer
301 %attr(0754,root,root) /etc/rc.d/init.d/bacula-dir
302 %attr(0754,root,root) /etc/rc.d/init.d/bacula-fd
303 %attr(0754,root,root) /etc/rc.d/init.d/bacula-sd
305 %attr(0644,root,root) %doc COPYING ChangeLog INSTALL README ReleaseNotes doc/*
306 %attr(0644,root,root) /usr/man/man1/*
307 %attr(0644,root,root) /usr/share/pixmaps/bacula.png
308 %attr(0644,root,root) /usr/share/gnome/apps/System/bacula.desktop
309 %attr(0644,root,root) /usr/share/applications/bacula.desktop
310 %attr(0644,root,root) %config(noreplace) /etc/bacula/gnome-console.conf
311 %attr(0644,root,root) /etc/logrotate.d/bacula
313 %attr(0640,root,root) %config(noreplace) /etc/bacula/bacula-dir.conf
314 %attr(0640,root,root) %config(noreplace) /etc/bacula/bacula-fd.conf
315 %attr(0640,root,root) %config(noreplace) /etc/bacula/bacula-sd.conf
316 %attr(0640,root,root) %config(noreplace) /etc/bacula/console.conf
317 %attr(0640,root,root) /etc/bacula/query.sql
318 %attr(0640,root,root) /usr/lib/sqlite/libsqlite.a
319 %attr(0640,root,root) /usr/lib/sqlite/sqlite.h
320 %attr(0640,root,root) %dir /var/bacula
322 %attr(0750,root,root) /usr/sbin/*
323 %attr(0750,root,root) /usr/lib/sqlite/sqlite
325 %post sqlite-%{rh_version}
326 # delete then add our links
327 /sbin/chkconfig --del bacula-dir
328 /sbin/chkconfig --del bacula-fd
329 /sbin/chkconfig --del bacula-sd
330 /sbin/chkconfig --add bacula-dir
331 /sbin/chkconfig --add bacula-fd
332 /sbin/chkconfig --add bacula-sd
334 # add execute permission for console
335 chmod 0755 /usr/sbin/gnome-console
338 /etc/bacula/make_sqlite_tables
340 %preun sqlite-%{rh_version}
342 /sbin/chkconfig --del bacula-dir
343 /sbin/chkconfig --del bacula-fd
344 /sbin/chkconfig --del bacula-sd
348 %files client-%{rh_version}
349 %defattr(-,root,root)
351 %attr(0754,root,root) /etc/bacula/fd
352 %attr(0754,root,root) /etc/rc.d/init.d/bacula-fd
354 %attr(0644,root,root) %doc COPYING ChangeLog INSTALL README ReleaseNotes doc/*
355 %attr(0644,root,root) /etc/logrotate.d/bacula
357 %attr(0640,root,root) %config(noreplace) /etc/bacula/bacula-fd.conf
358 %attr(0640,root,root) %dir /var/bacula
360 %attr(0750,root,root) /usr/sbin/bacula-fd
361 %attr(0750,root,root) /usr/sbin/btraceback
362 %attr(0750,root,root) /usr/sbin/btraceback.gdb
363 %attr(0750,root,root) /usr/sbin/smtp
366 %post client-%{rh_version}
367 # delete then add our links
368 /sbin/chkconfig --del bacula-fd
369 /sbin/chkconfig --add bacula-fd
371 %preun client-%{rh_version}
373 /sbin/chkconfig --del bacula-fd
376 * Fri Oct 24 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
377 - Added separate Source declaration for depkgs
378 - added patch for make_catalog_backup script
379 * Mon May 11 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>
380 - Misc changes to mysql/sqlite build and rh7/8 menu differences
381 - Added rh_version to sub-package names
382 - Added installed but missing file /etc/bacula/gconsole
383 - rm'd /etc/bacula/grant_mysql_privileges on sqlite builds
384 * Thu May 08 2003 Kern Sibbald <kern at sibbald.com>
385 - Update spec for version 1.31 and combine client
386 * Sun Mar 30 2003 D. Scott Barninger <barninger at fairfieldcomputers.com>