2 # - update desktop files, think about su-wrappers for console (with .desktop files)
4 # - fix log file permissions
6 #make[1]: *** No rule to make target `../lib/libbac.la', needed by `bacula-dir'. Stop.
7 #make[1]: *** Waiting for unfinished jobs....
8 #make[1]: Leaving directory `/home/users/glen/rpm/BUILD.x86_64-linux/bacula-5.0.2/src/dird'
11 %bcond_without console_wx # wx-console program
12 %bcond_without bat # bat Qt4 GUI
13 %bcond_without dbi # use Database Independent Abstraction Layer (libdbi)
14 %bcond_without mysql # use MySQL
15 %bcond_without pgsql # use PostgreSQL
16 %bcond_without sqlite3 # use SQLite3
18 %bcond_with 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
26 Summary: Bacula - The Network Backup Solution
27 Summary(pl.UTF-8): Bacula - rozwiązanie do wykonywania kopii zapasowych po sieci
31 License: extended GPL v2
32 Group: Networking/Utilities
33 Source0: http://downloads.sourceforge.net/bacula/%{name}-%{version}.tar.gz
34 # Source0-md5: e9204d2e772f12662de28da3327853de
35 Source1: http://downloads.sourceforge.net/bacula/%{name}-docs-%{version}.tar.bz2
36 # Source1-md5: 7a6afbf592dde4fae0240d82ed3cb10d
37 Source2: http://downloads.sourceforge.net/bacula/%{name}-rescue-5.0.0.tar.gz
38 # Source2-md5: 349623581cfe0bcd798dd137abac959a
39 Source10: %{name}-dir.init
40 Source11: %{name}-fd.init
41 Source12: %{name}-sd.init
42 Source13: %{name}.logrotate
43 Source14: %{name}-dir.sysconfig
44 Source15: %{name}-fd.sysconfig
45 Source16: %{name}-sd.sysconfig
46 Patch0: %{name}-mtx-changer.patch
47 Patch1: %{name}-link.patch
48 Patch2: %{name}-tinfo-readline.patch
49 Patch3: %{name}-branding.patch
50 Patch4: %{name}-conf.patch
51 Patch5: %{name}-desktop.patch
52 Patch6: %{name}-64bitbuild_fix.patch
53 Patch7: %{name}-dbi_fixes.patch
54 Patch8: %{name}-dbi_dbcheck.patch
55 Patch9: %{name}-openssl1.patch
56 URL: http://www.bacula.org/
57 BuildRequires: acl-devel
58 BuildRequires: autoconf
59 BuildRequires: automake
60 BuildRequires: gettext-devel
61 BuildRequires: gtk+2-devel
62 BuildRequires: libcap-devel
63 %{?with_dbi:BuildRequires: libdbi-devel >= 0.8.4}
64 BuildRequires: libtool
66 BuildRequires: fakeroot
68 BuildRequires: libwrap-devel
69 BuildRequires: ncurses-devel
70 BuildRequires: openssl-devel
71 BuildRequires: pkgconfig
73 BuildRequires: python-devel
74 BuildRequires: python-modules
77 BuildRequires: QtCore-devel
78 BuildRequires: QtGui-devel
79 BuildRequires: qt4-build >= 4.3.3-3
80 BuildRequires: qt4-qmake >= 4.3.3-3
81 #BuildRequires: qwt-devel >= 5.0.2-2
83 %{?with_mysql:BuildRequires: mysql-devel}
84 %{?with_pgsql:BuildRequires: postgresql-devel}
85 BuildRequires: readline-devel
86 BuildRequires: rpm-pythonprov
87 BuildRequires: rpmbuild(macros) >= 1.268
88 BuildRequires: sed >= 4.0
89 %{?with_sqlite3:BuildRequires: sqlite3-devel}
91 %if %{with console_wx}
92 BuildRequires: wxGTK2-unicode-devel >= 2.4.0
94 BuildRequires: zlib-devel
95 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
97 %define _sysconfdir /etc/%{name}
98 %define _localstatedir /var/lib/%{name}
99 %define nagiosplugindir %{_prefix}/lib/nagios/plugins
101 # from 'the worst' to 'the best'
102 %define databases %{?with_dbi:dbi} %{?with_sqlite3:sqlite3} %{?with_mysql:mysql} %{?with_pgsql:postgresql}
104 # dependency section is broken. ccache usage is instead to makefiles
105 %undefine with_ccache
108 Bacula - It comes by night and sucks the vital essence from your
111 Bacula is a set of computer programs that permit you (or the system
112 administrator) to manage backup, recovery, and verification of
113 computer data across a network of computers of different kinds. In
114 technical terms, it is a network client/server based backup program.
115 Bacula is relatively easy to use and efficient, while offering many
116 advanced storage management features that make it easy to find and
117 recover lost or damaged files.
119 %description -l pl.UTF-8
120 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
122 Bacula to zbiór programów umożliwiających administratorowi na
123 zarządzanie kopiami zapasowymi, odzyskiwaniem i weryfikacją danych w
124 sieci komputerów różnego rodzaju. W terminologii technicznej jest to
125 program do kopii zapasowych pracujący w architekturze klient-serwer.
126 Bacula jest stosunkowo łatwa w użyciu i wydajna, oferując przy tym
127 wiele zaawansowanych możliwości przy zarządzaniu nośnikami,
128 ułatwiających znalezienie i odzyskanie utraconych lub uszkodzonych
132 Summary: Common files for bacula package
133 Summary(pl.UTF-8): Pliki wspólne dla pakietu bacula
134 Group: Networking/Utilities
135 Requires(post): openssl-tools
136 Requires(post): sed >= 4.0
137 Requires(post,preun): /sbin/chkconfig
138 Requires(postun): /usr/sbin/groupdel
139 Requires(postun): /usr/sbin/userdel
140 Requires(pre): /usr/sbin/groupadd
141 Requires(pre): /usr/sbin/useradd
142 Conflicts: bacula-console < 0:1.34.6
143 Conflicts: bacula-dir < 0:1.34.6
144 Conflicts: bacula-fd < 0:1.34.6
145 Conflicts: bacula-sd < 0:1.34.6
148 Bacula - It comes by night and sucks the vital essence from your
151 Bacula is a set of computer programs that permit you (or the system
152 administrator) to manage backup, recovery, and verification of
153 computer data across a network of computers of different kinds. In
154 technical terms, it is a network client/server based backup program.
155 Bacula is relatively easy to use and efficient, while offering many
156 advanced storage management features that make it easy to find and
157 recover lost or damaged files.
159 %description common -l pl.UTF-8
160 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
162 Bacula to zbiór programów umożliwiających administratorowi na
163 zarządzanie kopiami zapasowymi, odzyskiwaniem i weryfikacją danych w
164 sieci komputerów różnego rodzaju. W terminologii technicznej jest to
165 program do kopii zapasowych pracujący w architekturze klient-serwer.
166 Bacula jest stosunkowo łatwa w użyciu i wydajna, oferując przy tym
167 wiele zaawansowanych możliwości przy zarządzaniu nośnikami,
168 ułatwiających znalezienie i odzyskanie utraconych lub uszkodzonych
172 Summary: Bacula Director and Catalog services
173 Summary(pl.UTF-8): Usługi Bacula Director i Catalog
174 Group: Networking/Utilities
175 Requires(post): sed >= 4.0
176 Requires: %{name}-common = %{version}-%{release}
177 Requires: bacula(db) = %{version}-%{release}
178 Obsoletes: bacula-updatedb
181 Bacula - It comes by night and sucks the vital essence from your
184 Bacula Director is the program that supervises all the backup,
185 restore, verify and archive operations. The system administrator uses
186 the Bacula Director to schedule backups and to recover files. Catalog
187 services are comprised of the software programs responsible for
188 maintaining the file indexes and volume databases for all files backed
189 up. The Catalog services permit the System Administrator or user to
190 quickly locate and restore any desired file, since it maintains a
191 record of all Volumes used, all Jobs run, and all Files saved.
193 %description dir -l pl.UTF-8
194 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
196 Bacula Director to program nadzorujący wszystkie operacje wykonywania
197 kopii zapasowych, odzyskiwania, weryfikacji i archiwizowania.
198 Administrator używa Bacula Directora do szeregowania kopii zapasowych
199 oraz odzyskiwania plików. Usługi katalogowe (Catalog services) są
200 używane przez programy odpowiedzialne za zarządzanie indeksami plików
201 i bazą danych wolumenów dla wszystkich kopiowanych plików. Usługi
202 katalogowe umożliwiają administratorowi lub użytkownikowi szybko
203 zlokalizować i odtworzyć dowolny plik, ponieważ utrzymują rekord ze
204 wszystkimi używanymi wolumenami, uruchomionymi zadaniami i zapisanymi
208 Summary: Bacula Console
209 Summary(pl.UTF-8): Konsola Baculi
210 Group: Networking/Utilities
211 Requires(post): sed >= 4.0
212 Requires: %{name}-common = %{version}-%{release}
215 Bacula - It comes by night and sucks the vital essence from your
218 Bacula Console is the program that allows the administrator or user to
219 communicate with the Bacula Director. This is the text only console
222 %description console -l pl.UTF-8
223 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
225 Bacula Console to program umożliwiający administratorowi lub
226 użytkownikowi komunikowanie się z programem Bacula Director. To jest
227 interfejs czysto tekstowy.
230 Summary: Bacula wxWidgets Console
231 Summary(pl.UTF-8): Konsola Baculi oparta na wxWidgets
232 Group: Networking/Utilities
233 Requires(post): sed >= 4.0
234 Requires: %{name}-common = %{version}-%{release}
236 %description console-wx
237 Bacula - It comes by night and sucks the vital essence from your
240 Bacula Console is the program that allows the administrator or user to
241 communicate with the Bacula Director. This is the wxWidgets GUI
244 %description console-wx -l pl.UTF-8
245 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
247 Bacula Console to program umożliwiający administratorowi lub
248 użytkownikowi komunikowanie się z programem Bacula Director. To jest
249 interfejs graficzny oparty na wxWidgets.
252 Summary: Bacula Qt4 Console
253 Summary(pl.UTF-8): Konsola Baculi oparta na Qt4
254 Group: Networking/Utilities
255 Requires(post): sed >= 4.0
256 Requires: %{name}-common = %{version}-%{release}
258 %description console-qt4
259 Bacula - It comes by night and sucks the vital essence from your
262 Bacula Console is the program that allows the administrator or user to
263 communicate with the Bacula Director. This is the Qt4 GUI interface.
265 %description console-qt4 -l pl.UTF-8
266 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
268 Bacula Console to program umożliwiający administratorowi lub
269 użytkownikowi komunikowanie się z programem Bacula Director. To jest
270 interfejs graficzny oparty na Qt4.
272 %package tray-monitor
273 Summary: Bacula Tray Monitor
274 Group: Networking/Utilities
275 Requires(post): sed >= 4.0
276 Requires: %{name}-common = %{version}-%{release}
278 %description tray-monitor
279 Bacula - It comes by night and sucks the vital essence from your
282 The Monitor program is typically an icon in the system tray. However,
283 once the icon is expanded into a full window, the administrator or
284 user can obtain status information about the Director or the backup
285 status on the local workstation or any other Bacula daemon that is
289 Summary: Bacula File services (Client)
290 Summary(pl.UTF-8): Usługi Bacula File (klient)
291 Group: Networking/Utilities
292 Requires(post): sed >= 4.0
293 Requires: %{name}-common = %{version}-%{release}
296 Bacula - It comes by night and sucks the vital essence from your
299 Bacula File services (or Client program) is the software program that
300 is installed on the machine to be backed up. It is specific to the
301 operating system on which it runs and is responsible for providing the
302 file attributes and data when requested by the Director. The File
303 services are also responsible for the file system dependent part of
304 restoring the file attributes and data during a recovery operation.
305 This program runs as a daemon on the machine to be backed up, and in
306 some of the documentation, the File daemon is referred to as the
307 Client (for example in Bacula configuration file).
309 %description fd -l pl.UTF-8
310 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
312 Usługi Bacula File (inaczej program kliencki) to oprogramowanie, które
313 instaluje się na maszynach, z których mają być wykonywane kopie
314 zapasowe. Są one specyficzne dla systemu operacyjnego, pod którym
315 działa dana maszyna i odpowiadają za dostarczanie atrybutów i danych
316 plików na żądanie Directora. Usługi plikowe są także odpowiedzialne za
317 zależną od systemu plików część odzyskiwania atrybutów i danych plików
318 podczas operacji odzyskiwania danych. Program działa jako demon na
319 maszynie, która ma być backupowana i w części dokumentacji demon ten
320 (File) jest nazywany klientem (na przykład w pliku konfiguracyjnym
324 Summary: Bacula Storage services
325 Summary(pl.UTF-8): Usługi Bacula Storage
326 Group: Networking/Utilities
327 Requires(post): sed >= 4.0
328 Requires: %{name}-common = %{version}-%{release}
329 Conflicts: dvd+rw-tools <= 5.21.4.10.8-1
332 Bacula - It comes by night and sucks the vital essence from your
335 Bacula Storage services consist of the software programs that perform
336 the storage and recovery of the file attributes and data to the
337 physical backup media or volumes. In other words, the Storage daemon
338 is responsible for reading and writing your tapes (or other storage
339 media, e.g. files). The Storage services runs as a daemon on the
340 machine that has the backup device (usually a tape drive).
342 %description sd -l pl.UTF-8
343 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
345 Usługi Bacula Storage składają się z programów obsługujących
346 przechowywanie danych oraz odzyskiwanie atrybutów i danych na
347 fizycznych nośnikach lub wolumenach. Innymi słowy, demon Storage jest
348 odpowiedzialny za odczyt i zapis taśm (lub innych nośników do
349 przechowywania danych, np. plików). Usługi Storage działają jako demon
350 na maszynie, która zawiera urządzenie backupowe (zwykle napęd
353 %package db-postgresql
354 Summary: PostgreSQL database driver for Bacula
355 Summary(pl.UTF-8): Sterownik bazy PostgreSQL dla Baculi
356 Group: Networking/Utilities
357 Requires(post): /sbin/ldconfig
358 Requires: %{name}-common = %{version}-%{release}
359 Provides: bacula(db) = %{version}-%{release}
360 Obsoletes: bacula(db)
362 %description db-postgresql
363 PostgreSQL database driver for Bacula.
365 %description db-postgresql -l pl.UTF-8
366 Sterownik bazy PostgreSQL dla Baculi.
369 Summary: MySQL database driver for Bacula
370 Summary(pl.UTF-8): Sterownik bazy MySQL dla Baculi
371 Group: Networking/Utilities
372 Requires(post): /sbin/ldconfig
373 Requires: %{name}-common = %{version}-%{release}
374 Provides: bacula(db) = %{version}-%{release}
375 Obsoletes: bacula(db)
377 %description db-mysql
378 MySQL database driver for Bacula.
380 %description db-mysql -l pl.UTF-8
381 Sterownik bazy MySQL dla Baculi.
384 Summary: SQLite database driver for Bacula
385 Summary(pl.UTF-8): Sterownik bazy SQLite dla Baculi
386 Group: Networking/Utilities
387 Requires(post): /sbin/ldconfig
388 Requires: %{name}-common = %{version}-%{release}
389 Provides: bacula(db) = %{version}-%{release}
390 Obsoletes: bacula(db)
392 %description db-sqlite3
393 SQLite database driver for Bacula.
395 %description db-sqlite3 -l pl.UTF-8
396 Sterownik bazy SQLite dla Baculi.
399 Summary: libdbi database driver for Bacula
400 Summary(pl.UTF-8): Sterownik bazy libdbi dla Baculi
401 Group: Networking/Utilities
402 Requires(post): /sbin/ldconfig
403 Requires: %{name}-common = %{version}-%{release}
404 Provides: bacula(db) = %{version}-%{release}
405 Obsoletes: bacula(db)
408 libdbi database driver for Bacula.
410 %description db-dbi -l pl.UTF-8
411 Sterownik baz libdbi dla Baculi.
414 Summary: Bacula - The Network Backup Solution
415 Summary(pl.UTF-8): Bacula - rozwiązanie do wykonywania kopii zapasowych po sieci
416 Group: Networking/Utilities
417 Requires: %{name}-fd = %{version}-%{release}
422 Bacula - It comes by night and sucks the vital essence from your
425 Bacula is a set of computer programs that permit you (or the system
426 administrator) to manage backup, recovery, and verification of
427 computer data across a network of computers of different kinds. In
428 technical terms, it is a network client/server based backup program.
429 Bacula is relatively easy to use and efficient, while offering many
430 advanced storage management features that make it easy to find and
431 recover lost or damaged files.
433 This package installs scripts for disaster recovery and builds rescue
434 floppy disk for bare metal recovery.
436 %description rescue -l pl.UTF-8
437 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
439 Bacula to zbiór programów umożliwiających administratorowi na
440 zarządzanie kopiami zapasowymi, odzyskiwaniem i weryfikacją danych w
441 sieci komputerów różnego rodzaju. W terminologii technicznej jest to
442 program do kopii zapasowych pracujący w architekturze klient-serwer.
443 Bacula jest stosunkowo łatwa w użyciu i wydajna, oferując przy tym
444 wiele zaawansowanych możliwości przy zarządzaniu nośnikami,
445 ułatwiających znalezienie i odzyskanie utraconych lub uszkodzonych
448 Ten pakiet zawiera skrypty do odtwarzania po awarii i tworzy dyskietkę
449 ratunkowe do odtwarzania systemu od zera.
451 %package -n nagios-plugin-check_bacula
452 Summary: Nagios plugin to check bacula
454 Requires: nagios-common
456 %description -n nagios-plugin-check_bacula
457 Nagios plugin to check bacula.
472 tar -xf %{SOURCE2} && ln -s bacula-rescue-* rescue
474 sed -i -e 's#bindir=.*#bindir=%{_bindir}#g' \
475 src/cats/create_* src/cats/delete_* src/cats/drop_* \
476 src/cats/grant_* src/cats/make_* src/cats/update_*
477 sed -i -e 's/@hostname@/--hostname--/' src/*/*.conf.in
480 for dbtype in mysql postgresql sqlite3; do
481 sed -i -e "s,@DB_TYPE@,$dbtype,g" src/cats/*_${dbtype}_*
487 %{__aclocal} -I bacula-macros -I gettext-macros
488 # $BUILD_DIR not seen by libtoolize, export it
489 BUILD_DIR=.. %{__libtoolize}
491 %{__autoconf} --prepend-include=$(pwd)/autoconf autoconf/configure.in > configure
493 CPPFLAGS="-I/usr/include/ncurses -I%{_includedir}/readline"
495 # we wan't the 'base' build built with the last database in the list,
496 # to make sure it is full-featured
497 for database in %{databases}; do
498 WXCONFIG=%{_bindir}/wx-gtk2-unicode-config \
499 QMAKE=%{_bindir}/qt4-qmake \
501 --with-scriptdir=%{_libexecdir}/%{name} \
502 %{?with_bat:--enable-bat} \
504 --enable-smartalloc \
505 %{?with_console_wx:--enable-bwx-console} \
506 --enable-tray-monitor \
507 %{?with_python:--with-python} \
509 --with-tcp-wrappers \
510 --with-working-dir=%{_var}/lib/%{name} \
511 --with-dump-email="root@localhost" \
512 --with-job-email="root@localhost" \
513 --with-smtp-host=localhost \
514 --with-pid-dir=/var/run \
515 --with-subsys-dir=/var/lock/subsys \
516 --enable-batch-insert \
518 %{?with_sqlite3_sync_off:--enable-extra-sqlite3-init="pragma synchronous=0;"} \
519 --with-dir-password="#FAKE-dir-password#" \
520 --with-fd-password="#FAKE-fd-password#" \
521 --with-sd-password="#FAKE-sd-password#" \
522 --with-mon-dir-password="#FAKE-mon-dir-password#" \
523 --with-mon-fd-password="#FAKE-mon-fd-password#" \
524 --with-mon-sd-password="#FAKE-mon-sd-password#" \
527 # build the database library
528 %{__make} -C src/cats clean
529 %{__make} -C src/cats
531 # install the database library in a temporary location
532 install -d libbacsql/$database%{_libdir}
533 %{__make} -C src/cats libtool-install DESTDIR=$PWD/libbacsql/$database
546 %{__make} -C examples/nagios/check_bacula
558 rm -rf $RPM_BUILD_ROOT
560 install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,logrotate.d,pam.d,sysconfig}
561 install -d $RPM_BUILD_ROOT%{_sysconfdir}/rescue
562 install -d $RPM_BUILD_ROOT{%{_pixmapsdir},%{_desktopdir},%{_mandir},%{_bindir},/var/log/bacula}
565 DESTDIR=$RPM_BUILD_ROOT
567 # install libraries for all the database backends
568 # ldconfig will add the soname symlinks when one of the packages is installed
569 for database in %{databases}; do
570 for libfile in libbacsql/$database%{_libdir}/lib*-*.so; do
571 orig_name=${libfile##*/}
572 file_prefix=${orig_name%%-*.so}
573 file_suffix=${orig_name#*-}
574 file_name=$file_prefix-$database-$file_suffix
575 install -p $libfile $RPM_BUILD_ROOT/%{_libdir}/$file_name
576 touch $RPM_BUILD_ROOT/%{_libdir}/$orig_name
580 install -p %{SOURCE10} $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-dir
581 install -p %{SOURCE11} $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-fd
582 install -p %{SOURCE12} $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-sd
583 cp -a %{SOURCE13} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}-dir
584 cp -a %{SOURCE14} $RPM_BUILD_ROOT/etc/sysconfig/bacula-dir
585 cp -a %{SOURCE15} $RPM_BUILD_ROOT/etc/sysconfig/bacula-fd
586 cp -a %{SOURCE16} $RPM_BUILD_ROOT/etc/sysconfig/bacula-sd
588 %if %{with console_wx}
589 # tray-monitor is for regular users
590 #mv $RPM_BUILD_ROOT%{_sbindir}/bacula-tray-monitor $RPM_BUILD_ROOT%{_bindir}
592 cp -a scripts/bacula.png $RPM_BUILD_ROOT%{_pixmapsdir}/bacula.png
593 #install src/tray-monitor/generic.xpm $RPM_BUILD_ROOT%{_pixmapsdir}/bacula-tray-monitor.xpm
594 sed -e 's/gnome-console/wx-console/g;s/Console/Wx Console/g' \
595 scripts/bacula.desktop.gnome2 > $RPM_BUILD_ROOT%{_desktopdir}/bacula-wx.desktop
596 #sed -e 's#%{_sbindir}#%{_bindir}#' \
597 # scripts/bacula-tray-monitor.desktop > $RPM_BUILD_ROOT%{_desktopdir}/bacula-tray-monitor.desktop
601 # TODO: libtool install
602 #libtool --silent --mode=install install src/qt-console/bat $RPM_BUILD_ROOT%{_bindir}
603 install src/qt-console/.libs/bat $RPM_BUILD_ROOT%{_bindir}
604 cp -a scripts/bat.desktop $RPM_BUILD_ROOT%{_desktopdir}
608 # install the rescue stuff, these are the rescue scripts
609 cp -a rescue/linux/floppy/backup.etc.list $RPM_BUILD_ROOT%{_sysconfdir}/rescue
610 cp -a rescue/linux/floppy/sfdisk.bz2 $RPM_BUILD_ROOT%{_sysconfdir}/rescue
611 install -p rescue/linux/floppy/*_* $RPM_BUILD_ROOT%{_sysconfdir}/rescue
612 install -p rescue/linux/floppy/getdiskinfo $RPM_BUILD_ROOT%{_sysconfdir}/rescue
615 touch $RPM_BUILD_ROOT/var/log/bacula/log
617 # install the updatedb scripts
618 install -p updatedb/update_sqlite* $RPM_BUILD_ROOT%{_libexecdir}/%{name}
620 # place for site passwords
621 touch $RPM_BUILD_ROOT%{_sysconfdir}/{dir-password,fd-password,sd-password}
622 touch $RPM_BUILD_ROOT%{_sysconfdir}/{mon-dir-password,mon-fd-password,mon-sd-password}
624 mv $RPM_BUILD_ROOT%{_libdir}/bacula/mtx-changer.conf $RPM_BUILD_ROOT/etc/bacula/mtx-changer.conf
627 rm -f $RPM_BUILD_ROOT%{_libexecdir}/%{name}/{gconsole,startmysql,stopmysql,bacula,bconsole,fd}
628 %if %{without console_wx}
629 rm -f $RPM_BUILD_ROOT%{_desktopdir}/bacula-wx.desktop
631 touch $RPM_BUILD_ROOT%{_sysconfdir}/.pw.sed
633 rm $RPM_BUILD_ROOT%{_docdir}/bacula/ChangeLog
634 rm $RPM_BUILD_ROOT%{_docdir}/bacula/INSTALL
635 rm $RPM_BUILD_ROOT%{_docdir}/bacula/LICENSE
636 rm $RPM_BUILD_ROOT%{_docdir}/bacula/README
637 rm $RPM_BUILD_ROOT%{_docdir}/bacula/ReleaseNotes
638 rm $RPM_BUILD_ROOT%{_docdir}/bacula/VERIFYING
639 rm $RPM_BUILD_ROOT%{_docdir}/bacula/technotes
641 # startup scripts, those in /etc/rc.d/init.d are better
642 rm $RPM_BUILD_ROOT%{_sbindir}/bacula
643 rm $RPM_BUILD_ROOT%{_libexecdir}/%{name}/bacula-ctl-*
646 rm $RPM_BUILD_ROOT%{_libexecdir}/%{name}/*_bdb_*
648 # rename to avoid possible conflicts
649 mv $RPM_BUILD_ROOT%{_sbindir}/{,bacula-}dbcheck
650 mv $RPM_BUILD_ROOT%{_mandir}/man8/{,bacula-}dbcheck.8.gz
652 # no -devel files packaged, so this is also useless
653 rm $RPM_BUILD_ROOT%{_libdir}/libbac{,cfg,find,py,sql}.{so,la}
655 # placeholders for the symlinks set in %%post db-*
656 for f in create_bacula_database drop_bacula_database drop_bacula_tables \
657 grant_bacula_privileges make_bacula_tables update_bacula_tables ; do
659 ln -sf /dev/null $RPM_BUILD_ROOT%{_libexecdir}/%{name}/$f
663 %{__make} -C examples/nagios/check_bacula install \
664 sbindir=%{nagiosplugindir} \
665 DESTDIR=$RPM_BUILD_ROOT
669 rm -rf $RPM_BUILD_ROOT
672 %groupadd -P %{name}-common -g 136 -r -f bacula
673 %useradd -P %{name}-common -u 136 -r -d /var/lib/bacula -s /bin/false -c "Bacula User" -g bacula bacula
676 %define update_configs \
677 echo "Updating bacula passwords and names..." | %banner \
679 for f in *-password ; do \
680 if [ ! -s $f ] ; then \
681 openssl rand -base64 33 > $f \
684 for cf in *.conf *.conf.rpmnew ; do \
685 [ -f $cf ] && sed -i -e"s:#FAKE-$f#:$p:" "$cf" || : \
688 for cf in *.conf *.conf.rpmnew ; do \
689 [ -f $cf ] && sed -i -e"s:--hostname--:`hostname`:" "$cf" || : \
698 if [ "$1" = "0" ]; then
703 %triggerpostun dir -- %{name}-dir < 5.0
704 %banner bacula-dir -t3 <<EOF
705 You have upgraded from an older version of Bacula director.
707 You will probably need to call %{_libexecdir}/%{name}/update_bacula_tables
708 script to upgrade the database.
713 /sbin/chkconfig --add bacula-dir
714 %service bacula-dir restart "Bacula Director daemon"
717 if [ "$1" = "0" ]; then
718 %service bacula-dir stop
719 /sbin/chkconfig --del bacula-dir
724 /sbin/chkconfig --add bacula-fd
725 %service bacula-fd restart "Bacula File daemon"
728 if [ "$1" = "0" ]; then
729 %service bacula-fd stop
730 /sbin/chkconfig --del bacula-fd
735 /sbin/chkconfig --add bacula-sd
736 %service bacula-sd restart "Bacula Storage daemon"
739 if [ "$1" = "0" ]; then
740 %service bacula-sd stop
741 /sbin/chkconfig --del bacula-sd
745 if [ -e %{_sysconfdir}/console.conf -a ! -e %{_sysconfdir}/bconsole.conf ]; then
746 mv %{_sysconfdir}/console.conf %{_sysconfdir}/bconsole.conf
755 %triggerpostun common -- %{name}-common < 5.0.1-2
756 find /etc/bacula/bat.conf* -perm /007 -print0 | xargs -0 -r chmod 600 || :
765 # link our current installed conf file to the rescue directory
766 ln -sf %{_sysconfdir}/bacula-fd.conf %{_sysconfdir}/rescue/bacula-fd.conf
769 echo "Creating rescue files for this system..."
770 cd %{_sysconfdir}/rescue
774 # remove the files created after the initial rpm installation
775 if [ "$1" = "0" ]; then
776 rm -f %{_sysconfdir}/rescue/bacula-fd.conf
777 rm -f %{_sysconfdir}/rescue/partition.*
778 rm -f %{_sysconfdir}/rescue/format.*
779 rm -f %{_sysconfdir}/rescue/mount_drives
780 rm -f %{_sysconfdir}/rescue/start_network
781 rm -f %{_sysconfdir}/rescue/sfdisk
782 rm -rf %{_sysconfdir}/rescue/diskinfo/*
787 for name in "create database" "drop tables" "drop database" "grant privileges" "make tables" "update tables"; do \
788 prefix="${name%% *}" \
789 suffix="${name#* }" \
790 ln -sf "${prefix}_%{1}_${suffix}" %{_libexecdir}/%{name}/"${prefix}_bacula_${suffix}" || : \
792 %service bacula-dir restart "Bacula Director daemon"
794 %define db_postun() \
796 if [ "$1" = "0" ]; then \
797 for f in %{_libexecdir}/%{name}/*_bacula_*; do \
798 if [ -L "$f" -a ! -e "$f" ]; then \
807 %postun db-postgresql
808 %db_postun postgresql
822 # dbi backend is different, as it is not bound with a specific db engine
825 %service bacula-dir restart "Bacula Director daemon"
827 %postun db-dbi -p /sbin/ldconfig
830 %defattr(644,root,root,755)
833 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*-password
834 # do not remove bsmtp from files. Fix build if it is not installed.
835 %attr(755,root,root) %{_sbindir}/bsmtp
836 %attr(755,root,root) %{_sbindir}/btraceback
837 %attr(755,root,root) %{_libdir}/libbac-5*.so
838 %attr(755,root,root) %{_libdir}/libbaccfg-5*.so
839 %attr(755,root,root) %{_libdir}/libbacfind-5*.so
840 %attr(755,root,root) %{_libdir}/libbacpy-5*.so
841 %{_mandir}/man8/bacula.8*
842 %{_mandir}/man1/bsmtp.1*
843 %{_mandir}/man8/btraceback.8*
844 %dir %{_libexecdir}/%{name}
845 %{_libexecdir}/%{name}/btraceback.dbx
846 %{_libexecdir}/%{name}/btraceback.gdb
847 %{_libexecdir}/%{name}/bacula_config
848 %attr(770,root,bacula) %dir %{_localstatedir}
849 %attr(750,bacula,logs) %dir /var/log/bacula
850 %attr(640,bacula,logs) %ghost /var/log/bacula/log
853 %defattr(644,root,root,755)
854 %doc ChangeLog CheckList ReleaseNotes kernstodo LICENSE
855 #%doc examples %{name}-docs-%{version}/manual/{*.pdf,bacula}
856 %attr(640,root,bacula) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bacula-dir.conf
857 %ghost %{_sysconfdir}/.pw.sed
858 %attr(640,root,root) %config(noreplace) /etc/logrotate.d/bacula-dir
859 %attr(754,root,root) /etc/rc.d/init.d/bacula-dir
860 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/bacula-dir
861 %attr(755,root,root) %{_sbindir}/bacula-dir
862 %attr(755,root,root) %{_sbindir}/bregex
863 %attr(755,root,root) %{_sbindir}/bwild
864 %attr(755,root,root) %{_sbindir}/bacula-dbcheck
865 %{_mandir}/man8/bacula-dir.8*
866 %{_mandir}/man8/bacula-dbcheck.8*
867 %{_libexecdir}/%{name}/query.sql
868 #%attr(755,root,root) %{_libexecdir}/%{name}/make_catalog_backup
869 #%attr(755,root,root) %{_libexecdir}/%{name}/delete_catalog_backup
872 %defattr(644,root,root,755)
873 %attr(755,root,root) %{_libexecdir}/%{name}/create_postgresql_database
874 %attr(755,root,root) %{_libexecdir}/%{name}/drop_postgresql_database
875 %attr(755,root,root) %{_libexecdir}/%{name}/drop_postgresql_tables
876 %attr(755,root,root) %{_libexecdir}/%{name}/grant_postgresql_privileges
877 %attr(755,root,root) %{_libexecdir}/%{name}/make_postgresql_tables
878 %attr(755,root,root) %{_libexecdir}/%{name}/update_postgresql_*
879 %attr(755,root,root) %{_libdir}/libbacsql-postgresql-5*.so
881 %ghost %attr(755,root,root) %{_libdir}/libbacsql-5*.so
882 %ghost %{_libexecdir}/%{name}/create_bacula_database
883 %ghost %{_libexecdir}/%{name}/drop_bacula_tables
884 %ghost %{_libexecdir}/%{name}/drop_bacula_database
885 %ghost %{_libexecdir}/%{name}/grant_bacula_privileges
886 %ghost %{_libexecdir}/%{name}/make_bacula_tables
887 %ghost %{_libexecdir}/%{name}/update_bacula_tables
890 %defattr(644,root,root,755)
891 %attr(755,root,root) %{_libexecdir}/%{name}/create_mysql_database
892 %attr(755,root,root) %{_libexecdir}/%{name}/drop_mysql_database
893 %attr(755,root,root) %{_libexecdir}/%{name}/drop_mysql_tables
894 %attr(755,root,root) %{_libexecdir}/%{name}/grant_mysql_privileges
895 %attr(755,root,root) %{_libexecdir}/%{name}/make_mysql_tables
896 %attr(755,root,root) %{_libexecdir}/%{name}/update_mysql_*
897 %attr(755,root,root) %{_libdir}/libbacsql-mysql-5*.so
899 %ghost %attr(755,root,root) %{_libdir}/libbacsql-5*.so
900 %ghost %{_libexecdir}/%{name}/create_bacula_database
901 %ghost %{_libexecdir}/%{name}/drop_bacula_tables
902 %ghost %{_libexecdir}/%{name}/drop_bacula_database
903 %ghost %{_libexecdir}/%{name}/grant_bacula_privileges
904 %ghost %{_libexecdir}/%{name}/make_bacula_tables
905 %ghost %{_libexecdir}/%{name}/update_bacula_tables
908 %defattr(644,root,root,755)
909 %attr(755,root,root) %{_libexecdir}/%{name}/create_sqlite3_database
910 %attr(755,root,root) %{_libexecdir}/%{name}/drop_sqlite3_database
911 %attr(755,root,root) %{_libexecdir}/%{name}/drop_sqlite3_tables
912 %attr(755,root,root) %{_libexecdir}/%{name}/grant_sqlite3_privileges
913 %attr(755,root,root) %{_libexecdir}/%{name}/make_sqlite3_tables
914 %attr(755,root,root) %{_libexecdir}/%{name}/update_sqlite3_*
915 %attr(755,root,root) %{_libexecdir}/%{name}/update_sqlite_*
916 %attr(755,root,root) %{_libdir}/libbacsql-sqlite3-5*.so
918 %ghost %attr(755,root,root) %{_libdir}/libbacsql-5*.so
919 %ghost %{_libexecdir}/%{name}/create_bacula_database
920 %ghost %{_libexecdir}/%{name}/drop_bacula_tables
921 %ghost %{_libexecdir}/%{name}/drop_bacula_database
922 %ghost %{_libexecdir}/%{name}/grant_bacula_privileges
923 %ghost %{_libexecdir}/%{name}/make_bacula_tables
924 %ghost %{_libexecdir}/%{name}/update_bacula_tables
927 %defattr(644,root,root,755)
928 %attr(755,root,root) %{_libexecdir}/%{name}/create_postgresql_database
929 %attr(755,root,root) %{_libexecdir}/%{name}/drop_postgresql_database
930 %attr(755,root,root) %{_libexecdir}/%{name}/drop_postgresql_tables
931 %attr(755,root,root) %{_libexecdir}/%{name}/grant_postgresql_privileges
932 %attr(755,root,root) %{_libexecdir}/%{name}/make_postgresql_tables
933 %attr(755,root,root) %{_libexecdir}/%{name}/update_postgresql_*
934 %attr(755,root,root) %{_libexecdir}/%{name}/create_mysql_database
935 %attr(755,root,root) %{_libexecdir}/%{name}/drop_mysql_database
936 %attr(755,root,root) %{_libexecdir}/%{name}/drop_mysql_tables
937 %attr(755,root,root) %{_libexecdir}/%{name}/grant_mysql_privileges
938 %attr(755,root,root) %{_libexecdir}/%{name}/make_mysql_tables
939 %attr(755,root,root) %{_libexecdir}/%{name}/update_mysql_*
940 %attr(755,root,root) %{_libexecdir}/%{name}/create_sqlite3_database
941 %attr(755,root,root) %{_libexecdir}/%{name}/drop_sqlite3_database
942 %attr(755,root,root) %{_libexecdir}/%{name}/drop_sqlite3_tables
943 %attr(755,root,root) %{_libexecdir}/%{name}/grant_sqlite3_privileges
944 %attr(755,root,root) %{_libexecdir}/%{name}/make_sqlite3_tables
945 %attr(755,root,root) %{_libexecdir}/%{name}/update_sqlite3_*
946 %attr(755,root,root) %{_libexecdir}/%{name}/update_sqlite_*
947 %attr(755,root,root) %{_libdir}/libbacsql-dbi-5*.so
949 %ghost %attr(755,root,root) %{_libdir}/libbacsql-5*.so
952 %defattr(644,root,root,755)
954 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bacula-fd.conf
955 %attr(754,root,root) /etc/rc.d/init.d/bacula-fd
956 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/bacula-fd
957 %attr(755,root,root) %{_sbindir}/bacula-fd
958 %attr(755,root,root) %{_libdir}/bpipe-fd.so
959 %{_mandir}/man8/bacula-fd.8*
962 %defattr(644,root,root,755)
964 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bacula-sd.conf
965 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mtx-changer.conf
966 %attr(754,root,root) /etc/rc.d/init.d/bacula-sd
967 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/bacula-sd
968 %attr(755,root,root) %{_sbindir}/bacula-sd
969 %attr(755,root,root) %{_sbindir}/bcopy
970 %attr(755,root,root) %{_sbindir}/bextract
971 %attr(755,root,root) %{_sbindir}/bls
972 %attr(755,root,root) %{_sbindir}/bscan
973 %attr(755,root,root) %{_sbindir}/btape
974 %attr(755,root,root) %{_libexecdir}/%{name}/mtx-changer
975 %attr(755,root,root) %{_libexecdir}/%{name}/disk-changer
976 %attr(755,root,root) %{_libexecdir}/%{name}/dvd-handler
977 %{_mandir}/man8/bacula-sd.8*
978 %{_mandir}/man8/bcopy.8*
979 %{_mandir}/man8/bextract.8*
980 %{_mandir}/man8/bls.8*
981 %{_mandir}/man8/bscan.8*
982 %{_mandir}/man8/btape.8*
985 %defattr(644,root,root,755)
987 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bconsole.conf
988 %attr(755,root,root) %{_sbindir}/bconsole
989 %{_mandir}/man8/bconsole.8*
991 %if %{with console_wx}
993 %defattr(644,root,root,755)
995 %{_pixmapsdir}/%{name}.png
996 %{_desktopdir}/bacula-wx.desktop
997 %attr(640,root,bacula) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bwx-console.conf
998 %attr(755,root,root) %{_sbindir}/bwx-console
999 %{_mandir}/man1/bacula-bwxconsole.1*
1004 %defattr(644,root,root,755)
1006 %{_pixmapsdir}/%{name}.png
1007 %{_desktopdir}/bat.desktop
1008 # Do not make this file world-readable or any user will get full access to the
1010 %attr(640,root,bacula) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bat.conf
1011 %attr(755,root,root) %{_bindir}/bat
1012 %{_mandir}/man1/bat.1*
1016 %if %{with console_wx}
1018 %defattr(644,root,root,755)
1020 %attr(755,root,root) %{_sbindir}/bacula-tray-monitor
1021 #%{_pixmapsdir}/%{name}-tray-monitor.xpm
1022 #%{_desktopdir}/%{name}-tray-monitor.desktop
1023 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/tray-monitor.conf
1024 %{_mandir}/man1/bacula-tray-monitor.1*
1029 %defattr(644,root,root,755)
1031 %dir %{_sysconfdir}/rescue
1032 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/backup.etc.list
1033 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/bacula-fd
1034 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/format_floppy
1035 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/getdiskinfo
1036 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/make_rescue_disk
1037 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/restore_bacula
1038 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/restore_etc
1039 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/run_grub
1040 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/run_lilo
1041 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/sfdisk.bz2
1045 %files -n nagios-plugin-check_bacula
1046 %defattr(644,root,root,755)
1047 %attr(755,root,root) %{nagiosplugindir}/check_bacula