2 # - update desktop files, think about su-wrappers for console
4 # - fix log file permissions
7 %bcond_without console_wx # wx-console program
8 %bcond_without gnome # gnome-console program
9 %bcond_with sqlite # use SQLite
10 %bcond_without bat # bat Qt4 GUI
11 %bcond_without mysql # use MySQL
12 %bcond_with pgsql # use PostgreSQL
15 %bcond_with sqlite3 # use SQLite3 instead of SQLite 2
16 %bcond_with sqlite3_sync_off # makes SQLite3 backend much faster, but less reliable
18 %define database sqlite
23 %define database sqlite3
29 %define database postgresql
31 %undefine with_sqlite3
35 %define database mysql
37 %undefine with_sqlite3
39 %undefine with_sqlite3_sync_off
42 Summary: Bacula - The Network Backup Solution
43 Summary(pl.UTF-8): Bacula - rozwiązanie do wykonywania kopii zapasowych po sieci
48 License: extended GPL v2
49 Group: Networking/Utilities
50 Source0: http://dl.sourceforge.net/bacula/%{name}-%{version}.tar.gz
51 # Source0-md5: 4eb6155b45611018af03002d37a2ffde
52 Source1: http://dl.sourceforge.net/bacula/%{name}-docs-%{version}.tar.bz2
53 # Source1-md5: d9bb3e8ca8c9a4c741b83569c21a4806
54 Source2: http://dl.sourceforge.net/bacula/%{name}-rescue-%{version}.tar.gz
55 # Source2-md5: 320f95575591d285c3192e58912322c4
56 Source10: %{name}-dir.init
57 Source11: %{name}-fd.init
58 Source12: %{name}-sd.init
59 Source13: %{name}.logrotate
60 Source14: %{name}-dir.sysconfig
61 Source15: %{name}-fd.sysconfig
62 Source16: %{name}-sd.sysconfig
63 Patch0: %{name}-dvd-handler_path.patch
64 Patch1: %{name}-link.patch
65 Patch2: %{name}-mysql.patch
66 Patch3: %{name}-tinfo-readline.patch
67 Patch4: %{name}-branding.patch
68 Patch5: %{name}-conf.patch
69 Patch6: %{name}-nostatic.patch
70 Patch7: %{name}-2.4.4-bat-install.patch
71 Patch8: %{name}-2.4.4-fortify.patch
72 Patch9: %{name}-2.4.4-jobname-edit.patch
73 Patch10: %{name}-2.4.4-label-failure.patch
74 Patch11: %{name}-2.4.4-reload.patch
75 Patch12: %{name}-2.4.4-sd-deadlock.patch
76 Patch13: %{name}-2.4.4-time_t_64bit.patch
77 Patch14: %{name}-2.4.4-tray-sizing.patch
78 URL: http://www.bacula.org/
79 BuildRequires: acl-static
80 BuildRequires: automake
82 BuildRequires: fakeroot
84 BuildRequires: glibc-static
86 BuildRequires: libgnome-devel >= 2.0
87 BuildRequires: libgnomeui-devel >= 2.0
89 BuildRequires: libstdc++-static
90 BuildRequires: libwrap-static
92 BuildRequires: ncurses-devel
93 BuildRequires: openssl-devel
94 BuildRequires: openssl-static
95 BuildRequires: pkgconfig
97 BuildRequires: python-static
100 BuildRequires: QtCore-devel
101 BuildRequires: QtGui-devel
102 BuildRequires: qt4-build >= 4.3.3-3
103 BuildRequires: qt4-qmake >= 4.3.3-3
104 BuildRequires: qwt-devel >= 5.0.2-2
106 %{?with_mysql:BuildRequires: mysql-devel}
107 %{?with_pgsql:BuildRequires: postgresql-devel}
108 BuildRequires: readline-devel
109 BuildRequires: rpmbuild(macros) >= 1.268
110 BuildRequires: sed >= 4.0
111 %{?with_sqlite:BuildRequires: sqlite-devel}
112 %{?with_sqlite3:BuildRequires: sqlite3-devel}
113 %if %{with console_wx}
114 BuildRequires: wxGTK2-unicode-devel >= 2.4.0
116 BuildRequires: zlib-devel
117 BuildRequires: zlib-static
118 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
120 %define _sysconfdir /etc/%{name}
121 %define _localstatedir /var/lib/%{name}
123 # dependency section is broken. ccache usage is instead to makefiles
124 %undefine with_ccache
127 Bacula - It comes by night and sucks the vital essence from your
130 Bacula is a set of computer programs that permit you (or the system
131 administrator) to manage backup, recovery, and verification of
132 computer data across a network of computers of different kinds. In
133 technical terms, it is a network client/server based backup program.
134 Bacula is relatively easy to use and efficient, while offering many
135 advanced storage management features that make it easy to find and
136 recover lost or damaged files.
138 %description -l pl.UTF-8
139 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
141 Bacula to zbiór programów umożliwiających administratorowi na
142 zarządzanie kopiami zapasowymi, odzyskiwaniem i weryfikacją danych w
143 sieci komputerów różnego rodzaju. W terminologii technicznej jest to
144 program do kopii zapasowych pracujący w architekturze klient-serwer.
145 Bacula jest stosunkowo łatwa w użyciu i wydajna, oferując przy tym
146 wiele zaawansowanych możliwości przy zarządzaniu nośnikami,
147 ułatwiających znalezienie i odzyskanie utraconych lub uszkodzonych
151 Summary: Common files for bacula package
152 Summary(pl.UTF-8): Pliki wspólne dla pakietu bacula
153 Group: Networking/Utilities
154 Requires(post): openssl-tools
155 Requires(post): sed >= 4.0
156 Requires(post,preun): /sbin/chkconfig
157 Requires(postun): /usr/sbin/groupdel
158 Requires(postun): /usr/sbin/userdel
159 Requires(pre): /usr/sbin/groupadd
160 Requires(pre): /usr/sbin/useradd
161 Conflicts: bacula-console < 0:1.34.6
162 Conflicts: bacula-dir < 0:1.34.6
163 Conflicts: bacula-fd < 0:1.34.6
164 Conflicts: bacula-sd < 0:1.34.6
167 Bacula - It comes by night and sucks the vital essence from your
170 Bacula is a set of computer programs that permit you (or the system
171 administrator) to manage backup, recovery, and verification of
172 computer data across a network of computers of different kinds. In
173 technical terms, it is a network client/server based backup program.
174 Bacula is relatively easy to use and efficient, while offering many
175 advanced storage management features that make it easy to find and
176 recover lost or damaged files.
178 %description common -l pl.UTF-8
179 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
181 Bacula to zbiór programów umożliwiających administratorowi na
182 zarządzanie kopiami zapasowymi, odzyskiwaniem i weryfikacją danych w
183 sieci komputerów różnego rodzaju. W terminologii technicznej jest to
184 program do kopii zapasowych pracujący w architekturze klient-serwer.
185 Bacula jest stosunkowo łatwa w użyciu i wydajna, oferując przy tym
186 wiele zaawansowanych możliwości przy zarządzaniu nośnikami,
187 ułatwiających znalezienie i odzyskanie utraconych lub uszkodzonych
191 Summary: Bacula Director and Catalog services
192 Summary(pl.UTF-8): Usługi Bacula Director i Catalog
193 Group: Networking/Utilities
194 Requires(post): sed >= 4.0
195 Requires: %{name}-common = %{epoch}:%{version}-%{release}
196 Obsoletes: bacula-updatedb
199 Bacula - It comes by night and sucks the vital essence from your
202 Bacula Director is the program that supervises all the backup,
203 restore, verify and archive operations. The system administrator uses
204 the Bacula Director to schedule backups and to recover files. Catalog
205 services are comprised of the software programs responsible for
206 maintaining the file indexes and volume databases for all files backed
207 up. The Catalog services permit the System Administrator or user to
208 quickly locate and restore any desired file, since it maintains a
209 record of all Volumes used, all Jobs run, and all Files saved. This
210 build requires %{database} to be installed separately as the catalog
213 %description dir -l pl.UTF-8
214 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
216 Bacula Director to program nadzorujący wszystkie operacje wykonywania
217 kopii zapasowych, odzyskiwania, weryfikacji i archiwizowania.
218 Administrator używa Bacula Directora do szeregowania kopii zapasowych
219 oraz odzyskiwania plików. Usługi katalogowe (Catalog services) są
220 używane przez programy odpowiedzialne za zarządzanie indeksami plików
221 i bazą danych wolumenów dla wszystkich kopiowanych plików. Usługi
222 katalogowe umożliwiają administratorowi lub użytkownikowi szybko
223 zlokalizować i odtworzyć dowolny plik, ponieważ utrzymują rekord ze
224 wszystkimi używanymi wolumenami, uruchomionymi zadaniami i zapisanymi
225 plikami. Pakiet wymaga %{database} zainstalowanego oddzielnie jako
226 bazy danych dla katalogu.
229 Summary: Bacula Console
230 Summary(pl.UTF-8): Konsola Baculi
231 Group: Networking/Utilities
232 Requires(post): sed >= 4.0
233 Requires: %{name}-common = %{epoch}:%{version}-%{release}
236 Bacula - It comes by night and sucks the vital essence from your
239 Bacula Console is the program that allows the administrator or user to
240 communicate with the Bacula Director. This is the text only console
243 %description console -l pl.UTF-8
244 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
246 Bacula Console to program umożliwiający administratorowi lub
247 użytkownikowi komunikowanie się z programem Bacula Director. To jest
248 interfejs czysto tekstowy.
251 Summary: Bacula wxWidgets Console
252 Summary(pl.UTF-8): Konsola Baculi oparta na wxWidgets
253 Group: Networking/Utilities
254 Requires(post): sed >= 4.0
255 Requires: %{name}-common = %{epoch}:%{version}-%{release}
257 %description console-wx
258 Bacula - It comes by night and sucks the vital essence from your
261 Bacula Console is the program that allows the administrator or user to
262 communicate with the Bacula Director. This is the wxWidgets GUI
265 %description console-wx -l pl.UTF-8
266 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
268 Bacula Console to program umożliwiający administratorowi lub
269 użytkownikowi komunikowanie się z programem Bacula Director. To jest
270 interfejs graficzny oparty na wxWidgets.
272 %package console-gnome
273 Summary: Bacula GNOME Console
274 Summary(pl.UTF-8): Konsola Baculi oparta dla GNOME
275 Group: Networking/Utilities
276 Requires(post): sed >= 4.0
277 Requires: %{name}-common = %{epoch}:%{version}-%{release}
279 %description console-gnome
280 Bacula - It comes by night and sucks the vital essence from your
283 Bacula Console is the program that allows the administrator or user to
284 communicate with the Bacula Director. This is the GNOME GUI interface.
286 %description console-gnome -l pl.UTF-8
287 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
289 Bacula Console to program umożliwiający administratorowi lub
290 użytkownikowi komunikowanie się z programem Bacula Director. To jest
291 interfejs graficzny oparty na GNOME.
294 Summary: Bacula Qt4 Console
295 Summary(pl.UTF-8): Konsola Baculi oparta na Qt4
296 Group: Networking/Utilities
297 Requires(post): sed >= 4.0
298 Requires: %{name}-common = %{epoch}:%{version}-%{release}
300 %description console-qt4
301 Bacula - It comes by night and sucks the vital essence from your
304 Bacula Console is the program that allows the administrator or user to
305 communicate with the Bacula Director. This is the Qt4 GUI interface.
307 %description console-qt4 -l pl.UTF-8
308 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
310 Bacula Console to program umożliwiający administratorowi lub
311 użytkownikowi komunikowanie się z programem Bacula Director. To jest
312 interfejs graficzny oparty na Qt4.
314 %package tray-monitor
315 Summary: Bacula Tray Monitor
316 Group: Networking/Utilities
317 Requires(post): sed >= 4.0
318 Requires: %{name}-common = %{epoch}:%{version}-%{release}
320 %description tray-monitor
321 Bacula - It comes by night and sucks the vital essence from your
324 The Monitor program is typically an icon in the system tray. However,
325 once the icon is expanded into a full window, the administrator or
326 user can obtain status information about the Director or the backup
327 status on the local workstation or any other Bacula daemon that is
331 Summary: Bacula File services (Client)
332 Summary(pl.UTF-8): Usługi Bacula File (klient)
333 Group: Networking/Utilities
334 Requires(post): sed >= 4.0
335 Requires: %{name}-common = %{epoch}:%{version}-%{release}
338 Bacula - It comes by night and sucks the vital essence from your
341 Bacula File services (or Client program) is the software program that
342 is installed on the machine to be backed up. It is specific to the
343 operating system on which it runs and is responsible for providing the
344 file attributes and data when requested by the Director. The File
345 services are also responsible for the file system dependent part of
346 restoring the file attributes and data during a recovery operation.
347 This program runs as a daemon on the machine to be backed up, and in
348 some of the documentation, the File daemon is referred to as the
349 Client (for example in Bacula configuration file).
351 %description fd -l pl.UTF-8
352 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
354 Usługi Bacula File (inaczej program kliencki) to oprogramowanie, które
355 instaluje się na maszynach, z których mają być wykonywane kopie
356 zapasowe. Są one specyficzne dla systemu operacyjnego, pod którym
357 działa dana maszyna i odpowiadają za dostarczanie atrybutów i danych
358 plików na żądanie Directora. Usługi plikowe są także odpowiedzialne za
359 zależną od systemu plików część odzyskiwania atrybutów i danych plików
360 podczas operacji odzyskiwania danych. Program działa jako demon na
361 maszynie, która ma być backupowana i w części dokumentacji demon ten
362 (File) jest nazywany klientem (na przykład w pliku konfiguracyjnym
366 Summary: Bacula Storage services
367 Summary(pl.UTF-8): Usługi Bacula Storage
368 Group: Networking/Utilities
369 Requires(post): sed >= 4.0
370 Requires: %{name}-common = %{epoch}:%{version}-%{release}
371 Conflicts: dvd+rw-tools <= 5.21.4.10.8-1
374 Bacula - It comes by night and sucks the vital essence from your
377 Bacula Storage services consist of the software programs that perform
378 the storage and recovery of the file attributes and data to the
379 physical backup media or volumes. In other words, the Storage daemon
380 is responsible for reading and writing your tapes (or other storage
381 media, e.g. files). The Storage services runs as a daemon on the
382 machine that has the backup device (usually a tape drive).
384 %description sd -l pl.UTF-8
385 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
387 Usługi Bacula Storage składają się z programów obsługujących
388 przechowywanie danych oraz odzyskiwanie atrybutów i danych na
389 fizycznych nośnikach lub wolumenach. Innymi słowy, demon Storage jest
390 odpowiedzialny za odczyt i zapis taśm (lub innych nośników do
391 przechowywania danych, np. plików). Usługi Storage działają jako demon
392 na maszynie, która zawiera urządzenie backupowe (zwykle napęd
396 Summary: Bacula - The Network Backup Solution
397 Summary(pl.UTF-8): Bacula - rozwiązanie do wykonywania kopii zapasowych po sieci
398 Group: Networking/Utilities
399 Requires: %{name}-fd = %{epoch}:%{version}-%{release}
404 Bacula - It comes by night and sucks the vital essence from your
407 Bacula is a set of computer programs that permit you (or the system
408 administrator) to manage backup, recovery, and verification of
409 computer data across a network of computers of different kinds. In
410 technical terms, it is a network client/server based backup program.
411 Bacula is relatively easy to use and efficient, while offering many
412 advanced storage management features that make it easy to find and
413 recover lost or damaged files.
415 This package installs scripts for disaster recovery and builds rescue
416 floppy disk for bare metal recovery.
418 To make the bacula rescue disk run "./make_rescue_disk
420 - --copy-etc-files" from the %{_sysconfdir}/rescue directory. To
421 recreate the rescue information for this system run ./getdiskinfo
424 %description rescue -l pl.UTF-8
425 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
427 Bacula to zbiór programów umożliwiających administratorowi na
428 zarządzanie kopiami zapasowymi, odzyskiwaniem i weryfikacją danych w
429 sieci komputerów różnego rodzaju. W terminologii technicznej jest to
430 program do kopii zapasowych pracujący w architekturze klient-serwer.
431 Bacula jest stosunkowo łatwa w użyciu i wydajna, oferując przy tym
432 wiele zaawansowanych możliwości przy zarządzaniu nośnikami,
433 ułatwiających znalezienie i odzyskanie utraconych lub uszkodzonych
436 Ten pakiet zawiera skrypty do odtwarzania po awarii i tworzy dyskietkę
437 ratunkowe do odtwarzania systemu od zera.
439 Aby stworzyć dyskietkę ratunkową Baculi, należy uruchomić "./make_rescue_disk
440 --copy-static-bacula - --copy-etc-files" z katalogu
441 %{_sysconfdir}/rescue . Aby ponownie utworzyć informacje ratunkowe dla
442 danego systemu, należy ponownie uruchomić ./getdiskinfo .
462 tar -xf %{SOURCE2} && ln -s bacula-rescue-* rescue
464 sed -i -e 's#bindir=.*#bindir=%{_bindir}#g' \
465 src/cats/create_* src/cats/delete_* src/cats/drop_* \
466 src/cats/grant_* src/cats/make_* src/cats/update_*
467 sed -i -e 's/@hostname@/--hostname--/' src/*/*.conf.in
470 cp -f %{_datadir}/automake/config.sub autoconf
471 cd autoconf && %{__aclocal} -I bacula-macros -I gettext-macros && cd ..
472 %{__autoconf} --prepend-include=$(pwd)/autoconf autoconf/configure.in > configure
474 CPPFLAGS="-I/usr/include/ncurses -I%{_includedir}/readline"
475 WXCONFIG=%{_bindir}/wx-gtk2-unicode-config \
477 --with-scriptdir=%{_libexecdir}/%{name} \
478 --%{!?with_gnome:dis}%{?with_gnome:en}able-gnome \
479 %{?with_bat:--enable-bat} \
481 --enable-smartalloc \
482 %{?with_console_wx:--enable-bwx-console} \
483 --enable-tray-monitor \
484 %{?with_python:--with-python} \
486 --with-tcp-wrappers \
487 --with-working-dir=%{_var}/lib/%{name} \
488 --with-dump-email="root@localhost" \
489 --with-job-email="root@localhost" \
490 --with-smtp-host=localhost \
491 --with-pid-dir=/var/run \
492 --with-subsys-dir=/var/lock/subsys \
493 --enable-batch-insert \
495 %{?with_sqlite3_sync_off:--enable-extra-sqlite3-init="pragma synchronous=0;"} \
496 --with-dir-password="#FAKE-dir-password#" \
497 --with-fd-password="#FAKE-fd-password#" \
498 --with-sd-password="#FAKE-sd-password#" \
499 --with-mon-dir-password="#FAKE-mon-dir-password#" \
500 --with-mon-fd-password="#FAKE-mon-fd-password#" \
501 --with-mon-sd-password="#FAKE-mon-sd-password#" \
521 rm -rf $RPM_BUILD_ROOT
523 install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,logrotate.d,pam.d,sysconfig}
524 install -d $RPM_BUILD_ROOT%{_sysconfdir}/rescue
525 install -d $RPM_BUILD_ROOT{%{_pixmapsdir},%{_desktopdir},%{_mandir},%{_bindir},/var/log/bacula}
528 DESTDIR=$RPM_BUILD_ROOT
531 #strip -R.comment -R.note src/filed/static-bacula-fd
532 #install src/filed/static-bacula-fd $RPM_BUILD_ROOT%{_sysconfdir}/rescue/bacula-fd
534 install %{SOURCE10} $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-dir
535 install %{SOURCE11} $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-fd
536 install %{SOURCE12} $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-sd
537 install %{SOURCE13} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}-dir
538 install %{SOURCE14} $RPM_BUILD_ROOT/etc/sysconfig/bacula-dir
539 install %{SOURCE15} $RPM_BUILD_ROOT/etc/sysconfig/bacula-fd
540 install %{SOURCE16} $RPM_BUILD_ROOT/etc/sysconfig/bacula-sd
542 %if %{with console_wx}
543 # tray-monitor is for regular users
544 mv $RPM_BUILD_ROOT%{_sbindir}/bacula-tray-monitor $RPM_BUILD_ROOT%{_bindir}
546 install scripts/bacula.png $RPM_BUILD_ROOT%{_pixmapsdir}/bacula.png
547 install src/tray-monitor/generic.xpm $RPM_BUILD_ROOT%{_pixmapsdir}/bacula-tray-monitor.xpm
548 install scripts/bacula.desktop.gnome2 $RPM_BUILD_ROOT%{_desktopdir}/bacula.desktop
549 sed -e 's/gnome-console/wx-console/g;s/Console/Wx Console/g' \
550 scripts/bacula.desktop.gnome2 > $RPM_BUILD_ROOT%{_desktopdir}/bacula-wx.desktop
551 sed -e 's#%{_sbindir}#%{_bindir}#' \
552 scripts/bacula-tray-monitor.desktop > $RPM_BUILD_ROOT%{_desktopdir}/bacula-tray-monitor.desktop
556 install src/qt-console/bat $RPM_BUILD_ROOT%{_sbindir}
557 install scripts/bat.desktop $RPM_BUILD_ROOT%{_desktopdir}
561 # install the rescue stuff, these are the rescue scripts
562 install rescue/linux/floppy/backup.etc.list $RPM_BUILD_ROOT%{_sysconfdir}/rescue
563 install rescue/linux/floppy/*_* $RPM_BUILD_ROOT%{_sysconfdir}/rescue
564 install rescue/linux/floppy/getdiskinfo $RPM_BUILD_ROOT%{_sysconfdir}/rescue
565 install rescue/linux/floppy/sfdisk.bz2 $RPM_BUILD_ROOT%{_sysconfdir}/rescue
568 touch $RPM_BUILD_ROOT/var/log/bacula/log
570 # install the updatedb scripts
571 install updatedb/update_sqlite* $RPM_BUILD_ROOT%{_libexecdir}/%{name}
573 # place for site passwords
574 touch $RPM_BUILD_ROOT%{_sysconfdir}/{dir-password,fd-password,sd-password}
575 touch $RPM_BUILD_ROOT%{_sysconfdir}/{mon-dir-password,mon-fd-password,mon-sd-password}
578 rm -f $RPM_BUILD_ROOT%{_libexecdir}/%{name}/{gconsole,startmysql,stopmysql,bacula,bconsole,fd}
579 rm -f $RPM_BUILD_ROOT%{_sbindir}/static-bacula-fd
580 %if !%{with console_wx}
581 rm -f $RPM_BUILD_ROOT%{_desktopdir}/bacula-wx.desktop
583 touch $RPM_BUILD_ROOT%{_sysconfdir}/.pw.sed
586 rm -rf $RPM_BUILD_ROOT
589 %groupadd -P %{name}-common -g 136 -r -f bacula
590 %useradd -P %{name}-common -u 136 -r -d /var/lib/bacula -s /bin/false -c "Bacula User" -g bacula bacula
593 echo "Updating bacula passwords and names..."
595 for f in *-password ; do
596 if [ ! -s $f ] ; then
597 openssl rand -base64 33 > $f
600 for cf in *.conf *.conf.rpmnew ; do
601 [ -f $cf ] && sed -i -e"s:#FAKE-$f#:$p:" "$cf" || :
604 for cf in *.conf *.conf.rpmnew ; do
605 [ -f $cf ] && sed -i -e"s:--hostname--:`hostname`:" "$cf" || :
609 if [ "$1" = "0" ]; then
617 # XXX: Most of this upgrade procedure is safe for sqlite only. Other databases would require knowledge
618 # about currently used version so we can't easily support these :(
620 %if %{with sqlite} || %{with sqlite3}
621 [ -s %{_localstatedir}/bacula.db ] && \
622 DB_VER=`echo "select * from Version;" | \
623 %{_bindir}/sqlite%{?with_sqlite3:3} %{_localstatedir}/bacula.db | tail -n 1 2>/dev/null`
625 if [ -z "$DB_VER" ]; then
626 # grant privileges and create tables
627 %{_libexecdir}/%{name}/grant_bacula_privileges > dev/null
628 %{_libexecdir}/%{name}/create_bacula_database > dev/null
629 %{_libexecdir}/%{name}/make_bacula_tables > dev/null
631 echo "Backing up bacula tables"
632 echo ".dump" | sqlite%{?with_sqlite3:3} %{_localstatedir}/bacula.db | bzip2 > %{_localstatedir}/bacula_backup.sql.bz2
634 db_type="%{database}"
636 next_ver=$(($DB_VER + 1))
637 # support up to version 30; increase this if needed
638 for ver in $(seq $next_ver 30); do
639 prev_ver=$(($ver - 1))
641 if [ -x %{_libexecdir}/%{name}/update_${type}_tables_${prev_ver}_to_${ver} ]; then
642 echo "Upgrading bacula database: db=${db_type} from ${prev_ver} to ${ver}..."
643 %{_libexecdir}/%{name}/update_${type}_tables_${prev_ver}_to_${ver}
647 %{_libexecdir}/%{name}/update_bacula_tables
648 echo "If bacula works correctly you can remove the backup file %{_localstatedir}/bacula_backup.sql.bz2"
650 chown -R bacula:bacula %{_localstatedir}
651 chmod -R u+rX,go-rwx %{_localstatedir}/*
654 echo "Updating Bacula passwords and names..."
656 for f in *-password ; do
658 sed -i -e"s:#FAKE-$f#:$p:" *.conf *.conf.rpmnew 2>/dev/null || :
660 sed -i -e"s:--hostname--:`hostname`:" *.conf *.conf.rpmnew 2>/dev/null || :
662 /sbin/chkconfig --add bacula-dir
663 %service bacula-dir restart "Bacula Director daemon"
666 if [ "$1" = "0" ]; then
667 %service bacula-dir stop
668 /sbin/chkconfig --del bacula-dir
672 echo "Updating Bacula passwords and names..."
674 for f in *-password ; do
676 sed -i -e"s:#FAKE-$f#:$p:" *.conf *.conf.rpmnew 2>/dev/null || :
678 sed -i -e"s:--hostname--:`hostname`:" *.conf *.conf.rpmnew 2>/dev/null || :
680 /sbin/chkconfig --add bacula-fd
681 %service bacula-fd restart "Bacula File daemon"
684 if [ "$1" = "0" ]; then
685 %service bacula-fd stop
686 /sbin/chkconfig --del bacula-fd
690 echo "Updating Bacula passwords and names..."
692 for f in *-password ; do
694 sed -i -e"s:#FAKE-$f#:$p:" *.conf *.conf.rpmnew 2>/dev/null || :
696 sed -i -e"s:--hostname--:`hostname`:" *.conf *.conf.rpmnew 2>/dev/null || :
698 /sbin/chkconfig --add bacula-sd
699 %service bacula-sd restart "Bacula Storage daemon"
702 if [ "$1" = "0" ]; then
703 %service bacula-sd stop
704 /sbin/chkconfig --del bacula-sd
708 if [ -e %{_sysconfdir}/console.conf -a ! -e %{_sysconfdir}/bconsole.conf ]; then
709 mv %{_sysconfdir}/console.conf %{_sysconfdir}/bconsole.conf
713 echo "Updating Bacula passwords and names..."
715 for f in *-password ; do
717 sed -i -e"s:#FAKE-$f#:$p:" *.conf *.conf.rpmnew 2>/dev/null || :
719 sed -i -e"s:--hostname--:`hostname`:" *.conf *.conf.rpmnew 2>/dev/null || :
722 echo "Updating Bacula passwords and names..."
724 for f in *-password ; do
726 sed -i -e"s:#FAKE-$f#:$p:" *.conf *.conf.rpmnew 2>/dev/null || :
728 sed -i -e"s:--hostname--:`hostname`:" *.conf *.conf.rpmnew 2>/dev/null || :
731 echo "Updating Bacula passwords and names..."
733 for f in *-password ; do
735 sed -i -e"s:#FAKE-$f#:$p:" *.conf *.conf.rpmnew 2>/dev/null || :
737 sed -i -e"s:--hostname--:`hostname`:" *.conf *.conf.rpmnew 2>/dev/null || :
740 echo "Updating Bacula passwords and names..."
742 for f in *-password ; do
744 sed -i -e"s:#FAKE-$f#:$p:" *.conf *.conf.rpmnew 2>/dev/null || :
746 sed -i -e"s:--hostname--:`hostname`:" *.conf *.conf.rpmnew 2>/dev/null || :
749 echo "Updating Bacula passwords and names..."
751 for f in *-password ; do
753 sed -i -e"s:#FAKE-$f#:$p:" *.conf *.conf.rpmnew 2>/dev/null || :
755 sed -i -e"s:--hostname--:`hostname`:" *.conf *.conf.rpmnew 2>/dev/null || :
758 # link our current installed conf file to the rescue directory
759 ln -sf %{_sysconfdir}/bacula-fd.conf %{_sysconfdir}/rescue/bacula-fd.conf
762 echo "Creating rescue files for this system..."
763 cd %{_sysconfdir}/rescue
767 # remove the files created after the initial rpm installation
768 if [ "$1" = "0" ]; then
769 rm -f %{_sysconfdir}/rescue/bacula-fd.conf
770 rm -f %{_sysconfdir}/rescue/partition.*
771 rm -f %{_sysconfdir}/rescue/format.*
772 rm -f %{_sysconfdir}/rescue/mount_drives
773 rm -f %{_sysconfdir}/rescue/start_network
774 rm -f %{_sysconfdir}/rescue/sfdisk
775 rm -rf %{_sysconfdir}/rescue/diskinfo/*
779 %defattr(644,root,root,755)
782 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*-password
783 %attr(755,root,root) %{_sbindir}/bsmtp
784 %attr(755,root,root) %{_sbindir}/btraceback
785 %{_mandir}/man8/bacula.8*
786 %{_mandir}/man1/bsmtp.1*
787 %{_mandir}/man8/btraceback.8*
788 %dir %{_libexecdir}/%{name}
789 %{_libexecdir}/%{name}/btraceback.dbx
790 %{_libexecdir}/%{name}/btraceback.gdb
791 %attr(770,root,bacula) %dir %{_localstatedir}
792 %attr(750,bacula,logs) %dir /var/log/bacula
793 %attr(640,bacula,logs) %ghost /var/log/bacula/log
796 %defattr(644,root,root,755)
797 %doc ChangeLog CheckList ReleaseNotes kernstodo LICENSE
798 #%doc examples %{name}-docs-%{version}/manual/{*.pdf,bacula}
799 %attr(640,root,bacula) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bacula-dir.conf
800 %ghost %{_sysconfdir}/.pw.sed
801 %attr(640,root,root) %config(noreplace) /etc/logrotate.d/bacula-dir
802 %attr(754,root,root) /etc/rc.d/init.d/bacula-dir
803 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/bacula-dir
804 %attr(755,root,root) %{_sbindir}/bacula-dir
805 %attr(755,root,root) %{_sbindir}/bregex
806 %attr(755,root,root) %{_sbindir}/bwild
807 %attr(755,root,root) %{_sbindir}/dbcheck
808 %{_mandir}/man8/bacula-dir.8*
809 %{_mandir}/man8/dbcheck.8*
810 %{_libexecdir}/%{name}/query.sql
812 %attr(755,root,root) %{_libexecdir}/%{name}/create_sqlite3_database
813 %attr(755,root,root) %{_libexecdir}/%{name}/drop_sqlite3_database
814 %attr(755,root,root) %{_libexecdir}/%{name}/drop_sqlite3_tables
815 %attr(755,root,root) %{_libexecdir}/%{name}/grant_sqlite3_privileges
816 %attr(755,root,root) %{_libexecdir}/%{name}/make_sqlite3_tables
817 %attr(755,root,root) %{_libexecdir}/%{name}/update_sqlite3_*
820 %attr(755,root,root) %{_libexecdir}/%{name}/create_sqlite_database
821 %attr(755,root,root) %{_libexecdir}/%{name}/drop_sqlite_database
822 %attr(755,root,root) %{_libexecdir}/%{name}/drop_sqlite_tables
823 %attr(755,root,root) %{_libexecdir}/%{name}/grant_sqlite_privileges
824 %attr(755,root,root) %{_libexecdir}/%{name}/make_sqlite_tables
825 %attr(755,root,root) %{_libexecdir}/%{name}/update_sqlite_*
828 %attr(755,root,root) %{_libexecdir}/%{name}/create_mysql_database
829 %attr(755,root,root) %{_libexecdir}/%{name}/drop_mysql_database
830 %attr(755,root,root) %{_libexecdir}/%{name}/drop_mysql_tables
831 %attr(755,root,root) %{_libexecdir}/%{name}/grant_mysql_privileges
832 %attr(755,root,root) %{_libexecdir}/%{name}/make_mysql_tables
833 %attr(755,root,root) %{_libexecdir}/%{name}/update_mysql_*
836 %attr(755,root,root) %{_libexecdir}/%{name}/create_postgresql_database
837 %attr(755,root,root) %{_libexecdir}/%{name}/drop_postgresql_database
838 %attr(755,root,root) %{_libexecdir}/%{name}/drop_postgresql_tables
839 %attr(755,root,root) %{_libexecdir}/%{name}/grant_postgresql_privileges
840 %attr(755,root,root) %{_libexecdir}/%{name}/make_postgresql_tables
841 %attr(755,root,root) %{_libexecdir}/%{name}/update_postgresql_*
843 %attr(755,root,root) %{_libexecdir}/%{name}/create_bacula_database
844 %attr(755,root,root) %{_libexecdir}/%{name}/drop_bacula_database
845 %attr(755,root,root) %{_libexecdir}/%{name}/drop_bacula_tables
846 %attr(755,root,root) %{_libexecdir}/%{name}/grant_bacula_privileges
847 %attr(755,root,root) %{_libexecdir}/%{name}/make_bacula_tables
848 %attr(755,root,root) %{_libexecdir}/%{name}/update_bacula_tables
849 %attr(755,root,root) %{_libexecdir}/%{name}/make_catalog_backup
850 %attr(755,root,root) %{_libexecdir}/%{name}/delete_catalog_backup
853 %defattr(644,root,root,755)
855 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bacula-fd.conf
856 %attr(754,root,root) /etc/rc.d/init.d/bacula-fd
857 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/bacula-fd
858 %attr(755,root,root) %{_sbindir}/bacula-fd
859 %{_mandir}/man8/bacula-fd.8*
862 %defattr(644,root,root,755)
864 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bacula-sd.conf
865 %attr(754,root,root) /etc/rc.d/init.d/bacula-sd
866 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/bacula-sd
867 %attr(755,root,root) %{_sbindir}/bacula-sd
868 %attr(755,root,root) %{_sbindir}/bcopy
869 %attr(755,root,root) %{_sbindir}/bextract
870 %attr(755,root,root) %{_sbindir}/bls
871 %attr(755,root,root) %{_sbindir}/bscan
872 %attr(755,root,root) %{_sbindir}/btape
873 %attr(755,root,root) %{_libexecdir}/%{name}/mtx-changer
874 %attr(755,root,root) %{_libexecdir}/%{name}/disk-changer
875 %attr(755,root,root) %{_libexecdir}/%{name}/dvd-handler
876 %{_mandir}/man8/bacula-sd.8*
877 %{_mandir}/man8/bcopy.8*
878 %{_mandir}/man8/bextract.8*
879 %{_mandir}/man8/bls.8*
880 %{_mandir}/man8/bscan.8*
881 %{_mandir}/man8/btape.8*
884 %defattr(644,root,root,755)
886 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bconsole.conf
887 %attr(755,root,root) %{_sbindir}/bconsole
888 %{_mandir}/man8/bconsole.8*
890 %if %{with console_wx}
892 %defattr(644,root,root,755)
894 %{_pixmapsdir}/%{name}.png
895 %{_desktopdir}/bacula-wx.desktop
896 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bwx-console.conf
897 %attr(755,root,root) %{_sbindir}/bwx-console
898 %{_mandir}/man1/bacula-bwxconsole.1*
903 %defattr(644,root,root,755)
905 %{_pixmapsdir}/%{name}.png
906 %{_desktopdir}/bacula.desktop
907 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bgnome-console.conf
908 %attr(755,root,root) %{_sbindir}/bgnome-console
909 %{_mandir}/man1/bacula-bgnome-console.1*
914 %defattr(644,root,root,755)
916 %{_pixmapsdir}/%{name}.png
917 %{_desktopdir}/bat.desktop
918 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bat.conf
919 %attr(755,root,root) %{_sbindir}/bat
920 %{_mandir}/man1/bat.1*
923 %if %{with console_wx}
925 %defattr(644,root,root,755)
927 %{_pixmapsdir}/%{name}-tray-monitor.xpm
928 %{_desktopdir}/%{name}-tray-monitor.desktop
929 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/tray-monitor.conf
930 %attr(755,root,root) %{_bindir}/bacula-tray-monitor
931 %{_mandir}/man1/bacula-tray-monitor.1*
936 %defattr(644,root,root,755)
938 %dir %{_sysconfdir}/rescue
939 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/backup.etc.list
940 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/bacula-fd
941 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/format_floppy
942 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/getdiskinfo
943 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/make_rescue_disk
944 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/restore_bacula
945 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/restore_etc
946 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/run_grub
947 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/run_lilo
948 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/sfdisk.bz2