]> git.pld-linux.org Git - packages/bacula.git/blob - bacula.spec
- update for PLD
[packages/bacula.git] / bacula.spec
1 # TODO:
2 # - install section
3 # - build section
4 # - files section
5 # - pld configs and init scripts
6 #
7 Summary:        Bacula - The Network Backup Solution
8 Name:           bacula
9 Version:        1.34.6
10 Release:        0.1
11 Group:          Networking/Utilities
12 License:        GPL v2
13 Source0:        http://dl.sourceforge.net/bacula/%{name}-%{version}.tar.gz
14 # Source0-md5:  c8aaef1429f9b37efce381f49f7bccb8
15 Source1:        http://www.tux.org/pub/distributions/tinylinux/tomsrtbt/tomsrtbt-2.0.103.tar.gz
16 # Source1-md5:  d5ee50efb28986d564547d5da5de2483
17 URL:            http://www.bacula.org/
18 BuildRequires:  wxGTK2-devel
19 BuildRequires:  openssl-devel
20 BuildRequires:  pkgconfig
21 BuildRequires:  ncurses-devel
22 BuildRequires:  readline-devel
23 BuildRequires:  sqlite2-devel
24 BuildRequires:  libwrap-devel
25 BuildRequires:  zlib-devel
26 BuildRequires:  acl-devel
27 BuildRequires:  libstdc++-devel
28 Provides:       bacula-dir
29 Provides:       bacula-sd
30 Provides:       bacula-fd
31 Provides:       bacula-server
32 Conflicts:      bacula-client
33 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
34
35 %define         _sysconfdir     /etc/%{name}
36
37 %description
38 Bacula - It comes by night and sucks the vital essence from your
39 computers.
40
41 Bacula is a set of computer programs that permit you (or the system
42 administrator) to manage backup, recovery, and verification of
43 computer data across a network of computers of different kinds. In
44 technical terms, it is a network client/server based backup program.
45 Bacula is relatively easy to use and efficient, while offering many
46 advanced storage management features that make it easy to find and
47 recover lost or damaged files. Bacula source code has been released
48 under the GPL version 2 license.
49
50 %package client
51 Summary:        Bacula - The Network Backup Solution
52 Group:          Networking/Utilities
53 Provides:       bacula-fd
54
55 %description client
56 Bacula - It comes by night and sucks the vital essence from your
57 computers.
58
59 Bacula is a set of computer programs that permit you (or the system
60 administrator) to manage backup, recovery, and verification of
61 computer data across a network of computers of different kinds. In
62 technical terms, it is a network client/server based backup program.
63 Bacula is relatively easy to use and efficient, while offering many
64 advanced storage management features that make it easy to find and
65 recover lost or damaged files. Bacula source code has been released
66 under the GPL version 2 license.
67
68 This is the File daemon (Client) only package. It includes the command
69 line console program.
70
71 %package rescue
72
73 Summary:        Bacula - The Network Backup Solution
74 Group:          Networking/Utilities
75 Requires:       coreutils
76 Requires:       util-linux
77 Requires:       libc5
78 Requires:       bacula-fd
79
80 %description rescue
81 Bacula - It comes by night and sucks the vital essence from your
82 computers.
83
84 Bacula is a set of computer programs that permit you (or the system
85 administrator) to manage backup, recovery, and verification of
86 computer data across a network of computers of different kinds. In
87 technical terms, it is a network client/server based backup program.
88 Bacula is relatively easy to use and efficient, while offering many
89 advanced storage management features that make it easy to find and
90 recover lost or damaged files. Bacula source code has been released
91 under the GPL version 2 license.
92
93 This package installs scripts for disaster recovery and builds rescue
94 floppy disks for bare metal recovery. This package includes tomsrtbt
95 (http://www.toms.net/rb/, by Tom Oehser, Tom@Toms.NET) to provide a
96 tool to build a boot floppy disk.
97
98 You need to have the bacula-sqlite, bacula-mysql, bacula-postgresql or
99 bacula-client package for your platform installed and configured
100 before installing this package.
101
102 To create a boot disk run "./getdiskinfo" from the /etc/bacula/rescue
103 directory (this is done when the package is first installed), then run
104 "./install.s" from the /etc/bacula/rescue/tomsrtbt/ directory. To make
105 the bacula rescue disk run "./make_rescue_disk --copy-static-bacula
106 - --copy-etc-files" from the /etc/bacula/rescue directory. To recreate
107   the rescue information for this system run ./getdiskinfo again.
108
109 %package updatedb
110 Summary:        Bacula - The Network Backup Solution
111 Group:          Networking/Utilities
112
113 %description updatedb
114 Bacula - It comes by night and sucks the vital essence from your
115 computers.
116
117 Bacula is a set of computer programs that permit you (or the system
118 administrator) to manage backup, recovery, and verification of
119 computer data across a network of computers of different kinds. In
120 technical terms, it is a network client/server based backup program.
121 Bacula is relatively easy to use and efficient, while offering many
122 advanced storage management features that make it easy to find and
123 recover lost or damaged files. Bacula source code has been released
124 under the GPL version 2 license.
125
126 This package installs scripts for updating older versions of the
127 bacula database.
128
129 %package wxconsole
130 Summary:        Bacula - The Network Backup Solution
131 Group:          Networking/Utilities
132 Requires:       bacula-fd
133
134 %description wxconsole
135 Bacula - It comes by night and sucks the vital essence from your
136 computers.
137
138 Bacula is a set of computer programs that permit you (or the system
139 administrator) to manage backup, recovery, and verification of
140 computer data across a network of computers of different kinds. In
141 technical terms, it is a network client/server based backup program.
142 Bacula is relatively easy to use and efficient, while offering many
143 advanced storage management features that make it easy to find and
144 recover lost or damaged files. Bacula source code has been released
145 under the GPL version 2 license.
146
147 This is the WX Console package. It is an add-on to the client or
148 server packages.
149
150 %prep
151 %setup -q -b 1
152 sed -i -e 's#wx-config#wxgtk2-2.4-config#g' configure*
153 sed -i -e 's#-lreadline -ltermcap#-lreadline#g' configure*
154
155 %build
156 # patches for the bundled sqlite scripts
157 # patch the make_sqlite_tables script for installation bindir
158 patch src/cats/make_sqlite_tables.in src/cats/make_sqlite_tables.in.patch
159 # patch the create_sqlite_database script for installation bindir
160 patch src/cats/create_sqlite_database.in src/cats/create_sqlite_database.in.patch
161 # patch the make_catalog_backup script for installation bindir
162 patch src/cats/make_catalog_backup.in src/cats/make_catalog_backup.in.patch
163 # patch the update_sqlite_tables script for installation bindir
164 patch src/cats/update_sqlite_tables.in src/cats/update_sqlite_tables.in.patch
165
166 CPPFLAGS="-I%{_includedir}/ncurses -I%{_includedir}/readline"
167 %configure \
168         --disable-gnome \
169         --disable-conio \
170         --enable-wx-console \
171         --with-readline \
172         --with-tcp-wrappers \
173         --with-working-dir=%{_var}/lib/%{name} \
174         --with-dump-email="root@localhost" \
175         --with-job-email="root@localhost" \
176         --with-smtp-host=localhost \
177         --with-pid-dir=/var/run \
178         --with-subsys-dir=/var/lock/subsys \
179         --with-sqlite
180 %{__make}
181
182 %install
183 rm -rf $RPM_BUILD_ROOT
184
185 install -d $RPM_BUILD_ROOT%{_sysconfdir}/init.d
186 install -d $RPM_BUILD_ROOT/etc/logrotate.d
187 install -d $RPM_BUILD_ROOT%{_datadir}/pixmaps
188 install -d $RPM_BUILD_ROOT%{_datadir}/applications
189 install -d $RPM_BUILD_ROOT%{_sysconfdir}/bacula/rescue
190 install -d $RPM_BUILD_ROOT%{_sysconfdir}/bacula/rescue/tomsrtbt
191 install -d $RPM_BUILD_ROOT%{_sysconfdir}/bacula/updatedb
192 install -d $RPM_BUILD_ROOT/etc/pam.d
193 install -d $RPM_BUILD_ROOT/etc/security/console.apps
194 install -d $RPM_BUILD_ROOT%{_bindir}
195
196 %{__make} install \
197         DESTDIR=$RPM_BUILD_ROOT
198
199 # setup the manual for the doc dir and correct some broken CVS permissions
200 mkdir html-manual
201 cp -p doc/html-manual/*.html html-manual/
202 cp -p doc/html-manual/*.jpg html-manual/
203 cp -p doc/html-manual/*.gif html-manual/
204 cp -p doc/html-manual/*.css html-manual/
205
206 cp -p platforms/redhat/bacula-dir $RPM_BUILD_ROOT%{_sysconfdir}/init.d/bacula-dir
207 cp -p platforms/redhat/bacula-fd $RPM_BUILD_ROOT%{_sysconfdir}/init.d/bacula-fd
208 cp -p platforms/redhat/bacula-sd $RPM_BUILD_ROOT%{_sysconfdir}/init.d/bacula-sd
209 chmod 0754 $RPM_BUILD_ROOT%{_sysconfdir}/init.d/*
210
211 cp -p scripts/bacula.png $RPM_BUILD_ROOT%{_datadir}/pixmaps/bacula.png
212 cp -p scripts/bacula.desktop.gnome2.consolehelper $RPM_BUILD_ROOT%{_datadir}/applications/bacula.desktop
213 cp -p scripts/gnome-console.console_apps $RPM_BUILD_ROOT/etc/security/console.apps/gnome-console
214 cp -p scripts/gnome-console.pamd $RPM_BUILD_ROOT/etc/pam.d/gnome-console
215 ln -sf consolehelper $RPM_BUILD_ROOT%{_bindir}/gnome-console
216
217 cp -p ../depkgs/sqlite/sqlite $RPM_BUILD_ROOT%{sqlite_bindir}/sqlite
218 cp -p ../depkgs/sqlite/sqlite.h $RPM_BUILD_ROOT%{sqlite_bindir}/sqlite.h
219 cp -p ../depkgs/sqlite/libsqlite.a $RPM_BUILD_ROOT%{sqlite_bindir}/libsqlite.a
220
221 # install the logrotate file
222 cp -p scripts/logrotate $RPM_BUILD_ROOT/etc/logrotate.d/bacula
223
224 # install the rescue stuff
225 # these are the rescue scripts
226 cp -p rescue/linux/backup.etc.list $RPM_BUILD_ROOT%{_sysconfdir}/bacula/rescue/
227 cp -p rescue/linux/format_floppy $RPM_BUILD_ROOT%{_sysconfdir}/bacula/rescue/
228 cp -p rescue/linux/getdiskinfo $RPM_BUILD_ROOT%{_sysconfdir}/bacula/rescue/
229 cp -p rescue/linux/make_rescue_disk $RPM_BUILD_ROOT%{_sysconfdir}/bacula/rescue/
230 cp -p rescue/linux/restore_bacula $RPM_BUILD_ROOT%{_sysconfdir}/bacula/rescue/
231 cp -p rescue/linux/restore_etc $RPM_BUILD_ROOT%{_sysconfdir}/bacula/rescue/
232 cp -p rescue/linux/run_grub $RPM_BUILD_ROOT%{_sysconfdir}/bacula/rescue/
233 cp -p rescue/linux/run_lilo $RPM_BUILD_ROOT%{_sysconfdir}/bacula/rescue/
234 cp -p rescue/linux/sfdisk.bz2 $RPM_BUILD_ROOT%{_sysconfdir}/bacula/rescue/
235
236 # this is the static file daemon
237 cp -p src/filed/static-bacula-fd $RPM_BUILD_ROOT%{_sysconfdir}/bacula/rescue/bacula-fd
238
239 # this is the tom's root boot disk
240 cp -p ../%{tomsrtbt}/* $RPM_BUILD_ROOT%{_sysconfdir}/bacula/rescue/tomsrtbt/
241
242 # install the updatedb scripts
243 cp -p updatedb/* $RPM_BUILD_ROOT%{_sysconfdir}/bacula/updatedb/
244
245 # now clean up permissions that are left broken by the install
246 chmod o-r $RPM_BUILD_ROOT%{_sysconfdir}/bacula/query.sql
247 chmod o-rwx $RPM_BUILD_ROOT/var/bacula
248
249 %pre sqlite
250 # test for bacula database older than version 6
251 if [ -s %{_var}/lib/%{name}/bacula.db ];then
252         DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite %{_var}/lib/%{name}/bacula.db | tail -n 1 2>/dev/null`
253         if [ -n "$DB_VER" ] && [ "$DB_VER" -lt "6" ]; then
254                 echo "This bacula upgrade will update a bacula database from version 6 to 7."
255                 echo "You appear to be running database version $DB_VER. You must first update"
256                 echo "your database to version 6 and then install this upgrade. The alternative"
257                 echo "is to use /etc/bacula/drop_sqlite_tables to delete all your your current"
258                 echo "catalog information, then do the upgrade. Information on updating a"
259                 echo "database older than version 6 can be found in the release notes."
260                 exit 1
261         fi
262 fi
263 # check for and copy /etc/bacula/console.conf to bconsole.conf
264 if [ -s /etc/bacula/console.conf ];then
265         cp -p /etc/bacula/console.conf /etc/bacula/bconsole.conf
266 fi
267
268 %post sqlite
269 # add our links
270 if [ "$1" -ge 1 ] ; then
271         /sbin/chkconfig --add bacula-dir
272         /sbin/chkconfig --add bacula-fd
273         /sbin/chkconfig --add bacula-sd
274 fi
275
276 # test for an existing database
277 if [ -s %{_var}/lib/%{name}/bacula.db ]; then
278         DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite %{_var}/lib/%{name}/bacula.db | tail -n 1 2>/dev/null`
279         # check to see if we need to upgrade a 1.32 or lower database
280         if [ "$DB_VER" -lt "7" ]; then
281                 echo "This release requires an upgrade to your bacula database."
282                 echo "Backing up your current database..."
283                 echo ".dump" | %{sqlite_bindir}/sqlite %{_var}/lib/%{name}/bacula.db | bzip2 > %{_var}/lib/%{name}/bacula_backup.sql.bz2
284                 echo "Upgrading bacula database ..."
285                 /etc/bacula/update_sqlite_tables
286                 echo "If bacula works correctly you can remove the backup file %{_var}/lib/%{name}/bacula_backup.sql.bz2"
287         fi
288 else
289         # create the database and tables
290         echo "Hmm, doesn't look like you have an existing database."
291         echo "Creating SQLite database..."
292         /etc/bacula/create_sqlite_database
293         echo "Creating the SQLite tables..."
294         /etc/bacula/make_sqlite_tables
295 fi
296
297 %preun sqlite
298 # delete our links
299 if [ $1 = 0 ]; then
300         /sbin/chkconfig --del bacula-dir
301         /sbin/chkconfig --del bacula-fd
302         /sbin/chkconfig --del bacula-sd
303 fi
304
305 %post client
306 # add our link
307 if [ "$1" -ge 1 ] ; then
308         /sbin/chkconfig --add bacula-fd
309 fi
310
311 %preun client
312 # delete our link
313 if [ $1 = 0 ]; then
314         /sbin/chkconfig --del bacula-fd
315 fi
316
317 %post updatedb
318 echo "The database update scripts were installed to /etc/bacula/updatedb"
319
320 %clean
321 rm -rf $RPM_BUILD_ROOT
322
323 %post rescue
324 # link our current installed conf file to the rescue directory
325 ln -s /etc/bacula-fd.conf /etc/bacula/rescue/bacula-fd.conf
326
327 # run getdiskinfo
328 echo "Creating rescue files for this system..."
329 cd /etc/bacula/rescue
330 ./getdiskinfo
331
332 %preun rescue
333 # remove the files created after the initial rpm installation
334 rm -f /etc/bacula/rescue/bacula-fd.conf
335 rm -f /etc/bacula/rescue/partition.*
336 rm -f /etc/bacula/rescue/format.*
337 rm -f /etc/bacula/rescue/mount_drives
338 rm -f /etc/bacula/rescue/start_network
339 rm -f /etc/bacula/rescue/sfdisk
340 rm -rf /etc/bacula/rescue/diskinfo/*
341
342 %files
343 %defattr(644,root,root,755)
344 %{_sysconfdir}/bacula/bacula
345 %{_sysconfdir}/bacula/bconsole
346 %{_sysconfdir}/bacula/fd
347 %{_sysconfdir}/bacula/create_bacula_database
348 %{_sysconfdir}/bacula/drop_bacula_database
349 %{_sysconfdir}/bacula/grant_bacula_privileges
350 %{_sysconfdir}/bacula/make_bacula_tables
351 %{_sysconfdir}/bacula/drop_bacula_tables
352 %{_sysconfdir}/bacula/update_bacula_tables
353 %{_sysconfdir}/bacula/create_sqlite_database
354 %{_sysconfdir}/bacula/drop_sqlite_database
355 %{_sysconfdir}/bacula/grant_sqlite_privileges
356 %{_sysconfdir}/bacula/make_sqlite_tables
357 %{_sysconfdir}/bacula/drop_sqlite_tables
358 %{_sysconfdir}/bacula/update_sqlite_tables
359 %{_sysconfdir}/bacula/make_catalog_backup
360 %{_sysconfdir}/bacula/delete_catalog_backup
361 %{_sysconfdir}/bacula/mtx-changer
362 %{_sysconfdir}/init.d/bacula-dir
363 %{_sysconfdir}/init.d/bacula-fd
364 %{_sysconfdir}/init.d/bacula-sd
365
366 %doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo doc/bacula.pdf html-manual
367 %{_mandir}/man1/*
368
369 /etc/logrotate.d/bacula
370
371 %config(noreplace) %{_sysconfdir}/bacula/bacula-dir.conf
372 %config(noreplace) %{_sysconfdir}/bacula/bacula-fd.conf
373 %config(noreplace) %{_sysconfdir}/bacula/bacula-sd.conf
374 %config(noreplace) %{_sysconfdir}/bacula/bconsole.conf
375 %{_sysconfdir}/bacula/query.sql
376 %{sqlite_bindir}/libsqlite.a
377 %{sqlite_bindir}/sqlite.h
378 %dir %{_var}/lib/%{name}
379
380 %attr(755,root,root) %{_sbindir}/bacula-dir
381 %attr(755,root,root) %{_sbindir}/bacula-fd
382 %attr(755,root,root) %{_sbindir}/bacula-sd
383 %attr(755,root,root) %{_sbindir}/bcopy
384 %attr(755,root,root) %{_sbindir}/bextract
385 %attr(755,root,root) %{_sbindir}/bls
386 %attr(755,root,root) %{_sbindir}/bscan
387 %attr(755,root,root) %{_sbindir}/btape
388 %attr(755,root,root) %{_sbindir}/btraceback
389 %attr(755,root,root) %{_sbindir}/bconsole
390 %attr(755,root,root) %{_sbindir}/dbcheck
391 %attr(755,root,root) %{_sbindir}/loaderinfo
392 %attr(755,root,root) %{_sbindir}/mtx
393 %attr(755,root,root) %{_sbindir}/scsitape
394 %attr(755,root,root) %{_sbindir}/bsmtp
395 %attr(755,root,root) %{_sbindir}/tapeinfo
396 %attr(755,root,root) %{_sbindir}/static-bacula-fd
397 %{sqlite_bindir}/sqlite
398 %{_sysconfdir}/bacula/btraceback.gdb
399
400 %files client
401 %defattr(644,root,root,755)
402
403 %{_sysconfdir}/bacula/fd
404 %{_sysconfdir}/bacula/bconsole
405 %{_sysconfdir}/init.d/bacula-fd
406
407 %doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo doc/bacula.pdf html-manual ../Release_Notes-%{version}-%{release}.txt
408 /etc/logrotate.d/bacula
409
410 %config(noreplace) %{_sysconfdir}/bacula/bacula-fd.conf
411 %config(noreplace) %{_sysconfdir}/bacula/bconsole.conf
412 %dir %{_var}/lib/%{name}
413
414 %attr(755,root,root) %{_sbindir}/bacula-fd
415 %attr(755,root,root) %{_sbindir}/btraceback
416 %{_sysconfdir}/bacula/btraceback.gdb
417 %attr(755,root,root) %{_sbindir}/bsmtp
418 %attr(755,root,root) %{_sbindir}/bconsole
419
420 %files rescue
421 %defattr(644,root,root,755)
422 %{_sysconfdir}/bacula/rescue/backup.etc.list
423 %{_sysconfdir}/bacula/rescue/format_floppy
424 %{_sysconfdir}/bacula/rescue/getdiskinfo
425 %{_sysconfdir}/bacula/rescue/make_rescue_disk
426 %{_sysconfdir}/bacula/rescue/restore_bacula
427 %{_sysconfdir}/bacula/rescue/restore_etc
428 %{_sysconfdir}/bacula/rescue/run_grub
429 %{_sysconfdir}/bacula/rescue/run_lilo
430 %{_sysconfdir}/bacula/rescue/sfdisk.bz2
431 %{_sysconfdir}/bacula/rescue/bacula-fd
432 %{_sysconfdir}/bacula/rescue/tomsrtbt/*
433
434 %files updatedb
435 %defattr(644,root,root,755)
436 %{_sysconfdir}/bacula/updatedb/*
437
438 %files wxconsole
439 %defattr(644,root,root,755)
440 %attr(755,root,root) %{_sbindir}/wx-console
441 %{_sysconfdir}/bacula/wxconsole
442 %config(noreplace) %{_sysconfdir}/bacula/gnome-console.conf
443 %{_datadir}/pixmaps/bacula.png
444 %{_datadir}/applications/bacula.desktop
445
446 # add the console helper files
447 %config(noreplace,missingok) /etc/pam.d/gnome-console
448 %config(noreplace,missingok) /etc/security/console.apps/gnome-console
This page took 0.127022 seconds and 3 git commands to generate.