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 bat # bat Qt4 GUI
9 %bcond_without dbi # use Database Independent Abstraction Layer (libdbi)
10 %bcond_with mysql # use MySQL
11 %bcond_with pgsql # use PostgreSQL
14 %bcond_with sqlite3 # use SQLite3 instead of SQLite 2
15 %bcond_with sqlite3_sync_off # makes SQLite3 backend much faster, but less reliable
21 %undefine with_sqlite3
24 %define database sqlite3
30 %define database postgresql
33 %undefine with_sqlite3
36 %define database mysql
39 %undefine with_sqlite3
41 %if %{without sqlite3}
42 %undefine with_sqlite3_sync_off
45 Summary: Bacula - The Network Backup Solution
46 Summary(pl.UTF-8): Bacula - rozwiązanie do wykonywania kopii zapasowych po sieci
51 License: extended GPL v2
52 Group: Networking/Utilities
53 Source0: http://downloads.sourceforge.net/bacula/%{name}-%{version}.tar.gz
54 # Source0-md5: beb9f8da196b3c9ffb0356f087dbdb99
55 Source1: http://downloads.sourceforge.net/bacula/%{name}-docs-%{version}.tar.bz2
56 # Source1-md5: ce2ef0dca50ab916fd6701b53b7bb4df
57 Source2: http://downloads.sourceforge.net/bacula/%{name}-rescue-5.0.0.tar.gz
58 # Source2-md5: 349623581cfe0bcd798dd137abac959a
59 Source10: %{name}-dir.init
60 Source11: %{name}-fd.init
61 Source12: %{name}-sd.init
62 Source13: %{name}.logrotate
63 Source14: %{name}-dir.sysconfig
64 Source15: %{name}-fd.sysconfig
65 Source16: %{name}-sd.sysconfig
66 Patch0: %{name}-mtx-changer.patch
67 Patch1: %{name}-link.patch
68 Patch2: %{name}-tinfo-readline.patch
69 Patch3: %{name}-branding.patch
70 Patch4: %{name}-conf.patch
71 Patch5: %{name}-desktop.patch
72 Patch6: %{name}-64bitbuild_fix.patch
73 Patch7: %{name}-dbi_fixes.patch
74 Patch8: %{name}-dbi_dbcheck.patch
75 URL: http://www.bacula.org/
76 BuildRequires: acl-devel
77 BuildRequires: autoconf
78 BuildRequires: automake
79 BuildRequires: gettext-devel
80 BuildRequires: libcap-devel
81 %{?with_dbi:BuildRequires: libdbi-devel >= 0.8.4}
82 BuildRequires: libtool
84 BuildRequires: fakeroot
86 BuildRequires: libwrap-devel
88 BuildRequires: ncurses-devel
89 BuildRequires: openssl-devel
90 BuildRequires: pkgconfig
92 BuildRequires: python-static
95 BuildRequires: QtCore-devel
96 BuildRequires: QtGui-devel
97 BuildRequires: qt4-build >= 4.3.3-3
98 BuildRequires: qt4-qmake >= 4.3.3-3
99 BuildRequires: qwt-devel >= 5.0.2-2
101 %{?with_mysql:BuildRequires: mysql-devel}
102 %{?with_pgsql:BuildRequires: postgresql-devel}
103 BuildRequires: readline-devel
104 BuildRequires: rpmbuild(macros) >= 1.268
105 BuildRequires: sed >= 4.0
106 %{?with_sqlite3:BuildRequires: sqlite3-devel}
107 %if %{with console_wx}
108 BuildRequires: wxGTK2-unicode-devel >= 2.4.0
110 BuildRequires: zlib-devel
111 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
113 %define _sysconfdir /etc/%{name}
114 %define _localstatedir /var/lib/%{name}
116 # dependency section is broken. ccache usage is instead to makefiles
117 %undefine with_ccache
120 Bacula - It comes by night and sucks the vital essence from your
123 Bacula is a set of computer programs that permit you (or the system
124 administrator) to manage backup, recovery, and verification of
125 computer data across a network of computers of different kinds. In
126 technical terms, it is a network client/server based backup program.
127 Bacula is relatively easy to use and efficient, while offering many
128 advanced storage management features that make it easy to find and
129 recover lost or damaged files.
131 %description -l pl.UTF-8
132 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
134 Bacula to zbiór programów umożliwiających administratorowi na
135 zarządzanie kopiami zapasowymi, odzyskiwaniem i weryfikacją danych w
136 sieci komputerów różnego rodzaju. W terminologii technicznej jest to
137 program do kopii zapasowych pracujący w architekturze klient-serwer.
138 Bacula jest stosunkowo łatwa w użyciu i wydajna, oferując przy tym
139 wiele zaawansowanych możliwości przy zarządzaniu nośnikami,
140 ułatwiających znalezienie i odzyskanie utraconych lub uszkodzonych
144 Summary: Common files for bacula package
145 Summary(pl.UTF-8): Pliki wspólne dla pakietu bacula
146 Group: Networking/Utilities
147 Requires(post): openssl-tools
148 Requires(post): sed >= 4.0
149 Requires(post,preun): /sbin/chkconfig
150 Requires(postun): /usr/sbin/groupdel
151 Requires(postun): /usr/sbin/userdel
152 Requires(pre): /usr/sbin/groupadd
153 Requires(pre): /usr/sbin/useradd
154 Conflicts: bacula-console < 0:1.34.6
155 Conflicts: bacula-dir < 0:1.34.6
156 Conflicts: bacula-fd < 0:1.34.6
157 Conflicts: bacula-sd < 0:1.34.6
160 Bacula - It comes by night and sucks the vital essence from your
163 Bacula is a set of computer programs that permit you (or the system
164 administrator) to manage backup, recovery, and verification of
165 computer data across a network of computers of different kinds. In
166 technical terms, it is a network client/server based backup program.
167 Bacula is relatively easy to use and efficient, while offering many
168 advanced storage management features that make it easy to find and
169 recover lost or damaged files.
171 %description common -l pl.UTF-8
172 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
174 Bacula to zbiór programów umożliwiających administratorowi na
175 zarządzanie kopiami zapasowymi, odzyskiwaniem i weryfikacją danych w
176 sieci komputerów różnego rodzaju. W terminologii technicznej jest to
177 program do kopii zapasowych pracujący w architekturze klient-serwer.
178 Bacula jest stosunkowo łatwa w użyciu i wydajna, oferując przy tym
179 wiele zaawansowanych możliwości przy zarządzaniu nośnikami,
180 ułatwiających znalezienie i odzyskanie utraconych lub uszkodzonych
184 Summary: Bacula Director and Catalog services
185 Summary(pl.UTF-8): Usługi Bacula Director i Catalog
186 Group: Networking/Utilities
187 Requires(post): sed >= 4.0
188 Requires: %{name}-common = %{epoch}:%{version}-%{release}
189 Obsoletes: bacula-updatedb
192 Bacula - It comes by night and sucks the vital essence from your
195 Bacula Director is the program that supervises all the backup,
196 restore, verify and archive operations. The system administrator uses
197 the Bacula Director to schedule backups and to recover files. Catalog
198 services are comprised of the software programs responsible for
199 maintaining the file indexes and volume databases for all files backed
200 up. The Catalog services permit the System Administrator or user to
201 quickly locate and restore any desired file, since it maintains a
202 record of all Volumes used, all Jobs run, and all Files saved.
204 %description dir -l pl.UTF-8
205 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
207 Bacula Director to program nadzorujący wszystkie operacje wykonywania
208 kopii zapasowych, odzyskiwania, weryfikacji i archiwizowania.
209 Administrator używa Bacula Directora do szeregowania kopii zapasowych
210 oraz odzyskiwania plików. Usługi katalogowe (Catalog services) są
211 używane przez programy odpowiedzialne za zarządzanie indeksami plików
212 i bazą danych wolumenów dla wszystkich kopiowanych plików. Usługi
213 katalogowe umożliwiają administratorowi lub użytkownikowi szybko
214 zlokalizować i odtworzyć dowolny plik, ponieważ utrzymują rekord ze
215 wszystkimi używanymi wolumenami, uruchomionymi zadaniami i zapisanymi
219 Summary: Bacula Console
220 Summary(pl.UTF-8): Konsola Baculi
221 Group: Networking/Utilities
222 Requires(post): sed >= 4.0
223 Requires: %{name}-common = %{epoch}:%{version}-%{release}
226 Bacula - It comes by night and sucks the vital essence from your
229 Bacula Console is the program that allows the administrator or user to
230 communicate with the Bacula Director. This is the text only console
233 %description console -l pl.UTF-8
234 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
236 Bacula Console to program umożliwiający administratorowi lub
237 użytkownikowi komunikowanie się z programem Bacula Director. To jest
238 interfejs czysto tekstowy.
241 Summary: Bacula wxWidgets Console
242 Summary(pl.UTF-8): Konsola Baculi oparta na wxWidgets
243 Group: Networking/Utilities
244 Requires(post): sed >= 4.0
245 Requires: %{name}-common = %{epoch}:%{version}-%{release}
247 %description console-wx
248 Bacula - It comes by night and sucks the vital essence from your
251 Bacula Console is the program that allows the administrator or user to
252 communicate with the Bacula Director. This is the wxWidgets GUI
255 %description console-wx -l pl.UTF-8
256 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
258 Bacula Console to program umożliwiający administratorowi lub
259 użytkownikowi komunikowanie się z programem Bacula Director. To jest
260 interfejs graficzny oparty na wxWidgets.
263 Summary: Bacula Qt4 Console
264 Summary(pl.UTF-8): Konsola Baculi oparta na Qt4
265 Group: Networking/Utilities
266 Requires(post): sed >= 4.0
267 Requires: %{name}-common = %{epoch}:%{version}-%{release}
269 %description console-qt4
270 Bacula - It comes by night and sucks the vital essence from your
273 Bacula Console is the program that allows the administrator or user to
274 communicate with the Bacula Director. This is the Qt4 GUI interface.
276 %description console-qt4 -l pl.UTF-8
277 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
279 Bacula Console to program umożliwiający administratorowi lub
280 użytkownikowi komunikowanie się z programem Bacula Director. To jest
281 interfejs graficzny oparty na Qt4.
283 %package tray-monitor
284 Summary: Bacula Tray Monitor
285 Group: Networking/Utilities
286 Requires(post): sed >= 4.0
287 Requires: %{name}-common = %{epoch}:%{version}-%{release}
289 %description tray-monitor
290 Bacula - It comes by night and sucks the vital essence from your
293 The Monitor program is typically an icon in the system tray. However,
294 once the icon is expanded into a full window, the administrator or
295 user can obtain status information about the Director or the backup
296 status on the local workstation or any other Bacula daemon that is
300 Summary: Bacula File services (Client)
301 Summary(pl.UTF-8): Usługi Bacula File (klient)
302 Group: Networking/Utilities
303 Requires(post): sed >= 4.0
304 Requires: %{name}-common = %{epoch}:%{version}-%{release}
307 Bacula - It comes by night and sucks the vital essence from your
310 Bacula File services (or Client program) is the software program that
311 is installed on the machine to be backed up. It is specific to the
312 operating system on which it runs and is responsible for providing the
313 file attributes and data when requested by the Director. The File
314 services are also responsible for the file system dependent part of
315 restoring the file attributes and data during a recovery operation.
316 This program runs as a daemon on the machine to be backed up, and in
317 some of the documentation, the File daemon is referred to as the
318 Client (for example in Bacula configuration file).
320 %description fd -l pl.UTF-8
321 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
323 Usługi Bacula File (inaczej program kliencki) to oprogramowanie, które
324 instaluje się na maszynach, z których mają być wykonywane kopie
325 zapasowe. Są one specyficzne dla systemu operacyjnego, pod którym
326 działa dana maszyna i odpowiadają za dostarczanie atrybutów i danych
327 plików na żądanie Directora. Usługi plikowe są także odpowiedzialne za
328 zależną od systemu plików część odzyskiwania atrybutów i danych plików
329 podczas operacji odzyskiwania danych. Program działa jako demon na
330 maszynie, która ma być backupowana i w części dokumentacji demon ten
331 (File) jest nazywany klientem (na przykład w pliku konfiguracyjnym
335 Summary: Bacula Storage services
336 Summary(pl.UTF-8): Usługi Bacula Storage
337 Group: Networking/Utilities
338 Requires(post): sed >= 4.0
339 Requires: %{name}-common = %{epoch}:%{version}-%{release}
340 Conflicts: dvd+rw-tools <= 5.21.4.10.8-1
343 Bacula - It comes by night and sucks the vital essence from your
346 Bacula Storage services consist of the software programs that perform
347 the storage and recovery of the file attributes and data to the
348 physical backup media or volumes. In other words, the Storage daemon
349 is responsible for reading and writing your tapes (or other storage
350 media, e.g. files). The Storage services runs as a daemon on the
351 machine that has the backup device (usually a tape drive).
353 %description sd -l pl.UTF-8
354 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
356 Usługi Bacula Storage składają się z programów obsługujących
357 przechowywanie danych oraz odzyskiwanie atrybutów i danych na
358 fizycznych nośnikach lub wolumenach. Innymi słowy, demon Storage jest
359 odpowiedzialny za odczyt i zapis taśm (lub innych nośników do
360 przechowywania danych, np. plików). Usługi Storage działają jako demon
361 na maszynie, która zawiera urządzenie backupowe (zwykle napęd
365 Summary: Bacula - The Network Backup Solution
366 Summary(pl.UTF-8): Bacula - rozwiązanie do wykonywania kopii zapasowych po sieci
367 Group: Networking/Utilities
368 Requires: %{name}-fd = %{epoch}:%{version}-%{release}
373 Bacula - It comes by night and sucks the vital essence from your
376 Bacula is a set of computer programs that permit you (or the system
377 administrator) to manage backup, recovery, and verification of
378 computer data across a network of computers of different kinds. In
379 technical terms, it is a network client/server based backup program.
380 Bacula is relatively easy to use and efficient, while offering many
381 advanced storage management features that make it easy to find and
382 recover lost or damaged files.
384 This package installs scripts for disaster recovery and builds rescue
385 floppy disk for bare metal recovery.
387 To make the bacula rescue disk run "./make_rescue_disk
389 - --copy-etc-files" from the %{_sysconfdir}/rescue directory. To
390 recreate the rescue information for this system run ./getdiskinfo
393 %description rescue -l pl.UTF-8
394 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
396 Bacula to zbiór programów umożliwiających administratorowi na
397 zarządzanie kopiami zapasowymi, odzyskiwaniem i weryfikacją danych w
398 sieci komputerów różnego rodzaju. W terminologii technicznej jest to
399 program do kopii zapasowych pracujący w architekturze klient-serwer.
400 Bacula jest stosunkowo łatwa w użyciu i wydajna, oferując przy tym
401 wiele zaawansowanych możliwości przy zarządzaniu nośnikami,
402 ułatwiających znalezienie i odzyskanie utraconych lub uszkodzonych
405 Ten pakiet zawiera skrypty do odtwarzania po awarii i tworzy dyskietkę
406 ratunkowe do odtwarzania systemu od zera.
408 Aby stworzyć dyskietkę ratunkową Baculi, należy uruchomić "./make_rescue_disk
409 --copy-static-bacula - --copy-etc-files" z katalogu
410 %{_sysconfdir}/rescue . Aby ponownie utworzyć informacje ratunkowe dla
411 danego systemu, należy ponownie uruchomić ./getdiskinfo .
422 %{?with_dbi:%patch7 -p1}
425 tar -xf %{SOURCE2} && ln -s bacula-rescue-* rescue
427 sed -i -e 's#bindir=.*#bindir=%{_bindir}#g' \
428 src/cats/create_* src/cats/delete_* src/cats/drop_* \
429 src/cats/grant_* src/cats/make_* src/cats/update_*
430 sed -i -e 's/@hostname@/--hostname--/' src/*/*.conf.in
433 for dbtype in bdb mysql postgresql sqlite3; do
434 sed -i -e "s,@DB_TYPE@,$dbtype,g" src/cats/*_${dbtype}_*
440 %{__aclocal} -I bacula-macros -I gettext-macros
441 # $BUILD_DIR not seen by libtoolize, export it
442 BUILD_DIR=.. %{__libtoolize}
444 %{__autoconf} --prepend-include=$(pwd)/autoconf autoconf/configure.in > configure
446 CPPFLAGS="-I/usr/include/ncurses -I%{_includedir}/readline"
447 WXCONFIG=%{_bindir}/wx-gtk2-unicode-config \
449 --with-scriptdir=%{_libexecdir}/%{name} \
450 %{?with_bat:--enable-bat} \
452 --enable-smartalloc \
453 %{?with_console_wx:--enable-bwx-console} \
454 --enable-tray-monitor \
455 %{?with_python:--with-python} \
457 --with-tcp-wrappers \
458 --with-working-dir=%{_var}/lib/%{name} \
459 --with-dump-email="root@localhost" \
460 --with-job-email="root@localhost" \
461 --with-smtp-host=localhost \
462 --with-pid-dir=/var/run \
463 --with-subsys-dir=/var/lock/subsys \
464 --enable-batch-insert \
466 %{?with_sqlite3_sync_off:--enable-extra-sqlite3-init="pragma synchronous=0;"} \
467 --with-dir-password="#FAKE-dir-password#" \
468 --with-fd-password="#FAKE-fd-password#" \
469 --with-sd-password="#FAKE-sd-password#" \
470 --with-mon-dir-password="#FAKE-mon-dir-password#" \
471 --with-mon-fd-password="#FAKE-mon-fd-password#" \
472 --with-mon-sd-password="#FAKE-mon-sd-password#" \
492 rm -rf $RPM_BUILD_ROOT
494 install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,logrotate.d,pam.d,sysconfig}
495 install -d $RPM_BUILD_ROOT%{_sysconfdir}/rescue
496 install -d $RPM_BUILD_ROOT{%{_pixmapsdir},%{_desktopdir},%{_mandir},%{_bindir},/var/log/bacula}
499 DESTDIR=$RPM_BUILD_ROOT
501 install %{SOURCE10} $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-dir
502 install %{SOURCE11} $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-fd
503 install %{SOURCE12} $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-sd
504 install %{SOURCE13} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}-dir
505 install %{SOURCE14} $RPM_BUILD_ROOT/etc/sysconfig/bacula-dir
506 install %{SOURCE15} $RPM_BUILD_ROOT/etc/sysconfig/bacula-fd
507 install %{SOURCE16} $RPM_BUILD_ROOT/etc/sysconfig/bacula-sd
509 %if %{with console_wx}
510 # tray-monitor is for regular users
511 #mv $RPM_BUILD_ROOT%{_sbindir}/bacula-tray-monitor $RPM_BUILD_ROOT%{_bindir}
513 install scripts/bacula.png $RPM_BUILD_ROOT%{_pixmapsdir}/bacula.png
514 #install src/tray-monitor/generic.xpm $RPM_BUILD_ROOT%{_pixmapsdir}/bacula-tray-monitor.xpm
515 sed -e 's/gnome-console/wx-console/g;s/Console/Wx Console/g' \
516 scripts/bacula.desktop.gnome2 > $RPM_BUILD_ROOT%{_desktopdir}/bacula-wx.desktop
517 #sed -e 's#%{_sbindir}#%{_bindir}#' \
518 # scripts/bacula-tray-monitor.desktop > $RPM_BUILD_ROOT%{_desktopdir}/bacula-tray-monitor.desktop
522 install src/qt-console/.libs/bat $RPM_BUILD_ROOT%{_sbindir}
523 install scripts/bat.desktop $RPM_BUILD_ROOT%{_desktopdir}
527 # install the rescue stuff, these are the rescue scripts
528 install rescue/linux/floppy/backup.etc.list $RPM_BUILD_ROOT%{_sysconfdir}/rescue
529 install rescue/linux/floppy/*_* $RPM_BUILD_ROOT%{_sysconfdir}/rescue
530 install rescue/linux/floppy/getdiskinfo $RPM_BUILD_ROOT%{_sysconfdir}/rescue
531 install rescue/linux/floppy/sfdisk.bz2 $RPM_BUILD_ROOT%{_sysconfdir}/rescue
534 touch $RPM_BUILD_ROOT/var/log/bacula/log
536 # install the updatedb scripts
537 install updatedb/update_sqlite* $RPM_BUILD_ROOT%{_libexecdir}/%{name}
539 # place for site passwords
540 touch $RPM_BUILD_ROOT%{_sysconfdir}/{dir-password,fd-password,sd-password}
541 touch $RPM_BUILD_ROOT%{_sysconfdir}/{mon-dir-password,mon-fd-password,mon-sd-password}
543 mv $RPM_BUILD_ROOT%{_libdir}/bacula/mtx-changer.conf $RPM_BUILD_ROOT/etc/bacula/mtx-changer.conf
546 rm -f $RPM_BUILD_ROOT%{_libexecdir}/%{name}/{gconsole,startmysql,stopmysql,bacula,bconsole,fd}
547 %if %{without console_wx}
548 rm -f $RPM_BUILD_ROOT%{_desktopdir}/bacula-wx.desktop
550 touch $RPM_BUILD_ROOT%{_sysconfdir}/.pw.sed
552 rm $RPM_BUILD_ROOT%{_docdir}/bacula/ChangeLog
553 rm $RPM_BUILD_ROOT%{_docdir}/bacula/INSTALL
554 rm $RPM_BUILD_ROOT%{_docdir}/bacula/LICENSE
555 rm $RPM_BUILD_ROOT%{_docdir}/bacula/README
556 rm $RPM_BUILD_ROOT%{_docdir}/bacula/ReleaseNotes
557 rm $RPM_BUILD_ROOT%{_docdir}/bacula/VERIFYING
558 rm $RPM_BUILD_ROOT%{_docdir}/bacula/technotes
560 # startup scripts, those in /etc/rc.d/init.d are better
561 rm $RPM_BUILD_ROOT%{_sbindir}/bacula
562 rm $RPM_BUILD_ROOT%{_libexecdir}/%{name}/bacula-ctl-*
564 # rename to avoid possible conflicts
565 mv $RPM_BUILD_ROOT%{_sbindir}/{,bacula-}dbcheck
566 mv $RPM_BUILD_ROOT%{_mandir}/man8/{,bacula-}dbcheck.8.gz
568 # no -devel files packaged, so this is also useless
569 rm $RPM_BUILD_ROOT%{_libdir}/libbac{,cfg,find,py,sql}.{so,la}
571 # sqlite is not supported
572 rm $RPM_BUILD_ROOT%{_libexecdir}/%{name}/update_sqlite_*
576 rm -rf $RPM_BUILD_ROOT
579 %groupadd -P %{name}-common -g 136 -r -f bacula
580 %useradd -P %{name}-common -u 136 -r -d /var/lib/bacula -s /bin/false -c "Bacula User" -g bacula bacula
584 echo "Updating bacula passwords and names..."
586 for f in *-password ; do
587 if [ ! -s $f ] ; then
588 openssl rand -base64 33 > $f
591 for cf in *.conf *.conf.rpmnew ; do
592 [ -f $cf ] && sed -i -e"s:#FAKE-$f#:$p:" "$cf" || :
595 for cf in *.conf *.conf.rpmnew ; do
596 [ -f $cf ] && sed -i -e"s:--hostname--:`hostname`:" "$cf" || :
601 if [ "$1" = "0" ]; then
609 # XXX: Most of this upgrade procedure is safe for sqlite only. Other databases would require knowledge
610 # about currently used version so we can't easily support these :(
613 [ -s %{_localstatedir}/bacula.db ] && \
614 DB_VER=`echo "select * from Version;" | \
615 %{_bindir}/sqlite%{?with_sqlite3:3} %{_localstatedir}/bacula.db | tail -n 1 2>/dev/null`
617 if [ -z "$DB_VER" ]; then
618 # grant privileges and create tables
619 %{_libexecdir}/%{name}/grant_bacula_privileges > dev/null
620 %{_libexecdir}/%{name}/create_bacula_database > dev/null
621 %{_libexecdir}/%{name}/make_bacula_tables > dev/null
623 echo "Backing up bacula tables"
624 echo ".dump" | sqlite%{?with_sqlite3:3} %{_localstatedir}/bacula.db | bzip2 > %{_localstatedir}/bacula_backup.sql.bz2
626 db_type="%{database}"
628 next_ver=$(($DB_VER + 1))
629 # support up to version 30; increase this if needed
630 for ver in $(seq $next_ver 30); do
631 prev_ver=$(($ver - 1))
633 if [ -x %{_libexecdir}/%{name}/update_${type}_tables_${prev_ver}_to_${ver} ]; then
634 echo "Upgrading bacula database: db=${db_type} from ${prev_ver} to ${ver}..."
635 %{_libexecdir}/%{name}/update_${type}_tables_${prev_ver}_to_${ver}
639 %{_libexecdir}/%{name}/update_bacula_tables
640 echo "If bacula works correctly you can remove the backup file %{_localstatedir}/bacula_backup.sql.bz2"
642 chown -R bacula:bacula %{_localstatedir}
643 chmod -R u+rX,go-rwx %{_localstatedir}/*
646 echo "Updating Bacula passwords and names..."
648 for f in *-password; do
650 sed -i -e"s:#FAKE-$f#:$p:" *.conf *.conf.rpmnew 2>/dev/null || :
652 sed -i -e"s:--hostname--:`hostname`:" *.conf *.conf.rpmnew 2>/dev/null || :
654 /sbin/chkconfig --add bacula-dir
655 %service bacula-dir restart "Bacula Director daemon"
658 if [ "$1" = "0" ]; then
659 %service bacula-dir stop
660 /sbin/chkconfig --del bacula-dir
664 echo "Updating Bacula passwords and names..."
666 for f in *-password; do
668 sed -i -e"s:#FAKE-$f#:$p:" *.conf *.conf.rpmnew 2>/dev/null || :
670 sed -i -e"s:--hostname--:`hostname`:" *.conf *.conf.rpmnew 2>/dev/null || :
672 /sbin/chkconfig --add bacula-fd
673 %service bacula-fd restart "Bacula File daemon"
676 if [ "$1" = "0" ]; then
677 %service bacula-fd stop
678 /sbin/chkconfig --del bacula-fd
682 echo "Updating Bacula passwords and names..."
684 for f in *-password; do
686 sed -i -e"s:#FAKE-$f#:$p:" *.conf *.conf.rpmnew 2>/dev/null || :
688 sed -i -e"s:--hostname--:`hostname`:" *.conf *.conf.rpmnew 2>/dev/null || :
690 /sbin/chkconfig --add bacula-sd
691 %service bacula-sd restart "Bacula Storage daemon"
694 if [ "$1" = "0" ]; then
695 %service bacula-sd stop
696 /sbin/chkconfig --del bacula-sd
700 if [ -e %{_sysconfdir}/console.conf -a ! -e %{_sysconfdir}/bconsole.conf ]; then
701 mv %{_sysconfdir}/console.conf %{_sysconfdir}/bconsole.conf
705 echo "Updating Bacula passwords and names..."
707 for f in *-password; do
709 sed -i -e"s:#FAKE-$f#:$p:" *.conf *.conf.rpmnew 2>/dev/null || :
711 sed -i -e"s:--hostname--:`hostname`:" *.conf *.conf.rpmnew 2>/dev/null || :
714 echo "Updating Bacula passwords and names..."
716 for f in *-password; do
718 sed -i -e"s:#FAKE-$f#:$p:" *.conf *.conf.rpmnew 2>/dev/null || :
720 sed -i -e"s:--hostname--:`hostname`:" *.conf *.conf.rpmnew 2>/dev/null || :
723 echo "Updating Bacula passwords and names..."
725 for f in *-password; do
727 sed -i -e"s:#FAKE-$f#:$p:" *.conf *.conf.rpmnew 2>/dev/null || :
729 sed -i -e"s:--hostname--:`hostname`:" *.conf *.conf.rpmnew 2>/dev/null || :
732 echo "Updating Bacula passwords and names..."
734 for f in *-password; do
736 sed -i -e"s:#FAKE-$f#:$p:" *.conf *.conf.rpmnew 2>/dev/null || :
738 sed -i -e"s:--hostname--:`hostname`:" *.conf *.conf.rpmnew 2>/dev/null || :
741 # link our current installed conf file to the rescue directory
742 ln -sf %{_sysconfdir}/bacula-fd.conf %{_sysconfdir}/rescue/bacula-fd.conf
745 echo "Creating rescue files for this system..."
746 cd %{_sysconfdir}/rescue
750 # remove the files created after the initial rpm installation
751 if [ "$1" = "0" ]; then
752 rm -f %{_sysconfdir}/rescue/bacula-fd.conf
753 rm -f %{_sysconfdir}/rescue/partition.*
754 rm -f %{_sysconfdir}/rescue/format.*
755 rm -f %{_sysconfdir}/rescue/mount_drives
756 rm -f %{_sysconfdir}/rescue/start_network
757 rm -f %{_sysconfdir}/rescue/sfdisk
758 rm -rf %{_sysconfdir}/rescue/diskinfo/*
762 %defattr(644,root,root,755)
765 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*-password
766 # do not remove bsmtp from files. Fix build if it is not installed.
767 %attr(755,root,root) %{_sbindir}/bsmtp
768 %attr(755,root,root) %{_sbindir}/btraceback
769 %attr(755,root,root) %{_libdir}/libbac-%{version}.so
770 %attr(755,root,root) %{_libdir}/libbaccfg-%{version}.so
771 %attr(755,root,root) %{_libdir}/libbacfind-%{version}.so
772 %attr(755,root,root) %{_libdir}/libbacpy-%{version}.so
773 %attr(755,root,root) %{_libdir}/libbacsql-%{version}.so
774 %{_mandir}/man8/bacula.8*
775 %{_mandir}/man1/bsmtp.1*
776 %{_mandir}/man8/btraceback.8*
777 %dir %{_libexecdir}/%{name}
778 %{_libexecdir}/%{name}/btraceback.dbx
779 %{_libexecdir}/%{name}/btraceback.gdb
780 %{_libexecdir}/%{name}/bacula_config
781 %attr(770,root,bacula) %dir %{_localstatedir}
782 %attr(750,bacula,logs) %dir /var/log/bacula
783 %attr(640,bacula,logs) %ghost /var/log/bacula/log
786 %defattr(644,root,root,755)
787 %doc ChangeLog CheckList ReleaseNotes kernstodo LICENSE
788 #%doc examples %{name}-docs-%{version}/manual/{*.pdf,bacula}
789 %attr(640,root,bacula) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bacula-dir.conf
790 %ghost %{_sysconfdir}/.pw.sed
791 %attr(640,root,root) %config(noreplace) /etc/logrotate.d/bacula-dir
792 %attr(754,root,root) /etc/rc.d/init.d/bacula-dir
793 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/bacula-dir
794 %attr(755,root,root) %{_sbindir}/bacula-dir
795 %attr(755,root,root) %{_sbindir}/bregex
796 %attr(755,root,root) %{_sbindir}/bwild
797 %attr(755,root,root) %{_sbindir}/bacula-dbcheck
798 %{_mandir}/man8/bacula-dir.8*
799 %{_mandir}/man8/bacula-dbcheck.8*
800 %{_libexecdir}/%{name}/query.sql
801 %if %{with bdb} || %{with dbi}
802 %attr(755,root,root) %{_libexecdir}/%{name}/create_bdb_database
803 %attr(755,root,root) %{_libexecdir}/%{name}/drop_bdb_database
804 %attr(755,root,root) %{_libexecdir}/%{name}/drop_bdb_tables
805 %attr(755,root,root) %{_libexecdir}/%{name}/grant_bdb_privileges
806 %attr(755,root,root) %{_libexecdir}/%{name}/make_bdb_tables
807 %attr(755,root,root) %{_libexecdir}/%{name}/update_bdb_*
809 %if %{with sqlite3} || %{with dbi}
810 %attr(755,root,root) %{_libexecdir}/%{name}/create_sqlite3_database
811 %attr(755,root,root) %{_libexecdir}/%{name}/drop_sqlite3_database
812 %attr(755,root,root) %{_libexecdir}/%{name}/drop_sqlite3_tables
813 %attr(755,root,root) %{_libexecdir}/%{name}/grant_sqlite3_privileges
814 %attr(755,root,root) %{_libexecdir}/%{name}/make_sqlite3_tables
815 %attr(755,root,root) %{_libexecdir}/%{name}/update_sqlite3_*
817 %if %{with mysql} || %{with dbi}
818 %attr(755,root,root) %{_libexecdir}/%{name}/create_mysql_database
819 %attr(755,root,root) %{_libexecdir}/%{name}/drop_mysql_database
820 %attr(755,root,root) %{_libexecdir}/%{name}/drop_mysql_tables
821 %attr(755,root,root) %{_libexecdir}/%{name}/grant_mysql_privileges
822 %attr(755,root,root) %{_libexecdir}/%{name}/make_mysql_tables
823 %attr(755,root,root) %{_libexecdir}/%{name}/update_mysql_*
825 %if %{with pgsql} || %{with dbi}
826 %attr(755,root,root) %{_libexecdir}/%{name}/create_postgresql_database
827 %attr(755,root,root) %{_libexecdir}/%{name}/drop_postgresql_database
828 %attr(755,root,root) %{_libexecdir}/%{name}/drop_postgresql_tables
829 %attr(755,root,root) %{_libexecdir}/%{name}/grant_postgresql_privileges
830 %attr(755,root,root) %{_libexecdir}/%{name}/make_postgresql_tables
831 %attr(755,root,root) %{_libexecdir}/%{name}/update_postgresql_*
834 %attr(755,root,root) %{_libexecdir}/%{name}/create_bacula_database
835 %attr(755,root,root) %{_libexecdir}/%{name}/drop_bacula_database
836 %attr(755,root,root) %{_libexecdir}/%{name}/drop_bacula_tables
837 %attr(755,root,root) %{_libexecdir}/%{name}/grant_bacula_privileges
838 %attr(755,root,root) %{_libexecdir}/%{name}/make_bacula_tables
839 %attr(755,root,root) %{_libexecdir}/%{name}/update_bacula_tables
841 #%attr(755,root,root) %{_libexecdir}/%{name}/make_catalog_backup
842 #%attr(755,root,root) %{_libexecdir}/%{name}/delete_catalog_backup
845 %defattr(644,root,root,755)
847 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bacula-fd.conf
848 %attr(754,root,root) /etc/rc.d/init.d/bacula-fd
849 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/bacula-fd
850 %attr(755,root,root) %{_sbindir}/bacula-fd
851 %attr(755,root,root) %{_libdir}/bpipe-fd.so
852 %{_mandir}/man8/bacula-fd.8*
855 %defattr(644,root,root,755)
857 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bacula-sd.conf
858 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mtx-changer.conf
859 %attr(754,root,root) /etc/rc.d/init.d/bacula-sd
860 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/bacula-sd
861 %attr(755,root,root) %{_sbindir}/bacula-sd
862 %attr(755,root,root) %{_sbindir}/bcopy
863 %attr(755,root,root) %{_sbindir}/bextract
864 %attr(755,root,root) %{_sbindir}/bls
865 %attr(755,root,root) %{_sbindir}/bscan
866 %attr(755,root,root) %{_sbindir}/btape
867 %attr(755,root,root) %{_libexecdir}/%{name}/mtx-changer
868 %attr(755,root,root) %{_libexecdir}/%{name}/disk-changer
869 %attr(755,root,root) %{_libexecdir}/%{name}/dvd-handler
870 %{_mandir}/man8/bacula-sd.8*
871 %{_mandir}/man8/bcopy.8*
872 %{_mandir}/man8/bextract.8*
873 %{_mandir}/man8/bls.8*
874 %{_mandir}/man8/bscan.8*
875 %{_mandir}/man8/btape.8*
878 %defattr(644,root,root,755)
880 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bconsole.conf
881 %attr(755,root,root) %{_sbindir}/bconsole
882 %{_mandir}/man8/bconsole.8*
884 %if %{with console_wx}
886 %defattr(644,root,root,755)
888 %{_pixmapsdir}/%{name}.png
889 %{_desktopdir}/bacula-wx.desktop
890 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bwx-console.conf
891 %attr(755,root,root) %{_sbindir}/bwx-console
892 %{_mandir}/man1/bacula-bwxconsole.1*
897 %defattr(644,root,root,755)
899 %{_pixmapsdir}/%{name}.png
900 %{_desktopdir}/bat.desktop
901 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bat.conf
902 %attr(755,root,root) %{_sbindir}/bat
903 %{_mandir}/man1/bat.1*
907 %if %{with console_wx}
909 %defattr(644,root,root,755)
911 %attr(755,root,root) %{_sbindir}/bacula-tray-monitor
912 #%{_pixmapsdir}/%{name}-tray-monitor.xpm
913 #%{_desktopdir}/%{name}-tray-monitor.desktop
914 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/tray-monitor.conf
915 %{_mandir}/man1/bacula-tray-monitor.1*
920 %defattr(644,root,root,755)
922 %dir %{_sysconfdir}/rescue
923 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/backup.etc.list
924 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/bacula-fd
925 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/format_floppy
926 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/getdiskinfo
927 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/make_rescue_disk
928 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/restore_bacula
929 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/restore_etc
930 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/run_grub
931 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/run_lilo
932 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/sfdisk.bz2