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: fe964931ab3fc538a8884204d23e8a5a
52 Source1: http://dl.sourceforge.net/bacula/%{name}-docs-%{version}.tar.bz2
53 # Source1-md5: a251dc0b5a2c8250b43e2ae372526de2
54 Source2: http://dl.sourceforge.net/bacula/%{name}-rescue-%{version}.tar.gz
55 # Source2-md5: 51bc4b1e5d60593cb9f9aa80d31ad8e4
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 Patch10: 2.2.6-add.patch
71 Patch11: 2.2.6-dvdwrite_trialfix.patch
72 Patch12: 2.2.6-queued-msg.patch
73 Patch13: 2.2.6-backup-restore-socket.patch
74 Patch14: 2.2.6-mac-build.patch
75 Patch15: 2.2.6-status.patch
77 URL: http://www.bacula.org/
78 BuildRequires: acl-static
79 BuildRequires: automake
81 BuildRequires: fakeroot
83 BuildRequires: glibc-static
85 BuildRequires: libgnome-devel >= 2.0
86 BuildRequires: libgnomeui-devel >= 2.0
88 BuildRequires: libstdc++-static
89 BuildRequires: libwrap-static
91 BuildRequires: ncurses-devel
92 BuildRequires: openssl-devel
93 BuildRequires: openssl-static
94 BuildRequires: pkgconfig
96 BuildRequires: python-static
99 BuildRequires: QtCore-devel
100 BuildRequires: QtGui-devel
101 BuildRequires: qt4-build >= 4.3.3-3
102 BuildRequires: qt4-qmake >= 4.3.3-3
103 BuildRequires: qwt-devel >= 5.0.2-2
105 BuildRequires: readline-devel
106 BuildRequires: rpmbuild(macros) >= 1.268
107 BuildRequires: sed >= 4.0
108 %{?with_sqlite:BuildRequires: sqlite-devel}
109 %{?with_sqlite3:BuildRequires: sqlite3-devel}
110 %{?with_mysql:BuildRequires: mysql-devel}
111 %{?with_pgsql:BuildRequires: postgresql-devel}
112 %if %{with console_wx}
113 BuildRequires: wxGTK2-unicode-devel >= 2.4.0
115 BuildRequires: zlib-devel
116 BuildRequires: zlib-static
117 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
119 %define _sysconfdir /etc/%{name}
120 %define _localstatedir /var/lib/%{name}
122 # dependency section is broken. ccache usage is instead to makefiles
123 %undefine with_ccache
126 Bacula - It comes by night and sucks the vital essence from your
129 Bacula is a set of computer programs that permit you (or the system
130 administrator) to manage backup, recovery, and verification of
131 computer data across a network of computers of different kinds. In
132 technical terms, it is a network client/server based backup program.
133 Bacula is relatively easy to use and efficient, while offering many
134 advanced storage management features that make it easy to find and
135 recover lost or damaged files.
137 %description -l pl.UTF-8
138 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
140 Bacula to zbiór programów umożliwiających administratorowi na
141 zarządzanie kopiami zapasowymi, odzyskiwaniem i weryfikacją danych w
142 sieci komputerów różnego rodzaju. W terminologii technicznej jest to
143 program do kopii zapasowych pracujący w architekturze klient-serwer.
144 Bacula jest stosunkowo łatwa w użyciu i wydajna, oferując przy tym
145 wiele zaawansowanych możliwości przy zarządzaniu nośnikami,
146 ułatwiających znalezienie i odzyskanie utraconych lub uszkodzonych
150 Summary: Common files for bacula package
151 Summary(pl.UTF-8): Pliki wspólne dla pakietu bacula
152 Group: Networking/Utilities
153 Requires(post): openssl-tools
154 Requires(post): sed >= 4.0
155 Requires(post,preun): /sbin/chkconfig
156 Requires(postun): /usr/sbin/groupdel
157 Requires(postun): /usr/sbin/userdel
158 Requires(pre): /usr/sbin/groupadd
159 Requires(pre): /usr/sbin/useradd
160 Conflicts: bacula-console < 0:1.34.6
161 Conflicts: bacula-dir < 0:1.34.6
162 Conflicts: bacula-fd < 0:1.34.6
163 Conflicts: bacula-sd < 0:1.34.6
166 Bacula - It comes by night and sucks the vital essence from your
169 Bacula is a set of computer programs that permit you (or the system
170 administrator) to manage backup, recovery, and verification of
171 computer data across a network of computers of different kinds. In
172 technical terms, it is a network client/server based backup program.
173 Bacula is relatively easy to use and efficient, while offering many
174 advanced storage management features that make it easy to find and
175 recover lost or damaged files.
177 %description common -l pl.UTF-8
178 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
180 Bacula to zbiór programów umożliwiających administratorowi na
181 zarządzanie kopiami zapasowymi, odzyskiwaniem i weryfikacją danych w
182 sieci komputerów różnego rodzaju. W terminologii technicznej jest to
183 program do kopii zapasowych pracujący w architekturze klient-serwer.
184 Bacula jest stosunkowo łatwa w użyciu i wydajna, oferując przy tym
185 wiele zaawansowanych możliwości przy zarządzaniu nośnikami,
186 ułatwiających znalezienie i odzyskanie utraconych lub uszkodzonych
190 Summary: Bacula Director and Catalog services
191 Summary(pl.UTF-8): Usługi Bacula Director i Catalog
192 Group: Networking/Utilities
193 Requires(post): sed >= 4.0
194 Requires: %{name}-common = %{epoch}:%{version}-%{release}
195 Obsoletes: bacula-updatedb
198 Bacula - It comes by night and sucks the vital essence from your
201 Bacula Director is the program that supervises all the backup,
202 restore, verify and archive operations. The system administrator uses
203 the Bacula Director to schedule backups and to recover files. Catalog
204 services are comprised of the software programs responsible for
205 maintaining the file indexes and volume databases for all files backed
206 up. The Catalog services permit the System Administrator or user to
207 quickly locate and restore any desired file, since it maintains a
208 record of all Volumes used, all Jobs run, and all Files saved. This
209 build requires %{database} to be installed separately as the catalog
212 %description dir -l pl.UTF-8
213 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
215 Bacula Director to program nadzorujący wszystkie operacje wykonywania
216 kopii zapasowych, odzyskiwania, weryfikacji i archiwizowania.
217 Administrator używa Bacula Directora do szeregowania kopii zapasowych
218 oraz odzyskiwania plików. Usługi katalogowe (Catalog services) są
219 używane przez programy odpowiedzialne za zarządzanie indeksami plików
220 i bazą danych wolumenów dla wszystkich kopiowanych plików. Usługi
221 katalogowe umożliwiają administratorowi lub użytkownikowi szybko
222 zlokalizować i odtworzyć dowolny plik, ponieważ utrzymują rekord ze
223 wszystkimi używanymi wolumenami, uruchomionymi zadaniami i zapisanymi
224 plikami. Pakiet wymaga %{database} zainstalowanego oddzielnie jako
225 bazy danych dla katalogu.
228 Summary: Bacula Console
229 Summary(pl.UTF-8): Konsola Baculi
230 Group: Networking/Utilities
231 Requires(post): sed >= 4.0
232 Requires: %{name}-common = %{epoch}:%{version}-%{release}
235 Bacula - It comes by night and sucks the vital essence from your
238 Bacula Console is the program that allows the administrator or user to
239 communicate with the Bacula Director. This is the text only console
242 %description console -l pl.UTF-8
243 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
245 Bacula Console to program umożliwiający administratorowi lub
246 użytkownikowi komunikowanie się z programem Bacula Director. To jest
247 interfejs czysto tekstowy.
250 Summary: Bacula wxWidgets Console
251 Summary(pl.UTF-8): Konsola Baculi oparta na wxWidgets
252 Group: Networking/Utilities
253 Requires(post): sed >= 4.0
254 Requires: %{name}-common = %{epoch}:%{version}-%{release}
256 %description console-wx
257 Bacula - It comes by night and sucks the vital essence from your
260 Bacula Console is the program that allows the administrator or user to
261 communicate with the Bacula Director. This is the wxWidgets GUI
264 %description console-wx -l pl.UTF-8
265 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
267 Bacula Console to program umożliwiający administratorowi lub
268 użytkownikowi komunikowanie się z programem Bacula Director. To jest
269 interfejs graficzny oparty na wxWidgets.
271 %package console-gnome
272 Summary: Bacula GNOME Console
273 Summary(pl.UTF-8): Konsola Baculi oparta dla GNOME
274 Group: Networking/Utilities
275 Requires(post): sed >= 4.0
276 Requires: %{name}-common = %{epoch}:%{version}-%{release}
278 %description console-gnome
279 Bacula - It comes by night and sucks the vital essence from your
282 Bacula Console is the program that allows the administrator or user to
283 communicate with the Bacula Director. This is the GNOME GUI interface.
285 %description console-gnome -l pl.UTF-8
286 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
288 Bacula Console to program umożliwiający administratorowi lub
289 użytkownikowi komunikowanie się z programem Bacula Director. To jest
290 interfejs graficzny oparty na GNOME.
293 Summary: Bacula Qt4 Console
294 Summary(pl.UTF-8): Konsola Baculi oparta na Qt4
295 Group: Networking/Utilities
296 Requires(post): sed >= 4.0
297 Requires: %{name}-common = %{epoch}:%{version}-%{release}
299 %description console-qt4
300 Bacula - It comes by night and sucks the vital essence from your
303 Bacula Console is the program that allows the administrator or user to
304 communicate with the Bacula Director. This is the Qt4 GUI interface.
306 %description console-qt4 -l pl.UTF-8
307 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
309 Bacula Console to program umożliwiający administratorowi lub
310 użytkownikowi komunikowanie się z programem Bacula Director. To jest
311 interfejs graficzny oparty na Qt4.
313 %package tray-monitor
314 Summary: Bacula Tray Monitor
315 Group: Networking/Utilities
316 Requires(post): sed >= 4.0
317 Requires: %{name}-common = %{epoch}:%{version}-%{release}
319 %description tray-monitor
320 Bacula - It comes by night and sucks the vital essence from your
323 The Monitor program is typically an icon in the system tray. However,
324 once the icon is expanded into a full window, the administrator or
325 user can obtain status information about the Director or the backup
326 status on the local workstation or any other Bacula daemon that is
330 Summary: Bacula File services (Client)
331 Summary(pl.UTF-8): Usługi Bacula File (klient)
332 Group: Networking/Utilities
333 Requires(post): sed >= 4.0
334 Requires: %{name}-common = %{epoch}:%{version}-%{release}
337 Bacula - It comes by night and sucks the vital essence from your
340 Bacula File services (or Client program) is the software program that
341 is installed on the machine to be backed up. It is specific to the
342 operating system on which it runs and is responsible for providing the
343 file attributes and data when requested by the Director. The File
344 services are also responsible for the file system dependent part of
345 restoring the file attributes and data during a recovery operation.
346 This program runs as a daemon on the machine to be backed up, and in
347 some of the documentation, the File daemon is referred to as the
348 Client (for example in Bacula configuration file).
350 %description fd -l pl.UTF-8
351 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
353 Usługi Bacula File (inaczej program kliencki) to oprogramowanie, które
354 instaluje się na maszynach, z których mają być wykonywane kopie
355 zapasowe. Są one specyficzne dla systemu operacyjnego, pod którym
356 działa dana maszyna i odpowiadają za dostarczanie atrybutów i danych
357 plików na żądanie Directora. Usługi plikowe są także odpowiedzialne za
358 zależną od systemu plików część odzyskiwania atrybutów i danych plików
359 podczas operacji odzyskiwania danych. Program działa jako demon na
360 maszynie, która ma być backupowana i w części dokumentacji demon ten
361 (File) jest nazywany klientem (na przykład w pliku konfiguracyjnym
365 Summary: Bacula Storage services
366 Summary(pl.UTF-8): Usługi Bacula Storage
367 Group: Networking/Utilities
368 Requires(post): sed >= 4.0
369 Requires: %{name}-common = %{epoch}:%{version}-%{release}
370 Conflicts: dvd+rw-tools <= 5.21.4.10.8-1
373 Bacula - It comes by night and sucks the vital essence from your
376 Bacula Storage services consist of the software programs that perform
377 the storage and recovery of the file attributes and data to the
378 physical backup media or volumes. In other words, the Storage daemon
379 is responsible for reading and writing your tapes (or other storage
380 media, e.g. files). The Storage services runs as a daemon on the
381 machine that has the backup device (usually a tape drive).
383 %description sd -l pl.UTF-8
384 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
386 Usługi Bacula Storage składają się z programów obsługujących
387 przechowywanie danych oraz odzyskiwanie atrybutów i danych na
388 fizycznych nośnikach lub wolumenach. Innymi słowy, demon Storage jest
389 odpowiedzialny za odczyt i zapis taśm (lub innych nośników do
390 przechowywania danych, np. plików). Usługi Storage działają jako demon
391 na maszynie, która zawiera urządzenie backupowe (zwykle napęd
395 Summary: Bacula - The Network Backup Solution
396 Summary(pl.UTF-8): Bacula - rozwiązanie do wykonywania kopii zapasowych po sieci
397 Group: Networking/Utilities
398 Requires: %{name}-fd = %{epoch}:%{version}-%{release}
403 Bacula - It comes by night and sucks the vital essence from your
406 Bacula is a set of computer programs that permit you (or the system
407 administrator) to manage backup, recovery, and verification of
408 computer data across a network of computers of different kinds. In
409 technical terms, it is a network client/server based backup program.
410 Bacula is relatively easy to use and efficient, while offering many
411 advanced storage management features that make it easy to find and
412 recover lost or damaged files.
414 This package installs scripts for disaster recovery and builds rescue
415 floppy disk for bare metal recovery.
417 To make the bacula rescue disk run "./make_rescue_disk
419 - --copy-etc-files" from the %{_sysconfdir}/rescue directory. To
420 recreate the rescue information for this system run ./getdiskinfo
423 %description rescue -l pl.UTF-8
424 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
426 Bacula to zbiór programów umożliwiających administratorowi na
427 zarządzanie kopiami zapasowymi, odzyskiwaniem i weryfikacją danych w
428 sieci komputerów różnego rodzaju. W terminologii technicznej jest to
429 program do kopii zapasowych pracujący w architekturze klient-serwer.
430 Bacula jest stosunkowo łatwa w użyciu i wydajna, oferując przy tym
431 wiele zaawansowanych możliwości przy zarządzaniu nośnikami,
432 ułatwiających znalezienie i odzyskanie utraconych lub uszkodzonych
435 Ten pakiet zawiera skrypty do odtwarzania po awarii i tworzy dyskietkę
436 ratunkowe do odtwarzania systemu od zera.
438 Aby stworzyć dyskietkę ratunkową Baculi, należy uruchomić "./make_rescue_disk
439 --copy-static-bacula - --copy-etc-files" z katalogu
440 %{_sysconfdir}/rescue . Aby ponownie utworzyć informacje ratunkowe dla
441 danego systemu, należy ponownie uruchomić ./getdiskinfo .
461 tar -xf %{SOURCE2} && ln -s bacula-rescue-* rescue
463 sed -i -e 's#bindir=.*#bindir=%{_bindir}#g' \
464 src/cats/create_* src/cats/delete_* src/cats/drop_* \
465 src/cats/grant_* src/cats/make_* src/cats/update_*
466 sed -i -e 's/@hostname@/--hostname--/' src/*/*.conf.in
469 cp -f %{_datadir}/automake/config.sub autoconf
470 cd autoconf && %{__aclocal} -I bacula-macros -I gettext-macros && cd ..
471 %{__autoconf} --prepend-include=$(pwd)/autoconf autoconf/configure.in > configure
473 CPPFLAGS="-I/usr/include/ncurses -I%{_includedir}/readline"
474 WXCONFIG=%{_bindir}/wx-gtk2-unicode-config \
476 --with-scriptdir=%{_libexecdir}/%{name} \
477 --%{!?with_gnome:dis}%{?with_gnome:en}able-gnome \
478 %{?with_bat:--enable-bat} \
480 --enable-smartalloc \
481 %{?with_console_wx:--enable-bwx-console} \
482 --enable-tray-monitor \
483 %{?with_python:--with-python} \
485 --with-tcp-wrappers \
486 --with-working-dir=%{_var}/lib/%{name} \
487 --with-dump-email="root@localhost" \
488 --with-job-email="root@localhost" \
489 --with-smtp-host=localhost \
490 --with-pid-dir=/var/run \
491 --with-subsys-dir=/var/lock/subsys \
492 --enable-batch-insert \
494 %{?with_sqlite3_sync_off:--enable-extra-sqlite3-init="pragma synchronous=0;"} \
495 --with-dir-password="#FAKE-dir-password#" \
496 --with-fd-password="#FAKE-fd-password#" \
497 --with-sd-password="#FAKE-sd-password#" \
498 --with-mon-dir-password="#FAKE-mon-dir-password#" \
499 --with-mon-fd-password="#FAKE-mon-fd-password#" \
500 --with-mon-sd-password="#FAKE-mon-sd-password#" \
520 rm -rf $RPM_BUILD_ROOT
522 install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,logrotate.d,pam.d,sysconfig}
523 install -d $RPM_BUILD_ROOT%{_sysconfdir}/rescue
524 install -d $RPM_BUILD_ROOT{%{_pixmapsdir},%{_desktopdir},%{_mandir},%{_bindir},/var/log/bacula}
527 DESTDIR=$RPM_BUILD_ROOT
530 #strip -R.comment -R.note src/filed/static-bacula-fd
531 #install src/filed/static-bacula-fd $RPM_BUILD_ROOT%{_sysconfdir}/rescue/bacula-fd
533 install %{SOURCE10} $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-dir
534 install %{SOURCE11} $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-fd
535 install %{SOURCE12} $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-sd
536 install %{SOURCE13} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}-dir
537 install %{SOURCE14} $RPM_BUILD_ROOT/etc/sysconfig/bacula-dir
538 install %{SOURCE15} $RPM_BUILD_ROOT/etc/sysconfig/bacula-fd
539 install %{SOURCE16} $RPM_BUILD_ROOT/etc/sysconfig/bacula-sd
541 %if %{with console_wx}
542 # tray-monitor is for regular users
543 mv $RPM_BUILD_ROOT%{_sbindir}/bacula-tray-monitor $RPM_BUILD_ROOT%{_bindir}
545 install scripts/bacula.png $RPM_BUILD_ROOT%{_pixmapsdir}/bacula.png
546 install src/tray-monitor/generic.xpm $RPM_BUILD_ROOT%{_pixmapsdir}/bacula-tray-monitor.xpm
547 install scripts/bacula.desktop.gnome2 $RPM_BUILD_ROOT%{_desktopdir}/bacula.desktop
548 sed -e 's/gnome-console/wx-console/g;s/Console/Wx Console/g' \
549 scripts/bacula.desktop.gnome2 > $RPM_BUILD_ROOT%{_desktopdir}/bacula-wx.desktop
550 sed -e 's#%{_sbindir}#%{_bindir}#' \
551 scripts/bacula-tray-monitor.desktop > $RPM_BUILD_ROOT%{_desktopdir}/bacula-tray-monitor.desktop
555 install src/qt-console/bat $RPM_BUILD_ROOT%{_sbindir}
556 install scripts/bat.desktop $RPM_BUILD_ROOT%{_desktopdir}
560 # install the rescue stuff, these are the rescue scripts
561 install rescue/linux/floppy/backup.etc.list $RPM_BUILD_ROOT%{_sysconfdir}/rescue
562 install rescue/linux/floppy/*_* $RPM_BUILD_ROOT%{_sysconfdir}/rescue
563 install rescue/linux/floppy/getdiskinfo $RPM_BUILD_ROOT%{_sysconfdir}/rescue
564 install rescue/linux/floppy/sfdisk.bz2 $RPM_BUILD_ROOT%{_sysconfdir}/rescue
567 touch $RPM_BUILD_ROOT/var/log/bacula/log
569 # install the updatedb scripts
570 install updatedb/update_sqlite* $RPM_BUILD_ROOT%{_libexecdir}/%{name}
572 # place for site passwords
573 touch $RPM_BUILD_ROOT%{_sysconfdir}/{dir-password,fd-password,sd-password}
574 touch $RPM_BUILD_ROOT%{_sysconfdir}/{mon-dir-password,mon-fd-password,mon-sd-password}
577 rm -f $RPM_BUILD_ROOT%{_libexecdir}/%{name}/{gconsole,startmysql,stopmysql,bacula,bconsole,fd}
578 rm -f $RPM_BUILD_ROOT%{_sbindir}/static-bacula-fd
579 %if !%{with console_wx}
580 rm -f $RPM_BUILD_ROOT%{_desktopdir}/bacula-wx.desktop
582 touch $RPM_BUILD_ROOT%{_sysconfdir}/.pw.sed
585 rm -rf $RPM_BUILD_ROOT
588 %groupadd -P %{name}-common -g 136 -r -f bacula
589 %useradd -P %{name}-common -u 136 -r -d /var/lib/bacula -s /bin/false -c "Bacula User" -g bacula bacula
592 echo "Updating bacula passwords and names..."
594 for f in *-password ; do
595 if [ ! -s $f ] ; then
596 openssl rand -base64 33 > $f
599 for cf in *.conf *.conf.rpmnew ; do
600 [ -f $cf ] && sed -i -e"s:#FAKE-$f#:$p:" "$cf" || :
603 for cf in *.conf *.conf.rpmnew ; do
604 [ -f $cf ] && sed -i -e"s:--hostname--:`hostname`:" "$cf" || :
608 if [ "$1" = "0" ]; then
616 # XXX: Most of this upgrade procedure is safe for sqlite only. Other databases would require knowledge
617 # about currently used version so we can't easily support these :(
619 %if %{with sqlite} || %{with sqlite3}
620 [ -s %{_localstatedir}/bacula.db ] && \
621 DB_VER=`echo "select * from Version;" | \
622 %{_bindir}/sqlite%{?with_sqlite3:3} %{_localstatedir}/bacula.db | tail -n 1 2>/dev/null`
624 if [ -z "$DB_VER" ]; then
625 # grant privileges and create tables
626 %{_libexecdir}/%{name}/grant_bacula_privileges > dev/null
627 %{_libexecdir}/%{name}/create_bacula_database > dev/null
628 %{_libexecdir}/%{name}/make_bacula_tables > dev/null
630 echo "Backing up bacula tables"
631 echo ".dump" | sqlite%{?with_sqlite3:3} %{_localstatedir}/bacula.db | bzip2 > %{_localstatedir}/bacula_backup.sql.bz2
633 db_type="%{database}"
635 next_ver=$(($DB_VER + 1))
636 # support up to version 30; increase this if needed
637 for ver in $(seq $next_ver 30); do
638 prev_ver=$(($ver - 1))
640 if [ -x %{_libexecdir}/%{name}/update_${type}_tables_${prev_ver}_to_${ver} ]; then
641 echo "Upgrading bacula database: db=${db_type} from ${prev_ver} to ${ver}..."
642 %{_libexecdir}/%{name}/update_${type}_tables_${prev_ver}_to_${ver}
646 %{_libexecdir}/%{name}/update_bacula_tables
647 echo "If bacula works correctly you can remove the backup file %{_localstatedir}/bacula_backup.sql.bz2"
649 chown -R bacula:bacula %{_localstatedir}
650 chmod -R u+rX,go-rwx %{_localstatedir}/*
653 echo "Updating Bacula passwords and names..."
655 for f in *-password ; do
657 sed -i -e"s:#FAKE-$f#:$p:" *.conf *.conf.rpmnew 2>/dev/null || :
659 sed -i -e"s:--hostname--:`hostname`:" *.conf *.conf.rpmnew 2>/dev/null || :
661 /sbin/chkconfig --add bacula-dir
662 %service bacula-dir restart "Bacula Director daemon"
665 if [ "$1" = "0" ]; then
666 %service bacula-dir stop
667 /sbin/chkconfig --del bacula-dir
671 echo "Updating Bacula passwords and names..."
673 for f in *-password ; do
675 sed -i -e"s:#FAKE-$f#:$p:" *.conf *.conf.rpmnew 2>/dev/null || :
677 sed -i -e"s:--hostname--:`hostname`:" *.conf *.conf.rpmnew 2>/dev/null || :
679 /sbin/chkconfig --add bacula-fd
680 %service bacula-fd restart "Bacula File daemon"
683 if [ "$1" = "0" ]; then
684 %service bacula-fd stop
685 /sbin/chkconfig --del bacula-fd
689 echo "Updating Bacula passwords and names..."
691 for f in *-password ; do
693 sed -i -e"s:#FAKE-$f#:$p:" *.conf *.conf.rpmnew 2>/dev/null || :
695 sed -i -e"s:--hostname--:`hostname`:" *.conf *.conf.rpmnew 2>/dev/null || :
697 /sbin/chkconfig --add bacula-sd
698 %service bacula-sd restart "Bacula Storage daemon"
701 if [ "$1" = "0" ]; then
702 %service bacula-sd stop
703 /sbin/chkconfig --del bacula-sd
707 if [ -e %{_sysconfdir}/console.conf -a ! -e %{_sysconfdir}/bconsole.conf ]; then
708 mv %{_sysconfdir}/console.conf %{_sysconfdir}/bconsole.conf
712 echo "Updating Bacula passwords and names..."
714 for f in *-password ; do
716 sed -i -e"s:#FAKE-$f#:$p:" *.conf *.conf.rpmnew 2>/dev/null || :
718 sed -i -e"s:--hostname--:`hostname`:" *.conf *.conf.rpmnew 2>/dev/null || :
721 echo "Updating Bacula passwords and names..."
723 for f in *-password ; do
725 sed -i -e"s:#FAKE-$f#:$p:" *.conf *.conf.rpmnew 2>/dev/null || :
727 sed -i -e"s:--hostname--:`hostname`:" *.conf *.conf.rpmnew 2>/dev/null || :
730 echo "Updating Bacula passwords and names..."
732 for f in *-password ; do
734 sed -i -e"s:#FAKE-$f#:$p:" *.conf *.conf.rpmnew 2>/dev/null || :
736 sed -i -e"s:--hostname--:`hostname`:" *.conf *.conf.rpmnew 2>/dev/null || :
739 echo "Updating Bacula passwords and names..."
741 for f in *-password ; do
743 sed -i -e"s:#FAKE-$f#:$p:" *.conf *.conf.rpmnew 2>/dev/null || :
745 sed -i -e"s:--hostname--:`hostname`:" *.conf *.conf.rpmnew 2>/dev/null || :
748 echo "Updating Bacula passwords and names..."
750 for f in *-password ; do
752 sed -i -e"s:#FAKE-$f#:$p:" *.conf *.conf.rpmnew 2>/dev/null || :
754 sed -i -e"s:--hostname--:`hostname`:" *.conf *.conf.rpmnew 2>/dev/null || :
757 # link our current installed conf file to the rescue directory
758 ln -sf %{_sysconfdir}/bacula-fd.conf %{_sysconfdir}/rescue/bacula-fd.conf
761 echo "Creating rescue files for this system..."
762 cd %{_sysconfdir}/rescue
766 # remove the files created after the initial rpm installation
767 if [ "$1" = "0" ]; then
768 rm -f %{_sysconfdir}/rescue/bacula-fd.conf
769 rm -f %{_sysconfdir}/rescue/partition.*
770 rm -f %{_sysconfdir}/rescue/format.*
771 rm -f %{_sysconfdir}/rescue/mount_drives
772 rm -f %{_sysconfdir}/rescue/start_network
773 rm -f %{_sysconfdir}/rescue/sfdisk
774 rm -rf %{_sysconfdir}/rescue/diskinfo/*
778 %defattr(644,root,root,755)
781 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*-password
782 %attr(755,root,root) %{_sbindir}/bsmtp
783 %attr(755,root,root) %{_sbindir}/btraceback
784 %{_mandir}/man8/bacula.8*
785 %{_mandir}/man1/bsmtp.1*
786 %{_mandir}/man8/btraceback.8*
787 %dir %{_libexecdir}/%{name}
788 %{_libexecdir}/%{name}/btraceback.dbx
789 %{_libexecdir}/%{name}/btraceback.gdb
790 %attr(770,root,bacula) %dir %{_localstatedir}
791 %attr(750,bacula,logs) %dir /var/log/bacula
792 %attr(640,bacula,logs) %ghost /var/log/bacula/log
795 %defattr(644,root,root,755)
796 %doc ChangeLog CheckList ReleaseNotes kernstodo LICENSE
797 #%doc examples %{name}-docs-%{version}/manual/{*.pdf,bacula}
798 %attr(640,root,bacula) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bacula-dir.conf
799 %ghost %{_sysconfdir}/.pw.sed
800 %attr(640,root,root) %config(noreplace) /etc/logrotate.d/bacula-dir
801 %attr(754,root,root) /etc/rc.d/init.d/bacula-dir
802 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/bacula-dir
803 %attr(755,root,root) %{_sbindir}/bacula-dir
804 %attr(755,root,root) %{_sbindir}/bregex
805 %attr(755,root,root) %{_sbindir}/bwild
806 %attr(755,root,root) %{_sbindir}/dbcheck
807 %{_mandir}/man8/bacula-dir.8*
808 %{_mandir}/man8/dbcheck.8*
809 %{_libexecdir}/%{name}/query.sql
811 %attr(755,root,root) %{_libexecdir}/%{name}/create_sqlite3_database
812 %attr(755,root,root) %{_libexecdir}/%{name}/drop_sqlite3_database
813 %attr(755,root,root) %{_libexecdir}/%{name}/drop_sqlite3_tables
814 %attr(755,root,root) %{_libexecdir}/%{name}/grant_sqlite3_privileges
815 %attr(755,root,root) %{_libexecdir}/%{name}/make_sqlite3_tables
816 %attr(755,root,root) %{_libexecdir}/%{name}/update_sqlite3_*
819 %attr(755,root,root) %{_libexecdir}/%{name}/create_sqlite_database
820 %attr(755,root,root) %{_libexecdir}/%{name}/drop_sqlite_database
821 %attr(755,root,root) %{_libexecdir}/%{name}/drop_sqlite_tables
822 %attr(755,root,root) %{_libexecdir}/%{name}/grant_sqlite_privileges
823 %attr(755,root,root) %{_libexecdir}/%{name}/make_sqlite_tables
824 %attr(755,root,root) %{_libexecdir}/%{name}/update_sqlite_*
827 %attr(755,root,root) %{_libexecdir}/%{name}/create_mysql_database
828 %attr(755,root,root) %{_libexecdir}/%{name}/drop_mysql_database
829 %attr(755,root,root) %{_libexecdir}/%{name}/drop_mysql_tables
830 %attr(755,root,root) %{_libexecdir}/%{name}/grant_mysql_privileges
831 %attr(755,root,root) %{_libexecdir}/%{name}/make_mysql_tables
832 %attr(755,root,root) %{_libexecdir}/%{name}/update_mysql_*
835 %attr(755,root,root) %{_libexecdir}/%{name}/create_postgresql_database
836 %attr(755,root,root) %{_libexecdir}/%{name}/drop_postgresql_database
837 %attr(755,root,root) %{_libexecdir}/%{name}/drop_postgresql_tables
838 %attr(755,root,root) %{_libexecdir}/%{name}/grant_postgresql_privileges
839 %attr(755,root,root) %{_libexecdir}/%{name}/make_postgresql_tables
840 %attr(755,root,root) %{_libexecdir}/%{name}/update_postgresql_*
842 %attr(755,root,root) %{_libexecdir}/%{name}/create_bacula_database
843 %attr(755,root,root) %{_libexecdir}/%{name}/drop_bacula_database
844 %attr(755,root,root) %{_libexecdir}/%{name}/drop_bacula_tables
845 %attr(755,root,root) %{_libexecdir}/%{name}/grant_bacula_privileges
846 %attr(755,root,root) %{_libexecdir}/%{name}/make_bacula_tables
847 %attr(755,root,root) %{_libexecdir}/%{name}/update_bacula_tables
848 %attr(755,root,root) %{_libexecdir}/%{name}/make_catalog_backup
849 %attr(755,root,root) %{_libexecdir}/%{name}/delete_catalog_backup
852 %defattr(644,root,root,755)
854 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bacula-fd.conf
855 %attr(754,root,root) /etc/rc.d/init.d/bacula-fd
856 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/bacula-fd
857 %attr(755,root,root) %{_sbindir}/bacula-fd
858 %{_mandir}/man8/bacula-fd.8*
861 %defattr(644,root,root,755)
863 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bacula-sd.conf
864 %attr(754,root,root) /etc/rc.d/init.d/bacula-sd
865 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/bacula-sd
866 %attr(755,root,root) %{_sbindir}/bacula-sd
867 %attr(755,root,root) %{_sbindir}/bcopy
868 %attr(755,root,root) %{_sbindir}/bextract
869 %attr(755,root,root) %{_sbindir}/bls
870 %attr(755,root,root) %{_sbindir}/bscan
871 %attr(755,root,root) %{_sbindir}/btape
872 %attr(755,root,root) %{_libexecdir}/%{name}/mtx-changer
873 %attr(755,root,root) %{_libexecdir}/%{name}/disk-changer
874 %attr(755,root,root) %{_libexecdir}/%{name}/dvd-handler
875 %{_mandir}/man8/bacula-sd.8*
876 %{_mandir}/man8/bcopy.8*
877 %{_mandir}/man8/bextract.8*
878 %{_mandir}/man8/bls.8*
879 %{_mandir}/man8/bscan.8*
880 %{_mandir}/man8/btape.8*
883 %defattr(644,root,root,755)
885 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bconsole.conf
886 %attr(755,root,root) %{_sbindir}/bconsole
887 %{_mandir}/man8/bconsole.8*
889 %if %{with console_wx}
891 %defattr(644,root,root,755)
893 %{_pixmapsdir}/%{name}.png
894 %{_desktopdir}/bacula-wx.desktop
895 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bwx-console.conf
896 %attr(755,root,root) %{_sbindir}/bwx-console
897 %{_mandir}/man1/bacula-bwxconsole.1*
902 %defattr(644,root,root,755)
904 %{_pixmapsdir}/%{name}.png
905 %{_desktopdir}/bacula.desktop
906 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bgnome-console.conf
907 %attr(755,root,root) %{_sbindir}/bgnome-console
908 %{_mandir}/man1/bacula-bgnome-console.1*
913 %defattr(644,root,root,755)
915 %{_pixmapsdir}/%{name}.png
916 %{_desktopdir}/bat.desktop
917 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bat.conf
918 %attr(755,root,root) %{_sbindir}/bat
919 %{_mandir}/man1/bat.1*
922 %if %{with console_wx}
924 %defattr(644,root,root,755)
926 %{_pixmapsdir}/%{name}-tray-monitor.xpm
927 %{_desktopdir}/%{name}-tray-monitor.desktop
928 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/tray-monitor.conf
929 %attr(755,root,root) %{_bindir}/bacula-tray-monitor
930 %{_mandir}/man1/bacula-tray-monitor.1*
935 %defattr(644,root,root,755)
937 %dir %{_sysconfdir}/rescue
938 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/backup.etc.list
939 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/bacula-fd
940 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/format_floppy
941 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/getdiskinfo
942 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/make_rescue_disk
943 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/restore_bacula
944 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/restore_etc
945 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/run_grub
946 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/run_lilo
947 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/sfdisk.bz2