2 # - update desktop files, think about su-wrappers for console (with .desktop files)
3 # - fix log file permissions
4 # - check on upgrade (5.0 and 5.2 databases are NOT compatible)
7 %bcond_without wx # wx-console program
8 %bcond_without gtk # the GTK tray-monitor and wx-console
9 %if "%{pld_release}" == "ac"
10 %bcond_with qt # BAT / qt-console Qt4 GUI
12 %bcond_without qt # BAT / qt-console Qt4 GUI
14 %bcond_without mysql # use MySQL
15 %bcond_without pgsql # use PostgreSQL
16 %bcond_without sqlite3 # use SQLite3
17 %bcond_without python # Python Scripting support, http://www.bacula.org/3.0.x-manuals/en/concepts/concepts/Python_Scripting.html
18 %bcond_without nagios # build nagios plugin
20 %bcond_with sqlite3_sync_off # makes SQLite3 backend much faster, but less reliable
22 %if %{without sqlite3}
23 %undefine with_sqlite3_sync_off
31 Summary: Bacula - The Network Backup Solution
32 Summary(pl.UTF-8): Bacula - rozwiązanie do wykonywania kopii zapasowych po sieci
37 Group: Networking/Utilities
38 Source0: http://downloads.sourceforge.net/bacula/%{name}-%{version}.tar.gz
39 # Source0-md5: 43417bae0c221afb1f30a581c9e0f2fe
40 Source1: http://downloads.sourceforge.net/bacula/%{name}-docs-%{version}.tar.bz2
41 # Source1-md5: 0e7af41cc3b1c59662457679b02bf873
42 Source2: http://downloads.sourceforge.net/bacula/%{name}-rescue-5.0.1.tar.gz
43 # Source2-md5: bb194aed8e204f54bf2f61d7e721f257
44 Source10: %{name}-dir.init
45 Source11: %{name}-fd.init
46 Source12: %{name}-sd.init
47 Source13: %{name}.logrotate
48 Source14: %{name}-dir.sysconfig
49 Source15: %{name}-fd.sysconfig
50 Source16: %{name}-sd.sysconfig
51 Source17: %{name}-dir.service
52 Source18: %{name}-fd.service
53 Source19: %{name}-sd.service
54 Patch0: %{name}-mtx-changer.patch
55 Patch1: %{name}-branding.patch
56 Patch2: %{name}-conf.patch
57 Patch3: %{name}-desktop.patch
58 Patch4: make_catalog_backup-setup-home.patch
59 Patch5: %{name}-wx-console-build.patch
60 URL: http://www.bacula.org/
61 BuildRequires: acl-devel
62 BuildRequires: autoconf
63 BuildRequires: automake
64 BuildRequires: gettext-devel
65 %{?with_gtk:BuildRequires: gtk+2-devel}
66 BuildRequires: libcap-devel
67 BuildRequires: libtool >= 2:2.2
69 BuildRequires: fakeroot
71 BuildRequires: libwrap-devel
72 BuildRequires: ncurses-devel
73 BuildRequires: openssl-devel
74 BuildRequires: pkgconfig
76 BuildRequires: python-devel
77 BuildRequires: python-modules
80 BuildRequires: QtCore-devel
81 BuildRequires: QtGui-devel
82 BuildRequires: qt4-build >= %{qtver}
83 BuildRequires: qt4-qmake >= %{qtver}
85 %{?with_mysql:BuildRequires: mysql-devel}
86 %{?with_pgsql:BuildRequires: postgresql-devel}
87 BuildRequires: readline-devel
88 BuildRequires: rpm >= 4.4.9-56
89 BuildRequires: rpm-pythonprov
90 BuildRequires: rpmbuild(macros) >= 1.644
91 BuildRequires: sed >= 4.0
92 %{?with_sqlite3:BuildRequires: sqlite3-devel}
93 Requires: systemd-units >= 38
96 BuildRequires: wxGTK2-unicode-devel >= 2.4.0
98 BuildRequires: zlib-devel
99 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
101 %define _sysconfdir /etc/%{name}
102 %define _localstatedir /var/lib/%{name}
103 %define nagiosplugindir %{_libdir}/nagios/plugins
105 # db packages contain duplicates
106 %define _duplicate_files_terminate_build 0
108 # from 'the worst' to 'the best'
109 %define databases %{?with_sqlite3:sqlite3} %{?with_mysql:mysql} %{?with_pgsql:postgresql}
111 # dependency section is broken. ccache usage is instead to makefiles
112 %undefine with_ccache
115 Bacula - It comes by night and sucks the vital essence from your
118 Bacula is a set of computer programs that permit you (or the system
119 administrator) to manage backup, recovery, and verification of
120 computer data across a network of computers of different kinds. In
121 technical terms, it is a network client/server based backup program.
122 Bacula is relatively easy to use and efficient, while offering many
123 advanced storage management features that make it easy to find and
124 recover lost or damaged files.
126 %description -l pl.UTF-8
127 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
129 Bacula to zbiór programów umożliwiających administratorowi na
130 zarządzanie kopiami zapasowymi, odzyskiwaniem i weryfikacją danych w
131 sieci komputerów różnego rodzaju. W terminologii technicznej jest to
132 program do kopii zapasowych pracujący w architekturze klient-serwer.
133 Bacula jest stosunkowo łatwa w użyciu i wydajna, oferując przy tym
134 wiele zaawansowanych możliwości przy zarządzaniu nośnikami,
135 ułatwiających znalezienie i odzyskanie utraconych lub uszkodzonych
139 Summary: Common files for bacula package
140 Summary(pl.UTF-8): Pliki wspólne dla pakietu bacula
141 Group: Networking/Utilities
142 Requires(post): openssl-tools
143 Requires(post): sed >= 4.0
144 Requires(post,preun): /sbin/chkconfig
145 Requires(postun): /usr/sbin/groupdel
146 Requires(postun): /usr/sbin/userdel
147 Requires(pre): /usr/sbin/groupadd
148 Requires(pre): /usr/sbin/useradd
149 Conflicts: bacula-console < 0:1.34.6
150 Conflicts: bacula-dir < 0:1.34.6
151 Conflicts: bacula-fd < 0:1.34.6
152 Conflicts: bacula-sd < 0:1.34.6
153 Conflicts: logrotate < 3.8.0
156 Bacula - It comes by night and sucks the vital essence from your
159 Bacula is a set of computer programs that permit you (or the system
160 administrator) to manage backup, recovery, and verification of
161 computer data across a network of computers of different kinds. In
162 technical terms, it is a network client/server based backup program.
163 Bacula is relatively easy to use and efficient, while offering many
164 advanced storage management features that make it easy to find and
165 recover lost or damaged files.
167 %description common -l pl.UTF-8
168 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
170 Bacula to zbiór programów umożliwiających administratorowi na
171 zarządzanie kopiami zapasowymi, odzyskiwaniem i weryfikacją danych w
172 sieci komputerów różnego rodzaju. W terminologii technicznej jest to
173 program do kopii zapasowych pracujący w architekturze klient-serwer.
174 Bacula jest stosunkowo łatwa w użyciu i wydajna, oferując przy tym
175 wiele zaawansowanych możliwości przy zarządzaniu nośnikami,
176 ułatwiających znalezienie i odzyskanie utraconych lub uszkodzonych
180 Summary: Bacula Director and Catalog services
181 Summary(pl.UTF-8): Usługi Bacula Director i Catalog
182 Group: Networking/Utilities
183 Requires(post): sed >= 4.0
184 Requires: %{name}-common = %{version}-%{release}
185 Requires: bacula(db) = %{version}-%{release}
186 Obsoletes: bacula-updatedb
189 Bacula - It comes by night and sucks the vital essence from your
192 Bacula Director is the program that supervises all the backup,
193 restore, verify and archive operations. The system administrator uses
194 the Bacula Director to schedule backups and to recover files. Catalog
195 services are comprised of the software programs responsible for
196 maintaining the file indexes and volume databases for all files backed
197 up. The Catalog services permit the System Administrator or user to
198 quickly locate and restore any desired file, since it maintains a
199 record of all Volumes used, all Jobs run, and all Files saved.
201 %description dir -l pl.UTF-8
202 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
204 Bacula Director to program nadzorujący wszystkie operacje wykonywania
205 kopii zapasowych, odzyskiwania, weryfikacji i archiwizowania.
206 Administrator używa Bacula Directora do szeregowania kopii zapasowych
207 oraz odzyskiwania plików. Usługi katalogowe (Catalog services) są
208 używane przez programy odpowiedzialne za zarządzanie indeksami plików
209 i bazą danych wolumenów dla wszystkich kopiowanych plików. Usługi
210 katalogowe umożliwiają administratorowi lub użytkownikowi szybko
211 zlokalizować i odtworzyć dowolny plik, ponieważ utrzymują rekord ze
212 wszystkimi używanymi wolumenami, uruchomionymi zadaniami i zapisanymi
216 Summary: Bacula Console
217 Summary(pl.UTF-8): Konsola Baculi
218 Group: Networking/Utilities
219 Requires(post): sed >= 4.0
220 Requires: %{name}-common = %{version}-%{release}
223 Bacula - It comes by night and sucks the vital essence from your
226 Bacula Console is the program that allows the administrator or user to
227 communicate with the Bacula Director. This is the text only console
230 %description console -l pl.UTF-8
231 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
233 Bacula Console to program umożliwiający administratorowi lub
234 użytkownikowi komunikowanie się z programem Bacula Director. To jest
235 interfejs czysto tekstowy.
238 Summary: Bacula wxWidgets Console
239 Summary(pl.UTF-8): Konsola Baculi oparta na wxWidgets
240 Group: Networking/Utilities
241 Requires(post): sed >= 4.0
242 Requires: %{name}-common = %{version}-%{release}
244 %description console-wx
245 Bacula - It comes by night and sucks the vital essence from your
248 Bacula Console is the program that allows the administrator or user to
249 communicate with the Bacula Director. This is the wxWidgets GUI
252 %description console-wx -l pl.UTF-8
253 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
255 Bacula Console to program umożliwiający administratorowi lub
256 użytkownikowi komunikowanie się z programem Bacula Director. To jest
257 interfejs graficzny oparty na wxWidgets.
260 Summary: Bacula Qt4 Console
261 Summary(pl.UTF-8): Konsola Baculi oparta na Qt4
262 Group: Networking/Utilities
263 Requires(post): sed >= 4.0
264 Requires: %{name}-common = %{version}-%{release}
265 Requires: QtCore >= %{qtver}
267 %description console-qt4
268 Bacula - It comes by night and sucks the vital essence from your
271 Bacula Console is the program that allows the administrator or user to
272 communicate with the Bacula Director. This is the Qt4 GUI interface.
274 %description console-qt4 -l pl.UTF-8
275 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
277 Bacula Console to program umożliwiający administratorowi lub
278 użytkownikowi komunikowanie się z programem Bacula Director. To jest
279 interfejs graficzny oparty na Qt4.
281 %package tray-monitor
282 Summary: Bacula Tray Monitor
283 Group: Networking/Utilities
284 Requires(post): sed >= 4.0
285 Requires: %{name}-common = %{version}-%{release}
287 %description tray-monitor
288 Bacula - It comes by night and sucks the vital essence from your
291 The Monitor program is typically an icon in the system tray. However,
292 once the icon is expanded into a full window, the administrator or
293 user can obtain status information about the Director or the backup
294 status on the local workstation or any other Bacula daemon that is
298 Summary: Bacula File services (Client)
299 Summary(pl.UTF-8): Usługi Bacula File (klient)
300 Group: Networking/Utilities
301 Requires(post): sed >= 4.0
302 Requires: %{name}-common = %{version}-%{release}
305 Bacula - It comes by night and sucks the vital essence from your
308 Bacula File services (or Client program) is the software program that
309 is installed on the machine to be backed up. It is specific to the
310 operating system on which it runs and is responsible for providing the
311 file attributes and data when requested by the Director. The File
312 services are also responsible for the file system dependent part of
313 restoring the file attributes and data during a recovery operation.
314 This program runs as a daemon on the machine to be backed up, and in
315 some of the documentation, the File daemon is referred to as the
316 Client (for example in Bacula configuration file).
318 %description fd -l pl.UTF-8
319 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
321 Usługi Bacula File (inaczej program kliencki) to oprogramowanie, które
322 instaluje się na maszynach, z których mają być wykonywane kopie
323 zapasowe. Są one specyficzne dla systemu operacyjnego, pod którym
324 działa dana maszyna i odpowiadają za dostarczanie atrybutów i danych
325 plików na żądanie Directora. Usługi plikowe są także odpowiedzialne za
326 zależną od systemu plików część odzyskiwania atrybutów i danych plików
327 podczas operacji odzyskiwania danych. Program działa jako demon na
328 maszynie, która ma być backupowana i w części dokumentacji demon ten
329 (File) jest nazywany klientem (na przykład w pliku konfiguracyjnym
333 Summary: Bacula Storage services
334 Summary(pl.UTF-8): Usługi Bacula Storage
335 Group: Networking/Utilities
336 Requires(post): sed >= 4.0
337 Requires: %{name}-common = %{version}-%{release}
338 Conflicts: dvd+rw-tools <= 5.21.4.10.8-1
342 Bacula - It comes by night and sucks the vital essence from your
345 Bacula Storage services consist of the software programs that perform
346 the storage and recovery of the file attributes and data to the
347 physical backup media or volumes. In other words, the Storage daemon
348 is responsible for reading and writing your tapes (or other storage
349 media, e.g. files). The Storage services runs as a daemon on the
350 machine that has the backup device (usually a tape drive).
352 %description sd -l pl.UTF-8
353 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
355 Usługi Bacula Storage składają się z programów obsługujących
356 przechowywanie danych oraz odzyskiwanie atrybutów i danych na
357 fizycznych nośnikach lub wolumenach. Innymi słowy, demon Storage jest
358 odpowiedzialny za odczyt i zapis taśm (lub innych nośników do
359 przechowywania danych, np. plików). Usługi Storage działają jako demon
360 na maszynie, która zawiera urządzenie backupowe (zwykle napęd
363 %package db-postgresql
364 Summary: PostgreSQL database driver for Bacula
365 Summary(pl.UTF-8): Sterownik bazy PostgreSQL dla Baculi
366 Group: Networking/Utilities
367 Requires(post): /sbin/ldconfig
368 Requires: %{name}-common = %{version}-%{release}
369 Provides: bacula(db) = %{version}-%{release}
370 Obsoletes: bacula(db)
372 %description db-postgresql
373 PostgreSQL database driver for Bacula.
375 %description db-postgresql -l pl.UTF-8
376 Sterownik bazy PostgreSQL dla Baculi.
379 Summary: MySQL database driver for Bacula
380 Summary(pl.UTF-8): Sterownik bazy MySQL dla Baculi
381 Group: Networking/Utilities
382 Requires(post): /sbin/ldconfig
383 Requires: %{name}-common = %{version}-%{release}
384 Provides: bacula(db) = %{version}-%{release}
385 Obsoletes: bacula(db)
387 %description db-mysql
388 MySQL database driver for Bacula.
390 %description db-mysql -l pl.UTF-8
391 Sterownik bazy MySQL dla Baculi.
394 Summary: SQLite database driver for Bacula
395 Summary(pl.UTF-8): Sterownik bazy SQLite dla Baculi
396 Group: Networking/Utilities
397 Requires(post): /sbin/ldconfig
398 Requires: %{name}-common = %{version}-%{release}
399 Provides: bacula(db) = %{version}-%{release}
400 Obsoletes: bacula(db)
402 %description db-sqlite3
403 SQLite database driver for Bacula.
405 %description db-sqlite3 -l pl.UTF-8
406 Sterownik bazy SQLite dla Baculi.
409 Summary: Bacula - The Network Backup Solution
410 Summary(pl.UTF-8): Bacula - rozwiązanie do wykonywania kopii zapasowych po sieci
411 Group: Networking/Utilities
412 Requires: %{name}-fd = %{version}-%{release}
417 Bacula - It comes by night and sucks the vital essence from your
420 Bacula is a set of computer programs that permit you (or the system
421 administrator) to manage backup, recovery, and verification of
422 computer data across a network of computers of different kinds. In
423 technical terms, it is a network client/server based backup program.
424 Bacula is relatively easy to use and efficient, while offering many
425 advanced storage management features that make it easy to find and
426 recover lost or damaged files.
428 This package installs scripts for disaster recovery and builds rescue
429 floppy disk for bare metal recovery.
431 %description rescue -l pl.UTF-8
432 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
434 Bacula to zbiór programów umożliwiających administratorowi na
435 zarządzanie kopiami zapasowymi, odzyskiwaniem i weryfikacją danych w
436 sieci komputerów różnego rodzaju. W terminologii technicznej jest to
437 program do kopii zapasowych pracujący w architekturze klient-serwer.
438 Bacula jest stosunkowo łatwa w użyciu i wydajna, oferując przy tym
439 wiele zaawansowanych możliwości przy zarządzaniu nośnikami,
440 ułatwiających znalezienie i odzyskanie utraconych lub uszkodzonych
443 Ten pakiet zawiera skrypty do odtwarzania po awarii i tworzy dyskietkę
444 ratunkowe do odtwarzania systemu od zera.
446 %package -n nagios-plugin-check_bacula
447 Summary: Nagios plugin to check bacula
449 Requires: nagios-common
451 %description -n nagios-plugin-check_bacula
452 Nagios plugin to check bacula.
454 # provided by various db libraries as a symlink
455 %define _noautoreq libbaccats-%{version}.so
466 tar -xf %{SOURCE2} && ln -s bacula-rescue-* rescue
468 sed -i -e 's#bindir=.*#bindir=%{_bindir}#g' \
469 src/cats/create_* src/cats/delete_* src/cats/drop_* \
470 src/cats/grant_* src/cats/make_* src/cats/update_*
471 sed -i -e 's/@hostname@/--hostname--/' src/*/*.conf.in
472 sed -i -e 's/@basename@/--hostname--/' src/*/*.conf.in
476 %{__aclocal} -I bacula-macros -I gettext-macros
477 # $BUILD_DIR not seen by libtoolize, export it
478 BUILD_DIR=.. %{__libtoolize}
480 %{__autoconf} --prepend-include=$(pwd)/autoconf autoconf/configure.in > configure
482 CPPFLAGS="-I/usr/include/ncurses -I%{_includedir}/readline"
484 WXCONFIG=%{_bindir}/wx-gtk2-unicode-config \
485 QMAKE=%{_bindir}/qmake-qt4 \
487 --with-scriptdir=%{_libexecdir}/%{name} \
488 %{?with_qt:--enable-bat} \
490 --enable-smartalloc \
491 %{?with_wx:--enable-bwx-console} \
492 %{?with_gtk:--enable-tray-monitor} \
493 %{?with_python:--with-python} \
495 --with-tcp-wrappers \
496 --with-working-dir=%{_var}/lib/%{name} \
497 --with-dump-email="root@localhost" \
498 --with-job-email="root@localhost" \
499 --with-smtp-host=localhost \
500 --with-pid-dir=/var/run \
501 --with-subsys-dir=/var/lock/subsys \
502 --with-systemd=/lib/systemd/system \
503 --enable-batch-insert \
504 %{?with_pgsql:--with-postgresql} \
505 %{?with_mysql:--with-mysql} \
506 %{?with_sqlite3:--with-sqlite3} \
507 %{?with_sqlite3_sync_off:--enable-extra-sqlite3-init="pragma synchronous=0;"} \
508 --with-dir-password="#FAKE-dir-password#" \
509 --with-fd-password="#FAKE-fd-password#" \
510 --with-sd-password="#FAKE-sd-password#" \
511 --with-mon-dir-password="#FAKE-mon-dir-password#" \
512 --with-mon-fd-password="#FAKE-mon-fd-password#" \
513 --with-mon-sd-password="#FAKE-mon-sd-password#" \
522 %{__make} 2>&1 | tee log
523 # check for build errors
524 grep "Error in" log && exit 1
528 %{__make} -C examples/nagios/check_bacula
540 rm -rf $RPM_BUILD_ROOT
541 install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,logrotate.d,pam.d,sysconfig} \
542 $RPM_BUILD_ROOT%{_sysconfdir}/rescue \
543 $RPM_BUILD_ROOT{%{_pixmapsdir},%{_desktopdir}} \
544 $RPM_BUILD_ROOT{%{_mandir},%{_bindir},/var/log/bacula} \
545 $RPM_BUILD_ROOT%{systemdunitdir}
548 DESTDIR=$RPM_BUILD_ROOT
550 # create copies of make_catalog_backup for specific databases; zeore default one (will be ghost)
551 for database in %{databases}; do
552 sed -e "s#default_db_type=.*#default_db_type=${database}#g" \
553 $RPM_BUILD_ROOT%{_libdir}/%{name}/make_catalog_backup \
554 > $RPM_BUILD_ROOT%{_libdir}/%{name}/make_${database}_catalog_backup
555 chmod 755 $RPM_BUILD_ROOT%{_libdir}/%{name}/make_${database}_catalog_backup
557 :> $RPM_BUILD_ROOT%{_libdir}/%{name}/make_catalog_backup
559 # we use db dependant (at compile time) shell script only
560 rm $RPM_BUILD_ROOT%{_libexecdir}/%{name}/make_catalog_backup.pl
562 ## replace with empty file, replaced by ldconfig from each db-* package on intsall
563 rm $RPM_BUILD_ROOT%{_libdir}/libbaccats-%{version}.so
564 touch $RPM_BUILD_ROOT%{_libdir}/libbaccats-%{version}.so
566 install -p %{SOURCE10} $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-dir
567 install -p %{SOURCE11} $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-fd
568 install -p %{SOURCE12} $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-sd
569 cp -a %{SOURCE13} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}-dir
570 cp -a %{SOURCE14} $RPM_BUILD_ROOT/etc/sysconfig/bacula-dir
571 cp -a %{SOURCE15} $RPM_BUILD_ROOT/etc/sysconfig/bacula-fd
572 cp -a %{SOURCE16} $RPM_BUILD_ROOT/etc/sysconfig/bacula-sd
573 cp -a %{SOURCE17} $RPM_BUILD_ROOT%{systemdunitdir}/bacula-dir.service
574 cp -a %{SOURCE18} $RPM_BUILD_ROOT%{systemdunitdir}/bacula-fd.service
575 cp -a %{SOURCE19} $RPM_BUILD_ROOT%{systemdunitdir}/bacula-sd.service
578 cp -a scripts/bacula.png $RPM_BUILD_ROOT%{_pixmapsdir}/bacula.png
579 sed -e 's/gnome-console/wx-console/g;s/Console/Wx Console/g' \
580 scripts/wxconsole.desktop.consolehelper > $RPM_BUILD_ROOT%{_desktopdir}/bacula-wx.desktop
584 # qmake somewhy does not always create install_bins target. install our own the bin
585 rm -f $RPM_BUILD_ROOT%{_sbindir}/bat
586 libtool --silent --mode=install install src/qt-console/bat $RPM_BUILD_ROOT%{_bindir}
587 cp -a scripts/bacula.png $RPM_BUILD_ROOT%{_pixmapsdir}/bacula.png
588 cp -a scripts/bat.desktop $RPM_BUILD_ROOT%{_desktopdir}
592 # install the rescue stuff, these are the rescue scripts
593 cp -a rescue/linux/floppy/backup.etc.list $RPM_BUILD_ROOT%{_sysconfdir}/rescue
594 cp -a rescue/linux/floppy/sfdisk.bz2 $RPM_BUILD_ROOT%{_sysconfdir}/rescue
595 install -p rescue/linux/floppy/*_* $RPM_BUILD_ROOT%{_sysconfdir}/rescue
596 install -p rescue/linux/floppy/getdiskinfo $RPM_BUILD_ROOT%{_sysconfdir}/rescue
599 touch $RPM_BUILD_ROOT/var/log/bacula/log
601 # install the updatedb scripts for older versions that last full release
602 # 2.0 -> 3.0 : 10_to_11
603 # 5.0 -> 5.2 : 12_to_14
604 install -p updatedb/update_*_tables_10_to_11 $RPM_BUILD_ROOT%{_libexecdir}/%{name}
605 install -p updatedb/update_*_tables_11_to_12 $RPM_BUILD_ROOT%{_libexecdir}/%{name}
606 install -p updatedb/update_*_tables_12_to_14 $RPM_BUILD_ROOT%{_libexecdir}/%{name}
608 # place for site passwords
609 touch $RPM_BUILD_ROOT%{_sysconfdir}/{dir-password,fd-password,sd-password}
610 touch $RPM_BUILD_ROOT%{_sysconfdir}/{mon-dir-password,mon-fd-password,mon-sd-password}
612 mv $RPM_BUILD_ROOT%{_libexecdir}/%{name}/mtx-changer.conf $RPM_BUILD_ROOT%{_sysconfdir}/mtx-changer.conf
615 rm -f $RPM_BUILD_ROOT%{_libexecdir}/%{name}/{gconsole,startmysql,stopmysql,bacula,bconsole,fd}
617 rm -f $RPM_BUILD_ROOT%{_desktopdir}/bacula-wx.desktop
620 rm $RPM_BUILD_ROOT%{_docdir}/bacula/ChangeLog
621 rm $RPM_BUILD_ROOT%{_docdir}/bacula/INSTALL
622 rm $RPM_BUILD_ROOT%{_docdir}/bacula/LICENSE
623 rm $RPM_BUILD_ROOT%{_docdir}/bacula/README
624 rm $RPM_BUILD_ROOT%{_docdir}/bacula/ReleaseNotes
625 rm $RPM_BUILD_ROOT%{_docdir}/bacula/VERIFYING
626 rm $RPM_BUILD_ROOT%{_docdir}/bacula/technotes
628 # startup scripts, those in /etc/rc.d/init.d are better
629 rm $RPM_BUILD_ROOT%{_sbindir}/bacula
630 rm $RPM_BUILD_ROOT%{_libexecdir}/%{name}/bacula-ctl-*
633 rm $RPM_BUILD_ROOT%{_libexecdir}/%{name}/btraceback.mdb
635 # rename to avoid possible conflicts
636 mv $RPM_BUILD_ROOT%{_sbindir}/{,bacula-}dbcheck
637 mv $RPM_BUILD_ROOT%{_mandir}/man8/{,bacula-}dbcheck.8.gz
639 # no -devel files packaged, so this is also useless
640 rm $RPM_BUILD_ROOT%{_libdir}/libbac{,cfg,find,py,sql}.{so,la}
643 install -d $RPM_BUILD_ROOT%{nagiosplugindir}
644 %{__make} -C examples/nagios/check_bacula install \
645 sbindir=%{nagiosplugindir} \
646 INSTALL_PROGRAM="libtool --mode=install install -p" \
647 DESTDIR=$RPM_BUILD_ROOT
651 rm -rf $RPM_BUILD_ROOT
654 %groupadd -P %{name}-common -g 136 -r -f bacula
655 %useradd -P %{name}-common -u 136 -r -d /var/lib/bacula -s /bin/false -c "Bacula User" -g bacula bacula
657 %define update_configs \
658 echo "Updating bacula passwords and names..." | %banner -a %{name} \
660 for f in *-password; do \
661 if [ ! -s $f ]; then \
662 openssl rand -base64 33 > $f \
665 for cf in *.conf *.conf.rpmnew; do \
666 [ -f $cf ] && sed -i -e"s:#FAKE-$f#:$p:" "$cf" || : \
669 for cf in *.conf *.conf.rpmnew; do \
670 [ -f $cf ] && sed -i -e"s:--hostname--:`hostname`:" "$cf" || : \
679 if [ "$1" = "0" ]; then
684 %triggerpostun dir -- %{name}-dir < %{version}-0
685 %banner bacula-dir -t3 <<EOF
686 You have upgraded from an older version of Bacula director.
688 You will probably need to call %{_libexecdir}/%{name}/update_bacula_tables
689 script to upgrade the database.
691 Ensure you database partition has enough free space before you run the upgrade,
692 i.e check that there is enough room to rebuild 'File' table (it is the largest
699 /sbin/chkconfig --add bacula-dir
700 %service bacula-dir restart "Bacula Director daemon"
701 %systemd_post bacula-dir.service
704 if [ "$1" = "0" ]; then
705 %service bacula-dir stop
706 /sbin/chkconfig --del bacula-dir
708 %systemd_preun bacula-dir.service
715 /sbin/chkconfig --add bacula-fd
716 %service bacula-fd restart "Bacula File daemon"
717 %systemd_post bacula-fd.service
720 if [ "$1" = "0" ]; then
721 %service bacula-fd stop
722 /sbin/chkconfig --del bacula-fd
724 %systemd_preun bacula-fd.service
731 /sbin/chkconfig --add bacula-sd
732 %service bacula-sd restart "Bacula Storage daemon"
733 %systemd_post bacula-sd.service
736 if [ "$1" = "0" ]; then
737 %service bacula-sd stop
738 /sbin/chkconfig --del bacula-sd
740 %systemd_preun bacula-sd.service
746 if [ -e %{_sysconfdir}/console.conf -a ! -e %{_sysconfdir}/bconsole.conf ]; then
747 mv %{_sysconfdir}/console.conf %{_sysconfdir}/bconsole.conf
756 %triggerpostun common -- %{name}-common < 5.0.1-2
757 find %{_sysconfdir}/bat.conf* -perm /007 -print0 2>/dev/null | xargs -0 -r chmod 600 || :
766 # link our current installed conf file to the rescue directory
767 ln -sf %{_sysconfdir}/bacula-fd.conf %{_sysconfdir}/rescue/bacula-fd.conf
770 echo "Creating rescue files for this system..."
771 cd %{_sysconfdir}/rescue
775 # remove the files created after the initial rpm installation
776 if [ "$1" = "0" ]; then
777 rm -f %{_sysconfdir}/rescue/bacula-fd.conf
778 rm -f %{_sysconfdir}/rescue/partition.*
779 rm -f %{_sysconfdir}/rescue/format.*
780 rm -f %{_sysconfdir}/rescue/mount_drives
781 rm -f %{_sysconfdir}/rescue/start_network
782 rm -f %{_sysconfdir}/rescue/sfdisk
783 rm -rf %{_sysconfdir}/rescue/diskinfo/*
788 for name in "create database" "drop tables" "drop database" "grant privileges" "make tables" "update tables"; do \
789 prefix="${name%% *}" \
790 suffix="${name#* }" \
791 ln -sf "${prefix}_%{1}_${suffix}" %{_libexecdir}/%{name}/"${prefix}_bacula_${suffix}" || : \
793 ln -sf "make_%{1}_catalog_backup" %{_libexecdir}/%{name}/make_catalog_backup || : \
794 ln -sf libbaccats-%{1}-%{version}.so %{_libdir}/libbaccats-%{version}.so || : \
795 %service bacula-dir restart "Bacula Director daemon"
800 %postun db-postgresql -p /sbin/ldconfig
805 %postun db-mysql -p /sbin/ldconfig
810 %postun db-sqlite3 -p /sbin/ldconfig
813 %defattr(644,root,root,755)
815 %{?with_python:%doc examples/python}
817 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*-password
818 # do not remove bsmtp from files. Fix build if it is not installed.
819 %attr(755,root,root) %{_sbindir}/bsmtp
820 %attr(755,root,root) %{_sbindir}/btraceback
821 %attr(755,root,root) %{_libdir}/libbac-5*.so
822 %attr(755,root,root) %{_libdir}/libbaccfg-5*.so
823 %attr(755,root,root) %{_libdir}/libbacfind-5*.so
824 %attr(755,root,root) %{_libdir}/libbacpy-5*.so
825 %attr(755,root,root) %{_libdir}/libbacsql-5*.so
826 %{_mandir}/man8/bacula.8*
827 %{_mandir}/man1/bsmtp.1*
828 %{_mandir}/man8/btraceback.8*
829 %dir %{_libexecdir}/%{name}
830 %{_libexecdir}/%{name}/btraceback.dbx
831 %{_libexecdir}/%{name}/btraceback.gdb
832 %{_libexecdir}/%{name}/bacula_config
833 %attr(770,root,bacula) %dir %{_localstatedir}
834 %attr(750,bacula,logs) %dir /var/log/bacula
835 %attr(640,bacula,logs) %ghost /var/log/bacula/log
838 %defattr(644,root,root,755)
839 %doc ChangeLog CheckList ReleaseNotes LICENSE
840 #%doc examples %{name}-docs-%{version}/manual/{*.pdf,bacula}
841 %attr(640,root,bacula) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bacula-dir.conf
842 %attr(640,root,root) %config(noreplace) /etc/logrotate.d/bacula-dir
843 %attr(754,root,root) /etc/rc.d/init.d/bacula-dir
844 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/bacula-dir
845 %{systemdunitdir}/bacula-dir.service
846 %attr(755,root,root) %{_sbindir}/bacula-dir
847 %attr(755,root,root) %{_sbindir}/bregex
848 %attr(755,root,root) %{_sbindir}/bwild
849 %attr(755,root,root) %{_sbindir}/bacula-dbcheck
850 %{_mandir}/man8/bacula-dir.8*
851 %{_mandir}/man8/bacula-dbcheck.8*
852 %{_mandir}/man8/bregex.8*
853 %{_mandir}/man8/bwild.8*
854 %{_libexecdir}/%{name}/query.sql
855 %attr(755,root,root) %{_libexecdir}/%{name}/delete_catalog_backup
858 %defattr(644,root,root,755)
859 %attr(755,root,root) %{_libexecdir}/%{name}/create_postgresql_database
860 %attr(755,root,root) %{_libexecdir}/%{name}/drop_postgresql_database
861 %attr(755,root,root) %{_libexecdir}/%{name}/drop_postgresql_tables
862 %attr(755,root,root) %{_libexecdir}/%{name}/grant_postgresql_privileges
863 %attr(755,root,root) %{_libexecdir}/%{name}/make_postgresql_tables
864 %attr(755,root,root) %{_libexecdir}/%{name}/update_postgresql_*
865 %attr(755,root,root) %{_libexecdir}/%{name}/make_postgresql_catalog_backup
866 %attr(755,root,root) %{_libdir}/libbaccats-postgresql-5*.so
868 %ghost %attr(755,root,root) %{_libdir}/libbaccats-5*.so
869 %ghost %{_libexecdir}/%{name}/create_bacula_database
870 %ghost %{_libexecdir}/%{name}/drop_bacula_tables
871 %ghost %{_libexecdir}/%{name}/drop_bacula_database
872 %ghost %{_libexecdir}/%{name}/grant_bacula_privileges
873 %ghost %{_libexecdir}/%{name}/make_bacula_tables
874 %ghost %{_libexecdir}/%{name}/update_bacula_tables
875 %ghost %{_libexecdir}/%{name}/make_catalog_backup
878 %defattr(644,root,root,755)
879 %attr(755,root,root) %{_libexecdir}/%{name}/create_mysql_database
880 %attr(755,root,root) %{_libexecdir}/%{name}/drop_mysql_database
881 %attr(755,root,root) %{_libexecdir}/%{name}/drop_mysql_tables
882 %attr(755,root,root) %{_libexecdir}/%{name}/grant_mysql_privileges
883 %attr(755,root,root) %{_libexecdir}/%{name}/make_mysql_tables
884 %attr(755,root,root) %{_libexecdir}/%{name}/update_mysql_*
885 %attr(755,root,root) %{_libexecdir}/%{name}/make_mysql_catalog_backup
886 %attr(755,root,root) %{_libdir}/libbaccats-mysql-5*.so
888 %ghost %attr(755,root,root) %{_libdir}/libbaccats-5*.so
889 %ghost %{_libexecdir}/%{name}/create_bacula_database
890 %ghost %{_libexecdir}/%{name}/drop_bacula_tables
891 %ghost %{_libexecdir}/%{name}/drop_bacula_database
892 %ghost %{_libexecdir}/%{name}/grant_bacula_privileges
893 %ghost %{_libexecdir}/%{name}/make_bacula_tables
894 %ghost %{_libexecdir}/%{name}/update_bacula_tables
895 %ghost %{_libexecdir}/%{name}/make_catalog_backup
898 %defattr(644,root,root,755)
899 %attr(755,root,root) %{_libexecdir}/%{name}/create_sqlite3_database
900 %attr(755,root,root) %{_libexecdir}/%{name}/drop_sqlite3_database
901 %attr(755,root,root) %{_libexecdir}/%{name}/drop_sqlite3_tables
902 %attr(755,root,root) %{_libexecdir}/%{name}/grant_sqlite3_privileges
903 %attr(755,root,root) %{_libexecdir}/%{name}/make_sqlite3_tables
904 %attr(755,root,root) %{_libexecdir}/%{name}/update_sqlite3_*
905 %attr(755,root,root) %{_libexecdir}/%{name}/make_sqlite3_catalog_backup
906 %attr(755,root,root) %{_libdir}/libbaccats-sqlite3-5*.so
908 %ghost %attr(755,root,root) %{_libdir}/libbaccats-5*.so
909 %ghost %{_libexecdir}/%{name}/create_bacula_database
910 %ghost %{_libexecdir}/%{name}/drop_bacula_tables
911 %ghost %{_libexecdir}/%{name}/drop_bacula_database
912 %ghost %{_libexecdir}/%{name}/grant_bacula_privileges
913 %ghost %{_libexecdir}/%{name}/make_bacula_tables
914 %ghost %{_libexecdir}/%{name}/update_bacula_tables
915 %ghost %{_libexecdir}/%{name}/make_catalog_backup
918 %defattr(644,root,root,755)
920 %attr(640,root,bacula) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bacula-fd.conf
921 %attr(754,root,root) /etc/rc.d/init.d/bacula-fd
922 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/bacula-fd
923 %{systemdunitdir}/bacula-fd.service
924 %attr(755,root,root) %{_sbindir}/bacula-fd
925 %attr(755,root,root) %{_libdir}/bpipe-fd.so
926 %{_mandir}/man8/bacula-fd.8*
929 %defattr(644,root,root,755)
931 %attr(640,root,bacula) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bacula-sd.conf
932 %attr(640,root,bacula) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mtx-changer.conf
933 %attr(754,root,root) /etc/rc.d/init.d/bacula-sd
934 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/bacula-sd
935 %{systemdunitdir}/bacula-sd.service
936 %attr(755,root,root) %{_sbindir}/bacula-sd
937 %attr(755,root,root) %{_sbindir}/bcopy
938 %attr(755,root,root) %{_sbindir}/bextract
939 %attr(755,root,root) %{_sbindir}/bls
940 %attr(755,root,root) %{_sbindir}/bscan
941 %attr(755,root,root) %{_sbindir}/btape
942 %attr(755,root,root) %{_libexecdir}/%{name}/mtx-changer
943 %attr(755,root,root) %{_libexecdir}/%{name}/disk-changer
944 %attr(755,root,root) %{_libexecdir}/%{name}/dvd-handler
945 %{_mandir}/man8/bacula-sd.8*
946 %{_mandir}/man8/bcopy.8*
947 %{_mandir}/man8/bextract.8*
948 %{_mandir}/man8/bls.8*
949 %{_mandir}/man8/bscan.8*
950 %{_mandir}/man8/btape.8*
953 %defattr(644,root,root,755)
955 %attr(640,root,bacula) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bconsole.conf
956 %attr(755,root,root) %{_sbindir}/bconsole
957 %{_mandir}/man8/bconsole.8*
961 %defattr(644,root,root,755)
963 %{_pixmapsdir}/%{name}.png
964 %{_desktopdir}/bacula-wx.desktop
965 %attr(640,root,bacula) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bwx-console.conf
966 %attr(755,root,root) %{_sbindir}/bwx-console
967 %{_mandir}/man1/bacula-bwxconsole.1*
972 %defattr(644,root,root,755)
974 %{_pixmapsdir}/%{name}.png
975 %{_desktopdir}/bat.desktop
976 # Do not make this file world-readable or any user will get full access to the
978 %attr(640,root,bacula) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bat.conf
979 %attr(755,root,root) %{_bindir}/bat
980 %{_mandir}/man1/bat.1*
986 %defattr(644,root,root,755)
988 %attr(755,root,root) %{_sbindir}/bacula-tray-monitor
989 #%{_pixmapsdir}/%{name}-tray-monitor.xpm
990 #%{_desktopdir}/%{name}-tray-monitor.desktop
991 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/tray-monitor.conf
992 %{_mandir}/man1/bacula-tray-monitor.1*
997 %defattr(644,root,root,755)
999 %dir %{_sysconfdir}/rescue
1000 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/backup.etc.list
1001 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/bacula-fd
1002 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/format_floppy
1003 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/getdiskinfo
1004 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/make_rescue_disk
1005 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/restore_bacula
1006 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/restore_etc
1007 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/run_grub
1008 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/run_lilo
1009 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/sfdisk.bz2
1013 %files -n nagios-plugin-check_bacula
1014 %defattr(644,root,root,755)
1015 %attr(755,root,root) %{nagiosplugindir}/check_bacula