3 # - update desktop files, think about su-wrappers for console (with .desktop files)
4 # - fix log file permissions
7 %bcond_without qt # BAT / qt-console Qt5 GUI
8 %bcond_without mysql # use MySQL
9 %bcond_without pgsql # use PostgreSQL
10 %bcond_without sqlite3 # use SQLite3
11 %bcond_without nagios # build nagios plugin
12 %bcond_with s3 # Amazon S3 cloud backend
13 %bcond_with sqlite3_sync_off # makes SQLite3 backend much faster, but less reliable
15 %if %{without sqlite3}
16 %undefine with_sqlite3_sync_off
19 # Bacula requires this specific, custom version
20 %define libs3_version 20200523
22 Summary: Bacula - The Network Backup Solution
23 Summary(pl.UTF-8): Bacula - rozwiązanie do wykonywania kopii zapasowych po sieci
28 Group: Networking/Utilities
29 Source0: http://downloads.sourceforge.net/bacula/%{name}-%{version}.tar.gz
30 # Source0-md5: e686d4f1864c8c3e5c4ccb48a50db9a7
31 Source1: https://www.bacula.org/downloads/libs3-%{libs3_version}.tar.gz
32 # Source1-md5: ca97bc4133a21981139181ec8571f202
33 Source10: %{name}-dir.init
34 Source11: %{name}-fd.init
35 Source12: %{name}-sd.init
36 Source13: %{name}.logrotate
37 Source14: %{name}-dir.sysconfig
38 Source15: %{name}-fd.sysconfig
39 Source16: %{name}-sd.sysconfig
40 Patch0: %{name}-mtx-changer.patch
41 Patch1: %{name}-branding.patch
42 Patch2: %{name}-conf.patch
43 Patch3: %{name}-desktop.patch
44 Patch4: make_catalog_backup-setup-home.patch
45 Patch5: %{name}-libtool.patch
46 Patch6: %{name}-no_lockmgr.patch
48 Patch8: libs3-curl.patch
49 URL: http://www.bacula.org/
50 BuildRequires: acl-devel
51 BuildRequires: autoconf >= 2.61
52 BuildRequires: automake
53 %{?with_s3:BuildRequires: curl-devel}
54 BuildRequires: gettext-tools
55 BuildRequires: libcap-devel
56 BuildRequires: libtool >= 2:2.2
57 BuildRequires: libwrap-devel
58 %{?with_s3:BuildRequires: libxml2-devel}
59 BuildRequires: ncurses-devel
60 BuildRequires: openssl-devel
61 BuildRequires: pkgconfig
62 BuildRequires: python3
63 BuildRequires: python3-modules
65 BuildRequires: Qt5Core-devel
66 BuildRequires: Qt5Gui-devel
67 BuildRequires: Qt5Widgets-devel
68 BuildRequires: qt5-build
69 BuildRequires: qt5-qmake
71 %{?with_mysql:BuildRequires: mysql-devel}
72 %{?with_pgsql:BuildRequires: postgresql-devel}
73 BuildRequires: readline-devel
74 BuildRequires: rpm >= 4.4.9-56
75 BuildRequires: rpm-pythonprov
76 BuildRequires: rpmbuild(macros) >= 1.644
77 BuildRequires: sed >= 4.0
78 %{?with_sqlite3:BuildRequires: sqlite3-devel}
80 BuildRequires: zlib-devel
81 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
83 %define _sysconfdir /etc/%{name}
84 %define _localstatedir /var/lib/%{name}
85 %define nagiosplugindir %{_libdir}/nagios/plugins
87 # db packages contain duplicates
88 %define _duplicate_files_terminate_build 0
90 # from 'the worst' to 'the best'
91 %define databases %{?with_sqlite3:sqlite3} %{?with_mysql:mysql} %{?with_pgsql:postgresql}
93 # dependency section is broken. ccache usage is instead to makefiles
97 Bacula - It comes by night and sucks the vital essence from your
100 Bacula is a set of computer programs that permit you (or the system
101 administrator) to manage backup, recovery, and verification of
102 computer data across a network of computers of different kinds. In
103 technical terms, it is a network client/server based backup program.
104 Bacula is relatively easy to use and efficient, while offering many
105 advanced storage management features that make it easy to find and
106 recover lost or damaged files.
108 %description -l pl.UTF-8
109 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
111 Bacula to zbiór programów umożliwiających administratorowi na
112 zarządzanie kopiami zapasowymi, odzyskiwaniem i weryfikacją danych w
113 sieci komputerów różnego rodzaju. W terminologii technicznej jest to
114 program do kopii zapasowych pracujący w architekturze klient-serwer.
115 Bacula jest stosunkowo łatwa w użyciu i wydajna, oferując przy tym
116 wiele zaawansowanych możliwości przy zarządzaniu nośnikami,
117 ułatwiających znalezienie i odzyskanie utraconych lub uszkodzonych
121 Summary: Common files for bacula package
122 Summary(pl.UTF-8): Pliki wspólne dla pakietu bacula
123 Group: Networking/Utilities
124 Requires(post): openssl-tools
125 Requires(post): sed >= 4.0
126 Requires(post,preun): /sbin/chkconfig
127 Requires(postun): /usr/sbin/groupdel
128 Requires(postun): /usr/sbin/userdel
129 Requires(pre): /usr/sbin/groupadd
130 Requires(pre): /usr/sbin/useradd
131 Conflicts: bacula-console < 0:1.34.6
132 Conflicts: bacula-dir < 0:1.34.6
133 Conflicts: bacula-fd < 0:1.34.6
134 Conflicts: bacula-sd < 0:1.34.6
135 Conflicts: logrotate < 3.8.0
138 Bacula - It comes by night and sucks the vital essence from your
141 Bacula is a set of computer programs that permit you (or the system
142 administrator) to manage backup, recovery, and verification of
143 computer data across a network of computers of different kinds. In
144 technical terms, it is a network client/server based backup program.
145 Bacula is relatively easy to use and efficient, while offering many
146 advanced storage management features that make it easy to find and
147 recover lost or damaged files.
149 %description common -l pl.UTF-8
150 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
152 Bacula to zbiór programów umożliwiających administratorowi na
153 zarządzanie kopiami zapasowymi, odzyskiwaniem i weryfikacją danych w
154 sieci komputerów różnego rodzaju. W terminologii technicznej jest to
155 program do kopii zapasowych pracujący w architekturze klient-serwer.
156 Bacula jest stosunkowo łatwa w użyciu i wydajna, oferując przy tym
157 wiele zaawansowanych możliwości przy zarządzaniu nośnikami,
158 ułatwiających znalezienie i odzyskanie utraconych lub uszkodzonych
162 Summary: Bacula Director and Catalog services
163 Summary(pl.UTF-8): Usługi Bacula Director i Catalog
164 Group: Networking/Utilities
165 Requires(post): sed >= 4.0
166 Requires: %{name}-common = %{version}-%{release}
167 Requires: bacula-db = %{version}-%{release}
168 Obsoletes: bacula-updatedb
171 Bacula - It comes by night and sucks the vital essence from your
174 Bacula Director is the program that supervises all the backup,
175 restore, verify and archive operations. The system administrator uses
176 the Bacula Director to schedule backups and to recover files. Catalog
177 services are comprised of the software programs responsible for
178 maintaining the file indexes and volume databases for all files backed
179 up. The Catalog services permit the System Administrator or user to
180 quickly locate and restore any desired file, since it maintains a
181 record of all Volumes used, all Jobs run, and all Files saved.
183 %description dir -l pl.UTF-8
184 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
186 Bacula Director to program nadzorujący wszystkie operacje wykonywania
187 kopii zapasowych, odzyskiwania, weryfikacji i archiwizowania.
188 Administrator używa Bacula Directora do szeregowania kopii zapasowych
189 oraz odzyskiwania plików. Usługi katalogowe (Catalog services) są
190 używane przez programy odpowiedzialne za zarządzanie indeksami plików
191 i bazą danych wolumenów dla wszystkich kopiowanych plików. Usługi
192 katalogowe umożliwiają administratorowi lub użytkownikowi szybko
193 zlokalizować i odtworzyć dowolny plik, ponieważ utrzymują rekord ze
194 wszystkimi używanymi wolumenami, uruchomionymi zadaniami i zapisanymi
198 Summary: Bacula Console
199 Summary(pl.UTF-8): Konsola Baculi
200 Group: Networking/Utilities
201 Requires(post): sed >= 4.0
202 Requires: %{name}-common = %{version}-%{release}
205 Bacula - It comes by night and sucks the vital essence from your
208 Bacula Console is the program that allows the administrator or user to
209 communicate with the Bacula Director. This is the text only console
212 %description console -l pl.UTF-8
213 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
215 Bacula Console to program umożliwiający administratorowi lub
216 użytkownikowi komunikowanie się z programem Bacula Director. To jest
217 interfejs czysto tekstowy.
220 Summary: bat – The Bacula Administration Tool
221 Summary(pl.UTF-8): bat – narzędzie administratora Baculi
222 Group: Networking/Utilities
223 Requires(post): sed >= 4.0
224 Requires: %{name}-common = %{version}-%{release}
227 %description console-qt
228 Bacula - It comes by night and sucks the vital essence from your
231 bat is short for Bacula Administration Tool. It is a GUI form of
232 bconsole, but with many additional features.
234 %description console-qt -l pl.UTF-8
235 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
237 bat, czyli Bacula Administration Tool, jest graficznym odpowiednikiem
238 bconsole, z wieloma dodatkowymi funkcjami.
240 %package tray-monitor
241 Summary: Bacula Tray Monitor
242 Group: Networking/Utilities
243 Requires(post): sed >= 4.0
244 Requires: %{name}-common = %{version}-%{release}
246 %description tray-monitor
247 Bacula - It comes by night and sucks the vital essence from your
250 The Monitor program is typically an icon in the system tray. However,
251 once the icon is expanded into a full window, the administrator or
252 user can obtain status information about the Director or the backup
253 status on the local workstation or any other Bacula daemon that is
257 Summary: Bacula File services (Client)
258 Summary(pl.UTF-8): Usługi Bacula File (klient)
259 Group: Networking/Utilities
260 Requires(post): sed >= 4.0
261 Requires: %{name}-common = %{version}-%{release}
264 Bacula - It comes by night and sucks the vital essence from your
267 Bacula File services (or Client program) is the software program that
268 is installed on the machine to be backed up. It is specific to the
269 operating system on which it runs and is responsible for providing the
270 file attributes and data when requested by the Director. The File
271 services are also responsible for the file system dependent part of
272 restoring the file attributes and data during a recovery operation.
273 This program runs as a daemon on the machine to be backed up, and in
274 some of the documentation, the File daemon is referred to as the
275 Client (for example in Bacula configuration file).
277 %description fd -l pl.UTF-8
278 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
280 Usługi Bacula File (inaczej program kliencki) to oprogramowanie, które
281 instaluje się na maszynach, z których mają być wykonywane kopie
282 zapasowe. Są one specyficzne dla systemu operacyjnego, pod którym
283 działa dana maszyna i odpowiadają za dostarczanie atrybutów i danych
284 plików na żądanie Directora. Usługi plikowe są także odpowiedzialne za
285 zależną od systemu plików część odzyskiwania atrybutów i danych plików
286 podczas operacji odzyskiwania danych. Program działa jako demon na
287 maszynie, która ma być backupowana i w części dokumentacji demon ten
288 (File) jest nazywany klientem (na przykład w pliku konfiguracyjnym
292 Summary: Bacula Storage services
293 Summary(pl.UTF-8): Usługi Bacula Storage
294 Group: Networking/Utilities
295 Requires(post): sed >= 4.0
296 Requires: %{name}-common = %{version}-%{release}
298 Conflicts: dvd+rw-tools <= 5.21.4.10.8-1
301 Bacula - It comes by night and sucks the vital essence from your
304 Bacula Storage services consist of the software programs that perform
305 the storage and recovery of the file attributes and data to the
306 physical backup media or volumes. In other words, the Storage daemon
307 is responsible for reading and writing your tapes (or other storage
308 media, e.g. files). The Storage services runs as a daemon on the
309 machine that has the backup device (usually a tape drive).
311 %description sd -l pl.UTF-8
312 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
314 Usługi Bacula Storage składają się z programów obsługujących
315 przechowywanie danych oraz odzyskiwanie atrybutów i danych na
316 fizycznych nośnikach lub wolumenach. Innymi słowy, demon Storage jest
317 odpowiedzialny za odczyt i zapis taśm (lub innych nośników do
318 przechowywania danych, np. plików). Usługi Storage działają jako demon
319 na maszynie, która zawiera urządzenie backupowe (zwykle napęd
322 %package db-postgresql
323 Summary: PostgreSQL database driver for Bacula
324 Summary(pl.UTF-8): Sterownik bazy PostgreSQL dla Baculi
325 Group: Networking/Utilities
326 Requires(post): /sbin/ldconfig
327 Requires: %{name}-common = %{version}-%{release}
328 Provides: bacula-db = %{version}-%{release}
331 %description db-postgresql
332 PostgreSQL database driver for Bacula.
334 %description db-postgresql -l pl.UTF-8
335 Sterownik bazy PostgreSQL dla Baculi.
338 Summary: MySQL database driver for Bacula
339 Summary(pl.UTF-8): Sterownik bazy MySQL dla Baculi
340 Group: Networking/Utilities
341 Requires(post): /sbin/ldconfig
342 Requires: %{name}-common = %{version}-%{release}
343 Provides: bacula-db = %{version}-%{release}
346 %description db-mysql
347 MySQL database driver for Bacula.
349 %description db-mysql -l pl.UTF-8
350 Sterownik bazy MySQL dla Baculi.
353 Summary: SQLite database driver for Bacula
354 Summary(pl.UTF-8): Sterownik bazy SQLite dla Baculi
355 Group: Networking/Utilities
356 Requires(post): /sbin/ldconfig
357 Requires: %{name}-common = %{version}-%{release}
358 Provides: bacula-db = %{version}-%{release}
361 %description db-sqlite3
362 SQLite database driver for Bacula.
364 %description db-sqlite3 -l pl.UTF-8
365 Sterownik bazy SQLite dla Baculi.
367 %package -n nagios-plugin-check_bacula
368 Summary: Nagios plugin to check bacula
370 Requires: nagios-common
372 %description -n nagios-plugin-check_bacula
373 Nagios plugin to check bacula.
375 %define _noautoreq libbaccats-%{version}.so
376 # provided by various db libraries as a symlink
391 cd libs3-%{libs3_version}
396 sed -i -e 's#bindir=.*#bindir=%{_bindir}#g' \
397 src/cats/create_* src/cats/delete_* src/cats/drop_* \
398 src/cats/grant_* src/cats/make_* src/cats/update_*
399 sed -i -e 's/@hostname@/--hostname--/' src/*/*.conf.in
400 sed -i -e 's/@basename@/--hostname--/' src/*/*.conf.in
404 %{__aclocal} -I bacula-macros -I gettext-macros -I libtool
405 ## $BUILD_DIR not seen by libtoolize, export it
406 #BUILD_DIR=.. %%{__libtoolize}
408 %{__autoconf} --prepend-include=$(pwd)/autoconf autoconf/configure.in > configure
411 cd libs3-%{libs3_version}
412 CFLAGS="%{rpmcflags} -Wno-stringop-overflow" make VERBOSE=1 build/lib/libs3.a
413 ln -s ../inc build/include
417 CPPFLAGS="-I/usr/include/ncurses -I%{_includedir}/readline"
418 CXXFLAGS="%{rpmcxxflags} -Wno-narrowing"
419 CFLAGS="%{rpmcflags} -Wno-narrowing"
422 QMAKE=%{_bindir}/qmake-qt5 \
424 --with-scriptdir=%{_libexecdir}/%{name} \
425 %{?with_qt:--enable-bat} \
427 --enable-smartalloc \
429 --with-tcp-wrappers \
430 --with-working-dir=%{_var}/lib/%{name} \
431 --with-dump-email="root@localhost" \
432 --with-job-email="root@localhost" \
433 --with-smtp-host=localhost \
434 --with-logdir=/var/log/bacula \
435 --with-pid-dir=/var/run \
436 --with-subsys-dir=/var/lock/subsys \
437 --enable-batch-insert \
438 %{?with_pgsql:--with-postgresql} \
439 %{?with_mysql:--with-mysql} \
440 %{?with_sqlite3:--with-sqlite3} \
441 %{?with_sqlite3_sync_off:--enable-extra-sqlite3-init="pragma synchronous=0;"} \
442 %{!?with_s3:--without-s3} \
443 %{?with_s3:--with-s3=$PWD/libs3-%{libs3_version}/build} \
444 --with-dir-password="#FAKE-dir-password#" \
445 --with-fd-password="#FAKE-fd-password#" \
446 --with-sd-password="#FAKE-sd-password#" \
447 --with-mon-dir-password="#FAKE-mon-dir-password#" \
448 --with-mon-fd-password="#FAKE-mon-fd-password#" \
449 --with-mon-sd-password="#FAKE-mon-sd-password#" \
459 %{?with_s3:S3_LIBS="$PWD/libs3-%{libs3_version}/build/lib/libs3.a $(pkg-config --libs libcurl libxml-2.0)"} \
461 # check for build errors
462 grep "Error in" log && exit 1
463 # without this build fails with RPM_EC=1 on rpm.org RPM
468 %{__make} -C examples/nagios/check_bacula
472 rm -rf $RPM_BUILD_ROOT
473 install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,logrotate.d,pam.d,sysconfig} \
474 $RPM_BUILD_ROOT{%{_pixmapsdir},%{_desktopdir}} \
475 $RPM_BUILD_ROOT{%{_mandir},%{_bindir},/var/log{,/archive}/bacula}
478 DESTDIR=$RPM_BUILD_ROOT
480 %{__make} -C src/stored install-aligned \
481 DESTDIR=$RPM_BUILD_ROOT
484 %{__make} -C src/stored install-cloud \
485 DESTDIR=$RPM_BUILD_ROOT
488 # create copies of make_catalog_backup for specific databases; zeore default one (will be ghost)
489 for database in %{databases}; do
490 sed -e "s#default_db_type=.*#default_db_type=${database}#g" \
491 $RPM_BUILD_ROOT%{_libexecdir}/%{name}/make_catalog_backup \
492 > $RPM_BUILD_ROOT%{_libexecdir}/%{name}/make_${database}_catalog_backup
493 chmod 755 $RPM_BUILD_ROOT%{_libexecdir}/%{name}/make_${database}_catalog_backup
495 :> $RPM_BUILD_ROOT%{_libexecdir}/%{name}/make_catalog_backup
497 # we use db dependant (at compile time) shell script only
498 rm $RPM_BUILD_ROOT%{_libexecdir}/%{name}/make_catalog_backup.pl
500 ## replace with empty file, replaced by ldconfig from each db-* package on intsall
501 rm $RPM_BUILD_ROOT%{_libdir}/libbaccats-%{version}.so
502 touch $RPM_BUILD_ROOT%{_libdir}/libbaccats-%{version}.so
504 install -p %{SOURCE10} $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-dir
505 install -p %{SOURCE11} $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-fd
506 install -p %{SOURCE12} $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-sd
507 cp -a %{SOURCE13} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}-dir
508 cp -a %{SOURCE14} $RPM_BUILD_ROOT/etc/sysconfig/bacula-dir
509 cp -a %{SOURCE15} $RPM_BUILD_ROOT/etc/sysconfig/bacula-fd
510 cp -a %{SOURCE16} $RPM_BUILD_ROOT/etc/sysconfig/bacula-sd
513 # qmake somewhy does not always create install_bins target. install our own the bin
514 rm -f $RPM_BUILD_ROOT%{_sbindir}/bat
515 libtool --silent --mode=install install src/qt-console/bat $RPM_BUILD_ROOT%{_bindir}
516 cp -a scripts/bacula.png $RPM_BUILD_ROOT%{_pixmapsdir}/bacula.png
517 cp -a scripts/bat.desktop $RPM_BUILD_ROOT%{_desktopdir}
520 touch $RPM_BUILD_ROOT/var/log/bacula/log
522 # install the updatedb scripts for older versions that last full release
523 # 2.0 -> 3.0 : 10_to_11
524 # 5.0 -> 5.2 : 12_to_14
525 install -p updatedb/update_*_tables_10_to_11 $RPM_BUILD_ROOT%{_libexecdir}/%{name}
526 install -p updatedb/update_*_tables_11_to_12 $RPM_BUILD_ROOT%{_libexecdir}/%{name}
528 # place for site passwords
529 touch $RPM_BUILD_ROOT%{_sysconfdir}/{dir-password,fd-password,sd-password}
530 touch $RPM_BUILD_ROOT%{_sysconfdir}/{mon-dir-password,mon-fd-password,mon-sd-password}
532 mv $RPM_BUILD_ROOT%{_libexecdir}/%{name}/mtx-changer.conf $RPM_BUILD_ROOT%{_sysconfdir}/mtx-changer.conf
535 rm -f $RPM_BUILD_ROOT%{_libexecdir}/%{name}/{gconsole,startmysql,stopmysql,bacula,bconsole,fd}
537 rm $RPM_BUILD_ROOT%{_docdir}/bacula/ChangeLog
538 rm $RPM_BUILD_ROOT%{_docdir}/bacula/INSTALL
539 rm $RPM_BUILD_ROOT%{_docdir}/bacula/LICENSE
540 rm $RPM_BUILD_ROOT%{_docdir}/bacula/README
541 rm $RPM_BUILD_ROOT%{_docdir}/bacula/ReleaseNotes
542 rm $RPM_BUILD_ROOT%{_docdir}/bacula/VERIFYING
544 # startup scripts, those in /etc/rc.d/init.d are better
545 rm $RPM_BUILD_ROOT%{_sbindir}/bacula
546 rm $RPM_BUILD_ROOT%{_libexecdir}/%{name}/bacula-ctl-*
549 rm $RPM_BUILD_ROOT%{_libexecdir}/%{name}/btraceback.mdb
551 # rename to avoid possible conflicts
552 mv $RPM_BUILD_ROOT%{_sbindir}/{,bacula-}dbcheck
553 mv $RPM_BUILD_ROOT%{_mandir}/man8/{,bacula-}dbcheck.8.gz
555 # no -devel files packaged, so this is also useless
556 rm $RPM_BUILD_ROOT%{_libdir}/libbac{,cfg,find,sql,cats,sd}.{so,la}
557 rm $RPM_BUILD_ROOT%{_libdir}/bacula-sd-*-driver.so
558 %{?with_mysql:rm $RPM_BUILD_ROOT%{_libdir}/libbaccats-mysql.{la,so}}
559 %{?with_pgsql:rm $RPM_BUILD_ROOT%{_libdir}/libbaccats-postgresql.{la,so}}
560 %{?with_sqlite3:rm $RPM_BUILD_ROOT%{_libdir}/libbaccats-sqlite3.{la,so}}
563 install -d $RPM_BUILD_ROOT%{nagiosplugindir}
564 %{__make} -C examples/nagios/check_bacula install \
565 sbindir=%{nagiosplugindir} \
566 DESTDIR=$RPM_BUILD_ROOT
570 rm -rf $RPM_BUILD_ROOT
573 %groupadd -P %{name}-common -g 136 -r -f bacula
574 %useradd -P %{name}-common -u 136 -r -d /var/lib/bacula -s /bin/false -c "Bacula User" -g bacula bacula
576 %define update_configs \
577 echo "Updating bacula passwords and names..." | %banner -a %{name} \
579 for f in *-password; do \
580 if [ ! -s $f ]; then \
581 openssl rand -base64 33 > $f \
584 for cf in *.conf *.conf.rpmnew; do \
585 [ -f $cf ] && sed -i -e"s:#FAKE-$f#:$p:" "$cf" || : \
588 for cf in *.conf *.conf.rpmnew; do \
589 [ -f $cf ] && sed -i -e"s:--hostname--:`hostname`:" "$cf" || : \
598 if [ "$1" = "0" ]; then
603 %triggerpostun dir -- %{name}-dir < %{version}-0
604 %banner bacula-dir -t3 <<EOF
605 You have upgraded from an older version of Bacula director.
607 You will probably need to call %{_libexecdir}/%{name}/update_bacula_tables
608 script to upgrade the database.
610 Ensure you database partition has enough free space before you run the upgrade,
611 i.e check that there is enough room to rebuild 'File' table (it is the largest
618 /sbin/chkconfig --add bacula-dir
619 %service bacula-dir restart "Bacula Director daemon"
622 if [ "$1" = "0" ]; then
623 %service bacula-dir stop
624 /sbin/chkconfig --del bacula-dir
629 /sbin/chkconfig --add bacula-fd
630 %service bacula-fd restart "Bacula File daemon"
633 if [ "$1" = "0" ]; then
634 %service bacula-fd stop
635 /sbin/chkconfig --del bacula-fd
640 /sbin/chkconfig --add bacula-sd
641 %service bacula-sd restart "Bacula Storage daemon"
644 if [ "$1" = "0" ]; then
645 %service bacula-sd stop
646 /sbin/chkconfig --del bacula-sd
650 if [ -e %{_sysconfdir}/console.conf -a ! -e %{_sysconfdir}/bconsole.conf ]; then
651 mv %{_sysconfdir}/console.conf %{_sysconfdir}/bconsole.conf
657 %triggerpostun common -- %{name}-common < 5.0.1-2
658 find %{_sysconfdir}/bat.conf* -perm /007 -print0 2>/dev/null | xargs -0 -r chmod 600 || :
668 for name in "create database" "drop tables" "drop database" "grant privileges" "make tables" "update tables"; do \
669 prefix="${name%% *}" \
670 suffix="${name#* }" \
671 ln -sf "${prefix}_%{1}_${suffix}" %{_libexecdir}/%{name}/"${prefix}_bacula_${suffix}" || : \
673 ln -sf "make_%{1}_catalog_backup" %{_libexecdir}/%{name}/make_catalog_backup || : \
674 ln -sf libbaccats-%{1}-%{version}.so %{_libdir}/libbaccats-%{version}.so || : \
675 %service bacula-dir restart "Bacula Director daemon"
680 %postun db-postgresql -p /sbin/ldconfig
685 %postun db-mysql -p /sbin/ldconfig
690 %postun db-sqlite3 -p /sbin/ldconfig
693 %defattr(644,root,root,755)
696 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*-password
697 # do not remove bsmtp from files. Fix build if it is not installed.
698 %attr(755,root,root) %{_sbindir}/bsmtp
699 %attr(755,root,root) %{_sbindir}/btraceback
700 %attr(755,root,root) %{_libdir}/libbac-13*.so
701 %attr(755,root,root) %{_libdir}/libbaccfg-13*.so
702 %attr(755,root,root) %{_libdir}/libbacsd-13*.so
703 %attr(755,root,root) %{_libdir}/libbacfind-13*.so
704 %attr(755,root,root) %{_libdir}/libbacsql-13*.so
705 %{_mandir}/man8/bacula.8*
706 %{_mandir}/man1/bsmtp.1*
707 %{_mandir}/man8/btraceback.8*
708 %dir %{_libexecdir}/%{name}
709 %{_libexecdir}/%{name}/btraceback.dbx
710 %{_libexecdir}/%{name}/btraceback.gdb
711 %{_libexecdir}/%{name}/bacula_config
712 %attr(770,root,bacula) %dir %{_localstatedir}
713 %attr(750,bacula,logs) %dir /var/log/bacula
714 %attr(640,bacula,logs) %ghost /var/log/bacula/log
715 %attr(750,bacula,logs) %dir /var/log/archive/bacula
718 %defattr(644,root,root,755)
719 %doc ChangeLog ReleaseNotes LICENSE
720 #%doc examples %{name}-docs-%{version}/manual/{*.pdf,bacula}
721 %attr(640,root,bacula) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bacula-dir.conf
722 %attr(640,root,root) %config(noreplace) /etc/logrotate.d/bacula-dir
723 %attr(754,root,root) /etc/rc.d/init.d/bacula-dir
724 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/bacula-dir
725 %attr(755,root,root) %{_sbindir}/bacula-dir
726 %attr(755,root,root) %{_sbindir}/bdirjson
727 %attr(755,root,root) %{_sbindir}/bregex
728 %attr(755,root,root) %{_sbindir}/bwild
729 %attr(755,root,root) %{_sbindir}/bacula-dbcheck
730 %{_mandir}/man8/bacula-dir.8*
731 %{_mandir}/man8/bacula-dbcheck.8*
732 %{_mandir}/man8/bregex.8*
733 %{_mandir}/man8/bwild.8*
734 %{_libexecdir}/%{name}/query.sql
735 %attr(755,root,root) %{_libexecdir}/%{name}/delete_catalog_backup
739 %defattr(644,root,root,755)
740 %attr(755,root,root) %{_libexecdir}/%{name}/create_postgresql_database
741 %attr(755,root,root) %{_libexecdir}/%{name}/drop_postgresql_database
742 %attr(755,root,root) %{_libexecdir}/%{name}/drop_postgresql_tables
743 %attr(755,root,root) %{_libexecdir}/%{name}/grant_postgresql_privileges
744 %attr(755,root,root) %{_libexecdir}/%{name}/make_postgresql_tables
745 %attr(755,root,root) %{_libexecdir}/%{name}/update_postgresql_*
746 %attr(755,root,root) %{_libexecdir}/%{name}/make_postgresql_catalog_backup
747 %attr(755,root,root) %{_libdir}/libbaccats-postgresql-13*.so
749 %ghost %attr(755,root,root) %{_libdir}/libbaccats-13*.so
750 %ghost %{_libexecdir}/%{name}/create_bacula_database
751 %ghost %{_libexecdir}/%{name}/drop_bacula_tables
752 %ghost %{_libexecdir}/%{name}/drop_bacula_database
753 %ghost %{_libexecdir}/%{name}/grant_bacula_privileges
754 %ghost %{_libexecdir}/%{name}/make_bacula_tables
755 %ghost %{_libexecdir}/%{name}/update_bacula_tables
756 %ghost %{_libexecdir}/%{name}/make_catalog_backup
761 %defattr(644,root,root,755)
762 %attr(755,root,root) %{_libexecdir}/%{name}/create_mysql_database
763 %attr(755,root,root) %{_libexecdir}/%{name}/drop_mysql_database
764 %attr(755,root,root) %{_libexecdir}/%{name}/drop_mysql_tables
765 %attr(755,root,root) %{_libexecdir}/%{name}/grant_mysql_privileges
766 %attr(755,root,root) %{_libexecdir}/%{name}/make_mysql_tables
767 %attr(755,root,root) %{_libexecdir}/%{name}/update_mysql_*
768 %attr(755,root,root) %{_libexecdir}/%{name}/make_mysql_catalog_backup
769 %attr(755,root,root) %{_libdir}/libbaccats-mysql-13*.so
771 %ghost %attr(755,root,root) %{_libdir}/libbaccats-13*.so
772 %ghost %{_libexecdir}/%{name}/create_bacula_database
773 %ghost %{_libexecdir}/%{name}/drop_bacula_tables
774 %ghost %{_libexecdir}/%{name}/drop_bacula_database
775 %ghost %{_libexecdir}/%{name}/grant_bacula_privileges
776 %ghost %{_libexecdir}/%{name}/make_bacula_tables
777 %ghost %{_libexecdir}/%{name}/update_bacula_tables
778 %ghost %{_libexecdir}/%{name}/make_catalog_backup
783 %defattr(644,root,root,755)
784 %attr(755,root,root) %{_libexecdir}/%{name}/create_sqlite3_database
785 %attr(755,root,root) %{_libexecdir}/%{name}/drop_sqlite3_database
786 %attr(755,root,root) %{_libexecdir}/%{name}/drop_sqlite3_tables
787 %attr(755,root,root) %{_libexecdir}/%{name}/grant_sqlite3_privileges
788 %attr(755,root,root) %{_libexecdir}/%{name}/make_sqlite3_tables
789 %attr(755,root,root) %{_libexecdir}/%{name}/update_sqlite3_*
790 %attr(755,root,root) %{_libexecdir}/%{name}/make_sqlite3_catalog_backup
791 %attr(755,root,root) %{_libdir}/libbaccats-sqlite3-13*.so
793 %ghost %attr(755,root,root) %{_libdir}/libbaccats-13*.so
794 %ghost %{_libexecdir}/%{name}/create_bacula_database
795 %ghost %{_libexecdir}/%{name}/drop_bacula_tables
796 %ghost %{_libexecdir}/%{name}/drop_bacula_database
797 %ghost %{_libexecdir}/%{name}/grant_bacula_privileges
798 %ghost %{_libexecdir}/%{name}/make_bacula_tables
799 %ghost %{_libexecdir}/%{name}/update_bacula_tables
800 %ghost %{_libexecdir}/%{name}/make_catalog_backup
804 %defattr(644,root,root,755)
806 %attr(640,root,bacula) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bacula-fd.conf
807 %attr(754,root,root) /etc/rc.d/init.d/bacula-fd
808 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/bacula-fd
809 %attr(755,root,root) %{_sbindir}/bacula-fd
810 %attr(755,root,root) %{_sbindir}/bfdjson
811 %attr(755,root,root) %{_libdir}/bpipe-fd.so
812 %{_mandir}/man8/bacula-fd.8*
815 %defattr(644,root,root,755)
817 %attr(640,root,bacula) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bacula-sd.conf
818 %attr(640,root,bacula) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mtx-changer.conf
819 %attr(754,root,root) /etc/rc.d/init.d/bacula-sd
820 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/bacula-sd
821 %attr(755,root,root) %{_sbindir}/bacula-sd
822 %attr(755,root,root) %{_sbindir}/bcopy
823 %attr(755,root,root) %{_sbindir}/bextract
824 %attr(755,root,root) %{_sbindir}/bls
825 %attr(755,root,root) %{_sbindir}/bscan
826 %attr(755,root,root) %{_sbindir}/bsdjson
827 %attr(755,root,root) %{_sbindir}/btape
828 %attr(755,root,root) %{_libexecdir}/%{name}/baculabackupreport
829 %attr(755,root,root) %{_libexecdir}/%{name}/bacula-tray-monitor.desktop
830 %attr(755,root,root) %{_libexecdir}/%{name}/disk-changer
831 %attr(755,root,root) %{_libexecdir}/%{name}/isworm
832 %attr(755,root,root) %{_libexecdir}/%{name}/mtx-changer
833 %attr(755,root,root) %{_libexecdir}/%{name}/tapealert
834 %attr(755,root,root) %{_libdir}/bacula-sd-aligned-driver-13.*.so
836 %attr(755,root,root) %{_libdir}/bacula-sd-cloud-driver-13.*.so
839 %{_mandir}/man8/bacula-sd.8*
840 %{_mandir}/man8/bcopy.8*
841 %{_mandir}/man8/bextract.8*
842 %{_mandir}/man8/bls.8*
843 %{_mandir}/man8/bscan.8*
844 %{_mandir}/man8/btape.8*
847 %defattr(644,root,root,755)
849 %attr(640,root,bacula) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bconsole.conf
850 %attr(755,root,root) %{_sbindir}/bconsole
851 %attr(755,root,root) %{_sbindir}/bbconsjson
852 %{_mandir}/man8/bconsole.8*
856 %defattr(644,root,root,755)
858 %{_pixmapsdir}/%{name}.png
859 %{_desktopdir}/bat.desktop
860 # Do not make this file world-readable or any user will get full access to the
862 %attr(640,root,bacula) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bat.conf
863 %attr(755,root,root) %{_bindir}/bat
864 %{_mandir}/man1/bat.1*
869 %files -n nagios-plugin-check_bacula
870 %defattr(644,root,root,755)
871 %attr(755,root,root) %{nagiosplugindir}/check_bacula