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 Patch10: 2.2.6-add.patch
70 Patch11: 2.2.6-dvdwrite_trialfix.patch
71 Patch12: 2.2.6-queued-msg.patch
72 Patch13: 2.2.6-backup-restore-socket.patch
73 Patch14: 2.2.6-mac-build.patch
74 Patch15: 2.2.6-status.patch
76 URL: http://www.bacula.org/
77 BuildRequires: acl-static
78 BuildRequires: automake
80 BuildRequires: fakeroot
82 BuildRequires: glibc-static
84 BuildRequires: libgnome-devel >= 2.0
85 BuildRequires: libgnomeui-devel >= 2.0
87 BuildRequires: libstdc++-static
88 BuildRequires: libwrap-static
90 BuildRequires: ncurses-devel
91 BuildRequires: openssl-devel
92 BuildRequires: openssl-static
93 BuildRequires: pkgconfig
95 BuildRequires: python-static
98 BuildRequires: QtCore-devel
99 BuildRequires: QtGui-devel
100 BuildRequires: qt4-build
101 BuildRequires: qt4-qmake
102 BuildRequires: qwt-devel >= 5.0.2-2
104 BuildRequires: readline-devel
105 BuildRequires: rpmbuild(macros) >= 1.268
106 BuildRequires: sed >= 4.0
107 %{?with_sqlite:BuildRequires: sqlite-devel}
108 %{?with_sqlite3:BuildRequires: sqlite3-devel}
109 %{?with_mysql:BuildRequires: mysql-devel}
110 %{?with_pgsql:BuildRequires: postgresql-devel}
111 %if %{with console_wx}
112 BuildRequires: wxGTK2-unicode-devel >= 2.4.0
114 BuildRequires: zlib-devel
115 BuildRequires: zlib-static
116 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
118 %define _sysconfdir /etc/%{name}
119 %define _localstatedir /var/lib/%{name}
121 # dependency section is broken. ccache usage is instead to makefiles
122 %undefine with_ccache
125 Bacula - It comes by night and sucks the vital essence from your
128 Bacula is a set of computer programs that permit you (or the system
129 administrator) to manage backup, recovery, and verification of
130 computer data across a network of computers of different kinds. In
131 technical terms, it is a network client/server based backup program.
132 Bacula is relatively easy to use and efficient, while offering many
133 advanced storage management features that make it easy to find and
134 recover lost or damaged files.
136 %description -l pl.UTF-8
137 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
139 Bacula to zbiór programów umożliwiających administratorowi na
140 zarządzanie kopiami zapasowymi, odzyskiwaniem i weryfikacją danych w
141 sieci komputerów różnego rodzaju. W terminologii technicznej jest to
142 program do kopii zapasowych pracujący w architekturze klient-serwer.
143 Bacula jest stosunkowo łatwa w użyciu i wydajna, oferując przy tym
144 wiele zaawansowanych możliwości przy zarządzaniu nośnikami,
145 ułatwiających znalezienie i odzyskanie utraconych lub uszkodzonych
149 Summary: Common files for bacula package
150 Summary(pl.UTF-8): Pliki wspólne dla pakietu bacula
151 Group: Networking/Utilities
152 Requires(post): openssl-tools
153 Requires(post): sed >= 4.0
154 Requires(post,preun): /sbin/chkconfig
155 Requires(postun): /usr/sbin/groupdel
156 Requires(postun): /usr/sbin/userdel
157 Requires(pre): /usr/sbin/groupadd
158 Requires(pre): /usr/sbin/useradd
159 Conflicts: bacula-console < 0:1.34.6
160 Conflicts: bacula-dir < 0:1.34.6
161 Conflicts: bacula-fd < 0:1.34.6
162 Conflicts: bacula-sd < 0:1.34.6
165 Bacula - It comes by night and sucks the vital essence from your
168 Bacula is a set of computer programs that permit you (or the system
169 administrator) to manage backup, recovery, and verification of
170 computer data across a network of computers of different kinds. In
171 technical terms, it is a network client/server based backup program.
172 Bacula is relatively easy to use and efficient, while offering many
173 advanced storage management features that make it easy to find and
174 recover lost or damaged files.
176 %description common -l pl.UTF-8
177 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
179 Bacula to zbiór programów umożliwiających administratorowi na
180 zarządzanie kopiami zapasowymi, odzyskiwaniem i weryfikacją danych w
181 sieci komputerów różnego rodzaju. W terminologii technicznej jest to
182 program do kopii zapasowych pracujący w architekturze klient-serwer.
183 Bacula jest stosunkowo łatwa w użyciu i wydajna, oferując przy tym
184 wiele zaawansowanych możliwości przy zarządzaniu nośnikami,
185 ułatwiających znalezienie i odzyskanie utraconych lub uszkodzonych
189 Summary: Bacula Director and Catalog services
190 Summary(pl.UTF-8): Usługi Bacula Director i Catalog
191 Group: Networking/Utilities
192 Requires(post): sed >= 4.0
193 Requires: %{name}-common = %{epoch}:%{version}-%{release}
194 Obsoletes: bacula-updatedb
197 Bacula - It comes by night and sucks the vital essence from your
200 Bacula Director is the program that supervises all the backup,
201 restore, verify and archive operations. The system administrator uses
202 the Bacula Director to schedule backups and to recover files. Catalog
203 services are comprised of the software programs responsible for
204 maintaining the file indexes and volume databases for all files backed
205 up. The Catalog services permit the System Administrator or user to
206 quickly locate and restore any desired file, since it maintains a
207 record of all Volumes used, all Jobs run, and all Files saved. This
208 build requires sqlite%{?with_sqlite3:3} to be installed separately as the catalog
211 %description dir -l pl.UTF-8
212 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
214 Bacula Director to program nadzorujący wszystkie operacje wykonywania
215 kopii zapasowych, odzyskiwania, weryfikacji i archiwizowania.
216 Administrator używa Bacula Directora do szeregowania kopii zapasowych
217 oraz odzyskiwania plików. Usługi katalogowe (Catalog services) są
218 używane przez programy odpowiedzialne za zarządzanie indeksami plików
219 i bazą danych wolumenów dla wszystkich kopiowanych plików. Usługi
220 katalogowe umożliwiają administratorowi lub użytkownikowi szybko
221 zlokalizować i odtworzyć dowolny plik, ponieważ utrzymują rekord ze
222 wszystkimi używanymi wolumenami, uruchomionymi zadaniami i zapisanymi
223 plikami. Pakiet wymaga %{_database} zainstalowanego oddzielnie jako bazy
227 Summary: Bacula Console
228 Summary(pl.UTF-8): Konsola Baculi
229 Group: Networking/Utilities
230 Requires(post): sed >= 4.0
231 Requires: %{name}-common = %{epoch}:%{version}-%{release}
234 Bacula - It comes by night and sucks the vital essence from your
237 Bacula Console is the program that allows the administrator or user to
238 communicate with the Bacula Director. This is the text only console
241 %description console -l pl.UTF-8
242 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
244 Bacula Console to program umożliwiający administratorowi lub
245 użytkownikowi komunikowanie się z programem Bacula Director. To jest
246 interfejs czysto tekstowy.
249 Summary: Bacula wxWidgets Console
250 Summary(pl.UTF-8): Konsola Baculi oparta na wxWidgets
251 Group: Networking/Utilities
252 Requires(post): sed >= 4.0
253 Requires: %{name}-common = %{epoch}:%{version}-%{release}
255 %description console-wx
256 Bacula - It comes by night and sucks the vital essence from your
259 Bacula Console is the program that allows the administrator or user to
260 communicate with the Bacula Director. This is the wxWidgets GUI
263 %description console-wx -l pl.UTF-8
264 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
266 Bacula Console to program umożliwiający administratorowi lub
267 użytkownikowi komunikowanie się z programem Bacula Director. To jest
268 interfejs graficzny oparty na wxWidgets.
270 %package console-gnome
271 Summary: Bacula GNOME Console
272 Summary(pl.UTF-8): Konsola Baculi oparta dla GNOME
273 Group: Networking/Utilities
274 Requires(post): sed >= 4.0
275 Requires: %{name}-common = %{epoch}:%{version}-%{release}
277 %description console-gnome
278 Bacula - It comes by night and sucks the vital essence from your
281 Bacula Console is the program that allows the administrator or user to
282 communicate with the Bacula Director. This is the GNOME GUI interface.
284 %description console-gnome -l pl.UTF-8
285 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
287 Bacula Console to program umożliwiający administratorowi lub
288 użytkownikowi komunikowanie się z programem Bacula Director. To jest
289 interfejs graficzny oparty na GNOME.
292 Summary: Bacula QT4 Console
293 Summary(pl.UTF-8): Konsola Baculi oparta na QT4
294 Group: Networking/Utilities
295 Requires(post): sed >= 4.0
296 Requires: %{name}-common = %{epoch}:%{version}-%{release}
298 %description console-qt4
299 Bacula - It comes by night and sucks the vital essence from your
302 Bacula Console is the program that allows the administrator or user to
303 communicate with the Bacula Director. This is the QT4 GUI interface.
305 %description console-qt4 -l pl.UTF-8
306 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
308 Bacula Console to program umożliwiający administratorowi lub
309 użytkownikowi komunikowanie się z programem Bacula Director. To jest
310 interfejs graficzny oparty na QT4.
312 %package tray-monitor
313 Summary: Bacula Tray Monitor
314 Group: Networking/Utilities
315 Requires(post): sed >= 4.0
316 Requires: %{name}-common = %{epoch}:%{version}-%{release}
318 %description tray-monitor
319 Bacula - It comes by night and sucks the vital essence from your
322 The Monitor program is typically an icon in the system tray. However,
323 once the icon is expanded into a full window, the administrator or
324 user can obtain status information about the Director or the backup
325 status on the local workstation or any other Bacula daemon that is
329 Summary: Bacula File services (Client)
330 Summary(pl.UTF-8): Usługi Bacula File (klient)
331 Group: Networking/Utilities
332 Requires(post): sed >= 4.0
333 Requires: %{name}-common = %{epoch}:%{version}-%{release}
336 Bacula - It comes by night and sucks the vital essence from your
339 Bacula File services (or Client program) is the software program that
340 is installed on the machine to be backed up. It is specific to the
341 operating system on which it runs and is responsible for providing the
342 file attributes and data when requested by the Director. The File
343 services are also responsible for the file system dependent part of
344 restoring the file attributes and data during a recovery operation.
345 This program runs as a daemon on the machine to be backed up, and in
346 some of the documentation, the File daemon is referred to as the
347 Client (for example in Bacula configuration file).
349 %description fd -l pl.UTF-8
350 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
352 Usługi Bacula File (inaczej program kliencki) to oprogramowanie, które
353 instaluje się na maszynach, z których mają być wykonywane kopie
354 zapasowe. Są one specyficzne dla systemu operacyjnego, pod którym
355 działa dana maszyna i odpowiadają za dostarczanie atrybutów i danych
356 plików na żądanie Directora. Usługi plikowe są także odpowiedzialne za
357 zależną od systemu plików część odzyskiwania atrybutów i danych plików
358 podczas operacji odzyskiwania danych. Program działa jako demon na
359 maszynie, która ma być backupowana i w części dokumentacji demon ten
360 (File) jest nazywany klientem (na przykład w pliku konfiguracyjnym
364 Summary: Bacula Storage services
365 Summary(pl.UTF-8): Usługi Bacula Storage
366 Group: Networking/Utilities
367 Requires(post): sed >= 4.0
368 Requires: %{name}-common = %{epoch}:%{version}-%{release}
369 Conflicts: dvd+rw-tools <= 5.21.4.10.8-1
372 Bacula - It comes by night and sucks the vital essence from your
375 Bacula Storage services consist of the software programs that perform
376 the storage and recovery of the file attributes and data to the
377 physical backup media or volumes. In other words, the Storage daemon
378 is responsible for reading and writing your tapes (or other storage
379 media, e.g. files). The Storage services runs as a daemon on the
380 machine that has the backup device (usually a tape drive).
382 %description sd -l pl.UTF-8
383 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
385 Usługi Bacula Storage składają się z programów obsługujących
386 przechowywanie danych oraz odzyskiwanie atrybutów i danych na
387 fizycznych nośnikach lub wolumenach. Innymi słowy, demon Storage jest
388 odpowiedzialny za odczyt i zapis taśm (lub innych nośników do
389 przechowywania danych, np. plików). Usługi Storage działają jako demon
390 na maszynie, która zawiera urządzenie backupowe (zwykle napęd
394 Summary: Bacula - The Network Backup Solution
395 Summary(pl.UTF-8): Bacula - rozwiązanie do wykonywania kopii zapasowych po sieci
396 Group: Networking/Utilities
397 Requires: %{name}-fd = %{epoch}:%{version}-%{release}
402 Bacula - It comes by night and sucks the vital essence from your
405 Bacula is a set of computer programs that permit you (or the system
406 administrator) to manage backup, recovery, and verification of
407 computer data across a network of computers of different kinds. In
408 technical terms, it is a network client/server based backup program.
409 Bacula is relatively easy to use and efficient, while offering many
410 advanced storage management features that make it easy to find and
411 recover lost or damaged files.
413 This package installs scripts for disaster recovery and builds rescue
414 floppy disk for bare metal recovery.
416 To make the bacula rescue disk run "./make_rescue_disk
418 - --copy-etc-files" from the %{_sysconfdir}/rescue directory. To
419 recreate the rescue information for this system run ./getdiskinfo
422 %description rescue -l pl.UTF-8
423 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
425 Bacula to zbiór programów umożliwiających administratorowi na
426 zarządzanie kopiami zapasowymi, odzyskiwaniem i weryfikacją danych w
427 sieci komputerów różnego rodzaju. W terminologii technicznej jest to
428 program do kopii zapasowych pracujący w architekturze klient-serwer.
429 Bacula jest stosunkowo łatwa w użyciu i wydajna, oferując przy tym
430 wiele zaawansowanych możliwości przy zarządzaniu nośnikami,
431 ułatwiających znalezienie i odzyskanie utraconych lub uszkodzonych
434 Ten pakiet zawiera skrypty do odtwarzania po awarii i tworzy dyskietkę
435 ratunkowe do odtwarzania systemu od zera.
437 Aby stworzyć dyskietkę ratunkową Baculi, należy uruchomić "./make_rescue_disk
438 --copy-static-bacula - --copy-etc-files" z katalogu
439 %{_sysconfdir}/rescue . Aby ponownie utworzyć informacje ratunkowe dla
440 danego systemu, należy ponownie uruchomić ./getdiskinfo .
459 tar -xf %{SOURCE2} && ln -s bacula-rescue-* rescue
461 sed -i -e 's#bindir=.*#bindir=%{_bindir}#g' \
462 src/cats/create_* src/cats/delete_* src/cats/drop_* \
463 src/cats/grant_* src/cats/make_* src/cats/update_*
464 sed -i -e 's/@hostname@/--hostname--/' src/*/*.conf.in
467 cp -f %{_datadir}/automake/config.sub autoconf
468 cd autoconf && %{__aclocal} -I bacula-macros -I gettext-macros && cd ..
469 %{__autoconf} --prepend-include=$(pwd)/autoconf autoconf/configure.in > configure
471 CPPFLAGS="-I/usr/include/ncurses -I%{_includedir}/readline"
472 WXCONFIG=%{_bindir}/wx-gtk2-unicode-config \
474 --with-scriptdir=%{_libexecdir}/%{name} \
475 --%{!?with_gnome:dis}%{?with_gnome:en}able-gnome \
476 %{?with_bat:--enable-bat} \
478 --enable-smartalloc \
479 %{?with_console_wx:--enable-bwx-console} \
480 --enable-tray-monitor \
481 %{?with_python:--with-python} \
483 --with-tcp-wrappers \
484 --with-working-dir=%{_var}/lib/%{name} \
485 --with-dump-email="root@localhost" \
486 --with-job-email="root@localhost" \
487 --with-smtp-host=localhost \
488 --with-pid-dir=/var/run \
489 --with-subsys-dir=/var/lock/subsys \
490 --enable-batch-insert \
491 --with-%{_database} \
492 %{?with_sqlite3_sync_off:--enable-extra-sqlite3-init="pragma synchronous=0;"} \
493 --with-dir-password="#FAKE-dir-password#" \
494 --with-fd-password="#FAKE-fd-password#" \
495 --with-sd-password="#FAKE-sd-password#" \
496 --with-mon-dir-password="#FAKE-mon-dir-password#" \
497 --with-mon-fd-password="#FAKE-mon-fd-password#" \
498 --with-mon-sd-password="#FAKE-mon-sd-password#" \
518 rm -rf $RPM_BUILD_ROOT
520 install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,logrotate.d,pam.d,sysconfig}
521 install -d $RPM_BUILD_ROOT%{_sysconfdir}/rescue
522 install -d $RPM_BUILD_ROOT{%{_pixmapsdir},%{_desktopdir},%{_mandir},%{_bindir},/var/log/bacula}
525 DESTDIR=$RPM_BUILD_ROOT
528 #strip -R.comment -R.note src/filed/static-bacula-fd
529 #install src/filed/static-bacula-fd $RPM_BUILD_ROOT%{_sysconfdir}/rescue/bacula-fd
531 install %{SOURCE10} $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-dir
532 install %{SOURCE11} $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-fd
533 install %{SOURCE12} $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-sd
534 install %{SOURCE13} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}-dir
535 install %{SOURCE14} $RPM_BUILD_ROOT/etc/sysconfig/bacula-dir
536 install %{SOURCE15} $RPM_BUILD_ROOT/etc/sysconfig/bacula-fd
537 install %{SOURCE16} $RPM_BUILD_ROOT/etc/sysconfig/bacula-sd
539 %if %{with console_wx}
540 # tray-monitor is for regular users
541 mv $RPM_BUILD_ROOT%{_sbindir}/bacula-tray-monitor $RPM_BUILD_ROOT%{_bindir}
543 install scripts/bacula.png $RPM_BUILD_ROOT%{_pixmapsdir}/bacula.png
544 install src/tray-monitor/generic.xpm $RPM_BUILD_ROOT%{_pixmapsdir}/bacula-tray-monitor.xpm
545 install scripts/bacula.desktop.gnome2 $RPM_BUILD_ROOT%{_desktopdir}/bacula.desktop
546 sed -e 's/gnome-console/wx-console/g;s/Console/Wx Console/g' \
547 scripts/bacula.desktop.gnome2 > $RPM_BUILD_ROOT%{_desktopdir}/bacula-wx.desktop
548 sed -e 's#%{_sbindir}#%{_bindir}#' \
549 scripts/bacula-tray-monitor.desktop > $RPM_BUILD_ROOT%{_desktopdir}/bacula-tray-monitor.desktop
553 install src/qt-console/bat $RPM_BUILD_ROOT%{_sbindir}
554 install scripts/bat.desktop $RPM_BUILD_ROOT%{_desktopdir}
558 # install the rescue stuff, these are the rescue scripts
559 install rescue/linux/floppy/backup.etc.list $RPM_BUILD_ROOT%{_sysconfdir}/rescue
560 install rescue/linux/floppy/*_* $RPM_BUILD_ROOT%{_sysconfdir}/rescue
561 install rescue/linux/floppy/getdiskinfo $RPM_BUILD_ROOT%{_sysconfdir}/rescue
562 install rescue/linux/floppy/sfdisk.bz2 $RPM_BUILD_ROOT%{_sysconfdir}/rescue
565 touch $RPM_BUILD_ROOT/var/log/bacula/log
567 # install the updatedb scripts
568 install updatedb/update_sqlite* $RPM_BUILD_ROOT%{_libexecdir}/%{name}
570 # place for site passwords
571 touch $RPM_BUILD_ROOT%{_sysconfdir}/{dir-password,fd-password,sd-password}
572 touch $RPM_BUILD_ROOT%{_sysconfdir}/{mon-dir-password,mon-fd-password,mon-sd-password}
575 rm -f $RPM_BUILD_ROOT%{_libexecdir}/%{name}/{gconsole,startmysql,stopmysql,bacula,bconsole,fd}
576 rm -f $RPM_BUILD_ROOT%{_sbindir}/static-bacula-fd
577 %if !%{with console_wx}
578 rm -f $RPM_BUILD_ROOT%{_desktopdir}/bacula-wx.desktop
580 touch $RPM_BUILD_ROOT%{_sysconfdir}/.pw.sed
583 rm -rf $RPM_BUILD_ROOT
586 %groupadd -P %{name}-common -g 136 -r -f bacula
587 %useradd -P %{name}-common -u 136 -r -d /var/lib/bacula -s /bin/false -c "Bacula User" -g bacula bacula
590 echo "Updating bacula passwords and names..."
592 for f in *-password ; do
593 if [ ! -s $f ] ; then
594 openssl rand -base64 33 > $f
597 for cf in *.conf *.conf.rpmnew ; do
598 [ -f $cf ] && sed -i -e"s:#FAKE-$f#:$p:" "$cf" || :
601 for cf in *.conf *.conf.rpmnew ; do
602 [ -f $cf ] && sed -i -e"s:--hostname--:`hostname`:" "$cf" || :
606 if [ "$1" = "0" ]; then
614 # XXX: Most of this upgrade procedure is safe for sqlite only. Other databases would require knowledge
615 # about currently used version so we can't easily support these :(
617 %if %{with sqlite} || %{with sqlite3}
618 [ -s %{_localstatedir}/bacula.db ] && \
619 DB_VER=`echo "select * from Version;" | \
620 %{_bindir}/sqlite%{?with_sqlite3:3} %{_localstatedir}/bacula.db | tail -n 1 2>/dev/null`
622 if [ -z "$DB_VER" ]; then
623 # grant privileges and create tables
624 %{_libexecdir}/%{name}/grant_bacula_privileges > dev/null
625 %{_libexecdir}/%{name}/create_bacula_database > dev/null
626 %{_libexecdir}/%{name}/make_bacula_tables > dev/null
628 echo "Backing up bacula tables"
629 echo ".dump" | sqlite%{?with_sqlite3:3} %{_localstatedir}/bacula.db | bzip2 > %{_localstatedir}/bacula_backup.sql.bz2
631 db_type="%{_database}"
633 next_ver=$(($DB_VER + 1))
634 # support up to version 30; increase this if needed
635 for ver in $(seq $next_ver 30); do
636 prev_ver=$(($ver - 1))
638 if [ -x %{_libexecdir}/%{name}/update_${type}_tables_${prev_ver}_to_${ver} ]; then
639 echo "Upgrading bacula database: db=${db_type} from ${prev_ver} to ${ver}..."
640 %{_libexecdir}/%{name}/update_${type}_tables_${prev_ver}_to_${ver}
644 %{_libexecdir}/%{name}/update_bacula_tables
645 echo "If bacula works correctly you can remove the backup file %{_localstatedir}/bacula_backup.sql.bz2"
647 chown -R bacula:bacula %{_localstatedir}
648 chmod -R u+rX,go-rwx %{_localstatedir}/*
651 echo "Updating Bacula passwords and names..."
653 for f in *-password ; do
655 sed -i -e"s:#FAKE-$f#:$p:" *.conf *.conf.rpmnew 2>/dev/null || :
657 sed -i -e"s:--hostname--:`hostname`:" *.conf *.conf.rpmnew 2>/dev/null || :
659 /sbin/chkconfig --add bacula-dir
660 %service bacula-dir restart "Bacula Director daemon"
663 if [ "$1" = "0" ]; then
664 %service bacula-dir stop
665 /sbin/chkconfig --del bacula-dir
669 echo "Updating Bacula passwords and names..."
671 for f in *-password ; do
673 sed -i -e"s:#FAKE-$f#:$p:" *.conf *.conf.rpmnew 2>/dev/null || :
675 sed -i -e"s:--hostname--:`hostname`:" *.conf *.conf.rpmnew 2>/dev/null || :
677 /sbin/chkconfig --add bacula-fd
678 %service bacula-fd restart "Bacula File daemon"
681 if [ "$1" = "0" ]; then
682 %service bacula-fd stop
683 /sbin/chkconfig --del bacula-fd
687 echo "Updating Bacula passwords and names..."
689 for f in *-password ; do
691 sed -i -e"s:#FAKE-$f#:$p:" *.conf *.conf.rpmnew 2>/dev/null || :
693 sed -i -e"s:--hostname--:`hostname`:" *.conf *.conf.rpmnew 2>/dev/null || :
695 /sbin/chkconfig --add bacula-sd
696 %service bacula-sd restart "Bacula Storage daemon"
699 if [ "$1" = "0" ]; then
700 %service bacula-sd stop
701 /sbin/chkconfig --del bacula-sd
705 if [ -e %{_sysconfdir}/console.conf -a ! -e %{_sysconfdir}/bconsole.conf ]; then
706 mv %{_sysconfdir}/console.conf %{_sysconfdir}/bconsole.conf
710 echo "Updating Bacula passwords and names..."
712 for f in *-password ; do
714 sed -i -e"s:#FAKE-$f#:$p:" *.conf *.conf.rpmnew 2>/dev/null || :
716 sed -i -e"s:--hostname--:`hostname`:" *.conf *.conf.rpmnew 2>/dev/null || :
719 echo "Updating Bacula passwords and names..."
721 for f in *-password ; do
723 sed -i -e"s:#FAKE-$f#:$p:" *.conf *.conf.rpmnew 2>/dev/null || :
725 sed -i -e"s:--hostname--:`hostname`:" *.conf *.conf.rpmnew 2>/dev/null || :
728 echo "Updating Bacula passwords and names..."
730 for f in *-password ; do
732 sed -i -e"s:#FAKE-$f#:$p:" *.conf *.conf.rpmnew 2>/dev/null || :
734 sed -i -e"s:--hostname--:`hostname`:" *.conf *.conf.rpmnew 2>/dev/null || :
737 echo "Updating Bacula passwords and names..."
739 for f in *-password ; do
741 sed -i -e"s:#FAKE-$f#:$p:" *.conf *.conf.rpmnew 2>/dev/null || :
743 sed -i -e"s:--hostname--:`hostname`:" *.conf *.conf.rpmnew 2>/dev/null || :
746 echo "Updating Bacula passwords and names..."
748 for f in *-password ; do
750 sed -i -e"s:#FAKE-$f#:$p:" *.conf *.conf.rpmnew 2>/dev/null || :
752 sed -i -e"s:--hostname--:`hostname`:" *.conf *.conf.rpmnew 2>/dev/null || :
755 # link our current installed conf file to the rescue directory
756 ln -sf %{_sysconfdir}/bacula-fd.conf %{_sysconfdir}/rescue/bacula-fd.conf
759 echo "Creating rescue files for this system..."
760 cd %{_sysconfdir}/rescue
764 # remove the files created after the initial rpm installation
765 if [ "$1" = "0" ]; then
766 rm -f %{_sysconfdir}/rescue/bacula-fd.conf
767 rm -f %{_sysconfdir}/rescue/partition.*
768 rm -f %{_sysconfdir}/rescue/format.*
769 rm -f %{_sysconfdir}/rescue/mount_drives
770 rm -f %{_sysconfdir}/rescue/start_network
771 rm -f %{_sysconfdir}/rescue/sfdisk
772 rm -rf %{_sysconfdir}/rescue/diskinfo/*
776 %defattr(644,root,root,755)
779 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*-password
780 %attr(755,root,root) %{_sbindir}/bsmtp
781 %attr(755,root,root) %{_sbindir}/btraceback
782 %{_mandir}/man8/bacula.8*
783 %{_mandir}/man1/bsmtp.1*
784 %{_mandir}/man8/btraceback.8*
785 %dir %{_libexecdir}/%{name}
786 %{_libexecdir}/%{name}/btraceback.dbx
787 %{_libexecdir}/%{name}/btraceback.gdb
788 %attr(770,root,bacula) %dir %{_localstatedir}
789 %attr(750,bacula,logs) %dir /var/log/bacula
790 %attr(640,bacula,logs) %ghost /var/log/bacula/log
793 %defattr(644,root,root,755)
794 %doc ChangeLog CheckList ReleaseNotes kernstodo LICENSE
795 #%doc examples %{name}-docs-%{version}/manual/{*.pdf,bacula}
796 %attr(640,root,bacula) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bacula-dir.conf
797 %ghost %{_sysconfdir}/.pw.sed
798 %attr(640,root,root) %config(noreplace) /etc/logrotate.d/bacula-dir
799 %attr(754,root,root) /etc/rc.d/init.d/bacula-dir
800 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/bacula-dir
801 %attr(755,root,root) %{_sbindir}/bacula-dir
802 %attr(755,root,root) %{_sbindir}/bregex
803 %attr(755,root,root) %{_sbindir}/bwild
804 %attr(755,root,root) %{_sbindir}/dbcheck
805 %{_mandir}/man8/bacula-dir.8*
806 %{_mandir}/man8/dbcheck.8*
807 %{_libexecdir}/%{name}/query.sql
809 %attr(755,root,root) %{_libexecdir}/%{name}/create_sqlite3_database
810 %attr(755,root,root) %{_libexecdir}/%{name}/drop_sqlite3_database
811 %attr(755,root,root) %{_libexecdir}/%{name}/drop_sqlite3_tables
812 %attr(755,root,root) %{_libexecdir}/%{name}/grant_sqlite3_privileges
813 %attr(755,root,root) %{_libexecdir}/%{name}/make_sqlite3_tables
814 %attr(755,root,root) %{_libexecdir}/%{name}/update_sqlite3_*
817 %attr(755,root,root) %{_libexecdir}/%{name}/create_sqlite_database
818 %attr(755,root,root) %{_libexecdir}/%{name}/drop_sqlite_database
819 %attr(755,root,root) %{_libexecdir}/%{name}/drop_sqlite_tables
820 %attr(755,root,root) %{_libexecdir}/%{name}/grant_sqlite_privileges
821 %attr(755,root,root) %{_libexecdir}/%{name}/make_sqlite_tables
822 %attr(755,root,root) %{_libexecdir}/%{name}/update_sqlite_*
825 %attr(755,root,root) %{_libexecdir}/%{name}/create_mysql_database
826 %attr(755,root,root) %{_libexecdir}/%{name}/drop_mysql_database
827 %attr(755,root,root) %{_libexecdir}/%{name}/drop_mysql_tables
828 %attr(755,root,root) %{_libexecdir}/%{name}/grant_mysql_privileges
829 %attr(755,root,root) %{_libexecdir}/%{name}/make_mysql_tables
830 %attr(755,root,root) %{_libexecdir}/%{name}/update_mysql_*
833 %attr(755,root,root) %{_libexecdir}/%{name}/create_postgresql_database
834 %attr(755,root,root) %{_libexecdir}/%{name}/drop_postgresql_database
835 %attr(755,root,root) %{_libexecdir}/%{name}/drop_postgresql_tables
836 %attr(755,root,root) %{_libexecdir}/%{name}/grant_postgresql_privileges
837 %attr(755,root,root) %{_libexecdir}/%{name}/make_postgresql_tables
838 %attr(755,root,root) %{_libexecdir}/%{name}/update_postgresql_*
840 %attr(755,root,root) %{_libexecdir}/%{name}/create_bacula_database
841 %attr(755,root,root) %{_libexecdir}/%{name}/drop_bacula_database
842 %attr(755,root,root) %{_libexecdir}/%{name}/drop_bacula_tables
843 %attr(755,root,root) %{_libexecdir}/%{name}/grant_bacula_privileges
844 %attr(755,root,root) %{_libexecdir}/%{name}/make_bacula_tables
845 %attr(755,root,root) %{_libexecdir}/%{name}/update_bacula_tables
846 %attr(755,root,root) %{_libexecdir}/%{name}/make_catalog_backup
847 %attr(755,root,root) %{_libexecdir}/%{name}/delete_catalog_backup
850 %defattr(644,root,root,755)
852 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bacula-fd.conf
853 %attr(754,root,root) /etc/rc.d/init.d/bacula-fd
854 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/bacula-fd
855 %attr(755,root,root) %{_sbindir}/bacula-fd
856 %{_mandir}/man8/bacula-fd.8*
859 %defattr(644,root,root,755)
861 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bacula-sd.conf
862 %attr(754,root,root) /etc/rc.d/init.d/bacula-sd
863 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/bacula-sd
864 %attr(755,root,root) %{_sbindir}/bacula-sd
865 %attr(755,root,root) %{_sbindir}/bcopy
866 %attr(755,root,root) %{_sbindir}/bextract
867 %attr(755,root,root) %{_sbindir}/bls
868 %attr(755,root,root) %{_sbindir}/bscan
869 %attr(755,root,root) %{_sbindir}/btape
870 %attr(755,root,root) %{_libexecdir}/%{name}/mtx-changer
871 %attr(755,root,root) %{_libexecdir}/%{name}/disk-changer
872 %attr(755,root,root) %{_libexecdir}/%{name}/dvd-handler
873 %{_mandir}/man8/bacula-sd.8*
874 %{_mandir}/man8/bcopy.8*
875 %{_mandir}/man8/bextract.8*
876 %{_mandir}/man8/bls.8*
877 %{_mandir}/man8/bscan.8*
878 %{_mandir}/man8/btape.8*
881 %defattr(644,root,root,755)
883 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bconsole.conf
884 %attr(755,root,root) %{_sbindir}/bconsole
885 %{_mandir}/man8/bconsole.8*
887 %if %{with console_wx}
889 %defattr(644,root,root,755)
891 %{_pixmapsdir}/%{name}.png
892 %{_desktopdir}/bacula-wx.desktop
893 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bwx-console.conf
894 %attr(755,root,root) %{_sbindir}/bwx-console
895 %{_mandir}/man1/bacula-bwxconsole.1*
900 %defattr(644,root,root,755)
902 %{_pixmapsdir}/%{name}.png
903 %{_desktopdir}/bacula.desktop
904 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bgnome-console.conf
905 %attr(755,root,root) %{_sbindir}/bgnome-console
906 %{_mandir}/man1/bacula-bgnome-console.1*
911 %defattr(644,root,root,755)
913 %{_pixmapsdir}/%{name}.png
914 %{_desktopdir}/bat.desktop
915 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bat.conf
916 %attr(755,root,root) %{_sbindir}/bat
917 %{_mandir}/man1/bat.1*
920 %if %{with console_wx}
922 %defattr(644,root,root,755)
924 %{_pixmapsdir}/%{name}-tray-monitor.xpm
925 %{_desktopdir}/%{name}-tray-monitor.desktop
926 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/tray-monitor.conf
927 %attr(755,root,root) %{_bindir}/bacula-tray-monitor
928 %{_mandir}/man1/bacula-tray-monitor.1*
933 %defattr(644,root,root,755)
935 %dir %{_sysconfdir}/rescue
936 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/backup.etc.list
937 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/bacula-fd
938 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/format_floppy
939 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/getdiskinfo
940 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/make_rescue_disk
941 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/restore_bacula
942 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/restore_etc
943 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/run_grub
944 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/run_lilo
945 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/sfdisk.bz2