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: 077cb80b51cc13584b0960d863932af2
52 Source1: http://dl.sourceforge.net/bacula/%{name}-docs-%{version}.tar.bz2
53 # Source1-md5: 227601c7e970f028b180fbee7b41fec2
54 Source2: http://dl.sourceforge.net/bacula/%{name}-rescue-%{version}.tar.gz
55 # Source2-md5: 3a653938be31b307681060255f2a3991
56 Source10: %{name}-dir.init
57 Source11: %{name}-fd.init
58 Source12: %{name}-sd.init
59 Source13: %{name}.logrotate
60 Source14: %{name}-dir.sysconfig
61 Source15: %{name}-fd.sysconfig
62 Source16: %{name}-sd.sysconfig
63 Patch0: %{name}-dvd-handler_path.patch
64 Patch1: %{name}-link.patch
65 Patch2: %{name}-mysql.patch
66 Patch3: %{name}-tinfo-readline.patch
67 Patch4: %{name}-branding.patch
68 Patch5: %{name}-conf.patch
69 Patch6: %{name}-nostatic.patch
70 Patch7: %{name}-mount.patch
71 Patch8: %{name}-mysql-timeout.patch
72 Patch9: %{name}-sd-crash.patch
73 URL: http://www.bacula.org/
74 BuildRequires: acl-static
75 BuildRequires: automake
77 BuildRequires: fakeroot
79 BuildRequires: glibc-static
81 BuildRequires: libgnome-devel >= 2.0
82 BuildRequires: libgnomeui-devel >= 2.0
84 BuildRequires: libstdc++-static
85 BuildRequires: libwrap-static
87 BuildRequires: ncurses-devel
88 BuildRequires: openssl-devel
89 BuildRequires: openssl-static
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_sqlite:BuildRequires: sqlite-devel}
107 %{?with_sqlite3:BuildRequires: sqlite3-devel}
108 %if %{with console_wx}
109 BuildRequires: wxGTK2-unicode-devel >= 2.4.0
111 BuildRequires: zlib-devel
112 BuildRequires: zlib-static
113 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
115 %define _sysconfdir /etc/%{name}
116 %define _localstatedir /var/lib/%{name}
118 # dependency section is broken. ccache usage is instead to makefiles
119 %undefine with_ccache
122 Bacula - It comes by night and sucks the vital essence from your
125 Bacula is a set of computer programs that permit you (or the system
126 administrator) to manage backup, recovery, and verification of
127 computer data across a network of computers of different kinds. In
128 technical terms, it is a network client/server based backup program.
129 Bacula is relatively easy to use and efficient, while offering many
130 advanced storage management features that make it easy to find and
131 recover lost or damaged files.
133 %description -l pl.UTF-8
134 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
136 Bacula to zbiór programów umożliwiających administratorowi na
137 zarządzanie kopiami zapasowymi, odzyskiwaniem i weryfikacją danych w
138 sieci komputerów różnego rodzaju. W terminologii technicznej jest to
139 program do kopii zapasowych pracujący w architekturze klient-serwer.
140 Bacula jest stosunkowo łatwa w użyciu i wydajna, oferując przy tym
141 wiele zaawansowanych możliwości przy zarządzaniu nośnikami,
142 ułatwiających znalezienie i odzyskanie utraconych lub uszkodzonych
146 Summary: Common files for bacula package
147 Summary(pl.UTF-8): Pliki wspólne dla pakietu bacula
148 Group: Networking/Utilities
149 Requires(post): openssl-tools
150 Requires(post): sed >= 4.0
151 Requires(post,preun): /sbin/chkconfig
152 Requires(postun): /usr/sbin/groupdel
153 Requires(postun): /usr/sbin/userdel
154 Requires(pre): /usr/sbin/groupadd
155 Requires(pre): /usr/sbin/useradd
156 Conflicts: bacula-console < 0:1.34.6
157 Conflicts: bacula-dir < 0:1.34.6
158 Conflicts: bacula-fd < 0:1.34.6
159 Conflicts: bacula-sd < 0:1.34.6
162 Bacula - It comes by night and sucks the vital essence from your
165 Bacula is a set of computer programs that permit you (or the system
166 administrator) to manage backup, recovery, and verification of
167 computer data across a network of computers of different kinds. In
168 technical terms, it is a network client/server based backup program.
169 Bacula is relatively easy to use and efficient, while offering many
170 advanced storage management features that make it easy to find and
171 recover lost or damaged files.
173 %description common -l pl.UTF-8
174 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
176 Bacula to zbiór programów umożliwiających administratorowi na
177 zarządzanie kopiami zapasowymi, odzyskiwaniem i weryfikacją danych w
178 sieci komputerów różnego rodzaju. W terminologii technicznej jest to
179 program do kopii zapasowych pracujący w architekturze klient-serwer.
180 Bacula jest stosunkowo łatwa w użyciu i wydajna, oferując przy tym
181 wiele zaawansowanych możliwości przy zarządzaniu nośnikami,
182 ułatwiających znalezienie i odzyskanie utraconych lub uszkodzonych
186 Summary: Bacula Director and Catalog services
187 Summary(pl.UTF-8): Usługi Bacula Director i Catalog
188 Group: Networking/Utilities
189 Requires(post): sed >= 4.0
190 Requires: %{name}-common = %{epoch}:%{version}-%{release}
191 Obsoletes: bacula-updatedb
194 Bacula - It comes by night and sucks the vital essence from your
197 Bacula Director is the program that supervises all the backup,
198 restore, verify and archive operations. The system administrator uses
199 the Bacula Director to schedule backups and to recover files. Catalog
200 services are comprised of the software programs responsible for
201 maintaining the file indexes and volume databases for all files backed
202 up. The Catalog services permit the System Administrator or user to
203 quickly locate and restore any desired file, since it maintains a
204 record of all Volumes used, all Jobs run, and all Files saved. This
205 build requires %{database} to be installed separately as the catalog
208 %description dir -l pl.UTF-8
209 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
211 Bacula Director to program nadzorujący wszystkie operacje wykonywania
212 kopii zapasowych, odzyskiwania, weryfikacji i archiwizowania.
213 Administrator używa Bacula Directora do szeregowania kopii zapasowych
214 oraz odzyskiwania plików. Usługi katalogowe (Catalog services) są
215 używane przez programy odpowiedzialne za zarządzanie indeksami plików
216 i bazą danych wolumenów dla wszystkich kopiowanych plików. Usługi
217 katalogowe umożliwiają administratorowi lub użytkownikowi szybko
218 zlokalizować i odtworzyć dowolny plik, ponieważ utrzymują rekord ze
219 wszystkimi używanymi wolumenami, uruchomionymi zadaniami i zapisanymi
220 plikami. Pakiet wymaga %{database} zainstalowanego oddzielnie jako
221 bazy danych dla katalogu.
224 Summary: Bacula Console
225 Summary(pl.UTF-8): Konsola Baculi
226 Group: Networking/Utilities
227 Requires(post): sed >= 4.0
228 Requires: %{name}-common = %{epoch}:%{version}-%{release}
231 Bacula - It comes by night and sucks the vital essence from your
234 Bacula Console is the program that allows the administrator or user to
235 communicate with the Bacula Director. This is the text only console
238 %description console -l pl.UTF-8
239 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
241 Bacula Console to program umożliwiający administratorowi lub
242 użytkownikowi komunikowanie się z programem Bacula Director. To jest
243 interfejs czysto tekstowy.
246 Summary: Bacula wxWidgets Console
247 Summary(pl.UTF-8): Konsola Baculi oparta na wxWidgets
248 Group: Networking/Utilities
249 Requires(post): sed >= 4.0
250 Requires: %{name}-common = %{epoch}:%{version}-%{release}
252 %description console-wx
253 Bacula - It comes by night and sucks the vital essence from your
256 Bacula Console is the program that allows the administrator or user to
257 communicate with the Bacula Director. This is the wxWidgets GUI
260 %description console-wx -l pl.UTF-8
261 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
263 Bacula Console to program umożliwiający administratorowi lub
264 użytkownikowi komunikowanie się z programem Bacula Director. To jest
265 interfejs graficzny oparty na wxWidgets.
267 %package console-gnome
268 Summary: Bacula GNOME Console
269 Summary(pl.UTF-8): Konsola Baculi oparta dla GNOME
270 Group: Networking/Utilities
271 Requires(post): sed >= 4.0
272 Requires: %{name}-common = %{epoch}:%{version}-%{release}
274 %description console-gnome
275 Bacula - It comes by night and sucks the vital essence from your
278 Bacula Console is the program that allows the administrator or user to
279 communicate with the Bacula Director. This is the GNOME GUI interface.
281 %description console-gnome -l pl.UTF-8
282 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
284 Bacula Console to program umożliwiający administratorowi lub
285 użytkownikowi komunikowanie się z programem Bacula Director. To jest
286 interfejs graficzny oparty na GNOME.
289 Summary: Bacula Qt4 Console
290 Summary(pl.UTF-8): Konsola Baculi oparta na Qt4
291 Group: Networking/Utilities
292 Requires(post): sed >= 4.0
293 Requires: %{name}-common = %{epoch}:%{version}-%{release}
295 %description console-qt4
296 Bacula - It comes by night and sucks the vital essence from your
299 Bacula Console is the program that allows the administrator or user to
300 communicate with the Bacula Director. This is the Qt4 GUI interface.
302 %description console-qt4 -l pl.UTF-8
303 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
305 Bacula Console to program umożliwiający administratorowi lub
306 użytkownikowi komunikowanie się z programem Bacula Director. To jest
307 interfejs graficzny oparty na Qt4.
309 %package tray-monitor
310 Summary: Bacula Tray Monitor
311 Group: Networking/Utilities
312 Requires(post): sed >= 4.0
313 Requires: %{name}-common = %{epoch}:%{version}-%{release}
315 %description tray-monitor
316 Bacula - It comes by night and sucks the vital essence from your
319 The Monitor program is typically an icon in the system tray. However,
320 once the icon is expanded into a full window, the administrator or
321 user can obtain status information about the Director or the backup
322 status on the local workstation or any other Bacula daemon that is
326 Summary: Bacula File services (Client)
327 Summary(pl.UTF-8): Usługi Bacula File (klient)
328 Group: Networking/Utilities
329 Requires(post): sed >= 4.0
330 Requires: %{name}-common = %{epoch}:%{version}-%{release}
333 Bacula - It comes by night and sucks the vital essence from your
336 Bacula File services (or Client program) is the software program that
337 is installed on the machine to be backed up. It is specific to the
338 operating system on which it runs and is responsible for providing the
339 file attributes and data when requested by the Director. The File
340 services are also responsible for the file system dependent part of
341 restoring the file attributes and data during a recovery operation.
342 This program runs as a daemon on the machine to be backed up, and in
343 some of the documentation, the File daemon is referred to as the
344 Client (for example in Bacula configuration file).
346 %description fd -l pl.UTF-8
347 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
349 Usługi Bacula File (inaczej program kliencki) to oprogramowanie, które
350 instaluje się na maszynach, z których mają być wykonywane kopie
351 zapasowe. Są one specyficzne dla systemu operacyjnego, pod którym
352 działa dana maszyna i odpowiadają za dostarczanie atrybutów i danych
353 plików na żądanie Directora. Usługi plikowe są także odpowiedzialne za
354 zależną od systemu plików część odzyskiwania atrybutów i danych plików
355 podczas operacji odzyskiwania danych. Program działa jako demon na
356 maszynie, która ma być backupowana i w części dokumentacji demon ten
357 (File) jest nazywany klientem (na przykład w pliku konfiguracyjnym
361 Summary: Bacula Storage services
362 Summary(pl.UTF-8): Usługi Bacula Storage
363 Group: Networking/Utilities
364 Requires(post): sed >= 4.0
365 Requires: %{name}-common = %{epoch}:%{version}-%{release}
366 Conflicts: dvd+rw-tools <= 5.21.4.10.8-1
369 Bacula - It comes by night and sucks the vital essence from your
372 Bacula Storage services consist of the software programs that perform
373 the storage and recovery of the file attributes and data to the
374 physical backup media or volumes. In other words, the Storage daemon
375 is responsible for reading and writing your tapes (or other storage
376 media, e.g. files). The Storage services runs as a daemon on the
377 machine that has the backup device (usually a tape drive).
379 %description sd -l pl.UTF-8
380 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
382 Usługi Bacula Storage składają się z programów obsługujących
383 przechowywanie danych oraz odzyskiwanie atrybutów i danych na
384 fizycznych nośnikach lub wolumenach. Innymi słowy, demon Storage jest
385 odpowiedzialny za odczyt i zapis taśm (lub innych nośników do
386 przechowywania danych, np. plików). Usługi Storage działają jako demon
387 na maszynie, która zawiera urządzenie backupowe (zwykle napęd
391 Summary: Bacula - The Network Backup Solution
392 Summary(pl.UTF-8): Bacula - rozwiązanie do wykonywania kopii zapasowych po sieci
393 Group: Networking/Utilities
394 Requires: %{name}-fd = %{epoch}:%{version}-%{release}
399 Bacula - It comes by night and sucks the vital essence from your
402 Bacula is a set of computer programs that permit you (or the system
403 administrator) to manage backup, recovery, and verification of
404 computer data across a network of computers of different kinds. In
405 technical terms, it is a network client/server based backup program.
406 Bacula is relatively easy to use and efficient, while offering many
407 advanced storage management features that make it easy to find and
408 recover lost or damaged files.
410 This package installs scripts for disaster recovery and builds rescue
411 floppy disk for bare metal recovery.
413 To make the bacula rescue disk run "./make_rescue_disk
415 - --copy-etc-files" from the %{_sysconfdir}/rescue directory. To
416 recreate the rescue information for this system run ./getdiskinfo
419 %description rescue -l pl.UTF-8
420 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
422 Bacula to zbiór programów umożliwiających administratorowi na
423 zarządzanie kopiami zapasowymi, odzyskiwaniem i weryfikacją danych w
424 sieci komputerów różnego rodzaju. W terminologii technicznej jest to
425 program do kopii zapasowych pracujący w architekturze klient-serwer.
426 Bacula jest stosunkowo łatwa w użyciu i wydajna, oferując przy tym
427 wiele zaawansowanych możliwości przy zarządzaniu nośnikami,
428 ułatwiających znalezienie i odzyskanie utraconych lub uszkodzonych
431 Ten pakiet zawiera skrypty do odtwarzania po awarii i tworzy dyskietkę
432 ratunkowe do odtwarzania systemu od zera.
434 Aby stworzyć dyskietkę ratunkową Baculi, należy uruchomić "./make_rescue_disk
435 --copy-static-bacula - --copy-etc-files" z katalogu
436 %{_sysconfdir}/rescue . Aby ponownie utworzyć informacje ratunkowe dla
437 danego systemu, należy ponownie uruchomić ./getdiskinfo .
453 tar -xf %{SOURCE2} && ln -s bacula-rescue-* rescue
455 sed -i -e 's#bindir=.*#bindir=%{_bindir}#g' \
456 src/cats/create_* src/cats/delete_* src/cats/drop_* \
457 src/cats/grant_* src/cats/make_* src/cats/update_*
458 sed -i -e 's/@hostname@/--hostname--/' src/*/*.conf.in
461 cp -f %{_datadir}/automake/config.sub autoconf
462 cd autoconf && %{__aclocal} -I bacula-macros -I gettext-macros && cd ..
463 %{__autoconf} --prepend-include=$(pwd)/autoconf autoconf/configure.in > configure
465 CPPFLAGS="-I/usr/include/ncurses -I%{_includedir}/readline"
466 WXCONFIG=%{_bindir}/wx-gtk2-unicode-config \
468 --with-scriptdir=%{_libexecdir}/%{name} \
469 --%{!?with_gnome:dis}%{?with_gnome:en}able-gnome \
470 %{?with_bat:--enable-bat} \
472 --enable-smartalloc \
473 %{?with_console_wx:--enable-bwx-console} \
474 --enable-tray-monitor \
475 %{?with_python:--with-python} \
477 --with-tcp-wrappers \
478 --with-working-dir=%{_var}/lib/%{name} \
479 --with-dump-email="root@localhost" \
480 --with-job-email="root@localhost" \
481 --with-smtp-host=localhost \
482 --with-pid-dir=/var/run \
483 --with-subsys-dir=/var/lock/subsys \
484 --enable-batch-insert \
486 %{?with_sqlite3_sync_off:--enable-extra-sqlite3-init="pragma synchronous=0;"} \
487 --with-dir-password="#FAKE-dir-password#" \
488 --with-fd-password="#FAKE-fd-password#" \
489 --with-sd-password="#FAKE-sd-password#" \
490 --with-mon-dir-password="#FAKE-mon-dir-password#" \
491 --with-mon-fd-password="#FAKE-mon-fd-password#" \
492 --with-mon-sd-password="#FAKE-mon-sd-password#" \
512 rm -rf $RPM_BUILD_ROOT
514 install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,logrotate.d,pam.d,sysconfig}
515 install -d $RPM_BUILD_ROOT%{_sysconfdir}/rescue
516 install -d $RPM_BUILD_ROOT{%{_pixmapsdir},%{_desktopdir},%{_mandir},%{_bindir},/var/log/bacula}
519 DESTDIR=$RPM_BUILD_ROOT
522 #strip -R.comment -R.note src/filed/static-bacula-fd
523 #install src/filed/static-bacula-fd $RPM_BUILD_ROOT%{_sysconfdir}/rescue/bacula-fd
525 install %{SOURCE10} $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-dir
526 install %{SOURCE11} $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-fd
527 install %{SOURCE12} $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-sd
528 install %{SOURCE13} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}-dir
529 install %{SOURCE14} $RPM_BUILD_ROOT/etc/sysconfig/bacula-dir
530 install %{SOURCE15} $RPM_BUILD_ROOT/etc/sysconfig/bacula-fd
531 install %{SOURCE16} $RPM_BUILD_ROOT/etc/sysconfig/bacula-sd
533 %if %{with console_wx}
534 # tray-monitor is for regular users
535 mv $RPM_BUILD_ROOT%{_sbindir}/bacula-tray-monitor $RPM_BUILD_ROOT%{_bindir}
537 install scripts/bacula.png $RPM_BUILD_ROOT%{_pixmapsdir}/bacula.png
538 install src/tray-monitor/generic.xpm $RPM_BUILD_ROOT%{_pixmapsdir}/bacula-tray-monitor.xpm
539 install scripts/bacula.desktop.gnome2 $RPM_BUILD_ROOT%{_desktopdir}/bacula.desktop
540 sed -e 's/gnome-console/wx-console/g;s/Console/Wx Console/g' \
541 scripts/bacula.desktop.gnome2 > $RPM_BUILD_ROOT%{_desktopdir}/bacula-wx.desktop
542 sed -e 's#%{_sbindir}#%{_bindir}#' \
543 scripts/bacula-tray-monitor.desktop > $RPM_BUILD_ROOT%{_desktopdir}/bacula-tray-monitor.desktop
547 install src/qt-console/bat $RPM_BUILD_ROOT%{_sbindir}
548 install scripts/bat.desktop $RPM_BUILD_ROOT%{_desktopdir}
552 # install the rescue stuff, these are the rescue scripts
553 install rescue/linux/floppy/backup.etc.list $RPM_BUILD_ROOT%{_sysconfdir}/rescue
554 install rescue/linux/floppy/*_* $RPM_BUILD_ROOT%{_sysconfdir}/rescue
555 install rescue/linux/floppy/getdiskinfo $RPM_BUILD_ROOT%{_sysconfdir}/rescue
556 install rescue/linux/floppy/sfdisk.bz2 $RPM_BUILD_ROOT%{_sysconfdir}/rescue
559 touch $RPM_BUILD_ROOT/var/log/bacula/log
561 # install the updatedb scripts
562 install updatedb/update_sqlite* $RPM_BUILD_ROOT%{_libexecdir}/%{name}
564 # place for site passwords
565 touch $RPM_BUILD_ROOT%{_sysconfdir}/{dir-password,fd-password,sd-password}
566 touch $RPM_BUILD_ROOT%{_sysconfdir}/{mon-dir-password,mon-fd-password,mon-sd-password}
569 rm -f $RPM_BUILD_ROOT%{_libexecdir}/%{name}/{gconsole,startmysql,stopmysql,bacula,bconsole,fd}
570 rm -f $RPM_BUILD_ROOT%{_sbindir}/static-bacula-fd
571 %if !%{with console_wx}
572 rm -f $RPM_BUILD_ROOT%{_desktopdir}/bacula-wx.desktop
574 touch $RPM_BUILD_ROOT%{_sysconfdir}/.pw.sed
577 rm -rf $RPM_BUILD_ROOT
580 %groupadd -P %{name}-common -g 136 -r -f bacula
581 %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" || :
600 if [ "$1" = "0" ]; then
608 # XXX: Most of this upgrade procedure is safe for sqlite only. Other databases would require knowledge
609 # about currently used version so we can't easily support these :(
611 %if %{with sqlite} || %{with sqlite3}
612 [ -s %{_localstatedir}/bacula.db ] && \
613 DB_VER=`echo "select * from Version;" | \
614 %{_bindir}/sqlite%{?with_sqlite3:3} %{_localstatedir}/bacula.db | tail -n 1 2>/dev/null`
616 if [ -z "$DB_VER" ]; then
617 # grant privileges and create tables
618 %{_libexecdir}/%{name}/grant_bacula_privileges > dev/null
619 %{_libexecdir}/%{name}/create_bacula_database > dev/null
620 %{_libexecdir}/%{name}/make_bacula_tables > dev/null
622 echo "Backing up bacula tables"
623 echo ".dump" | sqlite%{?with_sqlite3:3} %{_localstatedir}/bacula.db | bzip2 > %{_localstatedir}/bacula_backup.sql.bz2
625 db_type="%{database}"
627 next_ver=$(($DB_VER + 1))
628 # support up to version 30; increase this if needed
629 for ver in $(seq $next_ver 30); do
630 prev_ver=$(($ver - 1))
632 if [ -x %{_libexecdir}/%{name}/update_${type}_tables_${prev_ver}_to_${ver} ]; then
633 echo "Upgrading bacula database: db=${db_type} from ${prev_ver} to ${ver}..."
634 %{_libexecdir}/%{name}/update_${type}_tables_${prev_ver}_to_${ver}
638 %{_libexecdir}/%{name}/update_bacula_tables
639 echo "If bacula works correctly you can remove the backup file %{_localstatedir}/bacula_backup.sql.bz2"
641 chown -R bacula:bacula %{_localstatedir}
642 chmod -R u+rX,go-rwx %{_localstatedir}/*
645 echo "Updating Bacula passwords and names..."
647 for f in *-password ; do
649 sed -i -e"s:#FAKE-$f#:$p:" *.conf *.conf.rpmnew 2>/dev/null || :
651 sed -i -e"s:--hostname--:`hostname`:" *.conf *.conf.rpmnew 2>/dev/null || :
653 /sbin/chkconfig --add bacula-dir
654 %service bacula-dir restart "Bacula Director daemon"
657 if [ "$1" = "0" ]; then
658 %service bacula-dir stop
659 /sbin/chkconfig --del bacula-dir
663 echo "Updating Bacula passwords and names..."
665 for f in *-password ; do
667 sed -i -e"s:#FAKE-$f#:$p:" *.conf *.conf.rpmnew 2>/dev/null || :
669 sed -i -e"s:--hostname--:`hostname`:" *.conf *.conf.rpmnew 2>/dev/null || :
671 /sbin/chkconfig --add bacula-fd
672 %service bacula-fd restart "Bacula File daemon"
675 if [ "$1" = "0" ]; then
676 %service bacula-fd stop
677 /sbin/chkconfig --del bacula-fd
681 echo "Updating Bacula passwords and names..."
683 for f in *-password ; do
685 sed -i -e"s:#FAKE-$f#:$p:" *.conf *.conf.rpmnew 2>/dev/null || :
687 sed -i -e"s:--hostname--:`hostname`:" *.conf *.conf.rpmnew 2>/dev/null || :
689 /sbin/chkconfig --add bacula-sd
690 %service bacula-sd restart "Bacula Storage daemon"
693 if [ "$1" = "0" ]; then
694 %service bacula-sd stop
695 /sbin/chkconfig --del bacula-sd
699 if [ -e %{_sysconfdir}/console.conf -a ! -e %{_sysconfdir}/bconsole.conf ]; then
700 mv %{_sysconfdir}/console.conf %{_sysconfdir}/bconsole.conf
704 echo "Updating Bacula passwords and names..."
706 for f in *-password ; do
708 sed -i -e"s:#FAKE-$f#:$p:" *.conf *.conf.rpmnew 2>/dev/null || :
710 sed -i -e"s:--hostname--:`hostname`:" *.conf *.conf.rpmnew 2>/dev/null || :
713 echo "Updating Bacula passwords and names..."
715 for f in *-password ; do
717 sed -i -e"s:#FAKE-$f#:$p:" *.conf *.conf.rpmnew 2>/dev/null || :
719 sed -i -e"s:--hostname--:`hostname`:" *.conf *.conf.rpmnew 2>/dev/null || :
722 echo "Updating Bacula passwords and names..."
724 for f in *-password ; do
726 sed -i -e"s:#FAKE-$f#:$p:" *.conf *.conf.rpmnew 2>/dev/null || :
728 sed -i -e"s:--hostname--:`hostname`:" *.conf *.conf.rpmnew 2>/dev/null || :
731 echo "Updating Bacula passwords and names..."
733 for f in *-password ; do
735 sed -i -e"s:#FAKE-$f#:$p:" *.conf *.conf.rpmnew 2>/dev/null || :
737 sed -i -e"s:--hostname--:`hostname`:" *.conf *.conf.rpmnew 2>/dev/null || :
740 echo "Updating Bacula passwords and names..."
742 for f in *-password ; do
744 sed -i -e"s:#FAKE-$f#:$p:" *.conf *.conf.rpmnew 2>/dev/null || :
746 sed -i -e"s:--hostname--:`hostname`:" *.conf *.conf.rpmnew 2>/dev/null || :
749 # link our current installed conf file to the rescue directory
750 ln -sf %{_sysconfdir}/bacula-fd.conf %{_sysconfdir}/rescue/bacula-fd.conf
753 echo "Creating rescue files for this system..."
754 cd %{_sysconfdir}/rescue
758 # remove the files created after the initial rpm installation
759 if [ "$1" = "0" ]; then
760 rm -f %{_sysconfdir}/rescue/bacula-fd.conf
761 rm -f %{_sysconfdir}/rescue/partition.*
762 rm -f %{_sysconfdir}/rescue/format.*
763 rm -f %{_sysconfdir}/rescue/mount_drives
764 rm -f %{_sysconfdir}/rescue/start_network
765 rm -f %{_sysconfdir}/rescue/sfdisk
766 rm -rf %{_sysconfdir}/rescue/diskinfo/*
770 %defattr(644,root,root,755)
773 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*-password
774 %attr(755,root,root) %{_sbindir}/bsmtp
775 %attr(755,root,root) %{_sbindir}/btraceback
776 %{_mandir}/man8/bacula.8*
777 %{_mandir}/man1/bsmtp.1*
778 %{_mandir}/man8/btraceback.8*
779 %dir %{_libexecdir}/%{name}
780 %{_libexecdir}/%{name}/btraceback.dbx
781 %{_libexecdir}/%{name}/btraceback.gdb
782 %attr(770,root,bacula) %dir %{_localstatedir}
783 %attr(750,bacula,logs) %dir /var/log/bacula
784 %attr(640,bacula,logs) %ghost /var/log/bacula/log
787 %defattr(644,root,root,755)
788 %doc ChangeLog CheckList ReleaseNotes kernstodo LICENSE
789 #%doc examples %{name}-docs-%{version}/manual/{*.pdf,bacula}
790 %attr(640,root,bacula) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bacula-dir.conf
791 %ghost %{_sysconfdir}/.pw.sed
792 %attr(640,root,root) %config(noreplace) /etc/logrotate.d/bacula-dir
793 %attr(754,root,root) /etc/rc.d/init.d/bacula-dir
794 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/bacula-dir
795 %attr(755,root,root) %{_sbindir}/bacula-dir
796 %attr(755,root,root) %{_sbindir}/bregex
797 %attr(755,root,root) %{_sbindir}/bwild
798 %attr(755,root,root) %{_sbindir}/dbcheck
799 %{_mandir}/man8/bacula-dir.8*
800 %{_mandir}/man8/dbcheck.8*
801 %{_libexecdir}/%{name}/query.sql
803 %attr(755,root,root) %{_libexecdir}/%{name}/create_sqlite3_database
804 %attr(755,root,root) %{_libexecdir}/%{name}/drop_sqlite3_database
805 %attr(755,root,root) %{_libexecdir}/%{name}/drop_sqlite3_tables
806 %attr(755,root,root) %{_libexecdir}/%{name}/grant_sqlite3_privileges
807 %attr(755,root,root) %{_libexecdir}/%{name}/make_sqlite3_tables
808 %attr(755,root,root) %{_libexecdir}/%{name}/update_sqlite3_*
811 %attr(755,root,root) %{_libexecdir}/%{name}/create_sqlite_database
812 %attr(755,root,root) %{_libexecdir}/%{name}/drop_sqlite_database
813 %attr(755,root,root) %{_libexecdir}/%{name}/drop_sqlite_tables
814 %attr(755,root,root) %{_libexecdir}/%{name}/grant_sqlite_privileges
815 %attr(755,root,root) %{_libexecdir}/%{name}/make_sqlite_tables
816 %attr(755,root,root) %{_libexecdir}/%{name}/update_sqlite_*
819 %attr(755,root,root) %{_libexecdir}/%{name}/create_mysql_database
820 %attr(755,root,root) %{_libexecdir}/%{name}/drop_mysql_database
821 %attr(755,root,root) %{_libexecdir}/%{name}/drop_mysql_tables
822 %attr(755,root,root) %{_libexecdir}/%{name}/grant_mysql_privileges
823 %attr(755,root,root) %{_libexecdir}/%{name}/make_mysql_tables
824 %attr(755,root,root) %{_libexecdir}/%{name}/update_mysql_*
827 %attr(755,root,root) %{_libexecdir}/%{name}/create_postgresql_database
828 %attr(755,root,root) %{_libexecdir}/%{name}/drop_postgresql_database
829 %attr(755,root,root) %{_libexecdir}/%{name}/drop_postgresql_tables
830 %attr(755,root,root) %{_libexecdir}/%{name}/grant_postgresql_privileges
831 %attr(755,root,root) %{_libexecdir}/%{name}/make_postgresql_tables
832 %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
840 %attr(755,root,root) %{_libexecdir}/%{name}/make_catalog_backup
841 %attr(755,root,root) %{_libexecdir}/%{name}/delete_catalog_backup
844 %defattr(644,root,root,755)
846 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bacula-fd.conf
847 %attr(754,root,root) /etc/rc.d/init.d/bacula-fd
848 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/bacula-fd
849 %attr(755,root,root) %{_sbindir}/bacula-fd
850 %{_mandir}/man8/bacula-fd.8*
853 %defattr(644,root,root,755)
855 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bacula-sd.conf
856 %attr(754,root,root) /etc/rc.d/init.d/bacula-sd
857 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/bacula-sd
858 %attr(755,root,root) %{_sbindir}/bacula-sd
859 %attr(755,root,root) %{_sbindir}/bcopy
860 %attr(755,root,root) %{_sbindir}/bextract
861 %attr(755,root,root) %{_sbindir}/bls
862 %attr(755,root,root) %{_sbindir}/bscan
863 %attr(755,root,root) %{_sbindir}/btape
864 %attr(755,root,root) %{_libexecdir}/%{name}/mtx-changer
865 %attr(755,root,root) %{_libexecdir}/%{name}/disk-changer
866 %attr(755,root,root) %{_libexecdir}/%{name}/dvd-handler
867 %{_mandir}/man8/bacula-sd.8*
868 %{_mandir}/man8/bcopy.8*
869 %{_mandir}/man8/bextract.8*
870 %{_mandir}/man8/bls.8*
871 %{_mandir}/man8/bscan.8*
872 %{_mandir}/man8/btape.8*
875 %defattr(644,root,root,755)
877 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bconsole.conf
878 %attr(755,root,root) %{_sbindir}/bconsole
879 %{_mandir}/man8/bconsole.8*
881 %if %{with console_wx}
883 %defattr(644,root,root,755)
885 %{_pixmapsdir}/%{name}.png
886 %{_desktopdir}/bacula-wx.desktop
887 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bwx-console.conf
888 %attr(755,root,root) %{_sbindir}/bwx-console
889 %{_mandir}/man1/bacula-bwxconsole.1*
894 %defattr(644,root,root,755)
896 %{_pixmapsdir}/%{name}.png
897 %{_desktopdir}/bacula.desktop
898 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bgnome-console.conf
899 %attr(755,root,root) %{_sbindir}/bgnome-console
900 %{_mandir}/man1/bacula-bgnome-console.1*
905 %defattr(644,root,root,755)
907 %{_pixmapsdir}/%{name}.png
908 %{_desktopdir}/bat.desktop
909 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bat.conf
910 %attr(755,root,root) %{_sbindir}/bat
911 %{_mandir}/man1/bat.1*
914 %if %{with console_wx}
916 %defattr(644,root,root,755)
918 %{_pixmapsdir}/%{name}-tray-monitor.xpm
919 %{_desktopdir}/%{name}-tray-monitor.desktop
920 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/tray-monitor.conf
921 %attr(755,root,root) %{_bindir}/bacula-tray-monitor
922 %{_mandir}/man1/bacula-tray-monitor.1*
927 %defattr(644,root,root,755)
929 %dir %{_sysconfdir}/rescue
930 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/backup.etc.list
931 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/bacula-fd
932 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/format_floppy
933 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/getdiskinfo
934 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/make_rescue_disk
935 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/restore_bacula
936 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/restore_etc
937 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/run_grub
938 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/run_lilo
939 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/sfdisk.bz2