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: libcap-devel
62 %{?with_dbi:BuildRequires: libdbi-devel >= 0.8.4}
63 BuildRequires: libtool
65 BuildRequires: fakeroot
67 BuildRequires: libwrap-devel
69 BuildRequires: ncurses-devel
70 BuildRequires: openssl-devel
71 BuildRequires: pkgconfig
73 BuildRequires: python-devel
76 BuildRequires: QtCore-devel
77 BuildRequires: QtGui-devel
78 BuildRequires: qt4-build >= 4.3.3-3
79 BuildRequires: qt4-qmake >= 4.3.3-3
80 BuildRequires: qwt-devel >= 5.0.2-2
82 %{?with_mysql:BuildRequires: mysql-devel}
83 %{?with_pgsql:BuildRequires: postgresql-devel}
84 BuildRequires: readline-devel
85 BuildRequires: rpmbuild(macros) >= 1.268
86 BuildRequires: sed >= 4.0
87 %{?with_sqlite3:BuildRequires: sqlite3-devel}
88 %if %{with console_wx}
89 BuildRequires: wxGTK2-unicode-devel >= 2.4.0
91 BuildRequires: zlib-devel
92 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
94 %define _sysconfdir /etc/%{name}
95 %define _localstatedir /var/lib/%{name}
96 %define nagiosplugindir %{_prefix}/lib/nagios/plugins
98 # from 'the worst' to 'the best'
99 %define databases %{?with_dbi:dbi} %{?with_sqlite3:sqlite3} %{?with_mysql:mysql} %{?with_pgsql:postgresql}
101 # dependency section is broken. ccache usage is instead to makefiles
102 %undefine with_ccache
105 Bacula - It comes by night and sucks the vital essence from your
108 Bacula is a set of computer programs that permit you (or the system
109 administrator) to manage backup, recovery, and verification of
110 computer data across a network of computers of different kinds. In
111 technical terms, it is a network client/server based backup program.
112 Bacula is relatively easy to use and efficient, while offering many
113 advanced storage management features that make it easy to find and
114 recover lost or damaged files.
116 %description -l pl.UTF-8
117 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
119 Bacula to zbiór programów umożliwiających administratorowi na
120 zarządzanie kopiami zapasowymi, odzyskiwaniem i weryfikacją danych w
121 sieci komputerów różnego rodzaju. W terminologii technicznej jest to
122 program do kopii zapasowych pracujący w architekturze klient-serwer.
123 Bacula jest stosunkowo łatwa w użyciu i wydajna, oferując przy tym
124 wiele zaawansowanych możliwości przy zarządzaniu nośnikami,
125 ułatwiających znalezienie i odzyskanie utraconych lub uszkodzonych
129 Summary: Common files for bacula package
130 Summary(pl.UTF-8): Pliki wspólne dla pakietu bacula
131 Group: Networking/Utilities
132 Requires(post): openssl-tools
133 Requires(post): sed >= 4.0
134 Requires(post,preun): /sbin/chkconfig
135 Requires(postun): /usr/sbin/groupdel
136 Requires(postun): /usr/sbin/userdel
137 Requires(pre): /usr/sbin/groupadd
138 Requires(pre): /usr/sbin/useradd
139 Conflicts: bacula-console < 0:1.34.6
140 Conflicts: bacula-dir < 0:1.34.6
141 Conflicts: bacula-fd < 0:1.34.6
142 Conflicts: bacula-sd < 0:1.34.6
145 Bacula - It comes by night and sucks the vital essence from your
148 Bacula is a set of computer programs that permit you (or the system
149 administrator) to manage backup, recovery, and verification of
150 computer data across a network of computers of different kinds. In
151 technical terms, it is a network client/server based backup program.
152 Bacula is relatively easy to use and efficient, while offering many
153 advanced storage management features that make it easy to find and
154 recover lost or damaged files.
156 %description common -l pl.UTF-8
157 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
159 Bacula to zbiór programów umożliwiających administratorowi na
160 zarządzanie kopiami zapasowymi, odzyskiwaniem i weryfikacją danych w
161 sieci komputerów różnego rodzaju. W terminologii technicznej jest to
162 program do kopii zapasowych pracujący w architekturze klient-serwer.
163 Bacula jest stosunkowo łatwa w użyciu i wydajna, oferując przy tym
164 wiele zaawansowanych możliwości przy zarządzaniu nośnikami,
165 ułatwiających znalezienie i odzyskanie utraconych lub uszkodzonych
169 Summary: Bacula Director and Catalog services
170 Summary(pl.UTF-8): Usługi Bacula Director i Catalog
171 Group: Networking/Utilities
172 Requires(post): sed >= 4.0
173 Requires: %{name}-common = %{version}-%{release}
174 Requires: bacula(db) = %{version}-%{release}
175 Obsoletes: bacula-updatedb
178 Bacula - It comes by night and sucks the vital essence from your
181 Bacula Director is the program that supervises all the backup,
182 restore, verify and archive operations. The system administrator uses
183 the Bacula Director to schedule backups and to recover files. Catalog
184 services are comprised of the software programs responsible for
185 maintaining the file indexes and volume databases for all files backed
186 up. The Catalog services permit the System Administrator or user to
187 quickly locate and restore any desired file, since it maintains a
188 record of all Volumes used, all Jobs run, and all Files saved.
190 %description dir -l pl.UTF-8
191 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
193 Bacula Director to program nadzorujący wszystkie operacje wykonywania
194 kopii zapasowych, odzyskiwania, weryfikacji i archiwizowania.
195 Administrator używa Bacula Directora do szeregowania kopii zapasowych
196 oraz odzyskiwania plików. Usługi katalogowe (Catalog services) są
197 używane przez programy odpowiedzialne za zarządzanie indeksami plików
198 i bazą danych wolumenów dla wszystkich kopiowanych plików. Usługi
199 katalogowe umożliwiają administratorowi lub użytkownikowi szybko
200 zlokalizować i odtworzyć dowolny plik, ponieważ utrzymują rekord ze
201 wszystkimi używanymi wolumenami, uruchomionymi zadaniami i zapisanymi
205 Summary: Bacula Console
206 Summary(pl.UTF-8): Konsola Baculi
207 Group: Networking/Utilities
208 Requires(post): sed >= 4.0
209 Requires: %{name}-common = %{version}-%{release}
212 Bacula - It comes by night and sucks the vital essence from your
215 Bacula Console is the program that allows the administrator or user to
216 communicate with the Bacula Director. This is the text only console
219 %description console -l pl.UTF-8
220 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
222 Bacula Console to program umożliwiający administratorowi lub
223 użytkownikowi komunikowanie się z programem Bacula Director. To jest
224 interfejs czysto tekstowy.
227 Summary: Bacula wxWidgets Console
228 Summary(pl.UTF-8): Konsola Baculi oparta na wxWidgets
229 Group: Networking/Utilities
230 Requires(post): sed >= 4.0
231 Requires: %{name}-common = %{version}-%{release}
233 %description console-wx
234 Bacula - It comes by night and sucks the vital essence from your
237 Bacula Console is the program that allows the administrator or user to
238 communicate with the Bacula Director. This is the wxWidgets GUI
241 %description console-wx -l pl.UTF-8
242 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
244 Bacula Console to program umożliwiający administratorowi lub
245 użytkownikowi komunikowanie się z programem Bacula Director. To jest
246 interfejs graficzny oparty na wxWidgets.
249 Summary: Bacula Qt4 Console
250 Summary(pl.UTF-8): Konsola Baculi oparta na Qt4
251 Group: Networking/Utilities
252 Requires(post): sed >= 4.0
253 Requires: %{name}-common = %{version}-%{release}
255 %description console-qt4
256 Bacula - It comes by night and sucks the vital essence from your
259 Bacula Console is the program that allows the administrator or user to
260 communicate with the Bacula Director. This is the Qt4 GUI interface.
262 %description console-qt4 -l pl.UTF-8
263 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
265 Bacula Console to program umożliwiający administratorowi lub
266 użytkownikowi komunikowanie się z programem Bacula Director. To jest
267 interfejs graficzny oparty na Qt4.
269 %package tray-monitor
270 Summary: Bacula Tray Monitor
271 Group: Networking/Utilities
272 Requires(post): sed >= 4.0
273 Requires: %{name}-common = %{version}-%{release}
275 %description tray-monitor
276 Bacula - It comes by night and sucks the vital essence from your
279 The Monitor program is typically an icon in the system tray. However,
280 once the icon is expanded into a full window, the administrator or
281 user can obtain status information about the Director or the backup
282 status on the local workstation or any other Bacula daemon that is
286 Summary: Bacula File services (Client)
287 Summary(pl.UTF-8): Usługi Bacula File (klient)
288 Group: Networking/Utilities
289 Requires(post): sed >= 4.0
290 Requires: %{name}-common = %{version}-%{release}
293 Bacula - It comes by night and sucks the vital essence from your
296 Bacula File services (or Client program) is the software program that
297 is installed on the machine to be backed up. It is specific to the
298 operating system on which it runs and is responsible for providing the
299 file attributes and data when requested by the Director. The File
300 services are also responsible for the file system dependent part of
301 restoring the file attributes and data during a recovery operation.
302 This program runs as a daemon on the machine to be backed up, and in
303 some of the documentation, the File daemon is referred to as the
304 Client (for example in Bacula configuration file).
306 %description fd -l pl.UTF-8
307 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
309 Usługi Bacula File (inaczej program kliencki) to oprogramowanie, które
310 instaluje się na maszynach, z których mają być wykonywane kopie
311 zapasowe. Są one specyficzne dla systemu operacyjnego, pod którym
312 działa dana maszyna i odpowiadają za dostarczanie atrybutów i danych
313 plików na żądanie Directora. Usługi plikowe są także odpowiedzialne za
314 zależną od systemu plików część odzyskiwania atrybutów i danych plików
315 podczas operacji odzyskiwania danych. Program działa jako demon na
316 maszynie, która ma być backupowana i w części dokumentacji demon ten
317 (File) jest nazywany klientem (na przykład w pliku konfiguracyjnym
321 Summary: Bacula Storage services
322 Summary(pl.UTF-8): Usługi Bacula Storage
323 Group: Networking/Utilities
324 Requires(post): sed >= 4.0
325 Requires: %{name}-common = %{version}-%{release}
326 Conflicts: dvd+rw-tools <= 5.21.4.10.8-1
329 Bacula - It comes by night and sucks the vital essence from your
332 Bacula Storage services consist of the software programs that perform
333 the storage and recovery of the file attributes and data to the
334 physical backup media or volumes. In other words, the Storage daemon
335 is responsible for reading and writing your tapes (or other storage
336 media, e.g. files). The Storage services runs as a daemon on the
337 machine that has the backup device (usually a tape drive).
339 %description sd -l pl.UTF-8
340 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
342 Usługi Bacula Storage składają się z programów obsługujących
343 przechowywanie danych oraz odzyskiwanie atrybutów i danych na
344 fizycznych nośnikach lub wolumenach. Innymi słowy, demon Storage jest
345 odpowiedzialny za odczyt i zapis taśm (lub innych nośników do
346 przechowywania danych, np. plików). Usługi Storage działają jako demon
347 na maszynie, która zawiera urządzenie backupowe (zwykle napęd
350 %package db-postgresql
351 Summary: PostgreSQL database driver for Bacula
352 Summary(pl.UTF-8): Sterownik bazy PostgreSQL dla Baculi
353 Group: Networking/Utilities
354 Requires(post): /sbin/ldconfig
355 Requires: %{name}-common = %{version}-%{release}
356 Provides: bacula(db) = %{version}-%{release}
357 Obsoletes: bacula(db)
359 %description db-postgresql
360 PostgreSQL database driver for Bacula.
362 %description db-postgresql -l pl.UTF-8
363 Sterownik bazy PostgreSQL dla Baculi.
366 Summary: MySQL database driver for Bacula
367 Summary(pl.UTF-8): Sterownik bazy MySQL dla Baculi
368 Group: Networking/Utilities
369 Requires(post): /sbin/ldconfig
370 Requires: %{name}-common = %{version}-%{release}
371 Provides: bacula(db) = %{version}-%{release}
372 Obsoletes: bacula(db)
374 %description db-mysql
375 MySQL database driver for Bacula.
377 %description db-mysql -l pl.UTF-8
378 Sterownik bazy MySQL dla Baculi.
381 Summary: SQLite database driver for Bacula
382 Summary(pl.UTF-8): Sterownik bazy SQLite dla Baculi
383 Group: Networking/Utilities
384 Requires(post): /sbin/ldconfig
385 Requires: %{name}-common = %{version}-%{release}
386 Provides: bacula(db) = %{version}-%{release}
387 Obsoletes: bacula(db)
389 %description db-sqlite3
390 SQLite database driver for Bacula.
392 %description db-sqlite3 -l pl.UTF-8
393 Sterownik bazy SQLite dla Baculi.
396 Summary: libdbi database driver for Bacula
397 Summary(pl.UTF-8): Sterownik bazy libdbi dla Baculi
398 Group: Networking/Utilities
399 Requires(post): /sbin/ldconfig
400 Requires: %{name}-common = %{version}-%{release}
401 Provides: bacula(db) = %{version}-%{release}
402 Obsoletes: bacula(db)
405 libdbi database driver for Bacula.
407 %description db-dbi -l pl.UTF-8
408 Sterownik baz libdbi dla Baculi.
411 Summary: Bacula - The Network Backup Solution
412 Summary(pl.UTF-8): Bacula - rozwiązanie do wykonywania kopii zapasowych po sieci
413 Group: Networking/Utilities
414 Requires: %{name}-fd = %{version}-%{release}
419 Bacula - It comes by night and sucks the vital essence from your
422 Bacula is a set of computer programs that permit you (or the system
423 administrator) to manage backup, recovery, and verification of
424 computer data across a network of computers of different kinds. In
425 technical terms, it is a network client/server based backup program.
426 Bacula is relatively easy to use and efficient, while offering many
427 advanced storage management features that make it easy to find and
428 recover lost or damaged files.
430 This package installs scripts for disaster recovery and builds rescue
431 floppy disk for bare metal recovery.
433 %description rescue -l pl.UTF-8
434 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
436 Bacula to zbiór programów umożliwiających administratorowi na
437 zarządzanie kopiami zapasowymi, odzyskiwaniem i weryfikacją danych w
438 sieci komputerów różnego rodzaju. W terminologii technicznej jest to
439 program do kopii zapasowych pracujący w architekturze klient-serwer.
440 Bacula jest stosunkowo łatwa w użyciu i wydajna, oferując przy tym
441 wiele zaawansowanych możliwości przy zarządzaniu nośnikami,
442 ułatwiających znalezienie i odzyskanie utraconych lub uszkodzonych
445 Ten pakiet zawiera skrypty do odtwarzania po awarii i tworzy dyskietkę
446 ratunkowe do odtwarzania systemu od zera.
448 %package -n nagios-plugin-check_bacula
449 Summary: Nagios plugin to check bacula
451 Requires: nagios-common
453 %description -n nagios-plugin-check_bacula
454 Nagios plugin to check bacula.
469 tar -xf %{SOURCE2} && ln -s bacula-rescue-* rescue
471 sed -i -e 's#bindir=.*#bindir=%{_bindir}#g' \
472 src/cats/create_* src/cats/delete_* src/cats/drop_* \
473 src/cats/grant_* src/cats/make_* src/cats/update_*
474 sed -i -e 's/@hostname@/--hostname--/' src/*/*.conf.in
477 for dbtype in mysql postgresql sqlite3; do
478 sed -i -e "s,@DB_TYPE@,$dbtype,g" src/cats/*_${dbtype}_*
484 %{__aclocal} -I bacula-macros -I gettext-macros
485 # $BUILD_DIR not seen by libtoolize, export it
486 BUILD_DIR=.. %{__libtoolize}
488 %{__autoconf} --prepend-include=$(pwd)/autoconf autoconf/configure.in > configure
490 CPPFLAGS="-I/usr/include/ncurses -I%{_includedir}/readline"
492 # we wan't the 'base' build built with the last database in the list,
493 # to make sure it is full-featured
494 for database in %{databases}; do
495 WXCONFIG=%{_bindir}/wx-gtk2-unicode-config \
497 --with-scriptdir=%{_libexecdir}/%{name} \
498 %{?with_bat:--enable-bat} \
500 --enable-smartalloc \
501 %{?with_console_wx:--enable-bwx-console} \
502 --enable-tray-monitor \
503 %{?with_python:--with-python} \
505 --with-tcp-wrappers \
506 --with-working-dir=%{_var}/lib/%{name} \
507 --with-dump-email="root@localhost" \
508 --with-job-email="root@localhost" \
509 --with-smtp-host=localhost \
510 --with-pid-dir=/var/run \
511 --with-subsys-dir=/var/lock/subsys \
512 --enable-batch-insert \
514 %{?with_sqlite3_sync_off:--enable-extra-sqlite3-init="pragma synchronous=0;"} \
515 --with-dir-password="#FAKE-dir-password#" \
516 --with-fd-password="#FAKE-fd-password#" \
517 --with-sd-password="#FAKE-sd-password#" \
518 --with-mon-dir-password="#FAKE-mon-dir-password#" \
519 --with-mon-fd-password="#FAKE-mon-fd-password#" \
520 --with-mon-sd-password="#FAKE-mon-sd-password#" \
523 # build the database library
524 %{__make} -C src/cats clean
525 %{__make} -C src/cats
527 # install the database library in a temporary location
528 install -d libbacsql/$database%{_libdir}
529 %{__make} -C src/cats libtool-install DESTDIR=$PWD/libbacsql/$database
542 %{__make} -C examples/nagios/check_bacula
554 rm -rf $RPM_BUILD_ROOT
556 install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,logrotate.d,pam.d,sysconfig}
557 install -d $RPM_BUILD_ROOT%{_sysconfdir}/rescue
558 install -d $RPM_BUILD_ROOT{%{_pixmapsdir},%{_desktopdir},%{_mandir},%{_bindir},/var/log/bacula}
561 DESTDIR=$RPM_BUILD_ROOT
563 # install libraries for all the database backends
564 # ldconfig will add the soname symlinks when one of the packages is installed
565 for database in %{databases}; do
566 for libfile in libbacsql/$database%{_libdir}/lib*-*.so; do
567 orig_name=${libfile##*/}
568 file_prefix=${orig_name%%-*.so}
569 file_suffix=${orig_name#*-}
570 file_name=$file_prefix-$database-$file_suffix
571 install -p $libfile $RPM_BUILD_ROOT/%{_libdir}/$file_name
572 touch $RPM_BUILD_ROOT/%{_libdir}/$orig_name
576 install -p %{SOURCE10} $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-dir
577 install -p %{SOURCE11} $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-fd
578 install -p %{SOURCE12} $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-sd
579 cp -a %{SOURCE13} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}-dir
580 cp -a %{SOURCE14} $RPM_BUILD_ROOT/etc/sysconfig/bacula-dir
581 cp -a %{SOURCE15} $RPM_BUILD_ROOT/etc/sysconfig/bacula-fd
582 cp -a %{SOURCE16} $RPM_BUILD_ROOT/etc/sysconfig/bacula-sd
584 %if %{with console_wx}
585 # tray-monitor is for regular users
586 #mv $RPM_BUILD_ROOT%{_sbindir}/bacula-tray-monitor $RPM_BUILD_ROOT%{_bindir}
588 cp -a scripts/bacula.png $RPM_BUILD_ROOT%{_pixmapsdir}/bacula.png
589 #install src/tray-monitor/generic.xpm $RPM_BUILD_ROOT%{_pixmapsdir}/bacula-tray-monitor.xpm
590 sed -e 's/gnome-console/wx-console/g;s/Console/Wx Console/g' \
591 scripts/bacula.desktop.gnome2 > $RPM_BUILD_ROOT%{_desktopdir}/bacula-wx.desktop
592 #sed -e 's#%{_sbindir}#%{_bindir}#' \
593 # scripts/bacula-tray-monitor.desktop > $RPM_BUILD_ROOT%{_desktopdir}/bacula-tray-monitor.desktop
597 # TODO: libtool install
598 #libtool --silent --mode=install install src/qt-console/bat $RPM_BUILD_ROOT%{_bindir}
599 install src/qt-console/.libs/bat $RPM_BUILD_ROOT%{_bindir}
600 cp -a scripts/bat.desktop $RPM_BUILD_ROOT%{_desktopdir}
604 # install the rescue stuff, these are the rescue scripts
605 cp -a rescue/linux/floppy/backup.etc.list $RPM_BUILD_ROOT%{_sysconfdir}/rescue
606 cp -a rescue/linux/floppy/sfdisk.bz2 $RPM_BUILD_ROOT%{_sysconfdir}/rescue
607 install -p rescue/linux/floppy/*_* $RPM_BUILD_ROOT%{_sysconfdir}/rescue
608 install -p rescue/linux/floppy/getdiskinfo $RPM_BUILD_ROOT%{_sysconfdir}/rescue
611 touch $RPM_BUILD_ROOT/var/log/bacula/log
613 # install the updatedb scripts
614 install -p updatedb/update_sqlite* $RPM_BUILD_ROOT%{_libexecdir}/%{name}
616 # place for site passwords
617 touch $RPM_BUILD_ROOT%{_sysconfdir}/{dir-password,fd-password,sd-password}
618 touch $RPM_BUILD_ROOT%{_sysconfdir}/{mon-dir-password,mon-fd-password,mon-sd-password}
620 mv $RPM_BUILD_ROOT%{_libdir}/bacula/mtx-changer.conf $RPM_BUILD_ROOT/etc/bacula/mtx-changer.conf
623 rm -f $RPM_BUILD_ROOT%{_libexecdir}/%{name}/{gconsole,startmysql,stopmysql,bacula,bconsole,fd}
624 %if %{without console_wx}
625 rm -f $RPM_BUILD_ROOT%{_desktopdir}/bacula-wx.desktop
627 touch $RPM_BUILD_ROOT%{_sysconfdir}/.pw.sed
629 rm $RPM_BUILD_ROOT%{_docdir}/bacula/ChangeLog
630 rm $RPM_BUILD_ROOT%{_docdir}/bacula/INSTALL
631 rm $RPM_BUILD_ROOT%{_docdir}/bacula/LICENSE
632 rm $RPM_BUILD_ROOT%{_docdir}/bacula/README
633 rm $RPM_BUILD_ROOT%{_docdir}/bacula/ReleaseNotes
634 rm $RPM_BUILD_ROOT%{_docdir}/bacula/VERIFYING
635 rm $RPM_BUILD_ROOT%{_docdir}/bacula/technotes
637 # startup scripts, those in /etc/rc.d/init.d are better
638 rm $RPM_BUILD_ROOT%{_sbindir}/bacula
639 rm $RPM_BUILD_ROOT%{_libexecdir}/%{name}/bacula-ctl-*
642 rm $RPM_BUILD_ROOT%{_libexecdir}/%{name}/*_bdb_*
644 # rename to avoid possible conflicts
645 mv $RPM_BUILD_ROOT%{_sbindir}/{,bacula-}dbcheck
646 mv $RPM_BUILD_ROOT%{_mandir}/man8/{,bacula-}dbcheck.8.gz
648 # no -devel files packaged, so this is also useless
649 rm $RPM_BUILD_ROOT%{_libdir}/libbac{,cfg,find,py,sql}.{so,la}
651 # placeholders for the symlinks set in %%post db-*
652 for f in create_bacula_database drop_bacula_database drop_bacula_tables \
653 grant_bacula_privileges make_bacula_tables update_bacula_tables ; do
655 ln -sf /dev/null $RPM_BUILD_ROOT%{_libexecdir}/%{name}/$f
659 %{__make} -C examples/nagios/check_bacula install \
660 sbindir=%{nagiosplugindir} \
661 DESTDIR=$RPM_BUILD_ROOT
665 rm -rf $RPM_BUILD_ROOT
668 %groupadd -P %{name}-common -g 136 -r -f bacula
669 %useradd -P %{name}-common -u 136 -r -d /var/lib/bacula -s /bin/false -c "Bacula User" -g bacula bacula
672 %define update_configs \
673 echo "Updating bacula passwords and names..." | %banner \
675 for f in *-password ; do \
676 if [ ! -s $f ] ; then \
677 openssl rand -base64 33 > $f \
680 for cf in *.conf *.conf.rpmnew ; do \
681 [ -f $cf ] && sed -i -e"s:#FAKE-$f#:$p:" "$cf" || : \
684 for cf in *.conf *.conf.rpmnew ; do \
685 [ -f $cf ] && sed -i -e"s:--hostname--:`hostname`:" "$cf" || : \
694 if [ "$1" = "0" ]; then
699 %triggerpostun dir -- %{name}-dir < 5.0
700 %banner bacula-dir -t3 <<EOF
701 You have upgraded from an older version of Bacula director.
703 You will probably need to call %{_libexecdir}/%{name}/update_bacula_tables
704 script to upgrade the database.
709 /sbin/chkconfig --add bacula-dir
710 %service bacula-dir restart "Bacula Director daemon"
713 if [ "$1" = "0" ]; then
714 %service bacula-dir stop
715 /sbin/chkconfig --del bacula-dir
720 /sbin/chkconfig --add bacula-fd
721 %service bacula-fd restart "Bacula File daemon"
724 if [ "$1" = "0" ]; then
725 %service bacula-fd stop
726 /sbin/chkconfig --del bacula-fd
731 /sbin/chkconfig --add bacula-sd
732 %service bacula-sd restart "Bacula Storage daemon"
735 if [ "$1" = "0" ]; then
736 %service bacula-sd stop
737 /sbin/chkconfig --del bacula-sd
741 if [ -e %{_sysconfdir}/console.conf -a ! -e %{_sysconfdir}/bconsole.conf ]; then
742 mv %{_sysconfdir}/console.conf %{_sysconfdir}/bconsole.conf
751 %triggerpostun common -- %{name}-common < 5.0.1-2
752 find /etc/bacula/bat.conf* -perm /007 -print0 | xargs -0 -r chmod 600 || :
761 # link our current installed conf file to the rescue directory
762 ln -sf %{_sysconfdir}/bacula-fd.conf %{_sysconfdir}/rescue/bacula-fd.conf
765 echo "Creating rescue files for this system..."
766 cd %{_sysconfdir}/rescue
770 # remove the files created after the initial rpm installation
771 if [ "$1" = "0" ]; then
772 rm -f %{_sysconfdir}/rescue/bacula-fd.conf
773 rm -f %{_sysconfdir}/rescue/partition.*
774 rm -f %{_sysconfdir}/rescue/format.*
775 rm -f %{_sysconfdir}/rescue/mount_drives
776 rm -f %{_sysconfdir}/rescue/start_network
777 rm -f %{_sysconfdir}/rescue/sfdisk
778 rm -rf %{_sysconfdir}/rescue/diskinfo/*
783 for name in "create database" "drop tables" "drop database" "grant privileges" "make tables" "update tables"; do \
784 prefix="${name%% *}" \
785 suffix="${name#* }" \
786 ln -sf "${prefix}_%{1}_${suffix}" %{_libexecdir}/%{name}/"${prefix}_bacula_${suffix}" || : \
788 %service bacula-dir restart "Bacula Director daemon"
790 %define db_postun() \
792 if [ "$1" = "0" ]; then \
793 for f in %{_libexecdir}/%{name}/*_bacula_*; do \
794 if [ -L "$f" -a ! -e "$f" ]; then \
803 %postun db-postgresql
804 %db_postun postgresql
818 # dbi backend is different, as it is not bound with a specific db engine
821 %service bacula-dir restart "Bacula Director daemon"
823 %postun db-dbi -p /sbin/ldconfig
826 %defattr(644,root,root,755)
829 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*-password
830 # do not remove bsmtp from files. Fix build if it is not installed.
831 %attr(755,root,root) %{_sbindir}/bsmtp
832 %attr(755,root,root) %{_sbindir}/btraceback
833 %attr(755,root,root) %{_libdir}/libbac-%{version}.so
834 %attr(755,root,root) %{_libdir}/libbaccfg-%{version}.so
835 %attr(755,root,root) %{_libdir}/libbacfind-%{version}.so
836 %attr(755,root,root) %{_libdir}/libbacpy-%{version}.so
837 %{_mandir}/man8/bacula.8*
838 %{_mandir}/man1/bsmtp.1*
839 %{_mandir}/man8/btraceback.8*
840 %dir %{_libexecdir}/%{name}
841 %{_libexecdir}/%{name}/btraceback.dbx
842 %{_libexecdir}/%{name}/btraceback.gdb
843 %{_libexecdir}/%{name}/bacula_config
844 %attr(770,root,bacula) %dir %{_localstatedir}
845 %attr(750,bacula,logs) %dir /var/log/bacula
846 %attr(640,bacula,logs) %ghost /var/log/bacula/log
849 %defattr(644,root,root,755)
850 %doc ChangeLog CheckList ReleaseNotes kernstodo LICENSE
851 #%doc examples %{name}-docs-%{version}/manual/{*.pdf,bacula}
852 %attr(640,root,bacula) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bacula-dir.conf
853 %ghost %{_sysconfdir}/.pw.sed
854 %attr(640,root,root) %config(noreplace) /etc/logrotate.d/bacula-dir
855 %attr(754,root,root) /etc/rc.d/init.d/bacula-dir
856 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/bacula-dir
857 %attr(755,root,root) %{_sbindir}/bacula-dir
858 %attr(755,root,root) %{_sbindir}/bregex
859 %attr(755,root,root) %{_sbindir}/bwild
860 %attr(755,root,root) %{_sbindir}/bacula-dbcheck
861 %{_mandir}/man8/bacula-dir.8*
862 %{_mandir}/man8/bacula-dbcheck.8*
863 %{_libexecdir}/%{name}/query.sql
864 #%attr(755,root,root) %{_libexecdir}/%{name}/make_catalog_backup
865 #%attr(755,root,root) %{_libexecdir}/%{name}/delete_catalog_backup
868 %defattr(644,root,root,755)
869 %attr(755,root,root) %{_libexecdir}/%{name}/create_postgresql_database
870 %attr(755,root,root) %{_libexecdir}/%{name}/drop_postgresql_database
871 %attr(755,root,root) %{_libexecdir}/%{name}/drop_postgresql_tables
872 %attr(755,root,root) %{_libexecdir}/%{name}/grant_postgresql_privileges
873 %attr(755,root,root) %{_libexecdir}/%{name}/make_postgresql_tables
874 %attr(755,root,root) %{_libexecdir}/%{name}/update_postgresql_*
875 %attr(755,root,root) %{_libdir}/libbacsql-postgresql-%{version}.so
877 %ghost %attr(755,root,root) %{_libdir}/libbacsql-%{version}.so
878 %ghost %{_libexecdir}/%{name}/create_bacula_database
879 %ghost %{_libexecdir}/%{name}/drop_bacula_tables
880 %ghost %{_libexecdir}/%{name}/drop_bacula_database
881 %ghost %{_libexecdir}/%{name}/grant_bacula_privileges
882 %ghost %{_libexecdir}/%{name}/make_bacula_tables
883 %ghost %{_libexecdir}/%{name}/update_bacula_tables
886 %defattr(644,root,root,755)
887 %attr(755,root,root) %{_libexecdir}/%{name}/create_mysql_database
888 %attr(755,root,root) %{_libexecdir}/%{name}/drop_mysql_database
889 %attr(755,root,root) %{_libexecdir}/%{name}/drop_mysql_tables
890 %attr(755,root,root) %{_libexecdir}/%{name}/grant_mysql_privileges
891 %attr(755,root,root) %{_libexecdir}/%{name}/make_mysql_tables
892 %attr(755,root,root) %{_libexecdir}/%{name}/update_mysql_*
893 %attr(755,root,root) %{_libdir}/libbacsql-mysql-%{version}.so
895 %ghost %attr(755,root,root) %{_libdir}/libbacsql-%{version}.so
896 %ghost %{_libexecdir}/%{name}/create_bacula_database
897 %ghost %{_libexecdir}/%{name}/drop_bacula_tables
898 %ghost %{_libexecdir}/%{name}/drop_bacula_database
899 %ghost %{_libexecdir}/%{name}/grant_bacula_privileges
900 %ghost %{_libexecdir}/%{name}/make_bacula_tables
901 %ghost %{_libexecdir}/%{name}/update_bacula_tables
904 %defattr(644,root,root,755)
905 %attr(755,root,root) %{_libexecdir}/%{name}/create_sqlite3_database
906 %attr(755,root,root) %{_libexecdir}/%{name}/drop_sqlite3_database
907 %attr(755,root,root) %{_libexecdir}/%{name}/drop_sqlite3_tables
908 %attr(755,root,root) %{_libexecdir}/%{name}/grant_sqlite3_privileges
909 %attr(755,root,root) %{_libexecdir}/%{name}/make_sqlite3_tables
910 %attr(755,root,root) %{_libexecdir}/%{name}/update_sqlite3_*
911 %attr(755,root,root) %{_libexecdir}/%{name}/update_sqlite_*
912 %attr(755,root,root) %{_libdir}/libbacsql-sqlite3-%{version}.so
914 %ghost %attr(755,root,root) %{_libdir}/libbacsql-%{version}.so
915 %ghost %{_libexecdir}/%{name}/create_bacula_database
916 %ghost %{_libexecdir}/%{name}/drop_bacula_tables
917 %ghost %{_libexecdir}/%{name}/drop_bacula_database
918 %ghost %{_libexecdir}/%{name}/grant_bacula_privileges
919 %ghost %{_libexecdir}/%{name}/make_bacula_tables
920 %ghost %{_libexecdir}/%{name}/update_bacula_tables
923 %defattr(644,root,root,755)
924 %attr(755,root,root) %{_libexecdir}/%{name}/create_postgresql_database
925 %attr(755,root,root) %{_libexecdir}/%{name}/drop_postgresql_database
926 %attr(755,root,root) %{_libexecdir}/%{name}/drop_postgresql_tables
927 %attr(755,root,root) %{_libexecdir}/%{name}/grant_postgresql_privileges
928 %attr(755,root,root) %{_libexecdir}/%{name}/make_postgresql_tables
929 %attr(755,root,root) %{_libexecdir}/%{name}/update_postgresql_*
930 %attr(755,root,root) %{_libexecdir}/%{name}/create_mysql_database
931 %attr(755,root,root) %{_libexecdir}/%{name}/drop_mysql_database
932 %attr(755,root,root) %{_libexecdir}/%{name}/drop_mysql_tables
933 %attr(755,root,root) %{_libexecdir}/%{name}/grant_mysql_privileges
934 %attr(755,root,root) %{_libexecdir}/%{name}/make_mysql_tables
935 %attr(755,root,root) %{_libexecdir}/%{name}/update_mysql_*
936 %attr(755,root,root) %{_libexecdir}/%{name}/create_sqlite3_database
937 %attr(755,root,root) %{_libexecdir}/%{name}/drop_sqlite3_database
938 %attr(755,root,root) %{_libexecdir}/%{name}/drop_sqlite3_tables
939 %attr(755,root,root) %{_libexecdir}/%{name}/grant_sqlite3_privileges
940 %attr(755,root,root) %{_libexecdir}/%{name}/make_sqlite3_tables
941 %attr(755,root,root) %{_libexecdir}/%{name}/update_sqlite3_*
942 %attr(755,root,root) %{_libexecdir}/%{name}/update_sqlite_*
943 %attr(755,root,root) %{_libdir}/libbacsql-dbi-%{version}.so
945 %ghost %attr(755,root,root) %{_libdir}/libbacsql-%{version}.so
948 %defattr(644,root,root,755)
950 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bacula-fd.conf
951 %attr(754,root,root) /etc/rc.d/init.d/bacula-fd
952 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/bacula-fd
953 %attr(755,root,root) %{_sbindir}/bacula-fd
954 %attr(755,root,root) %{_libdir}/bpipe-fd.so
955 %{_mandir}/man8/bacula-fd.8*
958 %defattr(644,root,root,755)
960 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bacula-sd.conf
961 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mtx-changer.conf
962 %attr(754,root,root) /etc/rc.d/init.d/bacula-sd
963 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/bacula-sd
964 %attr(755,root,root) %{_sbindir}/bacula-sd
965 %attr(755,root,root) %{_sbindir}/bcopy
966 %attr(755,root,root) %{_sbindir}/bextract
967 %attr(755,root,root) %{_sbindir}/bls
968 %attr(755,root,root) %{_sbindir}/bscan
969 %attr(755,root,root) %{_sbindir}/btape
970 %attr(755,root,root) %{_libexecdir}/%{name}/mtx-changer
971 %attr(755,root,root) %{_libexecdir}/%{name}/disk-changer
972 %attr(755,root,root) %{_libexecdir}/%{name}/dvd-handler
973 %{_mandir}/man8/bacula-sd.8*
974 %{_mandir}/man8/bcopy.8*
975 %{_mandir}/man8/bextract.8*
976 %{_mandir}/man8/bls.8*
977 %{_mandir}/man8/bscan.8*
978 %{_mandir}/man8/btape.8*
981 %defattr(644,root,root,755)
983 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bconsole.conf
984 %attr(755,root,root) %{_sbindir}/bconsole
985 %{_mandir}/man8/bconsole.8*
987 %if %{with console_wx}
989 %defattr(644,root,root,755)
991 %{_pixmapsdir}/%{name}.png
992 %{_desktopdir}/bacula-wx.desktop
993 %attr(640,root,bacula) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bwx-console.conf
994 %attr(755,root,root) %{_sbindir}/bwx-console
995 %{_mandir}/man1/bacula-bwxconsole.1*
1000 %defattr(644,root,root,755)
1002 %{_pixmapsdir}/%{name}.png
1003 %{_desktopdir}/bat.desktop
1004 # Do not make this file world-readable or any user will get full access to the
1006 %attr(640,root,bacula) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bat.conf
1007 %attr(755,root,root) %{_bindir}/bat
1008 %{_mandir}/man1/bat.1*
1012 %if %{with console_wx}
1014 %defattr(644,root,root,755)
1016 %attr(755,root,root) %{_sbindir}/bacula-tray-monitor
1017 #%{_pixmapsdir}/%{name}-tray-monitor.xpm
1018 #%{_desktopdir}/%{name}-tray-monitor.desktop
1019 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/tray-monitor.conf
1020 %{_mandir}/man1/bacula-tray-monitor.1*
1025 %defattr(644,root,root,755)
1027 %dir %{_sysconfdir}/rescue
1028 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/backup.etc.list
1029 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/bacula-fd
1030 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/format_floppy
1031 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/getdiskinfo
1032 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/make_rescue_disk
1033 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/restore_bacula
1034 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/restore_etc
1035 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/run_grub
1036 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/run_lilo
1037 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/sfdisk.bz2
1041 %files -n nagios-plugin-check_bacula
1042 %defattr(644,root,root,755)
1043 %attr(755,root,root) %{nagiosplugindir}/check_bacula