2 # - update desktop files, think about su-wrappers for console (with .desktop files)
4 # - fix log file permissions
7 %bcond_without console_wx # wx-console program
8 %bcond_without console_gnome # gnome console
9 %bcond_without bat # bat Qt4 GUI
10 %bcond_without mysql # use MySQL
11 %bcond_without pgsql # use PostgreSQL
12 %bcond_without sqlite3 # use SQLite3
13 %bcond_without python # Python Scripting support, http://www.bacula.org/3.0.x-manuals/en/concepts/concepts/Python_Scripting.html
14 %bcond_without nagios # build nagios plugin
16 %bcond_with sqlite3_sync_off # makes SQLite3 backend much faster, but less reliable
18 %if %{without sqlite3}
19 %undefine with_sqlite3_sync_off
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: 793da9f89fc5e024b6b95eb16a3120e5
31 Source1: http://downloads.sourceforge.net/bacula/%{name}-docs-%{version}.tar.bz2
32 # Source1-md5: d4db495def9e7843bcca8aff2d4d493b
33 Source2: http://downloads.sourceforge.net/bacula/%{name}-rescue-5.0.1.tar.gz
34 # Source2-md5: bb194aed8e204f54bf2f61d7e721f257
35 Source10: %{name}-dir.init
36 Source11: %{name}-fd.init
37 Source12: %{name}-sd.init
38 Source13: %{name}.logrotate
39 Source14: %{name}-dir.sysconfig
40 Source15: %{name}-fd.sysconfig
41 Source16: %{name}-sd.sysconfig
42 Patch0: %{name}-mtx-changer.patch
43 Patch1: %{name}-branding.patch
44 Patch2: %{name}-conf.patch
45 Patch3: %{name}-desktop.patch
46 Patch4: make_catalog_backup-setup-home.patch
47 Patch5: %{name}-mysql_thread.patch
48 URL: http://www.bacula.org/
49 BuildRequires: acl-devel
50 BuildRequires: autoconf
51 BuildRequires: automake
52 BuildRequires: gettext-devel
53 %{?with_console_wx:BuildRequires: gtk+2-devel}
54 BuildRequires: libcap-devel
55 BuildRequires: libtool >= 2:2.2
57 BuildRequires: fakeroot
59 BuildRequires: libwrap-devel
60 BuildRequires: ncurses-devel
61 BuildRequires: openssl-devel
62 BuildRequires: pkgconfig
64 BuildRequires: python-devel
65 BuildRequires: python-modules
68 BuildRequires: QtCore-devel
69 BuildRequires: QtGui-devel
70 BuildRequires: qt4-build >= 4.3.3-3
71 BuildRequires: qt4-qmake >= 4.3.3-3
72 #BuildRequires: qwt-devel >= 5.0.2-2
74 %{?with_mysql:BuildRequires: mysql-devel}
75 %{?with_pgsql:BuildRequires: postgresql-devel}
76 BuildRequires: readline-devel
77 BuildRequires: rpm-pythonprov
78 BuildRequires: rpmbuild(macros) >= 1.268
79 BuildRequires: sed >= 4.0
80 %{?with_sqlite3:BuildRequires: sqlite3-devel}
82 %if %{with console_wx}
83 BuildRequires: wxGTK2-unicode-devel >= 2.4.0
85 BuildRequires: zlib-devel
86 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
88 %define _sysconfdir /etc/%{name}
89 %define _localstatedir /var/lib/%{name}
90 %define nagiosplugindir %{_libdir}/nagios/plugins
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
139 Bacula - It comes by night and sucks the vital essence from your
142 Bacula is a set of computer programs that permit you (or the system
143 administrator) to manage backup, recovery, and verification of
144 computer data across a network of computers of different kinds. In
145 technical terms, it is a network client/server based backup program.
146 Bacula is relatively easy to use and efficient, while offering many
147 advanced storage management features that make it easy to find and
148 recover lost or damaged files.
150 %description common -l pl.UTF-8
151 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
153 Bacula to zbiór programów umożliwiających administratorowi na
154 zarządzanie kopiami zapasowymi, odzyskiwaniem i weryfikacją danych w
155 sieci komputerów różnego rodzaju. W terminologii technicznej jest to
156 program do kopii zapasowych pracujący w architekturze klient-serwer.
157 Bacula jest stosunkowo łatwa w użyciu i wydajna, oferując przy tym
158 wiele zaawansowanych możliwości przy zarządzaniu nośnikami,
159 ułatwiających znalezienie i odzyskanie utraconych lub uszkodzonych
163 Summary: Bacula Director and Catalog services
164 Summary(pl.UTF-8): Usługi Bacula Director i Catalog
165 Group: Networking/Utilities
166 Requires(post): sed >= 4.0
167 Requires: %{name}-common = %{version}-%{release}
168 Requires: bacula(db) = %{version}-%{release}
169 Obsoletes: bacula-updatedb
172 Bacula - It comes by night and sucks the vital essence from your
175 Bacula Director is the program that supervises all the backup,
176 restore, verify and archive operations. The system administrator uses
177 the Bacula Director to schedule backups and to recover files. Catalog
178 services are comprised of the software programs responsible for
179 maintaining the file indexes and volume databases for all files backed
180 up. The Catalog services permit the System Administrator or user to
181 quickly locate and restore any desired file, since it maintains a
182 record of all Volumes used, all Jobs run, and all Files saved.
184 %description dir -l pl.UTF-8
185 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
187 Bacula Director to program nadzorujący wszystkie operacje wykonywania
188 kopii zapasowych, odzyskiwania, weryfikacji i archiwizowania.
189 Administrator używa Bacula Directora do szeregowania kopii zapasowych
190 oraz odzyskiwania plików. Usługi katalogowe (Catalog services) są
191 używane przez programy odpowiedzialne za zarządzanie indeksami plików
192 i bazą danych wolumenów dla wszystkich kopiowanych plików. Usługi
193 katalogowe umożliwiają administratorowi lub użytkownikowi szybko
194 zlokalizować i odtworzyć dowolny plik, ponieważ utrzymują rekord ze
195 wszystkimi używanymi wolumenami, uruchomionymi zadaniami i zapisanymi
199 Summary: Bacula Console
200 Summary(pl.UTF-8): Konsola Baculi
201 Group: Networking/Utilities
202 Requires(post): sed >= 4.0
203 Requires: %{name}-common = %{version}-%{release}
206 Bacula - It comes by night and sucks the vital essence from your
209 Bacula Console is the program that allows the administrator or user to
210 communicate with the Bacula Director. This is the text only console
213 %description console -l pl.UTF-8
214 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
216 Bacula Console to program umożliwiający administratorowi lub
217 użytkownikowi komunikowanie się z programem Bacula Director. To jest
218 interfejs czysto tekstowy.
221 Summary: Bacula wxWidgets Console
222 Summary(pl.UTF-8): Konsola Baculi oparta na wxWidgets
223 Group: Networking/Utilities
224 Requires(post): sed >= 4.0
225 Requires: %{name}-common = %{version}-%{release}
227 %description console-wx
228 Bacula - It comes by night and sucks the vital essence from your
231 Bacula Console is the program that allows the administrator or user to
232 communicate with the Bacula Director. This is the wxWidgets GUI
235 %description console-wx -l pl.UTF-8
236 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
238 Bacula Console to program umożliwiający administratorowi lub
239 użytkownikowi komunikowanie się z programem Bacula Director. To jest
240 interfejs graficzny oparty na wxWidgets.
243 Summary: Bacula Qt4 Console
244 Summary(pl.UTF-8): Konsola Baculi oparta na Qt4
245 Group: Networking/Utilities
246 Requires(post): sed >= 4.0
247 Requires: %{name}-common = %{version}-%{release}
249 %description console-qt4
250 Bacula - It comes by night and sucks the vital essence from your
253 Bacula Console is the program that allows the administrator or user to
254 communicate with the Bacula Director. This is the Qt4 GUI interface.
256 %description console-qt4 -l pl.UTF-8
257 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
259 Bacula Console to program umożliwiający administratorowi lub
260 użytkownikowi komunikowanie się z programem Bacula Director. To jest
261 interfejs graficzny oparty na Qt4.
263 %package tray-monitor
264 Summary: Bacula Tray Monitor
265 Group: Networking/Utilities
266 Requires(post): sed >= 4.0
267 Requires: %{name}-common = %{version}-%{release}
269 %description tray-monitor
270 Bacula - It comes by night and sucks the vital essence from your
273 The Monitor program is typically an icon in the system tray. However,
274 once the icon is expanded into a full window, the administrator or
275 user can obtain status information about the Director or the backup
276 status on the local workstation or any other Bacula daemon that is
280 Summary: Bacula File services (Client)
281 Summary(pl.UTF-8): Usługi Bacula File (klient)
282 Group: Networking/Utilities
283 Requires(post): sed >= 4.0
284 Requires: %{name}-common = %{version}-%{release}
287 Bacula - It comes by night and sucks the vital essence from your
290 Bacula File services (or Client program) is the software program that
291 is installed on the machine to be backed up. It is specific to the
292 operating system on which it runs and is responsible for providing the
293 file attributes and data when requested by the Director. The File
294 services are also responsible for the file system dependent part of
295 restoring the file attributes and data during a recovery operation.
296 This program runs as a daemon on the machine to be backed up, and in
297 some of the documentation, the File daemon is referred to as the
298 Client (for example in Bacula configuration file).
300 %description fd -l pl.UTF-8
301 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
303 Usługi Bacula File (inaczej program kliencki) to oprogramowanie, które
304 instaluje się na maszynach, z których mają być wykonywane kopie
305 zapasowe. Są one specyficzne dla systemu operacyjnego, pod którym
306 działa dana maszyna i odpowiadają za dostarczanie atrybutów i danych
307 plików na żądanie Directora. Usługi plikowe są także odpowiedzialne za
308 zależną od systemu plików część odzyskiwania atrybutów i danych plików
309 podczas operacji odzyskiwania danych. Program działa jako demon na
310 maszynie, która ma być backupowana i w części dokumentacji demon ten
311 (File) jest nazywany klientem (na przykład w pliku konfiguracyjnym
315 Summary: Bacula Storage services
316 Summary(pl.UTF-8): Usługi Bacula Storage
317 Group: Networking/Utilities
318 Requires(post): sed >= 4.0
319 Requires: %{name}-common = %{version}-%{release}
320 Conflicts: dvd+rw-tools <= 5.21.4.10.8-1
323 Bacula - It comes by night and sucks the vital essence from your
326 Bacula Storage services consist of the software programs that perform
327 the storage and recovery of the file attributes and data to the
328 physical backup media or volumes. In other words, the Storage daemon
329 is responsible for reading and writing your tapes (or other storage
330 media, e.g. files). The Storage services runs as a daemon on the
331 machine that has the backup device (usually a tape drive).
333 %description sd -l pl.UTF-8
334 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
336 Usługi Bacula Storage składają się z programów obsługujących
337 przechowywanie danych oraz odzyskiwanie atrybutów i danych na
338 fizycznych nośnikach lub wolumenach. Innymi słowy, demon Storage jest
339 odpowiedzialny za odczyt i zapis taśm (lub innych nośników do
340 przechowywania danych, np. plików). Usługi Storage działają jako demon
341 na maszynie, która zawiera urządzenie backupowe (zwykle napęd
344 %package db-postgresql
345 Summary: PostgreSQL database driver for Bacula
346 Summary(pl.UTF-8): Sterownik bazy PostgreSQL dla Baculi
347 Group: Networking/Utilities
348 Requires(post): /sbin/ldconfig
349 Requires: %{name}-common = %{version}-%{release}
350 Provides: bacula(db) = %{version}-%{release}
351 Obsoletes: bacula(db)
353 %description db-postgresql
354 PostgreSQL database driver for Bacula.
356 %description db-postgresql -l pl.UTF-8
357 Sterownik bazy PostgreSQL dla Baculi.
360 Summary: MySQL database driver for Bacula
361 Summary(pl.UTF-8): Sterownik bazy MySQL dla Baculi
362 Group: Networking/Utilities
363 Requires(post): /sbin/ldconfig
364 Requires: %{name}-common = %{version}-%{release}
365 Provides: bacula(db) = %{version}-%{release}
366 Obsoletes: bacula(db)
368 %description db-mysql
369 MySQL database driver for Bacula.
371 %description db-mysql -l pl.UTF-8
372 Sterownik bazy MySQL dla Baculi.
375 Summary: SQLite database driver for Bacula
376 Summary(pl.UTF-8): Sterownik bazy SQLite dla Baculi
377 Group: Networking/Utilities
378 Requires(post): /sbin/ldconfig
379 Requires: %{name}-common = %{version}-%{release}
380 Provides: bacula(db) = %{version}-%{release}
381 Obsoletes: bacula(db)
383 %description db-sqlite3
384 SQLite database driver for Bacula.
386 %description db-sqlite3 -l pl.UTF-8
387 Sterownik bazy SQLite dla Baculi.
390 Summary: Bacula - The Network Backup Solution
391 Summary(pl.UTF-8): Bacula - rozwiązanie do wykonywania kopii zapasowych po sieci
392 Group: Networking/Utilities
393 Requires: %{name}-fd = %{version}-%{release}
398 Bacula - It comes by night and sucks the vital essence from your
401 Bacula is a set of computer programs that permit you (or the system
402 administrator) to manage backup, recovery, and verification of
403 computer data across a network of computers of different kinds. In
404 technical terms, it is a network client/server based backup program.
405 Bacula is relatively easy to use and efficient, while offering many
406 advanced storage management features that make it easy to find and
407 recover lost or damaged files.
409 This package installs scripts for disaster recovery and builds rescue
410 floppy disk for bare metal recovery.
412 %description rescue -l pl.UTF-8
413 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
415 Bacula to zbiór programów umożliwiających administratorowi na
416 zarządzanie kopiami zapasowymi, odzyskiwaniem i weryfikacją danych w
417 sieci komputerów różnego rodzaju. W terminologii technicznej jest to
418 program do kopii zapasowych pracujący w architekturze klient-serwer.
419 Bacula jest stosunkowo łatwa w użyciu i wydajna, oferując przy tym
420 wiele zaawansowanych możliwości przy zarządzaniu nośnikami,
421 ułatwiających znalezienie i odzyskanie utraconych lub uszkodzonych
424 Ten pakiet zawiera skrypty do odtwarzania po awarii i tworzy dyskietkę
425 ratunkowe do odtwarzania systemu od zera.
427 %package -n nagios-plugin-check_bacula
428 Summary: Nagios plugin to check bacula
430 Requires: nagios-common
432 %description -n nagios-plugin-check_bacula
433 Nagios plugin to check bacula.
444 tar -xf %{SOURCE2} && ln -s bacula-rescue-* rescue
446 sed -i -e 's#bindir=.*#bindir=%{_bindir}#g' \
447 src/cats/create_* src/cats/delete_* src/cats/drop_* \
448 src/cats/grant_* src/cats/make_* src/cats/update_*
449 sed -i -e 's/@hostname@/--hostname--/' src/*/*.conf.in
450 sed -i -e 's/@basename@/--hostname--/' src/*/*.conf.in
454 %{__aclocal} -I bacula-macros -I gettext-macros
455 # $BUILD_DIR not seen by libtoolize, export it
456 BUILD_DIR=.. %{__libtoolize}
458 %{__autoconf} --prepend-include=$(pwd)/autoconf autoconf/configure.in > configure
460 CPPFLAGS="-I/usr/include/ncurses -I%{_includedir}/readline"
462 WXCONFIG=%{_bindir}/wx-gtk2-unicode-config \
463 QMAKE=%{_bindir}/qt4-qmake \
465 --with-scriptdir=%{_libexecdir}/%{name} \
466 %{?with_bat:--enable-bat} \
468 --enable-smartalloc \
469 %{?with_console_wx:--enable-bwx-console} \
470 %{?with_console_gnome:--enable-gnome} \
471 --enable-tray-monitor \
472 %{?with_python:--with-python} \
474 --with-tcp-wrappers \
475 --with-working-dir=%{_var}/lib/%{name} \
476 --with-dump-email="root@localhost" \
477 --with-job-email="root@localhost" \
478 --with-smtp-host=localhost \
479 --with-pid-dir=/var/run \
480 --with-subsys-dir=/var/lock/subsys \
481 --enable-batch-insert \
482 %{?with_pgsql:--with-postgresql} \
483 %{?with_mysql:--with-mysql} \
484 %{?with_sqlite3:--with-sqlite3} \
485 %{?with_sqlite3_sync_off:--enable-extra-sqlite3-init="pragma synchronous=0;"} \
486 --with-dir-password="#FAKE-dir-password#" \
487 --with-fd-password="#FAKE-fd-password#" \
488 --with-sd-password="#FAKE-sd-password#" \
489 --with-mon-dir-password="#FAKE-mon-dir-password#" \
490 --with-mon-fd-password="#FAKE-mon-fd-password#" \
491 --with-mon-sd-password="#FAKE-mon-sd-password#" \
504 %{__make} -C examples/nagios/check_bacula
516 rm -rf $RPM_BUILD_ROOT
517 install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,logrotate.d,pam.d,sysconfig}
518 install -d $RPM_BUILD_ROOT%{_sysconfdir}/rescue
519 install -d $RPM_BUILD_ROOT{%{_pixmapsdir},%{_desktopdir},%{_mandir},%{_bindir},/var/log/bacula}
522 DESTDIR=$RPM_BUILD_ROOT
524 # we use db dependant (at compile time) shell script only
525 rm $RPM_BUILD_ROOT%{_libexecdir}/%{name}/make_catalog_backup.pl
526 ## dbi is not actual dbtype
527 #rm $RPM_BUILD_ROOT%{_libexecdir}/%{name}/make_dbi_catalog_backup
529 ## replace with empty file, replaced by ldconfig from each db-* package on intsall
530 #rm $RPM_BUILD_ROOT%{_libdir}/libbaccats-%{version}.so
531 #touch $RPM_BUILD_ROOT%{_libdir}/libbaccats-%{version}.so
533 install -p %{SOURCE10} $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-dir
534 install -p %{SOURCE11} $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-fd
535 install -p %{SOURCE12} $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-sd
536 cp -a %{SOURCE13} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}-dir
537 cp -a %{SOURCE14} $RPM_BUILD_ROOT/etc/sysconfig/bacula-dir
538 cp -a %{SOURCE15} $RPM_BUILD_ROOT/etc/sysconfig/bacula-fd
539 cp -a %{SOURCE16} $RPM_BUILD_ROOT/etc/sysconfig/bacula-sd
541 %if %{with console_wx}
542 # tray-monitor is for regular users
543 #mv $RPM_BUILD_ROOT%{_sbindir}/bacula-tray-monitor $RPM_BUILD_ROOT%{_bindir}
545 cp -a scripts/bacula.png $RPM_BUILD_ROOT%{_pixmapsdir}/bacula.png
546 #install src/tray-monitor/generic.xpm $RPM_BUILD_ROOT%{_pixmapsdir}/bacula-tray-monitor.xpm
547 sed -e 's/gnome-console/wx-console/g;s/Console/Wx Console/g' \
548 scripts/bacula.desktop.gnome2 > $RPM_BUILD_ROOT%{_desktopdir}/bacula-wx.desktop
549 #sed -e 's#%{_sbindir}#%{_bindir}#' \
550 # scripts/bacula-tray-monitor.desktop > $RPM_BUILD_ROOT%{_desktopdir}/bacula-tray-monitor.desktop
554 # qmake somewhy does not always create install_bins target. install our own the bin
555 rm -f $RPM_BUILD_ROOT%{_sbindir}/bat
556 libtool --silent --mode=install install src/qt-console/bat $RPM_BUILD_ROOT%{_bindir}
557 cp -a scripts/bat.desktop $RPM_BUILD_ROOT%{_desktopdir}
561 # install the rescue stuff, these are the rescue scripts
562 cp -a rescue/linux/floppy/backup.etc.list $RPM_BUILD_ROOT%{_sysconfdir}/rescue
563 cp -a rescue/linux/floppy/sfdisk.bz2 $RPM_BUILD_ROOT%{_sysconfdir}/rescue
564 install -p rescue/linux/floppy/*_* $RPM_BUILD_ROOT%{_sysconfdir}/rescue
565 install -p rescue/linux/floppy/getdiskinfo $RPM_BUILD_ROOT%{_sysconfdir}/rescue
568 touch $RPM_BUILD_ROOT/var/log/bacula/log
570 # install the updatedb scripts for older versions that last full release
571 # 2.0 -> 3.0 : 10_to_11
572 install -p updatedb/update_*_tables_10_to_11 $RPM_BUILD_ROOT%{_libexecdir}/%{name}
574 # place for site passwords
575 touch $RPM_BUILD_ROOT%{_sysconfdir}/{dir-password,fd-password,sd-password}
576 touch $RPM_BUILD_ROOT%{_sysconfdir}/{mon-dir-password,mon-fd-password,mon-sd-password}
578 mv $RPM_BUILD_ROOT%{_libexecdir}/%{name}/mtx-changer.conf $RPM_BUILD_ROOT%{_sysconfdir}/mtx-changer.conf
581 rm -f $RPM_BUILD_ROOT%{_libexecdir}/%{name}/{gconsole,startmysql,stopmysql,bacula,bconsole,fd}
582 %if %{without console_wx}
583 rm -f $RPM_BUILD_ROOT%{_desktopdir}/bacula-wx.desktop
585 touch $RPM_BUILD_ROOT%{_sysconfdir}/.pw.sed
587 rm $RPM_BUILD_ROOT%{_docdir}/bacula/ChangeLog
588 rm $RPM_BUILD_ROOT%{_docdir}/bacula/INSTALL
589 rm $RPM_BUILD_ROOT%{_docdir}/bacula/LICENSE
590 rm $RPM_BUILD_ROOT%{_docdir}/bacula/README
591 rm $RPM_BUILD_ROOT%{_docdir}/bacula/ReleaseNotes
592 rm $RPM_BUILD_ROOT%{_docdir}/bacula/VERIFYING
593 rm $RPM_BUILD_ROOT%{_docdir}/bacula/technotes
595 # startup scripts, those in /etc/rc.d/init.d are better
596 rm $RPM_BUILD_ROOT%{_sbindir}/bacula
597 rm $RPM_BUILD_ROOT%{_libexecdir}/%{name}/bacula-ctl-*
600 rm $RPM_BUILD_ROOT%{_libexecdir}/%{name}/btraceback.mdb
602 # rename to avoid possible conflicts
603 mv $RPM_BUILD_ROOT%{_sbindir}/{,bacula-}dbcheck
604 mv $RPM_BUILD_ROOT%{_mandir}/man8/{,bacula-}dbcheck.8.gz
606 # no -devel files packaged, so this is also useless
607 rm $RPM_BUILD_ROOT%{_libdir}/libbac{,cfg,find,py,sql}.{so,la}
609 # FIXME, something in post
610 rm $RPM_BUILD_ROOT/usr/lib64/libbaccats-5.2.1.so
613 install -d $RPM_BUILD_ROOT%{nagiosplugindir}
614 %{__make} -C examples/nagios/check_bacula install \
615 sbindir=%{nagiosplugindir} \
616 INSTALL_PROGRAM="libtool --mode=install install -p" \
617 DESTDIR=$RPM_BUILD_ROOT
621 rm -rf $RPM_BUILD_ROOT
624 %groupadd -P %{name}-common -g 136 -r -f bacula
625 %useradd -P %{name}-common -u 136 -r -d /var/lib/bacula -s /bin/false -c "Bacula User" -g bacula bacula
627 %define update_configs \
628 echo "Updating bacula passwords and names..." | %banner -a %{name} \
630 for f in *-password; do \
631 if [ ! -s $f ]; then \
632 openssl rand -base64 33 > $f \
635 for cf in *.conf *.conf.rpmnew; do \
636 [ -f $cf ] && sed -i -e"s:#FAKE-$f#:$p:" "$cf" || : \
639 for cf in *.conf *.conf.rpmnew; do \
640 [ -f $cf ] && sed -i -e"s:--hostname--:`hostname`:" "$cf" || : \
649 if [ "$1" = "0" ]; then
654 %triggerpostun dir -- %{name}-dir < 5.0
655 %banner bacula-dir -t3 <<EOF
656 You have upgraded from an older version of Bacula director.
658 You will probably need to call %{_libexecdir}/%{name}/update_bacula_tables
659 script to upgrade the database.
664 /sbin/chkconfig --add bacula-dir
665 %service bacula-dir restart "Bacula Director daemon"
668 if [ "$1" = "0" ]; then
669 %service bacula-dir stop
670 /sbin/chkconfig --del bacula-dir
675 /sbin/chkconfig --add bacula-fd
676 %service bacula-fd restart "Bacula File daemon"
679 if [ "$1" = "0" ]; then
680 %service bacula-fd stop
681 /sbin/chkconfig --del bacula-fd
686 /sbin/chkconfig --add bacula-sd
687 %service bacula-sd restart "Bacula Storage daemon"
690 if [ "$1" = "0" ]; then
691 %service bacula-sd stop
692 /sbin/chkconfig --del bacula-sd
696 if [ -e %{_sysconfdir}/console.conf -a ! -e %{_sysconfdir}/bconsole.conf ]; then
697 mv %{_sysconfdir}/console.conf %{_sysconfdir}/bconsole.conf
706 %triggerpostun common -- %{name}-common < 5.0.1-2
707 find %{_sysconfdir}/bat.conf* -perm /007 -print0 2>/dev/null | xargs -0 -r chmod 600 || :
716 # link our current installed conf file to the rescue directory
717 ln -sf %{_sysconfdir}/bacula-fd.conf %{_sysconfdir}/rescue/bacula-fd.conf
720 echo "Creating rescue files for this system..."
721 cd %{_sysconfdir}/rescue
725 # remove the files created after the initial rpm installation
726 if [ "$1" = "0" ]; then
727 rm -f %{_sysconfdir}/rescue/bacula-fd.conf
728 rm -f %{_sysconfdir}/rescue/partition.*
729 rm -f %{_sysconfdir}/rescue/format.*
730 rm -f %{_sysconfdir}/rescue/mount_drives
731 rm -f %{_sysconfdir}/rescue/start_network
732 rm -f %{_sysconfdir}/rescue/sfdisk
733 rm -rf %{_sysconfdir}/rescue/diskinfo/*
738 for name in "create database" "drop tables" "drop database" "grant privileges" "make tables" "update tables"; do \
739 prefix="${name%% *}" \
740 suffix="${name#* }" \
741 ln -sf "${prefix}_%{1}_${suffix}" %{_libexecdir}/%{name}/"${prefix}_bacula_${suffix}" || : \
743 ln -sf "make_%{1}_catalog_backup" %{_libexecdir}/%{name}/make_catalog_backup || : \
744 %service bacula-dir restart "Bacula Director daemon"
749 %postun db-postgresql -p /sbin/ldconfig
754 %postun db-mysql -p /sbin/ldconfig
759 %postun db-sqlite3 -p /sbin/ldconfig
762 %defattr(644,root,root,755)
764 %{?with_python:%doc examples/python}
766 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*-password
767 # do not remove bsmtp from files. Fix build if it is not installed.
768 %attr(755,root,root) %{_sbindir}/bsmtp
769 %attr(755,root,root) %{_sbindir}/btraceback
770 %attr(755,root,root) %{_libdir}/libbac-5*.so
771 %attr(755,root,root) %{_libdir}/libbaccfg-5*.so
772 %attr(755,root,root) %{_libdir}/libbacfind-5*.so
773 %attr(755,root,root) %{_libdir}/libbacpy-5*.so
774 %{_mandir}/man8/bacula.8*
775 %{_mandir}/man1/bsmtp.1*
776 %{_mandir}/man8/btraceback.8*
777 %dir %{_libexecdir}/%{name}
778 %{_libexecdir}/%{name}/btraceback.dbx
779 %{_libexecdir}/%{name}/btraceback.gdb
780 %{_libexecdir}/%{name}/bacula_config
781 %attr(770,root,bacula) %dir %{_localstatedir}
782 %attr(750,bacula,logs) %dir /var/log/bacula
783 %attr(640,bacula,logs) %ghost /var/log/bacula/log
786 %defattr(644,root,root,755)
787 %doc ChangeLog CheckList ReleaseNotes kernstodo LICENSE
788 #%doc examples %{name}-docs-%{version}/manual/{*.pdf,bacula}
789 %attr(640,root,bacula) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bacula-dir.conf
790 %ghost %{_sysconfdir}/.pw.sed
791 %attr(640,root,root) %config(noreplace) /etc/logrotate.d/bacula-dir
792 %attr(754,root,root) /etc/rc.d/init.d/bacula-dir
793 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/bacula-dir
794 %attr(755,root,root) %{_sbindir}/bacula-dir
795 %attr(755,root,root) %{_sbindir}/bregex
796 %attr(755,root,root) %{_sbindir}/bwild
797 %attr(755,root,root) %{_sbindir}/bacula-dbcheck
798 %{_mandir}/man8/bacula-dir.8*
799 %{_mandir}/man8/bacula-dbcheck.8*
800 %{_libexecdir}/%{name}/query.sql
801 %attr(755,root,root) %{_libexecdir}/%{name}/delete_catalog_backup
804 %defattr(644,root,root,755)
805 #%attr(755,root,root) %{_libexecdir}/%{name}/fix_postgresql_tables
806 %attr(755,root,root) %{_libexecdir}/%{name}/create_postgresql_database
807 %attr(755,root,root) %{_libexecdir}/%{name}/drop_postgresql_database
808 %attr(755,root,root) %{_libexecdir}/%{name}/drop_postgresql_tables
809 %attr(755,root,root) %{_libexecdir}/%{name}/grant_postgresql_privileges
810 %attr(755,root,root) %{_libexecdir}/%{name}/make_postgresql_tables
811 %attr(755,root,root) %{_libexecdir}/%{name}/update_postgresql_*
812 #attr(755,root,root) %{_libexecdir}/%{name}/make_postgresql_catalog_backup
813 %attr(755,root,root) %{_libdir}/libbaccats-postgresql-5*.so
815 #%ghost %attr(755,root,root) %{_libdir}/libbaccats-5*.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
825 %defattr(644,root,root,755)
826 %attr(755,root,root) %{_libexecdir}/%{name}/create_mysql_database
827 %attr(755,root,root) %{_libexecdir}/%{name}/drop_mysql_database
828 %attr(755,root,root) %{_libexecdir}/%{name}/drop_mysql_tables
829 %attr(755,root,root) %{_libexecdir}/%{name}/grant_mysql_privileges
830 %attr(755,root,root) %{_libexecdir}/%{name}/make_mysql_tables
831 %attr(755,root,root) %{_libexecdir}/%{name}/update_mysql_*
832 #%attr(755,root,root) %{_libexecdir}/%{name}/make_mysql_catalog_backup
833 %attr(755,root,root) %{_libdir}/libbaccats-mysql-5*.so
835 #%ghost %attr(755,root,root) %{_libdir}/libbaccats-5*.so
836 %ghost %{_libexecdir}/%{name}/create_bacula_database
837 %ghost %{_libexecdir}/%{name}/drop_bacula_tables
838 %ghost %{_libexecdir}/%{name}/drop_bacula_database
839 %ghost %{_libexecdir}/%{name}/grant_bacula_privileges
840 %ghost %{_libexecdir}/%{name}/make_bacula_tables
841 %ghost %{_libexecdir}/%{name}/update_bacula_tables
842 #%ghost %{_libexecdir}/%{name}/make_catalog_backup
845 %defattr(644,root,root,755)
846 %attr(755,root,root) %{_libexecdir}/%{name}/create_sqlite3_database
847 %attr(755,root,root) %{_libexecdir}/%{name}/drop_sqlite3_database
848 %attr(755,root,root) %{_libexecdir}/%{name}/drop_sqlite3_tables
849 %attr(755,root,root) %{_libexecdir}/%{name}/grant_sqlite3_privileges
850 %attr(755,root,root) %{_libexecdir}/%{name}/make_sqlite3_tables
851 %attr(755,root,root) %{_libexecdir}/%{name}/update_sqlite3_*
852 #%attr(755,root,root) %{_libexecdir}/%{name}/make_sqlite3_catalog_backup
853 %attr(755,root,root) %{_libdir}/libbaccats-sqlite3-5*.so
855 #%ghost %attr(755,root,root) %{_libdir}/libbaccats-5*.so
856 %ghost %{_libexecdir}/%{name}/create_bacula_database
857 %ghost %{_libexecdir}/%{name}/drop_bacula_tables
858 %ghost %{_libexecdir}/%{name}/drop_bacula_database
859 %ghost %{_libexecdir}/%{name}/grant_bacula_privileges
860 %ghost %{_libexecdir}/%{name}/make_bacula_tables
861 %ghost %{_libexecdir}/%{name}/update_bacula_tables
862 #%ghost %{_libexecdir}/%{name}/make_catalog_backup
865 %defattr(644,root,root,755)
867 %attr(640,root,bacula) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bacula-fd.conf
868 %attr(754,root,root) /etc/rc.d/init.d/bacula-fd
869 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/bacula-fd
870 %attr(755,root,root) %{_sbindir}/bacula-fd
871 %attr(755,root,root) %{_libdir}/bpipe-fd.so
872 %{_mandir}/man8/bacula-fd.8*
875 %defattr(644,root,root,755)
877 %attr(640,root,bacula) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bacula-sd.conf
878 %attr(640,root,bacula) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mtx-changer.conf
879 %attr(754,root,root) /etc/rc.d/init.d/bacula-sd
880 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/bacula-sd
881 %attr(755,root,root) %{_sbindir}/bacula-sd
882 %attr(755,root,root) %{_sbindir}/bcopy
883 %attr(755,root,root) %{_sbindir}/bextract
884 %attr(755,root,root) %{_sbindir}/bls
885 %attr(755,root,root) %{_sbindir}/bscan
886 %attr(755,root,root) %{_sbindir}/btape
887 %attr(755,root,root) %{_libexecdir}/%{name}/mtx-changer
888 %attr(755,root,root) %{_libexecdir}/%{name}/disk-changer
889 %attr(755,root,root) %{_libexecdir}/%{name}/dvd-handler
890 %{_mandir}/man8/bacula-sd.8*
891 %{_mandir}/man8/bcopy.8*
892 %{_mandir}/man8/bextract.8*
893 %{_mandir}/man8/bls.8*
894 %{_mandir}/man8/bscan.8*
895 %{_mandir}/man8/btape.8*
898 %defattr(644,root,root,755)
900 %attr(640,root,bacula) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bconsole.conf
901 %attr(755,root,root) %{_sbindir}/bconsole
902 %{_mandir}/man8/bconsole.8*
904 %if %{with console_wx}
906 %defattr(644,root,root,755)
908 %{_pixmapsdir}/%{name}.png
909 %{_desktopdir}/bacula-wx.desktop
910 #%attr(640,root,bacula) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bwx-console.conf
911 #%attr(755,root,root) %{_sbindir}/bwx-console
912 %{_mandir}/man1/bacula-bwxconsole.1*
917 %defattr(644,root,root,755)
919 %{_pixmapsdir}/%{name}.png
920 %{_desktopdir}/bat.desktop
921 # Do not make this file world-readable or any user will get full access to the
923 %attr(640,root,bacula) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bat.conf
924 %attr(755,root,root) %{_bindir}/bat
925 %{_mandir}/man1/bat.1*
929 %if %{with console_wx}
931 %defattr(644,root,root,755)
933 %attr(755,root,root) %{_sbindir}/bacula-tray-monitor
934 #%{_pixmapsdir}/%{name}-tray-monitor.xpm
935 #%{_desktopdir}/%{name}-tray-monitor.desktop
936 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/tray-monitor.conf
937 %{_mandir}/man1/bacula-tray-monitor.1*
942 %defattr(644,root,root,755)
944 %dir %{_sysconfdir}/rescue
945 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/backup.etc.list
946 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/bacula-fd
947 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/format_floppy
948 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/getdiskinfo
949 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/make_rescue_disk
950 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/restore_bacula
951 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/restore_etc
952 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/run_grub
953 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/run_lilo
954 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/sfdisk.bz2
958 %files -n nagios-plugin-check_bacula
959 %defattr(644,root,root,755)
960 %attr(755,root,root) %{nagiosplugindir}/check_bacula