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 %if "%{pld_release}" != "ac"
14 %bcond_without dbi # use Database Independent Abstraction Layer (libdbi)
16 %bcond_with dbi # use Database Independent Abstraction Layer (libdbi)
18 %bcond_without mysql # use MySQL
19 %bcond_without pgsql # use PostgreSQL
20 %bcond_without sqlite3 # use SQLite3
22 %bcond_without nagios # build nagios plugin
24 %bcond_with sqlite3_sync_off # makes SQLite3 backend much faster, but less reliable
26 %if %{without sqlite3}
27 %undefine with_sqlite3_sync_off
30 Summary: Bacula - The Network Backup Solution
31 Summary(pl.UTF-8): Bacula - rozwiązanie do wykonywania kopii zapasowych po sieci
35 License: extended GPL v2
36 Group: Networking/Utilities
37 Source0: http://downloads.sourceforge.net/bacula/%{name}-%{version}.tar.gz
38 # Source0-md5: 9de254ae39cab0587fdb2f5d8d90b03b
39 Source1: http://downloads.sourceforge.net/bacula/%{name}-docs-%{version}.tar.bz2
40 # Source1-md5: 7a00557dcf0dfa40de9e74176fefd1ae
41 Source2: http://downloads.sourceforge.net/bacula/%{name}-rescue-5.0.1.tar.gz
42 # Source2-md5: bb194aed8e204f54bf2f61d7e721f257
43 Source10: %{name}-dir.init
44 Source11: %{name}-fd.init
45 Source12: %{name}-sd.init
46 Source13: %{name}.logrotate
47 Source14: %{name}-dir.sysconfig
48 Source15: %{name}-fd.sysconfig
49 Source16: %{name}-sd.sysconfig
50 Patch0: %{name}-mtx-changer.patch
51 Patch1: %{name}-link.patch
52 Patch2: %{name}-tinfo-readline.patch
53 Patch3: %{name}-branding.patch
54 Patch4: %{name}-conf.patch
55 Patch5: %{name}-desktop.patch
56 Patch7: %{name}-dbi_fixes.patch
57 Patch8: %{name}-dbi_dbcheck.patch
58 Patch9: %{name}-openssl1.patch
59 Patch10: %{name}-dvd_rewind.patch
60 URL: http://www.bacula.org/
61 BuildRequires: acl-devel
62 BuildRequires: autoconf
63 BuildRequires: automake
64 BuildRequires: gettext-devel
65 BuildRequires: gtk+2-devel
66 BuildRequires: libcap-devel
67 %{?with_dbi:BuildRequires: libdbi-devel >= 0.8.4}
68 BuildRequires: libtool >= 2:2.2
70 BuildRequires: fakeroot
72 BuildRequires: libwrap-devel
73 BuildRequires: ncurses-devel
74 BuildRequires: openssl-devel
75 BuildRequires: pkgconfig
77 BuildRequires: python-devel
78 BuildRequires: python-modules
81 BuildRequires: QtCore-devel
82 BuildRequires: QtGui-devel
83 BuildRequires: qt4-build >= 4.3.3-3
84 BuildRequires: qt4-qmake >= 4.3.3-3
85 #BuildRequires: qwt-devel >= 5.0.2-2
87 %{?with_mysql:BuildRequires: mysql-devel}
88 %{?with_pgsql:BuildRequires: postgresql-devel}
89 BuildRequires: readline-devel
90 BuildRequires: rpm-pythonprov
91 BuildRequires: rpmbuild(macros) >= 1.268
92 BuildRequires: sed >= 4.0
93 %{?with_sqlite3:BuildRequires: sqlite3-devel}
95 %if %{with console_wx}
96 BuildRequires: wxGTK2-unicode-devel >= 2.4.0
98 BuildRequires: zlib-devel
99 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
101 %define _sysconfdir /etc/%{name}
102 %define _localstatedir /var/lib/%{name}
103 %define nagiosplugindir %{_libdir}/nagios/plugins
105 # from 'the worst' to 'the best'
106 %define databases %{?with_dbi:dbi} %{?with_sqlite3:sqlite3} %{?with_mysql:mysql} %{?with_pgsql:postgresql}
108 # dependency section is broken. ccache usage is instead to makefiles
109 %undefine with_ccache
112 Bacula - It comes by night and sucks the vital essence from your
115 Bacula is a set of computer programs that permit you (or the system
116 administrator) to manage backup, recovery, and verification of
117 computer data across a network of computers of different kinds. In
118 technical terms, it is a network client/server based backup program.
119 Bacula is relatively easy to use and efficient, while offering many
120 advanced storage management features that make it easy to find and
121 recover lost or damaged files.
123 %description -l pl.UTF-8
124 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
126 Bacula to zbiór programów umożliwiających administratorowi na
127 zarządzanie kopiami zapasowymi, odzyskiwaniem i weryfikacją danych w
128 sieci komputerów różnego rodzaju. W terminologii technicznej jest to
129 program do kopii zapasowych pracujący w architekturze klient-serwer.
130 Bacula jest stosunkowo łatwa w użyciu i wydajna, oferując przy tym
131 wiele zaawansowanych możliwości przy zarządzaniu nośnikami,
132 ułatwiających znalezienie i odzyskanie utraconych lub uszkodzonych
136 Summary: Common files for bacula package
137 Summary(pl.UTF-8): Pliki wspólne dla pakietu bacula
138 Group: Networking/Utilities
139 Requires(post): openssl-tools
140 Requires(post): sed >= 4.0
141 Requires(post,preun): /sbin/chkconfig
142 Requires(postun): /usr/sbin/groupdel
143 Requires(postun): /usr/sbin/userdel
144 Requires(pre): /usr/sbin/groupadd
145 Requires(pre): /usr/sbin/useradd
146 Conflicts: bacula-console < 0:1.34.6
147 Conflicts: bacula-dir < 0:1.34.6
148 Conflicts: bacula-fd < 0:1.34.6
149 Conflicts: bacula-sd < 0:1.34.6
152 Bacula - It comes by night and sucks the vital essence from your
155 Bacula is a set of computer programs that permit you (or the system
156 administrator) to manage backup, recovery, and verification of
157 computer data across a network of computers of different kinds. In
158 technical terms, it is a network client/server based backup program.
159 Bacula is relatively easy to use and efficient, while offering many
160 advanced storage management features that make it easy to find and
161 recover lost or damaged files.
163 %description common -l pl.UTF-8
164 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
166 Bacula to zbiór programów umożliwiających administratorowi na
167 zarządzanie kopiami zapasowymi, odzyskiwaniem i weryfikacją danych w
168 sieci komputerów różnego rodzaju. W terminologii technicznej jest to
169 program do kopii zapasowych pracujący w architekturze klient-serwer.
170 Bacula jest stosunkowo łatwa w użyciu i wydajna, oferując przy tym
171 wiele zaawansowanych możliwości przy zarządzaniu nośnikami,
172 ułatwiających znalezienie i odzyskanie utraconych lub uszkodzonych
176 Summary: Bacula Director and Catalog services
177 Summary(pl.UTF-8): Usługi Bacula Director i Catalog
178 Group: Networking/Utilities
179 Requires(post): sed >= 4.0
180 Requires: %{name}-common = %{version}-%{release}
181 Requires: bacula(db) = %{version}-%{release}
182 Obsoletes: bacula-updatedb
185 Bacula - It comes by night and sucks the vital essence from your
188 Bacula Director is the program that supervises all the backup,
189 restore, verify and archive operations. The system administrator uses
190 the Bacula Director to schedule backups and to recover files. Catalog
191 services are comprised of the software programs responsible for
192 maintaining the file indexes and volume databases for all files backed
193 up. The Catalog services permit the System Administrator or user to
194 quickly locate and restore any desired file, since it maintains a
195 record of all Volumes used, all Jobs run, and all Files saved.
197 %description dir -l pl.UTF-8
198 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
200 Bacula Director to program nadzorujący wszystkie operacje wykonywania
201 kopii zapasowych, odzyskiwania, weryfikacji i archiwizowania.
202 Administrator używa Bacula Directora do szeregowania kopii zapasowych
203 oraz odzyskiwania plików. Usługi katalogowe (Catalog services) są
204 używane przez programy odpowiedzialne za zarządzanie indeksami plików
205 i bazą danych wolumenów dla wszystkich kopiowanych plików. Usługi
206 katalogowe umożliwiają administratorowi lub użytkownikowi szybko
207 zlokalizować i odtworzyć dowolny plik, ponieważ utrzymują rekord ze
208 wszystkimi używanymi wolumenami, uruchomionymi zadaniami i zapisanymi
212 Summary: Bacula Console
213 Summary(pl.UTF-8): Konsola Baculi
214 Group: Networking/Utilities
215 Requires(post): sed >= 4.0
216 Requires: %{name}-common = %{version}-%{release}
219 Bacula - It comes by night and sucks the vital essence from your
222 Bacula Console is the program that allows the administrator or user to
223 communicate with the Bacula Director. This is the text only console
226 %description console -l pl.UTF-8
227 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
229 Bacula Console to program umożliwiający administratorowi lub
230 użytkownikowi komunikowanie się z programem Bacula Director. To jest
231 interfejs czysto tekstowy.
234 Summary: Bacula wxWidgets Console
235 Summary(pl.UTF-8): Konsola Baculi oparta na wxWidgets
236 Group: Networking/Utilities
237 Requires(post): sed >= 4.0
238 Requires: %{name}-common = %{version}-%{release}
240 %description console-wx
241 Bacula - It comes by night and sucks the vital essence from your
244 Bacula Console is the program that allows the administrator or user to
245 communicate with the Bacula Director. This is the wxWidgets GUI
248 %description console-wx -l pl.UTF-8
249 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
251 Bacula Console to program umożliwiający administratorowi lub
252 użytkownikowi komunikowanie się z programem Bacula Director. To jest
253 interfejs graficzny oparty na wxWidgets.
256 Summary: Bacula Qt4 Console
257 Summary(pl.UTF-8): Konsola Baculi oparta na Qt4
258 Group: Networking/Utilities
259 Requires(post): sed >= 4.0
260 Requires: %{name}-common = %{version}-%{release}
262 %description console-qt4
263 Bacula - It comes by night and sucks the vital essence from your
266 Bacula Console is the program that allows the administrator or user to
267 communicate with the Bacula Director. This is the Qt4 GUI interface.
269 %description console-qt4 -l pl.UTF-8
270 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
272 Bacula Console to program umożliwiający administratorowi lub
273 użytkownikowi komunikowanie się z programem Bacula Director. To jest
274 interfejs graficzny oparty na Qt4.
276 %package tray-monitor
277 Summary: Bacula Tray Monitor
278 Group: Networking/Utilities
279 Requires(post): sed >= 4.0
280 Requires: %{name}-common = %{version}-%{release}
282 %description tray-monitor
283 Bacula - It comes by night and sucks the vital essence from your
286 The Monitor program is typically an icon in the system tray. However,
287 once the icon is expanded into a full window, the administrator or
288 user can obtain status information about the Director or the backup
289 status on the local workstation or any other Bacula daemon that is
293 Summary: Bacula File services (Client)
294 Summary(pl.UTF-8): Usługi Bacula File (klient)
295 Group: Networking/Utilities
296 Requires(post): sed >= 4.0
297 Requires: %{name}-common = %{version}-%{release}
300 Bacula - It comes by night and sucks the vital essence from your
303 Bacula File services (or Client program) is the software program that
304 is installed on the machine to be backed up. It is specific to the
305 operating system on which it runs and is responsible for providing the
306 file attributes and data when requested by the Director. The File
307 services are also responsible for the file system dependent part of
308 restoring the file attributes and data during a recovery operation.
309 This program runs as a daemon on the machine to be backed up, and in
310 some of the documentation, the File daemon is referred to as the
311 Client (for example in Bacula configuration file).
313 %description fd -l pl.UTF-8
314 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
316 Usługi Bacula File (inaczej program kliencki) to oprogramowanie, które
317 instaluje się na maszynach, z których mają być wykonywane kopie
318 zapasowe. Są one specyficzne dla systemu operacyjnego, pod którym
319 działa dana maszyna i odpowiadają za dostarczanie atrybutów i danych
320 plików na żądanie Directora. Usługi plikowe są także odpowiedzialne za
321 zależną od systemu plików część odzyskiwania atrybutów i danych plików
322 podczas operacji odzyskiwania danych. Program działa jako demon na
323 maszynie, która ma być backupowana i w części dokumentacji demon ten
324 (File) jest nazywany klientem (na przykład w pliku konfiguracyjnym
328 Summary: Bacula Storage services
329 Summary(pl.UTF-8): Usługi Bacula Storage
330 Group: Networking/Utilities
331 Requires(post): sed >= 4.0
332 Requires: %{name}-common = %{version}-%{release}
333 Conflicts: dvd+rw-tools <= 5.21.4.10.8-1
336 Bacula - It comes by night and sucks the vital essence from your
339 Bacula Storage services consist of the software programs that perform
340 the storage and recovery of the file attributes and data to the
341 physical backup media or volumes. In other words, the Storage daemon
342 is responsible for reading and writing your tapes (or other storage
343 media, e.g. files). The Storage services runs as a daemon on the
344 machine that has the backup device (usually a tape drive).
346 %description sd -l pl.UTF-8
347 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
349 Usługi Bacula Storage składają się z programów obsługujących
350 przechowywanie danych oraz odzyskiwanie atrybutów i danych na
351 fizycznych nośnikach lub wolumenach. Innymi słowy, demon Storage jest
352 odpowiedzialny za odczyt i zapis taśm (lub innych nośników do
353 przechowywania danych, np. plików). Usługi Storage działają jako demon
354 na maszynie, która zawiera urządzenie backupowe (zwykle napęd
357 %package db-postgresql
358 Summary: PostgreSQL database driver for Bacula
359 Summary(pl.UTF-8): Sterownik bazy PostgreSQL dla Baculi
360 Group: Networking/Utilities
361 Requires(post): /sbin/ldconfig
362 Requires: %{name}-common = %{version}-%{release}
363 Provides: bacula(db) = %{version}-%{release}
364 Obsoletes: bacula(db)
366 %description db-postgresql
367 PostgreSQL database driver for Bacula.
369 %description db-postgresql -l pl.UTF-8
370 Sterownik bazy PostgreSQL dla Baculi.
373 Summary: MySQL database driver for Bacula
374 Summary(pl.UTF-8): Sterownik bazy MySQL dla Baculi
375 Group: Networking/Utilities
376 Requires(post): /sbin/ldconfig
377 Requires: %{name}-common = %{version}-%{release}
378 Provides: bacula(db) = %{version}-%{release}
379 Obsoletes: bacula(db)
381 %description db-mysql
382 MySQL database driver for Bacula.
384 %description db-mysql -l pl.UTF-8
385 Sterownik bazy MySQL dla Baculi.
388 Summary: SQLite database driver for Bacula
389 Summary(pl.UTF-8): Sterownik bazy SQLite dla Baculi
390 Group: Networking/Utilities
391 Requires(post): /sbin/ldconfig
392 Requires: %{name}-common = %{version}-%{release}
393 Provides: bacula(db) = %{version}-%{release}
394 Obsoletes: bacula(db)
396 %description db-sqlite3
397 SQLite database driver for Bacula.
399 %description db-sqlite3 -l pl.UTF-8
400 Sterownik bazy SQLite dla Baculi.
403 Summary: libdbi database driver for Bacula
404 Summary(pl.UTF-8): Sterownik bazy libdbi dla Baculi
405 Group: Networking/Utilities
406 Requires(post): /sbin/ldconfig
407 Requires: %{name}-common = %{version}-%{release}
408 Provides: bacula(db) = %{version}-%{release}
409 Obsoletes: bacula(db)
412 libdbi database driver for Bacula.
414 %description db-dbi -l pl.UTF-8
415 Sterownik baz libdbi dla Baculi.
418 Summary: Bacula - The Network Backup Solution
419 Summary(pl.UTF-8): Bacula - rozwiązanie do wykonywania kopii zapasowych po sieci
420 Group: Networking/Utilities
421 Requires: %{name}-fd = %{version}-%{release}
426 Bacula - It comes by night and sucks the vital essence from your
429 Bacula is a set of computer programs that permit you (or the system
430 administrator) to manage backup, recovery, and verification of
431 computer data across a network of computers of different kinds. In
432 technical terms, it is a network client/server based backup program.
433 Bacula is relatively easy to use and efficient, while offering many
434 advanced storage management features that make it easy to find and
435 recover lost or damaged files.
437 This package installs scripts for disaster recovery and builds rescue
438 floppy disk for bare metal recovery.
440 %description rescue -l pl.UTF-8
441 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
443 Bacula to zbiór programów umożliwiających administratorowi na
444 zarządzanie kopiami zapasowymi, odzyskiwaniem i weryfikacją danych w
445 sieci komputerów różnego rodzaju. W terminologii technicznej jest to
446 program do kopii zapasowych pracujący w architekturze klient-serwer.
447 Bacula jest stosunkowo łatwa w użyciu i wydajna, oferując przy tym
448 wiele zaawansowanych możliwości przy zarządzaniu nośnikami,
449 ułatwiających znalezienie i odzyskanie utraconych lub uszkodzonych
452 Ten pakiet zawiera skrypty do odtwarzania po awarii i tworzy dyskietkę
453 ratunkowe do odtwarzania systemu od zera.
455 %package -n nagios-plugin-check_bacula
456 Summary: Nagios plugin to check bacula
458 Requires: nagios-common
460 %description -n nagios-plugin-check_bacula
461 Nagios plugin to check bacula.
476 tar -xf %{SOURCE2} && ln -s bacula-rescue-* rescue
478 sed -i -e 's#bindir=.*#bindir=%{_bindir}#g' \
479 src/cats/create_* src/cats/delete_* src/cats/drop_* \
480 src/cats/grant_* src/cats/make_* src/cats/update_*
481 sed -i -e 's/@hostname@/--hostname--/' src/*/*.conf.in
484 for dbtype in mysql postgresql sqlite3; do
485 sed -i -e "s,@DB_TYPE@,$dbtype,g" src/cats/*_${dbtype}_*
491 %{__aclocal} -I bacula-macros -I gettext-macros
492 # $BUILD_DIR not seen by libtoolize, export it
493 BUILD_DIR=.. %{__libtoolize}
495 %{__autoconf} --prepend-include=$(pwd)/autoconf autoconf/configure.in > configure
497 CPPFLAGS="-I/usr/include/ncurses -I%{_includedir}/readline"
499 # we wan't the 'base' build built with the last database in the list,
500 # to make sure it is full-featured
501 for database in %{databases}; do
502 WXCONFIG=%{_bindir}/wx-gtk2-unicode-config \
503 QMAKE=%{_bindir}/qt4-qmake \
505 --with-scriptdir=%{_libexecdir}/%{name} \
506 %{?with_bat:--enable-bat} \
508 --enable-smartalloc \
509 %{?with_console_wx:--enable-bwx-console} \
510 --enable-tray-monitor \
511 %{?with_python:--with-python} \
513 --with-tcp-wrappers \
514 --with-working-dir=%{_var}/lib/%{name} \
515 --with-dump-email="root@localhost" \
516 --with-job-email="root@localhost" \
517 --with-smtp-host=localhost \
518 --with-pid-dir=/var/run \
519 --with-subsys-dir=/var/lock/subsys \
520 --enable-batch-insert \
522 %{?with_sqlite3_sync_off:--enable-extra-sqlite3-init="pragma synchronous=0;"} \
523 --with-dir-password="#FAKE-dir-password#" \
524 --with-fd-password="#FAKE-fd-password#" \
525 --with-sd-password="#FAKE-sd-password#" \
526 --with-mon-dir-password="#FAKE-mon-dir-password#" \
527 --with-mon-fd-password="#FAKE-mon-fd-password#" \
528 --with-mon-sd-password="#FAKE-mon-sd-password#" \
531 # build the database library
532 %{__make} -C src/cats clean
533 %{__make} -C src/cats
535 # install the database library in a temporary location
536 install -d libbacsql/$database%{_libdir}
537 %{__make} -C src/cats libtool-install DESTDIR=$PWD/libbacsql/$database
550 %{__make} -C examples/nagios/check_bacula
562 rm -rf $RPM_BUILD_ROOT
563 install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,logrotate.d,pam.d,sysconfig}
564 install -d $RPM_BUILD_ROOT%{_sysconfdir}/rescue
565 install -d $RPM_BUILD_ROOT{%{_pixmapsdir},%{_desktopdir},%{_mandir},%{_bindir},/var/log/bacula}
568 DESTDIR=$RPM_BUILD_ROOT
570 # install libraries for all the database backends
571 # ldconfig will add the soname symlinks when one of the packages is installed
572 for database in %{databases}; do
573 for libfile in libbacsql/$database%{_libdir}/lib*-*.so; do
574 orig_name=${libfile##*/}
575 file_prefix=${orig_name%%-*.so}
576 file_suffix=${orig_name#*-}
577 file_name=$file_prefix-$database-$file_suffix
578 install -p $libfile $RPM_BUILD_ROOT%{_libdir}/$file_name
579 touch $RPM_BUILD_ROOT%{_libdir}/$orig_name
583 # replace with empty file, replaced by ldconfig from each db-* package on intsall
584 rm -f $RPM_BUILD_ROOT%{_libdir}/libbacsql-%{version}.so
585 touch $RPM_BUILD_ROOT%{_libdir}/libbacsql-%{version}.so
587 install -p %{SOURCE10} $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-dir
588 install -p %{SOURCE11} $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-fd
589 install -p %{SOURCE12} $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-sd
590 cp -a %{SOURCE13} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}-dir
591 cp -a %{SOURCE14} $RPM_BUILD_ROOT/etc/sysconfig/bacula-dir
592 cp -a %{SOURCE15} $RPM_BUILD_ROOT/etc/sysconfig/bacula-fd
593 cp -a %{SOURCE16} $RPM_BUILD_ROOT/etc/sysconfig/bacula-sd
595 %if %{with console_wx}
596 # tray-monitor is for regular users
597 #mv $RPM_BUILD_ROOT%{_sbindir}/bacula-tray-monitor $RPM_BUILD_ROOT%{_bindir}
599 cp -a scripts/bacula.png $RPM_BUILD_ROOT%{_pixmapsdir}/bacula.png
600 #install src/tray-monitor/generic.xpm $RPM_BUILD_ROOT%{_pixmapsdir}/bacula-tray-monitor.xpm
601 sed -e 's/gnome-console/wx-console/g;s/Console/Wx Console/g' \
602 scripts/bacula.desktop.gnome2 > $RPM_BUILD_ROOT%{_desktopdir}/bacula-wx.desktop
603 #sed -e 's#%{_sbindir}#%{_bindir}#' \
604 # scripts/bacula-tray-monitor.desktop > $RPM_BUILD_ROOT%{_desktopdir}/bacula-tray-monitor.desktop
608 # qmake somewhy does not always create install_bins target. install our own the bin
609 rm -f $RPM_BUILD_ROOT%{_sbindir}/bat
610 libtool --silent --mode=install install src/qt-console/bat $RPM_BUILD_ROOT%{_bindir}
611 cp -a scripts/bat.desktop $RPM_BUILD_ROOT%{_desktopdir}
615 # install the rescue stuff, these are the rescue scripts
616 cp -a rescue/linux/floppy/backup.etc.list $RPM_BUILD_ROOT%{_sysconfdir}/rescue
617 cp -a rescue/linux/floppy/sfdisk.bz2 $RPM_BUILD_ROOT%{_sysconfdir}/rescue
618 install -p rescue/linux/floppy/*_* $RPM_BUILD_ROOT%{_sysconfdir}/rescue
619 install -p rescue/linux/floppy/getdiskinfo $RPM_BUILD_ROOT%{_sysconfdir}/rescue
622 touch $RPM_BUILD_ROOT/var/log/bacula/log
624 # install the updatedb scripts for older versions that last full release
625 # 2.0 -> 3.0 : 10_to_11
626 install -p updatedb/update_*_tables_10_to_11 $RPM_BUILD_ROOT%{_libexecdir}/%{name}
628 # place for site passwords
629 touch $RPM_BUILD_ROOT%{_sysconfdir}/{dir-password,fd-password,sd-password}
630 touch $RPM_BUILD_ROOT%{_sysconfdir}/{mon-dir-password,mon-fd-password,mon-sd-password}
632 mv $RPM_BUILD_ROOT%{_libdir}/bacula/mtx-changer.conf $RPM_BUILD_ROOT/etc/bacula/mtx-changer.conf
635 rm -f $RPM_BUILD_ROOT%{_libexecdir}/%{name}/{gconsole,startmysql,stopmysql,bacula,bconsole,fd}
636 %if %{without console_wx}
637 rm -f $RPM_BUILD_ROOT%{_desktopdir}/bacula-wx.desktop
639 touch $RPM_BUILD_ROOT%{_sysconfdir}/.pw.sed
641 rm $RPM_BUILD_ROOT%{_docdir}/bacula/ChangeLog
642 rm $RPM_BUILD_ROOT%{_docdir}/bacula/INSTALL
643 rm $RPM_BUILD_ROOT%{_docdir}/bacula/LICENSE
644 rm $RPM_BUILD_ROOT%{_docdir}/bacula/README
645 rm $RPM_BUILD_ROOT%{_docdir}/bacula/ReleaseNotes
646 rm $RPM_BUILD_ROOT%{_docdir}/bacula/VERIFYING
647 rm $RPM_BUILD_ROOT%{_docdir}/bacula/technotes
649 # startup scripts, those in /etc/rc.d/init.d are better
650 rm $RPM_BUILD_ROOT%{_sbindir}/bacula
651 rm $RPM_BUILD_ROOT%{_libexecdir}/%{name}/bacula-ctl-*
654 rm $RPM_BUILD_ROOT%{_libexecdir}/%{name}/btraceback.mdb
656 # rename to avoid possible conflicts
657 mv $RPM_BUILD_ROOT%{_sbindir}/{,bacula-}dbcheck
658 mv $RPM_BUILD_ROOT%{_mandir}/man8/{,bacula-}dbcheck.8.gz
660 # no -devel files packaged, so this is also useless
661 rm $RPM_BUILD_ROOT%{_libdir}/libbac{,cfg,find,py,sql}.{so,la}
663 # placeholders for the symlinks set in %%post db-*
664 for f in create_bacula_database drop_bacula_database drop_bacula_tables \
665 grant_bacula_privileges make_bacula_tables update_bacula_tables ; do
667 touch $RPM_BUILD_ROOT%{_libexecdir}/%{name}/$f
671 install -d $RPM_BUILD_ROOT%{nagiosplugindir}
672 %{__make} -C examples/nagios/check_bacula install \
673 sbindir=%{nagiosplugindir} \
674 INSTALL_PROGRAM="libtool --mode=install install -p" \
675 DESTDIR=$RPM_BUILD_ROOT
679 rm -rf $RPM_BUILD_ROOT
682 %groupadd -P %{name}-common -g 136 -r -f bacula
683 %useradd -P %{name}-common -u 136 -r -d /var/lib/bacula -s /bin/false -c "Bacula User" -g bacula bacula
685 %define update_configs \
686 echo "Updating bacula passwords and names..." | %banner -a %{name} \
688 for f in *-password; do \
689 if [ ! -s $f ]; then \
690 openssl rand -base64 33 > $f \
693 for cf in *.conf *.conf.rpmnew; do \
694 [ -f $cf ] && sed -i -e"s:#FAKE-$f#:$p:" "$cf" || : \
697 for cf in *.conf *.conf.rpmnew; do \
698 [ -f $cf ] && sed -i -e"s:--hostname--:`hostname`:" "$cf" || : \
707 if [ "$1" = "0" ]; then
712 %triggerpostun dir -- %{name}-dir < 5.0
713 %banner bacula-dir -t3 <<EOF
714 You have upgraded from an older version of Bacula director.
716 You will probably need to call %{_libexecdir}/%{name}/update_bacula_tables
717 script to upgrade the database.
722 /sbin/chkconfig --add bacula-dir
723 %service bacula-dir restart "Bacula Director daemon"
726 if [ "$1" = "0" ]; then
727 %service bacula-dir stop
728 /sbin/chkconfig --del bacula-dir
733 /sbin/chkconfig --add bacula-fd
734 %service bacula-fd restart "Bacula File daemon"
737 if [ "$1" = "0" ]; then
738 %service bacula-fd stop
739 /sbin/chkconfig --del bacula-fd
744 /sbin/chkconfig --add bacula-sd
745 %service bacula-sd restart "Bacula Storage daemon"
748 if [ "$1" = "0" ]; then
749 %service bacula-sd stop
750 /sbin/chkconfig --del bacula-sd
754 if [ -e %{_sysconfdir}/console.conf -a ! -e %{_sysconfdir}/bconsole.conf ]; then
755 mv %{_sysconfdir}/console.conf %{_sysconfdir}/bconsole.conf
764 %triggerpostun common -- %{name}-common < 5.0.1-2
765 find /etc/bacula/bat.conf* -perm /007 -print0 | xargs -0 -r chmod 600 || :
774 # link our current installed conf file to the rescue directory
775 ln -sf %{_sysconfdir}/bacula-fd.conf %{_sysconfdir}/rescue/bacula-fd.conf
778 echo "Creating rescue files for this system..."
779 cd %{_sysconfdir}/rescue
783 # remove the files created after the initial rpm installation
784 if [ "$1" = "0" ]; then
785 rm -f %{_sysconfdir}/rescue/bacula-fd.conf
786 rm -f %{_sysconfdir}/rescue/partition.*
787 rm -f %{_sysconfdir}/rescue/format.*
788 rm -f %{_sysconfdir}/rescue/mount_drives
789 rm -f %{_sysconfdir}/rescue/start_network
790 rm -f %{_sysconfdir}/rescue/sfdisk
791 rm -rf %{_sysconfdir}/rescue/diskinfo/*
796 for name in "create database" "drop tables" "drop database" "grant privileges" "make tables" "update tables"; do \
797 prefix="${name%% *}" \
798 suffix="${name#* }" \
799 ln -sf "${prefix}_%{1}_${suffix}" %{_libexecdir}/%{name}/"${prefix}_bacula_${suffix}" || : \
801 %service bacula-dir restart "Bacula Director daemon"
803 %define db_postun() \
805 if [ "$1" = "0" ]; then \
806 for f in %{_libexecdir}/%{name}/*_bacula_*; do \
807 if [ -L "$f" -a ! -e "$f" ]; then \
816 %postun db-postgresql
817 %db_postun postgresql
831 # dbi backend is different, as it is not bound with a specific db engine
834 %service bacula-dir restart "Bacula Director daemon"
836 %postun db-dbi -p /sbin/ldconfig
839 %defattr(644,root,root,755)
842 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*-password
843 # do not remove bsmtp from files. Fix build if it is not installed.
844 %attr(755,root,root) %{_sbindir}/bsmtp
845 %attr(755,root,root) %{_sbindir}/btraceback
846 %attr(755,root,root) %{_libdir}/libbac-5*.so
847 %attr(755,root,root) %{_libdir}/libbaccfg-5*.so
848 %attr(755,root,root) %{_libdir}/libbacfind-5*.so
849 %attr(755,root,root) %{_libdir}/libbacpy-5*.so
850 %{_mandir}/man8/bacula.8*
851 %{_mandir}/man1/bsmtp.1*
852 %{_mandir}/man8/btraceback.8*
853 %dir %{_libexecdir}/%{name}
854 %{_libexecdir}/%{name}/btraceback.dbx
855 %{_libexecdir}/%{name}/btraceback.gdb
856 %{_libexecdir}/%{name}/bacula_config
857 %attr(770,root,bacula) %dir %{_localstatedir}
858 %attr(750,bacula,logs) %dir /var/log/bacula
859 %attr(640,bacula,logs) %ghost /var/log/bacula/log
862 %defattr(644,root,root,755)
863 %doc ChangeLog CheckList ReleaseNotes kernstodo LICENSE
864 #%doc examples %{name}-docs-%{version}/manual/{*.pdf,bacula}
865 %attr(640,root,bacula) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bacula-dir.conf
866 %ghost %{_sysconfdir}/.pw.sed
867 %attr(640,root,root) %config(noreplace) /etc/logrotate.d/bacula-dir
868 %attr(754,root,root) /etc/rc.d/init.d/bacula-dir
869 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/bacula-dir
870 %attr(755,root,root) %{_sbindir}/bacula-dir
871 %attr(755,root,root) %{_sbindir}/bregex
872 %attr(755,root,root) %{_sbindir}/bwild
873 %attr(755,root,root) %{_sbindir}/bacula-dbcheck
874 %{_mandir}/man8/bacula-dir.8*
875 %{_mandir}/man8/bacula-dbcheck.8*
876 %{_libexecdir}/%{name}/query.sql
877 #%attr(755,root,root) %{_libexecdir}/%{name}/make_catalog_backup
878 #%attr(755,root,root) %{_libexecdir}/%{name}/delete_catalog_backup
881 %defattr(644,root,root,755)
882 %attr(755,root,root) %{_libexecdir}/%{name}/create_postgresql_database
883 %attr(755,root,root) %{_libexecdir}/%{name}/drop_postgresql_database
884 %attr(755,root,root) %{_libexecdir}/%{name}/drop_postgresql_tables
885 %attr(755,root,root) %{_libexecdir}/%{name}/grant_postgresql_privileges
886 %attr(755,root,root) %{_libexecdir}/%{name}/make_postgresql_tables
887 %attr(755,root,root) %{_libexecdir}/%{name}/update_postgresql_*
888 %attr(755,root,root) %{_libdir}/libbacsql-postgresql-5*.so
890 %ghost %attr(755,root,root) %{_libdir}/libbacsql-5*.so
891 %ghost %{_libexecdir}/%{name}/create_bacula_database
892 %ghost %{_libexecdir}/%{name}/drop_bacula_tables
893 %ghost %{_libexecdir}/%{name}/drop_bacula_database
894 %ghost %{_libexecdir}/%{name}/grant_bacula_privileges
895 %ghost %{_libexecdir}/%{name}/make_bacula_tables
896 %ghost %{_libexecdir}/%{name}/update_bacula_tables
899 %defattr(644,root,root,755)
900 %attr(755,root,root) %{_libexecdir}/%{name}/create_mysql_database
901 %attr(755,root,root) %{_libexecdir}/%{name}/drop_mysql_database
902 %attr(755,root,root) %{_libexecdir}/%{name}/drop_mysql_tables
903 %attr(755,root,root) %{_libexecdir}/%{name}/grant_mysql_privileges
904 %attr(755,root,root) %{_libexecdir}/%{name}/make_mysql_tables
905 %attr(755,root,root) %{_libexecdir}/%{name}/update_mysql_*
906 %attr(755,root,root) %{_libdir}/libbacsql-mysql-5*.so
908 %ghost %attr(755,root,root) %{_libdir}/libbacsql-5*.so
909 %ghost %{_libexecdir}/%{name}/create_bacula_database
910 %ghost %{_libexecdir}/%{name}/drop_bacula_tables
911 %ghost %{_libexecdir}/%{name}/drop_bacula_database
912 %ghost %{_libexecdir}/%{name}/grant_bacula_privileges
913 %ghost %{_libexecdir}/%{name}/make_bacula_tables
914 %ghost %{_libexecdir}/%{name}/update_bacula_tables
917 %defattr(644,root,root,755)
918 %attr(755,root,root) %{_libexecdir}/%{name}/create_sqlite3_database
919 %attr(755,root,root) %{_libexecdir}/%{name}/drop_sqlite3_database
920 %attr(755,root,root) %{_libexecdir}/%{name}/drop_sqlite3_tables
921 %attr(755,root,root) %{_libexecdir}/%{name}/grant_sqlite3_privileges
922 %attr(755,root,root) %{_libexecdir}/%{name}/make_sqlite3_tables
923 %attr(755,root,root) %{_libexecdir}/%{name}/update_sqlite3_*
924 %attr(755,root,root) %{_libdir}/libbacsql-sqlite3-5*.so
926 %ghost %attr(755,root,root) %{_libdir}/libbacsql-5*.so
927 %ghost %{_libexecdir}/%{name}/create_bacula_database
928 %ghost %{_libexecdir}/%{name}/drop_bacula_tables
929 %ghost %{_libexecdir}/%{name}/drop_bacula_database
930 %ghost %{_libexecdir}/%{name}/grant_bacula_privileges
931 %ghost %{_libexecdir}/%{name}/make_bacula_tables
932 %ghost %{_libexecdir}/%{name}/update_bacula_tables
936 %defattr(644,root,root,755)
937 %attr(755,root,root) %{_libexecdir}/%{name}/create_postgresql_database
938 %attr(755,root,root) %{_libexecdir}/%{name}/drop_postgresql_database
939 %attr(755,root,root) %{_libexecdir}/%{name}/drop_postgresql_tables
940 %attr(755,root,root) %{_libexecdir}/%{name}/grant_postgresql_privileges
941 %attr(755,root,root) %{_libexecdir}/%{name}/make_postgresql_tables
942 %attr(755,root,root) %{_libexecdir}/%{name}/update_postgresql_*
943 %attr(755,root,root) %{_libexecdir}/%{name}/create_mysql_database
944 %attr(755,root,root) %{_libexecdir}/%{name}/drop_mysql_database
945 %attr(755,root,root) %{_libexecdir}/%{name}/drop_mysql_tables
946 %attr(755,root,root) %{_libexecdir}/%{name}/grant_mysql_privileges
947 %attr(755,root,root) %{_libexecdir}/%{name}/make_mysql_tables
948 %attr(755,root,root) %{_libexecdir}/%{name}/update_mysql_*
949 %attr(755,root,root) %{_libexecdir}/%{name}/create_sqlite3_database
950 %attr(755,root,root) %{_libexecdir}/%{name}/drop_sqlite3_database
951 %attr(755,root,root) %{_libexecdir}/%{name}/drop_sqlite3_tables
952 %attr(755,root,root) %{_libexecdir}/%{name}/grant_sqlite3_privileges
953 %attr(755,root,root) %{_libexecdir}/%{name}/make_sqlite3_tables
954 %attr(755,root,root) %{_libexecdir}/%{name}/update_sqlite3_*
955 %attr(755,root,root) %{_libdir}/libbacsql-dbi-5*.so
957 %ghost %attr(755,root,root) %{_libdir}/libbacsql-5*.so
961 %defattr(644,root,root,755)
963 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bacula-fd.conf
964 %attr(754,root,root) /etc/rc.d/init.d/bacula-fd
965 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/bacula-fd
966 %attr(755,root,root) %{_sbindir}/bacula-fd
967 %attr(755,root,root) %{_libdir}/bpipe-fd.so
968 %{_mandir}/man8/bacula-fd.8*
971 %defattr(644,root,root,755)
973 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bacula-sd.conf
974 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mtx-changer.conf
975 %attr(754,root,root) /etc/rc.d/init.d/bacula-sd
976 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/bacula-sd
977 %attr(755,root,root) %{_sbindir}/bacula-sd
978 %attr(755,root,root) %{_sbindir}/bcopy
979 %attr(755,root,root) %{_sbindir}/bextract
980 %attr(755,root,root) %{_sbindir}/bls
981 %attr(755,root,root) %{_sbindir}/bscan
982 %attr(755,root,root) %{_sbindir}/btape
983 %attr(755,root,root) %{_libexecdir}/%{name}/mtx-changer
984 %attr(755,root,root) %{_libexecdir}/%{name}/disk-changer
985 %attr(755,root,root) %{_libexecdir}/%{name}/dvd-handler
986 %{_mandir}/man8/bacula-sd.8*
987 %{_mandir}/man8/bcopy.8*
988 %{_mandir}/man8/bextract.8*
989 %{_mandir}/man8/bls.8*
990 %{_mandir}/man8/bscan.8*
991 %{_mandir}/man8/btape.8*
994 %defattr(644,root,root,755)
996 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bconsole.conf
997 %attr(755,root,root) %{_sbindir}/bconsole
998 %{_mandir}/man8/bconsole.8*
1000 %if %{with console_wx}
1002 %defattr(644,root,root,755)
1004 %{_pixmapsdir}/%{name}.png
1005 %{_desktopdir}/bacula-wx.desktop
1006 %attr(640,root,bacula) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bwx-console.conf
1007 %attr(755,root,root) %{_sbindir}/bwx-console
1008 %{_mandir}/man1/bacula-bwxconsole.1*
1013 %defattr(644,root,root,755)
1015 %{_pixmapsdir}/%{name}.png
1016 %{_desktopdir}/bat.desktop
1017 # Do not make this file world-readable or any user will get full access to the
1019 %attr(640,root,bacula) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bat.conf
1020 %attr(755,root,root) %{_bindir}/bat
1021 %{_mandir}/man1/bat.1*
1025 %if %{with console_wx}
1027 %defattr(644,root,root,755)
1029 %attr(755,root,root) %{_sbindir}/bacula-tray-monitor
1030 #%{_pixmapsdir}/%{name}-tray-monitor.xpm
1031 #%{_desktopdir}/%{name}-tray-monitor.desktop
1032 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/tray-monitor.conf
1033 %{_mandir}/man1/bacula-tray-monitor.1*
1038 %defattr(644,root,root,755)
1040 %dir %{_sysconfdir}/rescue
1041 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/backup.etc.list
1042 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/bacula-fd
1043 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/format_floppy
1044 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/getdiskinfo
1045 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/make_rescue_disk
1046 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/restore_bacula
1047 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/restore_etc
1048 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/run_grub
1049 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/run_lilo
1050 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/sfdisk.bz2
1054 %files -n nagios-plugin-check_bacula
1055 %defattr(644,root,root,755)
1056 %attr(755,root,root) %{nagiosplugindir}/check_bacula