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: 0e3cd4e29878b09ae4554bae64785736
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 Source17: %{name}-dir.service
41 Source18: %{name}-fd.service
42 Source19: %{name}-sd.service
43 Patch0: %{name}-mtx-changer.patch
44 Patch1: %{name}-branding.patch
45 Patch2: %{name}-desktop.patch
46 Patch3: make_catalog_backup-setup-home.patch
47 Patch4: %{name}-no_lockmgr.patch
49 Patch6: libs3-curl.patch
50 URL: http://www.bacula.org/
51 BuildRequires: acl-devel
52 BuildRequires: autoconf >= 2.61
53 BuildRequires: automake
54 %{?with_s3:BuildRequires: curl-devel}
55 BuildRequires: gettext-tools
56 BuildRequires: libcap-devel
57 BuildRequires: libtool >= 2:2.2
58 BuildRequires: libwrap-devel
59 %{?with_s3:BuildRequires: libxml2-devel}
60 BuildRequires: ncurses-devel
61 BuildRequires: openssl-devel
62 BuildRequires: pkgconfig
64 BuildRequires: python-modules
66 BuildRequires: Qt5Core-devel
67 BuildRequires: Qt5Gui-devel
68 BuildRequires: Qt5Widgets-devel
69 BuildRequires: qt5-build
70 BuildRequires: qt5-qmake
72 %{?with_mysql:BuildRequires: mysql-devel}
73 %{?with_pgsql:BuildRequires: postgresql-devel}
74 BuildRequires: readline-devel
75 BuildRequires: rpm >= 4.4.9-56
76 BuildRequires: rpm-pythonprov
77 BuildRequires: rpmbuild(macros) >= 1.644
78 BuildRequires: sed >= 4.0
79 %{?with_sqlite3:BuildRequires: sqlite3-devel}
81 BuildRequires: zlib-devel
82 Requires: systemd-units >= 38
83 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
85 %define _sysconfdir /etc/%{name}
86 %define _localstatedir /var/lib/%{name}
87 %define nagiosplugindir %{_libdir}/nagios/plugins
89 # db packages contain duplicates
90 %define _duplicate_files_terminate_build 0
92 # from 'the worst' to 'the best'
93 %define databases %{?with_sqlite3:sqlite3} %{?with_mysql:mysql} %{?with_pgsql:postgresql}
95 # dependency section is broken. ccache usage is instead to makefiles
99 Bacula - It comes by night and sucks the vital essence from your
102 Bacula is a set of computer programs that permit you (or the system
103 administrator) to manage backup, recovery, and verification of
104 computer data across a network of computers of different kinds. In
105 technical terms, it is a network client/server based backup program.
106 Bacula is relatively easy to use and efficient, while offering many
107 advanced storage management features that make it easy to find and
108 recover lost or damaged files.
110 %description -l pl.UTF-8
111 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
113 Bacula to zbiór programów umożliwiających administratorowi na
114 zarządzanie kopiami zapasowymi, odzyskiwaniem i weryfikacją danych w
115 sieci komputerów różnego rodzaju. W terminologii technicznej jest to
116 program do kopii zapasowych pracujący w architekturze klient-serwer.
117 Bacula jest stosunkowo łatwa w użyciu i wydajna, oferując przy tym
118 wiele zaawansowanych możliwości przy zarządzaniu nośnikami,
119 ułatwiających znalezienie i odzyskanie utraconych lub uszkodzonych
123 Summary: Common files for bacula package
124 Summary(pl.UTF-8): Pliki wspólne dla pakietu bacula
125 Group: Networking/Utilities
126 Requires(post): openssl-tools
127 Requires(post): sed >= 4.0
128 Requires(post,preun): /sbin/chkconfig
129 Requires(postun): /usr/sbin/groupdel
130 Requires(postun): /usr/sbin/userdel
131 Requires(pre): /usr/sbin/groupadd
132 Requires(pre): /usr/sbin/useradd
133 Conflicts: bacula-console < 0:1.34.6
134 Conflicts: bacula-dir < 0:1.34.6
135 Conflicts: bacula-fd < 0:1.34.6
136 Conflicts: bacula-sd < 0:1.34.6
137 Conflicts: logrotate < 3.8.0
140 Bacula - It comes by night and sucks the vital essence from your
143 Bacula is a set of computer programs that permit you (or the system
144 administrator) to manage backup, recovery, and verification of
145 computer data across a network of computers of different kinds. In
146 technical terms, it is a network client/server based backup program.
147 Bacula is relatively easy to use and efficient, while offering many
148 advanced storage management features that make it easy to find and
149 recover lost or damaged files.
151 %description common -l pl.UTF-8
152 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
154 Bacula to zbiór programów umożliwiających administratorowi na
155 zarządzanie kopiami zapasowymi, odzyskiwaniem i weryfikacją danych w
156 sieci komputerów różnego rodzaju. W terminologii technicznej jest to
157 program do kopii zapasowych pracujący w architekturze klient-serwer.
158 Bacula jest stosunkowo łatwa w użyciu i wydajna, oferując przy tym
159 wiele zaawansowanych możliwości przy zarządzaniu nośnikami,
160 ułatwiających znalezienie i odzyskanie utraconych lub uszkodzonych
164 Summary: Bacula Director and Catalog services
165 Summary(pl.UTF-8): Usługi Bacula Director i Catalog
166 Group: Networking/Utilities
167 Requires(post): sed >= 4.0
168 Requires: %{name}-common = %{version}-%{release}
169 Requires: bacula-db = %{version}-%{release}
170 Requires: systemd-units >= 38
171 Obsoletes: bacula-updatedb
174 Bacula - It comes by night and sucks the vital essence from your
177 Bacula Director is the program that supervises all the backup,
178 restore, verify and archive operations. The system administrator uses
179 the Bacula Director to schedule backups and to recover files. Catalog
180 services are comprised of the software programs responsible for
181 maintaining the file indexes and volume databases for all files backed
182 up. The Catalog services permit the System Administrator or user to
183 quickly locate and restore any desired file, since it maintains a
184 record of all Volumes used, all Jobs run, and all Files saved.
186 %description dir -l pl.UTF-8
187 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
189 Bacula Director to program nadzorujący wszystkie operacje wykonywania
190 kopii zapasowych, odzyskiwania, weryfikacji i archiwizowania.
191 Administrator używa Bacula Directora do szeregowania kopii zapasowych
192 oraz odzyskiwania plików. Usługi katalogowe (Catalog services) są
193 używane przez programy odpowiedzialne za zarządzanie indeksami plików
194 i bazą danych wolumenów dla wszystkich kopiowanych plików. Usługi
195 katalogowe umożliwiają administratorowi lub użytkownikowi szybko
196 zlokalizować i odtworzyć dowolny plik, ponieważ utrzymują rekord ze
197 wszystkimi używanymi wolumenami, uruchomionymi zadaniami i zapisanymi
201 Summary: Bacula Console
202 Summary(pl.UTF-8): Konsola Baculi
203 Group: Networking/Utilities
204 Requires(post): sed >= 4.0
205 Requires: %{name}-common = %{version}-%{release}
208 Bacula - It comes by night and sucks the vital essence from your
211 Bacula Console is the program that allows the administrator or user to
212 communicate with the Bacula Director. This is the text only console
215 %description console -l pl.UTF-8
216 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
218 Bacula Console to program umożliwiający administratorowi lub
219 użytkownikowi komunikowanie się z programem Bacula Director. To jest
220 interfejs czysto tekstowy.
223 Summary: bat – The Bacula Administration Tool
224 Summary(pl.UTF-8): bat – narzędzie administratora Baculi
225 Group: Networking/Utilities
226 Requires(post): sed >= 4.0
227 Requires: %{name}-common = %{version}-%{release}
230 %description console-qt
231 Bacula - It comes by night and sucks the vital essence from your
234 bat is short for Bacula Administration Tool. It is a GUI form of
235 bconsole, but with many additional features.
237 %description console-qt -l pl.UTF-8
238 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
240 bat, czyli Bacula Administration Tool, jest graficznym odpowiednikiem
241 bconsole, z wieloma dodatkowymi funkcjami.
243 %package tray-monitor
244 Summary: Bacula Tray Monitor
245 Group: Networking/Utilities
246 Requires(post): sed >= 4.0
247 Requires: %{name}-common = %{version}-%{release}
249 %description tray-monitor
250 Bacula - It comes by night and sucks the vital essence from your
253 The Monitor program is typically an icon in the system tray. However,
254 once the icon is expanded into a full window, the administrator or
255 user can obtain status information about the Director or the backup
256 status on the local workstation or any other Bacula daemon that is
260 Summary: Bacula File services (Client)
261 Summary(pl.UTF-8): Usługi Bacula File (klient)
262 Group: Networking/Utilities
263 Requires(post): sed >= 4.0
264 Requires: %{name}-common = %{version}-%{release}
265 Requires: systemd-units >= 38
268 Bacula - It comes by night and sucks the vital essence from your
271 Bacula File services (or Client program) is the software program that
272 is installed on the machine to be backed up. It is specific to the
273 operating system on which it runs and is responsible for providing the
274 file attributes and data when requested by the Director. The File
275 services are also responsible for the file system dependent part of
276 restoring the file attributes and data during a recovery operation.
277 This program runs as a daemon on the machine to be backed up, and in
278 some of the documentation, the File daemon is referred to as the
279 Client (for example in Bacula configuration file).
281 %description fd -l pl.UTF-8
282 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
284 Usługi Bacula File (inaczej program kliencki) to oprogramowanie, które
285 instaluje się na maszynach, z których mają być wykonywane kopie
286 zapasowe. Są one specyficzne dla systemu operacyjnego, pod którym
287 działa dana maszyna i odpowiadają za dostarczanie atrybutów i danych
288 plików na żądanie Directora. Usługi plikowe są także odpowiedzialne za
289 zależną od systemu plików część odzyskiwania atrybutów i danych plików
290 podczas operacji odzyskiwania danych. Program działa jako demon na
291 maszynie, która ma być backupowana i w części dokumentacji demon ten
292 (File) jest nazywany klientem (na przykład w pliku konfiguracyjnym
296 Summary: Bacula Storage services
297 Summary(pl.UTF-8): Usługi Bacula Storage
298 Group: Networking/Utilities
299 Requires(post): sed >= 4.0
300 Requires: %{name}-common = %{version}-%{release}
301 Requires: systemd-units >= 38
303 Conflicts: dvd+rw-tools <= 5.21.4.10.8-1
306 Bacula - It comes by night and sucks the vital essence from your
309 Bacula Storage services consist of the software programs that perform
310 the storage and recovery of the file attributes and data to the
311 physical backup media or volumes. In other words, the Storage daemon
312 is responsible for reading and writing your tapes (or other storage
313 media, e.g. files). The Storage services runs as a daemon on the
314 machine that has the backup device (usually a tape drive).
316 %description sd -l pl.UTF-8
317 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
319 Usługi Bacula Storage składają się z programów obsługujących
320 przechowywanie danych oraz odzyskiwanie atrybutów i danych na
321 fizycznych nośnikach lub wolumenach. Innymi słowy, demon Storage jest
322 odpowiedzialny za odczyt i zapis taśm (lub innych nośników do
323 przechowywania danych, np. plików). Usługi Storage działają jako demon
324 na maszynie, która zawiera urządzenie backupowe (zwykle napęd
327 %package db-postgresql
328 Summary: PostgreSQL database driver for Bacula
329 Summary(pl.UTF-8): Sterownik bazy PostgreSQL dla Baculi
330 Group: Networking/Utilities
331 Requires(post): /sbin/ldconfig
332 Requires: %{name}-common = %{version}-%{release}
333 Provides: bacula-db = %{version}-%{release}
336 %description db-postgresql
337 PostgreSQL database driver for Bacula.
339 %description db-postgresql -l pl.UTF-8
340 Sterownik bazy PostgreSQL dla Baculi.
343 Summary: MySQL database driver for Bacula
344 Summary(pl.UTF-8): Sterownik bazy MySQL dla Baculi
345 Group: Networking/Utilities
346 Requires(post): /sbin/ldconfig
347 Requires: %{name}-common = %{version}-%{release}
348 Provides: bacula-db = %{version}-%{release}
351 %description db-mysql
352 MySQL database driver for Bacula.
354 %description db-mysql -l pl.UTF-8
355 Sterownik bazy MySQL dla Baculi.
358 Summary: SQLite database driver for Bacula
359 Summary(pl.UTF-8): Sterownik bazy SQLite dla Baculi
360 Group: Networking/Utilities
361 Requires(post): /sbin/ldconfig
362 Requires: %{name}-common = %{version}-%{release}
363 Provides: bacula-db = %{version}-%{release}
366 %description db-sqlite3
367 SQLite database driver for Bacula.
369 %description db-sqlite3 -l pl.UTF-8
370 Sterownik bazy SQLite dla Baculi.
372 %package -n nagios-plugin-check_bacula
373 Summary: Nagios plugin to check bacula
375 Requires: nagios-common
377 %description -n nagios-plugin-check_bacula
378 Nagios plugin to check bacula.
380 %define _noautoreq libbaccats-%{version}.so
381 # provided by various db libraries as a symlink
394 cd libs3-%{libs3_version}
399 sed -i -e 's#bindir=.*#bindir=%{_bindir}#g' \
400 src/cats/create_* src/cats/delete_* src/cats/drop_* \
401 src/cats/grant_* src/cats/make_* src/cats/update_*
402 sed -i -e 's/@hostname@/--hostname--/' src/*/*.conf.in
403 sed -i -e 's/@basename@/--hostname--/' src/*/*.conf.in
407 %{__aclocal} -I bacula-macros -I gettext-macros -I libtool
408 ## $BUILD_DIR not seen by libtoolize, export it
409 #BUILD_DIR=.. %%{__libtoolize}
411 %{__autoconf} --prepend-include=$(pwd)/autoconf autoconf/configure.in > configure
414 cd libs3-%{libs3_version}
415 CFLAGS="%{rpmcflags} -Wno-stringop-overflow" make VERBOSE=1 build/lib/libs3.a
416 ln -s ../inc build/include
420 CPPFLAGS="-I/usr/include/ncurses -I%{_includedir}/readline"
421 CXXFLAGS="%{rpmcxxflags} -Wno-narrowing"
422 CFLAGS="%{rpmcflags} -Wno-narrowing"
425 QMAKE=%{_bindir}/qmake-qt5 \
428 --with-scriptdir=%{_libexecdir}/%{name} \
429 %{?with_qt:--enable-bat} \
431 --enable-smartalloc \
433 --with-tcp-wrappers \
434 --with-working-dir=%{_var}/lib/%{name} \
435 --with-dump-email="root@localhost" \
436 --with-job-email="root@localhost" \
437 --with-smtp-host=localhost \
438 --with-pid-dir=/var/run \
439 --with-subsys-dir=/var/lock/subsys \
440 --with-systemd=%{systemdunitdir} \
441 --enable-batch-insert \
442 %{?with_pgsql:--with-postgresql} \
443 %{?with_mysql:--with-mysql} \
444 %{?with_sqlite3:--with-sqlite3} \
445 %{?with_sqlite3_sync_off:--enable-extra-sqlite3-init="pragma synchronous=0;"} \
446 %{!?with_s3:--without-s3} \
447 %{?with_s3:--with-s3=$PWD/libs3-%{libs3_version}/build} \
448 --with-dir-password="#FAKE-dir-password#" \
449 --with-fd-password="#FAKE-fd-password#" \
450 --with-sd-password="#FAKE-sd-password#" \
451 --with-mon-dir-password="#FAKE-mon-dir-password#" \
452 --with-mon-fd-password="#FAKE-mon-fd-password#" \
453 --with-mon-sd-password="#FAKE-mon-sd-password#" \
463 %{?with_s3:S3_LIBS="$PWD/libs3-%{libs3_version}/build/lib/libs3.a $(pkg-config --libs libcurl libxml-2.0)"} \
465 # check for build errors
466 grep "Error in" log && exit 1
470 %{__make} -C examples/nagios/check_bacula
474 rm -rf $RPM_BUILD_ROOT
475 install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,logrotate.d,pam.d,sysconfig} \
476 $RPM_BUILD_ROOT{%{_pixmapsdir},%{_desktopdir}} \
477 $RPM_BUILD_ROOT{%{_mandir},%{_bindir},/var/log{,/archive}/bacula} \
478 $RPM_BUILD_ROOT%{systemdunitdir}
481 DESTDIR=$RPM_BUILD_ROOT
483 %{__make} -C src/stored install-aligned \
484 DESTDIR=$RPM_BUILD_ROOT
487 %{__make} -C src/stored install-cloud \
488 DESTDIR=$RPM_BUILD_ROOT
491 # create copies of make_catalog_backup for specific databases; zeore default one (will be ghost)
492 for database in %{databases}; do
493 sed -e "s#default_db_type=.*#default_db_type=${database}#g" \
494 $RPM_BUILD_ROOT%{_libexecdir}/%{name}/make_catalog_backup \
495 > $RPM_BUILD_ROOT%{_libexecdir}/%{name}/make_${database}_catalog_backup
496 chmod 755 $RPM_BUILD_ROOT%{_libexecdir}/%{name}/make_${database}_catalog_backup
498 :> $RPM_BUILD_ROOT%{_libexecdir}/%{name}/make_catalog_backup
500 # we use db dependant (at compile time) shell script only
501 rm $RPM_BUILD_ROOT%{_libexecdir}/%{name}/make_catalog_backup.pl
503 ## replace with empty file, replaced by ldconfig from each db-* package on intsall
504 rm $RPM_BUILD_ROOT%{_libdir}/libbaccats-%{version}.so
505 touch $RPM_BUILD_ROOT%{_libdir}/libbaccats-%{version}.so
507 install -p %{SOURCE10} $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-dir
508 install -p %{SOURCE11} $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-fd
509 install -p %{SOURCE12} $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-sd
510 cp -a %{SOURCE13} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}-dir
511 cp -a %{SOURCE14} $RPM_BUILD_ROOT/etc/sysconfig/bacula-dir
512 cp -a %{SOURCE15} $RPM_BUILD_ROOT/etc/sysconfig/bacula-fd
513 cp -a %{SOURCE16} $RPM_BUILD_ROOT/etc/sysconfig/bacula-sd
514 cp -a %{SOURCE17} $RPM_BUILD_ROOT%{systemdunitdir}/bacula-dir.service
515 cp -a %{SOURCE18} $RPM_BUILD_ROOT%{systemdunitdir}/bacula-fd.service
516 cp -a %{SOURCE19} $RPM_BUILD_ROOT%{systemdunitdir}/bacula-sd.service
519 # qmake somewhy does not always create install_bins target. install our own the bin
520 rm -f $RPM_BUILD_ROOT%{_sbindir}/bat
521 libtool --silent --mode=install install src/qt-console/bat $RPM_BUILD_ROOT%{_bindir}
522 cp -a scripts/bacula.png $RPM_BUILD_ROOT%{_pixmapsdir}/bacula.png
523 cp -a scripts/bat.desktop $RPM_BUILD_ROOT%{_desktopdir}
526 touch $RPM_BUILD_ROOT/var/log/bacula/log
528 # install the updatedb scripts for older versions that last full release
529 # 2.0 -> 3.0 : 10_to_11
530 # 5.0 -> 5.2 : 12_to_14
531 install -p updatedb/update_*_tables_10_to_11 $RPM_BUILD_ROOT%{_libexecdir}/%{name}
532 install -p updatedb/update_*_tables_11_to_12 $RPM_BUILD_ROOT%{_libexecdir}/%{name}
534 # place for site passwords
535 touch $RPM_BUILD_ROOT%{_sysconfdir}/{dir-password,fd-password,sd-password}
536 touch $RPM_BUILD_ROOT%{_sysconfdir}/{mon-dir-password,mon-fd-password,mon-sd-password}
538 mv $RPM_BUILD_ROOT%{_libexecdir}/%{name}/mtx-changer.conf $RPM_BUILD_ROOT%{_sysconfdir}/mtx-changer.conf
541 rm -f $RPM_BUILD_ROOT%{_libexecdir}/%{name}/{gconsole,startmysql,stopmysql,bacula,bconsole,fd}
543 rm $RPM_BUILD_ROOT%{_docdir}/bacula/ChangeLog
544 rm $RPM_BUILD_ROOT%{_docdir}/bacula/INSTALL
545 rm $RPM_BUILD_ROOT%{_docdir}/bacula/LICENSE
546 rm $RPM_BUILD_ROOT%{_docdir}/bacula/README
547 rm $RPM_BUILD_ROOT%{_docdir}/bacula/ReleaseNotes
548 rm $RPM_BUILD_ROOT%{_docdir}/bacula/VERIFYING
550 # startup scripts, those in /etc/rc.d/init.d are better
551 rm $RPM_BUILD_ROOT%{_sbindir}/bacula
552 rm $RPM_BUILD_ROOT%{_libexecdir}/%{name}/bacula-ctl-*
555 rm $RPM_BUILD_ROOT%{_libexecdir}/%{name}/btraceback.mdb
557 # rename to avoid possible conflicts
558 mv $RPM_BUILD_ROOT%{_sbindir}/{,bacula-}dbcheck
559 mv $RPM_BUILD_ROOT%{_mandir}/man8/{,bacula-}dbcheck.8.gz
561 # no -devel files packaged, so this is also useless
562 rm $RPM_BUILD_ROOT%{_libdir}/libbac{,cfg,find,sql,cats,sd}.{so,la}
563 rm $RPM_BUILD_ROOT%{_libdir}/bacula-sd-*-driver.so
564 %{?with_mysql:rm $RPM_BUILD_ROOT%{_libdir}/libbaccats-mysql.{la,so}}
565 %{?with_pgsql:rm $RPM_BUILD_ROOT%{_libdir}/libbaccats-postgresql.{la,so}}
566 %{?with_sqlite3:rm $RPM_BUILD_ROOT%{_libdir}/libbaccats-sqlite3.{la,so}}
569 install -d $RPM_BUILD_ROOT%{nagiosplugindir}
570 %{__make} -C examples/nagios/check_bacula install \
571 sbindir=%{nagiosplugindir} \
572 DESTDIR=$RPM_BUILD_ROOT
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
582 %define update_configs \
583 echo "Updating bacula passwords and names..." | %banner -a %{name} \
585 for f in *-password; do \
586 if [ ! -s $f ]; then \
587 openssl rand -base64 33 > $f \
590 for cf in *.conf *.conf.rpmnew; do \
591 [ -f $cf ] && sed -i -e"s:#FAKE-$f#:$p:" "$cf" || : \
594 for cf in *.conf *.conf.rpmnew; do \
595 [ -f $cf ] && sed -i -e"s:--hostname--:`hostname`:" "$cf" || : \
604 if [ "$1" = "0" ]; then
609 %triggerpostun dir -- %{name}-dir < %{version}-0
610 %banner bacula-dir -t3 <<EOF
611 You have upgraded from an older version of Bacula director.
613 You will probably need to call %{_libexecdir}/%{name}/update_bacula_tables
614 script to upgrade the database.
616 Ensure you database partition has enough free space before you run the upgrade,
617 i.e check that there is enough room to rebuild 'File' table (it is the largest
624 /sbin/chkconfig --add bacula-dir
625 %service bacula-dir restart "Bacula Director daemon"
626 %systemd_post bacula-dir.service
629 if [ "$1" = "0" ]; then
630 %service bacula-dir stop
631 /sbin/chkconfig --del bacula-dir
633 %systemd_preun bacula-dir.service
640 /sbin/chkconfig --add bacula-fd
641 %service bacula-fd restart "Bacula File daemon"
642 %systemd_post bacula-fd.service
645 if [ "$1" = "0" ]; then
646 %service bacula-fd stop
647 /sbin/chkconfig --del bacula-fd
649 %systemd_preun bacula-fd.service
656 /sbin/chkconfig --add bacula-sd
657 %service bacula-sd restart "Bacula Storage daemon"
658 %systemd_post bacula-sd.service
661 if [ "$1" = "0" ]; then
662 %service bacula-sd stop
663 /sbin/chkconfig --del bacula-sd
665 %systemd_preun bacula-sd.service
671 if [ -e %{_sysconfdir}/console.conf -a ! -e %{_sysconfdir}/bconsole.conf ]; then
672 mv %{_sysconfdir}/console.conf %{_sysconfdir}/bconsole.conf
678 %triggerpostun common -- %{name}-common < 5.0.1-2
679 find %{_sysconfdir}/bat.conf* -perm /007 -print0 2>/dev/null | xargs -0 -r chmod 600 || :
689 for name in "create database" "drop tables" "drop database" "grant privileges" "make tables" "update tables"; do \
690 prefix="${name%% *}" \
691 suffix="${name#* }" \
692 ln -sf "${prefix}_%{1}_${suffix}" %{_libexecdir}/%{name}/"${prefix}_bacula_${suffix}" || : \
694 ln -sf "make_%{1}_catalog_backup" %{_libexecdir}/%{name}/make_catalog_backup || : \
695 ln -sf libbaccats-%{1}-%{version}.so %{_libdir}/libbaccats-%{version}.so || : \
696 %service bacula-dir restart "Bacula Director daemon"
701 %postun db-postgresql -p /sbin/ldconfig
706 %postun db-mysql -p /sbin/ldconfig
711 %postun db-sqlite3 -p /sbin/ldconfig
714 %defattr(644,root,root,755)
717 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*-password
718 # do not remove bsmtp from files. Fix build if it is not installed.
719 %attr(755,root,root) %{_sbindir}/bsmtp
720 %attr(755,root,root) %{_sbindir}/btraceback
721 %attr(755,root,root) %{_libdir}/libbac-11*.so
722 %attr(755,root,root) %{_libdir}/libbacsd-11*.so
723 %attr(755,root,root) %{_libdir}/libbaccfg-11*.so
724 %attr(755,root,root) %{_libdir}/libbacfind-11*.so
725 %attr(755,root,root) %{_libdir}/libbacsql-11*.so
726 %{_mandir}/man8/bacula.8*
727 %{_mandir}/man1/bsmtp.1*
728 %{_mandir}/man8/btraceback.8*
729 %dir %{_libexecdir}/%{name}
730 %{_libexecdir}/%{name}/btraceback.dbx
731 %{_libexecdir}/%{name}/btraceback.gdb
732 %{_libexecdir}/%{name}/bacula_config
733 %attr(770,root,bacula) %dir %{_localstatedir}
734 %attr(750,bacula,logs) %dir /var/log/bacula
735 %attr(640,bacula,logs) %ghost /var/log/bacula/log
736 %attr(750,bacula,logs) %dir /var/log/archive/bacula
739 %defattr(644,root,root,755)
740 %doc ChangeLog ReleaseNotes LICENSE
741 #%doc examples %{name}-docs-%{version}/manual/{*.pdf,bacula}
742 %attr(640,root,bacula) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bacula-dir.conf
743 %attr(640,root,root) %config(noreplace) /etc/logrotate.d/bacula-dir
744 %attr(754,root,root) /etc/rc.d/init.d/bacula-dir
745 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/bacula-dir
746 %{systemdunitdir}/bacula-dir.service
747 %attr(755,root,root) %{_sbindir}/bacula-dir
748 %attr(755,root,root) %{_sbindir}/bdirjson
749 %attr(755,root,root) %{_sbindir}/bregex
750 %attr(755,root,root) %{_sbindir}/bwild
751 %attr(755,root,root) %{_sbindir}/bacula-dbcheck
752 %{_mandir}/man8/bacula-dir.8*
753 %{_mandir}/man8/bacula-dbcheck.8*
754 %{_mandir}/man8/bregex.8*
755 %{_mandir}/man8/bwild.8*
756 %{_libexecdir}/%{name}/query.sql
757 %attr(755,root,root) %{_libexecdir}/%{name}/delete_catalog_backup
761 %defattr(644,root,root,755)
762 %attr(755,root,root) %{_libexecdir}/%{name}/create_postgresql_database
763 %attr(755,root,root) %{_libexecdir}/%{name}/drop_postgresql_database
764 %attr(755,root,root) %{_libexecdir}/%{name}/drop_postgresql_tables
765 %attr(755,root,root) %{_libexecdir}/%{name}/grant_postgresql_privileges
766 %attr(755,root,root) %{_libexecdir}/%{name}/make_postgresql_tables
767 %attr(755,root,root) %{_libexecdir}/%{name}/update_postgresql_*
768 %attr(755,root,root) %{_libexecdir}/%{name}/make_postgresql_catalog_backup
769 %attr(755,root,root) %{_libdir}/libbaccats-postgresql-11*.so
771 %ghost %attr(755,root,root) %{_libdir}/libbaccats-11*.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_mysql_database
785 %attr(755,root,root) %{_libexecdir}/%{name}/drop_mysql_database
786 %attr(755,root,root) %{_libexecdir}/%{name}/drop_mysql_tables
787 %attr(755,root,root) %{_libexecdir}/%{name}/grant_mysql_privileges
788 %attr(755,root,root) %{_libexecdir}/%{name}/make_mysql_tables
789 %attr(755,root,root) %{_libexecdir}/%{name}/update_mysql_*
790 %attr(755,root,root) %{_libexecdir}/%{name}/make_mysql_catalog_backup
791 %attr(755,root,root) %{_libdir}/libbaccats-mysql-11*.so
793 %ghost %attr(755,root,root) %{_libdir}/libbaccats-11*.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
805 %defattr(644,root,root,755)
806 %attr(755,root,root) %{_libexecdir}/%{name}/create_sqlite3_database
807 %attr(755,root,root) %{_libexecdir}/%{name}/drop_sqlite3_database
808 %attr(755,root,root) %{_libexecdir}/%{name}/drop_sqlite3_tables
809 %attr(755,root,root) %{_libexecdir}/%{name}/grant_sqlite3_privileges
810 %attr(755,root,root) %{_libexecdir}/%{name}/make_sqlite3_tables
811 %attr(755,root,root) %{_libexecdir}/%{name}/update_sqlite3_*
812 %attr(755,root,root) %{_libexecdir}/%{name}/make_sqlite3_catalog_backup
813 %attr(755,root,root) %{_libdir}/libbaccats-sqlite3-11*.so
815 %ghost %attr(755,root,root) %{_libdir}/libbaccats-11*.so
816 %ghost %{_libexecdir}/%{name}/create_bacula_database
817 %ghost %{_libexecdir}/%{name}/drop_bacula_tables
818 %ghost %{_libexecdir}/%{name}/drop_bacula_database
819 %ghost %{_libexecdir}/%{name}/grant_bacula_privileges
820 %ghost %{_libexecdir}/%{name}/make_bacula_tables
821 %ghost %{_libexecdir}/%{name}/update_bacula_tables
822 %ghost %{_libexecdir}/%{name}/make_catalog_backup
826 %defattr(644,root,root,755)
828 %attr(640,root,bacula) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bacula-fd.conf
829 %attr(754,root,root) /etc/rc.d/init.d/bacula-fd
830 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/bacula-fd
831 %{systemdunitdir}/bacula-fd.service
832 %attr(755,root,root) %{_sbindir}/bacula-fd
833 %attr(755,root,root) %{_sbindir}/bfdjson
834 %attr(755,root,root) %{_libdir}/bpipe-fd.so
835 %{_mandir}/man8/bacula-fd.8*
838 %defattr(644,root,root,755)
840 %attr(640,root,bacula) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bacula-sd.conf
841 %attr(640,root,bacula) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mtx-changer.conf
842 %attr(754,root,root) /etc/rc.d/init.d/bacula-sd
843 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/bacula-sd
844 %{systemdunitdir}/bacula-sd.service
845 %attr(755,root,root) %{_sbindir}/bacula-sd
846 %attr(755,root,root) %{_sbindir}/bcopy
847 %attr(755,root,root) %{_sbindir}/bextract
848 %attr(755,root,root) %{_sbindir}/bls
849 %attr(755,root,root) %{_sbindir}/bscan
850 %attr(755,root,root) %{_sbindir}/bsdjson
851 %attr(755,root,root) %{_sbindir}/btape
852 %attr(755,root,root) %{_libexecdir}/%{name}/baculabackupreport
853 %attr(755,root,root) %{_libexecdir}/%{name}/bacula-tray-monitor.desktop
854 %attr(755,root,root) %{_libexecdir}/%{name}/disk-changer
855 %attr(755,root,root) %{_libexecdir}/%{name}/isworm
856 %attr(755,root,root) %{_libexecdir}/%{name}/mtx-changer
857 %attr(755,root,root) %{_libexecdir}/%{name}/tapealert
858 %attr(755,root,root) %{_libdir}/bacula-sd-aligned-driver-11.*.so
860 %attr(755,root,root) %{_libdir}/bacula-sd-cloud-driver-11.*.so
863 %{_mandir}/man8/bacula-sd.8*
864 %{_mandir}/man8/bcopy.8*
865 %{_mandir}/man8/bextract.8*
866 %{_mandir}/man8/bls.8*
867 %{_mandir}/man8/bscan.8*
868 %{_mandir}/man8/btape.8*
871 %defattr(644,root,root,755)
873 %attr(640,root,bacula) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bconsole.conf
874 %attr(755,root,root) %{_sbindir}/bconsole
875 %attr(755,root,root) %{_sbindir}/bbconsjson
876 %{_mandir}/man8/bconsole.8*
880 %defattr(644,root,root,755)
882 %{_pixmapsdir}/%{name}.png
883 %{_desktopdir}/bat.desktop
884 # Do not make this file world-readable or any user will get full access to the
886 %attr(640,root,bacula) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bat.conf
887 %attr(755,root,root) %{_bindir}/bat
888 %{_mandir}/man1/bat.1*
893 %files -n nagios-plugin-check_bacula
894 %defattr(644,root,root,755)
895 %attr(755,root,root) %{nagiosplugindir}/check_bacula