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'
9 #warning: Installed (but unpackaged) file(s) found:
10 # /usr/lib64/bacula/btraceback.mdb
13 %bcond_without console_wx # wx-console program
14 %bcond_without bat # bat Qt4 GUI
15 %bcond_without dbi # use Database Independent Abstraction Layer (libdbi)
16 %bcond_without mysql # use MySQL
17 %bcond_without pgsql # use PostgreSQL
18 %bcond_without sqlite3 # use SQLite3
20 %bcond_without nagios # build nagios plugin
22 %bcond_with sqlite3_sync_off # makes SQLite3 backend much faster, but less reliable
24 %if %{without sqlite3}
25 %undefine with_sqlite3_sync_off
28 Summary: Bacula - The Network Backup Solution
29 Summary(pl.UTF-8): Bacula - rozwiązanie do wykonywania kopii zapasowych po sieci
33 License: extended GPL v2
34 Group: Networking/Utilities
35 Source0: http://downloads.sourceforge.net/bacula/%{name}-%{version}.tar.gz
36 # Source0-md5: 9de254ae39cab0587fdb2f5d8d90b03b
37 Source1: http://downloads.sourceforge.net/bacula/%{name}-docs-%{version}.tar.bz2
38 # Source1-md5: 7a00557dcf0dfa40de9e74176fefd1ae
39 Source2: http://downloads.sourceforge.net/bacula/%{name}-rescue-5.0.1.tar.gz
40 # Source2-md5: bb194aed8e204f54bf2f61d7e721f257
41 Source10: %{name}-dir.init
42 Source11: %{name}-fd.init
43 Source12: %{name}-sd.init
44 Source13: %{name}.logrotate
45 Source14: %{name}-dir.sysconfig
46 Source15: %{name}-fd.sysconfig
47 Source16: %{name}-sd.sysconfig
48 Patch0: %{name}-mtx-changer.patch
49 Patch1: %{name}-link.patch
50 Patch2: %{name}-tinfo-readline.patch
51 Patch3: %{name}-branding.patch
52 Patch4: %{name}-conf.patch
53 Patch5: %{name}-desktop.patch
54 Patch7: %{name}-dbi_fixes.patch
55 Patch8: %{name}-dbi_dbcheck.patch
56 Patch9: %{name}-openssl1.patch
57 Patch10: %{name}-dvd_rewind.patch
58 URL: http://www.bacula.org/
59 BuildRequires: acl-devel
60 BuildRequires: autoconf
61 BuildRequires: automake
62 BuildRequires: gettext-devel
63 BuildRequires: gtk+2-devel
64 BuildRequires: libcap-devel
65 %{?with_dbi:BuildRequires: libdbi-devel >= 0.8.4}
66 BuildRequires: libtool >= 2:2.2
68 BuildRequires: fakeroot
70 BuildRequires: libwrap-devel
71 BuildRequires: ncurses-devel
72 BuildRequires: openssl-devel
73 BuildRequires: pkgconfig
75 BuildRequires: python-devel
76 BuildRequires: python-modules
79 BuildRequires: QtCore-devel
80 BuildRequires: QtGui-devel
81 BuildRequires: qt4-build >= 4.3.3-3
82 BuildRequires: qt4-qmake >= 4.3.3-3
83 #BuildRequires: qwt-devel >= 5.0.2-2
85 %{?with_mysql:BuildRequires: mysql-devel}
86 %{?with_pgsql:BuildRequires: postgresql-devel}
87 BuildRequires: readline-devel
88 BuildRequires: rpm-pythonprov
89 BuildRequires: rpmbuild(macros) >= 1.268
90 BuildRequires: sed >= 4.0
91 %{?with_sqlite3:BuildRequires: sqlite3-devel}
93 %if %{with console_wx}
94 BuildRequires: wxGTK2-unicode-devel >= 2.4.0
96 BuildRequires: zlib-devel
97 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
99 %define _sysconfdir /etc/%{name}
100 %define _localstatedir /var/lib/%{name}
101 %define nagiosplugindir %{_prefix}/lib/nagios/plugins
103 # from 'the worst' to 'the best'
104 %define databases %{?with_dbi:dbi} %{?with_sqlite3:sqlite3} %{?with_mysql:mysql} %{?with_pgsql:postgresql}
106 # dependency section is broken. ccache usage is instead to makefiles
107 %undefine with_ccache
110 Bacula - It comes by night and sucks the vital essence from your
113 Bacula is a set of computer programs that permit you (or the system
114 administrator) to manage backup, recovery, and verification of
115 computer data across a network of computers of different kinds. In
116 technical terms, it is a network client/server based backup program.
117 Bacula is relatively easy to use and efficient, while offering many
118 advanced storage management features that make it easy to find and
119 recover lost or damaged files.
121 %description -l pl.UTF-8
122 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
124 Bacula to zbiór programów umożliwiających administratorowi na
125 zarządzanie kopiami zapasowymi, odzyskiwaniem i weryfikacją danych w
126 sieci komputerów różnego rodzaju. W terminologii technicznej jest to
127 program do kopii zapasowych pracujący w architekturze klient-serwer.
128 Bacula jest stosunkowo łatwa w użyciu i wydajna, oferując przy tym
129 wiele zaawansowanych możliwości przy zarządzaniu nośnikami,
130 ułatwiających znalezienie i odzyskanie utraconych lub uszkodzonych
134 Summary: Common files for bacula package
135 Summary(pl.UTF-8): Pliki wspólne dla pakietu bacula
136 Group: Networking/Utilities
137 Requires(post): openssl-tools
138 Requires(post): sed >= 4.0
139 Requires(post,preun): /sbin/chkconfig
140 Requires(postun): /usr/sbin/groupdel
141 Requires(postun): /usr/sbin/userdel
142 Requires(pre): /usr/sbin/groupadd
143 Requires(pre): /usr/sbin/useradd
144 Conflicts: bacula-console < 0:1.34.6
145 Conflicts: bacula-dir < 0:1.34.6
146 Conflicts: bacula-fd < 0:1.34.6
147 Conflicts: bacula-sd < 0:1.34.6
150 Bacula - It comes by night and sucks the vital essence from your
153 Bacula is a set of computer programs that permit you (or the system
154 administrator) to manage backup, recovery, and verification of
155 computer data across a network of computers of different kinds. In
156 technical terms, it is a network client/server based backup program.
157 Bacula is relatively easy to use and efficient, while offering many
158 advanced storage management features that make it easy to find and
159 recover lost or damaged files.
161 %description common -l pl.UTF-8
162 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
164 Bacula to zbiór programów umożliwiających administratorowi na
165 zarządzanie kopiami zapasowymi, odzyskiwaniem i weryfikacją danych w
166 sieci komputerów różnego rodzaju. W terminologii technicznej jest to
167 program do kopii zapasowych pracujący w architekturze klient-serwer.
168 Bacula jest stosunkowo łatwa w użyciu i wydajna, oferując przy tym
169 wiele zaawansowanych możliwości przy zarządzaniu nośnikami,
170 ułatwiających znalezienie i odzyskanie utraconych lub uszkodzonych
174 Summary: Bacula Director and Catalog services
175 Summary(pl.UTF-8): Usługi Bacula Director i Catalog
176 Group: Networking/Utilities
177 Requires(post): sed >= 4.0
178 Requires: %{name}-common = %{version}-%{release}
179 Requires: bacula(db) = %{version}-%{release}
180 Obsoletes: bacula-updatedb
183 Bacula - It comes by night and sucks the vital essence from your
186 Bacula Director is the program that supervises all the backup,
187 restore, verify and archive operations. The system administrator uses
188 the Bacula Director to schedule backups and to recover files. Catalog
189 services are comprised of the software programs responsible for
190 maintaining the file indexes and volume databases for all files backed
191 up. The Catalog services permit the System Administrator or user to
192 quickly locate and restore any desired file, since it maintains a
193 record of all Volumes used, all Jobs run, and all Files saved.
195 %description dir -l pl.UTF-8
196 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
198 Bacula Director to program nadzorujący wszystkie operacje wykonywania
199 kopii zapasowych, odzyskiwania, weryfikacji i archiwizowania.
200 Administrator używa Bacula Directora do szeregowania kopii zapasowych
201 oraz odzyskiwania plików. Usługi katalogowe (Catalog services) są
202 używane przez programy odpowiedzialne za zarządzanie indeksami plików
203 i bazą danych wolumenów dla wszystkich kopiowanych plików. Usługi
204 katalogowe umożliwiają administratorowi lub użytkownikowi szybko
205 zlokalizować i odtworzyć dowolny plik, ponieważ utrzymują rekord ze
206 wszystkimi używanymi wolumenami, uruchomionymi zadaniami i zapisanymi
210 Summary: Bacula Console
211 Summary(pl.UTF-8): Konsola Baculi
212 Group: Networking/Utilities
213 Requires(post): sed >= 4.0
214 Requires: %{name}-common = %{version}-%{release}
217 Bacula - It comes by night and sucks the vital essence from your
220 Bacula Console is the program that allows the administrator or user to
221 communicate with the Bacula Director. This is the text only console
224 %description console -l pl.UTF-8
225 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
227 Bacula Console to program umożliwiający administratorowi lub
228 użytkownikowi komunikowanie się z programem Bacula Director. To jest
229 interfejs czysto tekstowy.
232 Summary: Bacula wxWidgets Console
233 Summary(pl.UTF-8): Konsola Baculi oparta na wxWidgets
234 Group: Networking/Utilities
235 Requires(post): sed >= 4.0
236 Requires: %{name}-common = %{version}-%{release}
238 %description console-wx
239 Bacula - It comes by night and sucks the vital essence from your
242 Bacula Console is the program that allows the administrator or user to
243 communicate with the Bacula Director. This is the wxWidgets GUI
246 %description console-wx -l pl.UTF-8
247 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
249 Bacula Console to program umożliwiający administratorowi lub
250 użytkownikowi komunikowanie się z programem Bacula Director. To jest
251 interfejs graficzny oparty na wxWidgets.
254 Summary: Bacula Qt4 Console
255 Summary(pl.UTF-8): Konsola Baculi oparta na Qt4
256 Group: Networking/Utilities
257 Requires(post): sed >= 4.0
258 Requires: %{name}-common = %{version}-%{release}
260 %description console-qt4
261 Bacula - It comes by night and sucks the vital essence from your
264 Bacula Console is the program that allows the administrator or user to
265 communicate with the Bacula Director. This is the Qt4 GUI interface.
267 %description console-qt4 -l pl.UTF-8
268 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
270 Bacula Console to program umożliwiający administratorowi lub
271 użytkownikowi komunikowanie się z programem Bacula Director. To jest
272 interfejs graficzny oparty na Qt4.
274 %package tray-monitor
275 Summary: Bacula Tray Monitor
276 Group: Networking/Utilities
277 Requires(post): sed >= 4.0
278 Requires: %{name}-common = %{version}-%{release}
280 %description tray-monitor
281 Bacula - It comes by night and sucks the vital essence from your
284 The Monitor program is typically an icon in the system tray. However,
285 once the icon is expanded into a full window, the administrator or
286 user can obtain status information about the Director or the backup
287 status on the local workstation or any other Bacula daemon that is
291 Summary: Bacula File services (Client)
292 Summary(pl.UTF-8): Usługi Bacula File (klient)
293 Group: Networking/Utilities
294 Requires(post): sed >= 4.0
295 Requires: %{name}-common = %{version}-%{release}
298 Bacula - It comes by night and sucks the vital essence from your
301 Bacula File services (or Client program) is the software program that
302 is installed on the machine to be backed up. It is specific to the
303 operating system on which it runs and is responsible for providing the
304 file attributes and data when requested by the Director. The File
305 services are also responsible for the file system dependent part of
306 restoring the file attributes and data during a recovery operation.
307 This program runs as a daemon on the machine to be backed up, and in
308 some of the documentation, the File daemon is referred to as the
309 Client (for example in Bacula configuration file).
311 %description fd -l pl.UTF-8
312 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
314 Usługi Bacula File (inaczej program kliencki) to oprogramowanie, które
315 instaluje się na maszynach, z których mają być wykonywane kopie
316 zapasowe. Są one specyficzne dla systemu operacyjnego, pod którym
317 działa dana maszyna i odpowiadają za dostarczanie atrybutów i danych
318 plików na żądanie Directora. Usługi plikowe są także odpowiedzialne za
319 zależną od systemu plików część odzyskiwania atrybutów i danych plików
320 podczas operacji odzyskiwania danych. Program działa jako demon na
321 maszynie, która ma być backupowana i w części dokumentacji demon ten
322 (File) jest nazywany klientem (na przykład w pliku konfiguracyjnym
326 Summary: Bacula Storage services
327 Summary(pl.UTF-8): Usługi Bacula Storage
328 Group: Networking/Utilities
329 Requires(post): sed >= 4.0
330 Requires: %{name}-common = %{version}-%{release}
331 Conflicts: dvd+rw-tools <= 5.21.4.10.8-1
334 Bacula - It comes by night and sucks the vital essence from your
337 Bacula Storage services consist of the software programs that perform
338 the storage and recovery of the file attributes and data to the
339 physical backup media or volumes. In other words, the Storage daemon
340 is responsible for reading and writing your tapes (or other storage
341 media, e.g. files). The Storage services runs as a daemon on the
342 machine that has the backup device (usually a tape drive).
344 %description sd -l pl.UTF-8
345 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
347 Usługi Bacula Storage składają się z programów obsługujących
348 przechowywanie danych oraz odzyskiwanie atrybutów i danych na
349 fizycznych nośnikach lub wolumenach. Innymi słowy, demon Storage jest
350 odpowiedzialny za odczyt i zapis taśm (lub innych nośników do
351 przechowywania danych, np. plików). Usługi Storage działają jako demon
352 na maszynie, która zawiera urządzenie backupowe (zwykle napęd
355 %package db-postgresql
356 Summary: PostgreSQL database driver for Bacula
357 Summary(pl.UTF-8): Sterownik bazy PostgreSQL dla Baculi
358 Group: Networking/Utilities
359 Requires(post): /sbin/ldconfig
360 Requires: %{name}-common = %{version}-%{release}
361 Provides: bacula(db) = %{version}-%{release}
362 Obsoletes: bacula(db)
364 %description db-postgresql
365 PostgreSQL database driver for Bacula.
367 %description db-postgresql -l pl.UTF-8
368 Sterownik bazy PostgreSQL dla Baculi.
371 Summary: MySQL database driver for Bacula
372 Summary(pl.UTF-8): Sterownik bazy MySQL dla Baculi
373 Group: Networking/Utilities
374 Requires(post): /sbin/ldconfig
375 Requires: %{name}-common = %{version}-%{release}
376 Provides: bacula(db) = %{version}-%{release}
377 Obsoletes: bacula(db)
379 %description db-mysql
380 MySQL database driver for Bacula.
382 %description db-mysql -l pl.UTF-8
383 Sterownik bazy MySQL dla Baculi.
386 Summary: SQLite database driver for Bacula
387 Summary(pl.UTF-8): Sterownik bazy SQLite dla Baculi
388 Group: Networking/Utilities
389 Requires(post): /sbin/ldconfig
390 Requires: %{name}-common = %{version}-%{release}
391 Provides: bacula(db) = %{version}-%{release}
392 Obsoletes: bacula(db)
394 %description db-sqlite3
395 SQLite database driver for Bacula.
397 %description db-sqlite3 -l pl.UTF-8
398 Sterownik bazy SQLite dla Baculi.
401 Summary: libdbi database driver for Bacula
402 Summary(pl.UTF-8): Sterownik bazy libdbi dla Baculi
403 Group: Networking/Utilities
404 Requires(post): /sbin/ldconfig
405 Requires: %{name}-common = %{version}-%{release}
406 Provides: bacula(db) = %{version}-%{release}
407 Obsoletes: bacula(db)
410 libdbi database driver for Bacula.
412 %description db-dbi -l pl.UTF-8
413 Sterownik baz libdbi dla Baculi.
416 Summary: Bacula - The Network Backup Solution
417 Summary(pl.UTF-8): Bacula - rozwiązanie do wykonywania kopii zapasowych po sieci
418 Group: Networking/Utilities
419 Requires: %{name}-fd = %{version}-%{release}
424 Bacula - It comes by night and sucks the vital essence from your
427 Bacula is a set of computer programs that permit you (or the system
428 administrator) to manage backup, recovery, and verification of
429 computer data across a network of computers of different kinds. In
430 technical terms, it is a network client/server based backup program.
431 Bacula is relatively easy to use and efficient, while offering many
432 advanced storage management features that make it easy to find and
433 recover lost or damaged files.
435 This package installs scripts for disaster recovery and builds rescue
436 floppy disk for bare metal recovery.
438 %description rescue -l pl.UTF-8
439 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
441 Bacula to zbiór programów umożliwiających administratorowi na
442 zarządzanie kopiami zapasowymi, odzyskiwaniem i weryfikacją danych w
443 sieci komputerów różnego rodzaju. W terminologii technicznej jest to
444 program do kopii zapasowych pracujący w architekturze klient-serwer.
445 Bacula jest stosunkowo łatwa w użyciu i wydajna, oferując przy tym
446 wiele zaawansowanych możliwości przy zarządzaniu nośnikami,
447 ułatwiających znalezienie i odzyskanie utraconych lub uszkodzonych
450 Ten pakiet zawiera skrypty do odtwarzania po awarii i tworzy dyskietkę
451 ratunkowe do odtwarzania systemu od zera.
453 %package -n nagios-plugin-check_bacula
454 Summary: Nagios plugin to check bacula
456 Requires: nagios-common
458 %description -n nagios-plugin-check_bacula
459 Nagios plugin to check bacula.
474 tar -xf %{SOURCE2} && ln -s bacula-rescue-* rescue
476 sed -i -e 's#bindir=.*#bindir=%{_bindir}#g' \
477 src/cats/create_* src/cats/delete_* src/cats/drop_* \
478 src/cats/grant_* src/cats/make_* src/cats/update_*
479 sed -i -e 's/@hostname@/--hostname--/' src/*/*.conf.in
482 for dbtype in mysql postgresql sqlite3; do
483 sed -i -e "s,@DB_TYPE@,$dbtype,g" src/cats/*_${dbtype}_*
489 %{__aclocal} -I bacula-macros -I gettext-macros
490 # $BUILD_DIR not seen by libtoolize, export it
491 BUILD_DIR=.. %{__libtoolize}
493 %{__autoconf} --prepend-include=$(pwd)/autoconf autoconf/configure.in > configure
495 CPPFLAGS="-I/usr/include/ncurses -I%{_includedir}/readline"
497 # we wan't the 'base' build built with the last database in the list,
498 # to make sure it is full-featured
499 for database in %{databases}; do
500 WXCONFIG=%{_bindir}/wx-gtk2-unicode-config \
501 QMAKE=%{_bindir}/qt4-qmake \
503 --with-scriptdir=%{_libexecdir}/%{name} \
504 %{?with_bat:--enable-bat} \
506 --enable-smartalloc \
507 %{?with_console_wx:--enable-bwx-console} \
508 --enable-tray-monitor \
509 %{?with_python:--with-python} \
511 --with-tcp-wrappers \
512 --with-working-dir=%{_var}/lib/%{name} \
513 --with-dump-email="root@localhost" \
514 --with-job-email="root@localhost" \
515 --with-smtp-host=localhost \
516 --with-pid-dir=/var/run \
517 --with-subsys-dir=/var/lock/subsys \
518 --enable-batch-insert \
520 %{?with_sqlite3_sync_off:--enable-extra-sqlite3-init="pragma synchronous=0;"} \
521 --with-dir-password="#FAKE-dir-password#" \
522 --with-fd-password="#FAKE-fd-password#" \
523 --with-sd-password="#FAKE-sd-password#" \
524 --with-mon-dir-password="#FAKE-mon-dir-password#" \
525 --with-mon-fd-password="#FAKE-mon-fd-password#" \
526 --with-mon-sd-password="#FAKE-mon-sd-password#" \
529 # build the database library
530 %{__make} -C src/cats clean
531 %{__make} -C src/cats
533 # install the database library in a temporary location
534 install -d libbacsql/$database%{_libdir}
535 %{__make} -C src/cats libtool-install DESTDIR=$PWD/libbacsql/$database
548 %{__make} -C examples/nagios/check_bacula
560 rm -rf $RPM_BUILD_ROOT
561 install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,logrotate.d,pam.d,sysconfig}
562 install -d $RPM_BUILD_ROOT%{_sysconfdir}/rescue
563 install -d $RPM_BUILD_ROOT{%{_pixmapsdir},%{_desktopdir},%{_mandir},%{_bindir},/var/log/bacula}
566 DESTDIR=$RPM_BUILD_ROOT
568 # install libraries for all the database backends
569 # ldconfig will add the soname symlinks when one of the packages is installed
570 for database in %{databases}; do
571 for libfile in libbacsql/$database%{_libdir}/lib*-*.so; do
572 orig_name=${libfile##*/}
573 file_prefix=${orig_name%%-*.so}
574 file_suffix=${orig_name#*-}
575 file_name=$file_prefix-$database-$file_suffix
576 install -p $libfile $RPM_BUILD_ROOT%{_libdir}/$file_name
577 touch $RPM_BUILD_ROOT%{_libdir}/$orig_name
581 # replace with empty file, replaced by ldconfig from each db-* package on intsall
582 rm -f $RPM_BUILD_ROOT%{_libdir}/libbacsql-%{version}.so
583 touch $RPM_BUILD_ROOT%{_libdir}/libbacsql-%{version}.so
585 install -p %{SOURCE10} $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-dir
586 install -p %{SOURCE11} $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-fd
587 install -p %{SOURCE12} $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-sd
588 cp -a %{SOURCE13} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}-dir
589 cp -a %{SOURCE14} $RPM_BUILD_ROOT/etc/sysconfig/bacula-dir
590 cp -a %{SOURCE15} $RPM_BUILD_ROOT/etc/sysconfig/bacula-fd
591 cp -a %{SOURCE16} $RPM_BUILD_ROOT/etc/sysconfig/bacula-sd
593 %if %{with console_wx}
594 # tray-monitor is for regular users
595 #mv $RPM_BUILD_ROOT%{_sbindir}/bacula-tray-monitor $RPM_BUILD_ROOT%{_bindir}
597 cp -a scripts/bacula.png $RPM_BUILD_ROOT%{_pixmapsdir}/bacula.png
598 #install src/tray-monitor/generic.xpm $RPM_BUILD_ROOT%{_pixmapsdir}/bacula-tray-monitor.xpm
599 sed -e 's/gnome-console/wx-console/g;s/Console/Wx Console/g' \
600 scripts/bacula.desktop.gnome2 > $RPM_BUILD_ROOT%{_desktopdir}/bacula-wx.desktop
601 #sed -e 's#%{_sbindir}#%{_bindir}#' \
602 # scripts/bacula-tray-monitor.desktop > $RPM_BUILD_ROOT%{_desktopdir}/bacula-tray-monitor.desktop
606 mv $RPM_BUILD_ROOT{%{_sbindir},%{_bindir}}/bat
607 cp -a scripts/bat.desktop $RPM_BUILD_ROOT%{_desktopdir}
611 # install the rescue stuff, these are the rescue scripts
612 cp -a rescue/linux/floppy/backup.etc.list $RPM_BUILD_ROOT%{_sysconfdir}/rescue
613 cp -a rescue/linux/floppy/sfdisk.bz2 $RPM_BUILD_ROOT%{_sysconfdir}/rescue
614 install -p rescue/linux/floppy/*_* $RPM_BUILD_ROOT%{_sysconfdir}/rescue
615 install -p rescue/linux/floppy/getdiskinfo $RPM_BUILD_ROOT%{_sysconfdir}/rescue
618 touch $RPM_BUILD_ROOT/var/log/bacula/log
620 # install the updatedb scripts for older versions that last full release
621 # 2.0 -> 3.0 : 10_to_11
622 install -p updatedb/update_*_tables_10_to_11 $RPM_BUILD_ROOT%{_libexecdir}/%{name}
624 # place for site passwords
625 touch $RPM_BUILD_ROOT%{_sysconfdir}/{dir-password,fd-password,sd-password}
626 touch $RPM_BUILD_ROOT%{_sysconfdir}/{mon-dir-password,mon-fd-password,mon-sd-password}
628 mv $RPM_BUILD_ROOT%{_libdir}/bacula/mtx-changer.conf $RPM_BUILD_ROOT/etc/bacula/mtx-changer.conf
631 rm -f $RPM_BUILD_ROOT%{_libexecdir}/%{name}/{gconsole,startmysql,stopmysql,bacula,bconsole,fd}
632 %if %{without console_wx}
633 rm -f $RPM_BUILD_ROOT%{_desktopdir}/bacula-wx.desktop
635 touch $RPM_BUILD_ROOT%{_sysconfdir}/.pw.sed
637 rm $RPM_BUILD_ROOT%{_docdir}/bacula/ChangeLog
638 rm $RPM_BUILD_ROOT%{_docdir}/bacula/INSTALL
639 rm $RPM_BUILD_ROOT%{_docdir}/bacula/LICENSE
640 rm $RPM_BUILD_ROOT%{_docdir}/bacula/README
641 rm $RPM_BUILD_ROOT%{_docdir}/bacula/ReleaseNotes
642 rm $RPM_BUILD_ROOT%{_docdir}/bacula/VERIFYING
643 rm $RPM_BUILD_ROOT%{_docdir}/bacula/technotes
645 # startup scripts, those in /etc/rc.d/init.d are better
646 rm $RPM_BUILD_ROOT%{_sbindir}/bacula
647 rm $RPM_BUILD_ROOT%{_libexecdir}/%{name}/bacula-ctl-*
650 #rm $RPM_BUILD_ROOT%{_libexecdir}/%{name}/*_bdb_*
652 # rename to avoid possible conflicts
653 mv $RPM_BUILD_ROOT%{_sbindir}/{,bacula-}dbcheck
654 mv $RPM_BUILD_ROOT%{_mandir}/man8/{,bacula-}dbcheck.8.gz
656 # no -devel files packaged, so this is also useless
657 rm $RPM_BUILD_ROOT%{_libdir}/libbac{,cfg,find,py,sql}.{so,la}
659 # placeholders for the symlinks set in %%post db-*
660 for f in create_bacula_database drop_bacula_database drop_bacula_tables \
661 grant_bacula_privileges make_bacula_tables update_bacula_tables ; do
663 ln -sf /dev/null $RPM_BUILD_ROOT%{_libexecdir}/%{name}/$f
667 install -d $RPM_BUILD_ROOT%{nagiosplugindir}
668 %{__make} -C examples/nagios/check_bacula install \
669 sbindir=%{nagiosplugindir} \
670 DESTDIR=$RPM_BUILD_ROOT
674 rm -rf $RPM_BUILD_ROOT
677 %groupadd -P %{name}-common -g 136 -r -f bacula
678 %useradd -P %{name}-common -u 136 -r -d /var/lib/bacula -s /bin/false -c "Bacula User" -g bacula bacula
680 %define update_configs \
681 echo "Updating bacula passwords and names..." | %banner -a %{name} \
683 for f in *-password; do \
684 if [ ! -s $f ]; then \
685 openssl rand -base64 33 > $f \
688 for cf in *.conf *.conf.rpmnew; do \
689 [ -f $cf ] && sed -i -e"s:#FAKE-$f#:$p:" "$cf" || : \
692 for cf in *.conf *.conf.rpmnew; do \
693 [ -f $cf ] && sed -i -e"s:--hostname--:`hostname`:" "$cf" || : \
702 if [ "$1" = "0" ]; then
707 %triggerpostun dir -- %{name}-dir < 5.0
708 %banner bacula-dir -t3 <<EOF
709 You have upgraded from an older version of Bacula director.
711 You will probably need to call %{_libexecdir}/%{name}/update_bacula_tables
712 script to upgrade the database.
717 /sbin/chkconfig --add bacula-dir
718 %service bacula-dir restart "Bacula Director daemon"
721 if [ "$1" = "0" ]; then
722 %service bacula-dir stop
723 /sbin/chkconfig --del bacula-dir
728 /sbin/chkconfig --add bacula-fd
729 %service bacula-fd restart "Bacula File daemon"
732 if [ "$1" = "0" ]; then
733 %service bacula-fd stop
734 /sbin/chkconfig --del bacula-fd
739 /sbin/chkconfig --add bacula-sd
740 %service bacula-sd restart "Bacula Storage daemon"
743 if [ "$1" = "0" ]; then
744 %service bacula-sd stop
745 /sbin/chkconfig --del bacula-sd
749 if [ -e %{_sysconfdir}/console.conf -a ! -e %{_sysconfdir}/bconsole.conf ]; then
750 mv %{_sysconfdir}/console.conf %{_sysconfdir}/bconsole.conf
759 %triggerpostun common -- %{name}-common < 5.0.1-2
760 find /etc/bacula/bat.conf* -perm /007 -print0 | xargs -0 -r chmod 600 || :
769 # link our current installed conf file to the rescue directory
770 ln -sf %{_sysconfdir}/bacula-fd.conf %{_sysconfdir}/rescue/bacula-fd.conf
773 echo "Creating rescue files for this system..."
774 cd %{_sysconfdir}/rescue
778 # remove the files created after the initial rpm installation
779 if [ "$1" = "0" ]; then
780 rm -f %{_sysconfdir}/rescue/bacula-fd.conf
781 rm -f %{_sysconfdir}/rescue/partition.*
782 rm -f %{_sysconfdir}/rescue/format.*
783 rm -f %{_sysconfdir}/rescue/mount_drives
784 rm -f %{_sysconfdir}/rescue/start_network
785 rm -f %{_sysconfdir}/rescue/sfdisk
786 rm -rf %{_sysconfdir}/rescue/diskinfo/*
791 for name in "create database" "drop tables" "drop database" "grant privileges" "make tables" "update tables"; do \
792 prefix="${name%% *}" \
793 suffix="${name#* }" \
794 ln -sf "${prefix}_%{1}_${suffix}" %{_libexecdir}/%{name}/"${prefix}_bacula_${suffix}" || : \
796 %service bacula-dir restart "Bacula Director daemon"
798 %define db_postun() \
800 if [ "$1" = "0" ]; then \
801 for f in %{_libexecdir}/%{name}/*_bacula_*; do \
802 if [ -L "$f" -a ! -e "$f" ]; then \
811 %postun db-postgresql
812 %db_postun postgresql
826 # dbi backend is different, as it is not bound with a specific db engine
829 %service bacula-dir restart "Bacula Director daemon"
831 %postun db-dbi -p /sbin/ldconfig
834 %defattr(644,root,root,755)
837 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*-password
838 # do not remove bsmtp from files. Fix build if it is not installed.
839 %attr(755,root,root) %{_sbindir}/bsmtp
840 %attr(755,root,root) %{_sbindir}/btraceback
841 %attr(755,root,root) %{_libdir}/libbac-5*.so
842 %attr(755,root,root) %{_libdir}/libbaccfg-5*.so
843 %attr(755,root,root) %{_libdir}/libbacfind-5*.so
844 %attr(755,root,root) %{_libdir}/libbacpy-5*.so
845 %{_mandir}/man8/bacula.8*
846 %{_mandir}/man1/bsmtp.1*
847 %{_mandir}/man8/btraceback.8*
848 %dir %{_libexecdir}/%{name}
849 %{_libexecdir}/%{name}/btraceback.dbx
850 %{_libexecdir}/%{name}/btraceback.gdb
851 %{_libexecdir}/%{name}/bacula_config
852 %attr(770,root,bacula) %dir %{_localstatedir}
853 %attr(750,bacula,logs) %dir /var/log/bacula
854 %attr(640,bacula,logs) %ghost /var/log/bacula/log
857 %defattr(644,root,root,755)
858 %doc ChangeLog CheckList ReleaseNotes kernstodo LICENSE
859 #%doc examples %{name}-docs-%{version}/manual/{*.pdf,bacula}
860 %attr(640,root,bacula) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bacula-dir.conf
861 %ghost %{_sysconfdir}/.pw.sed
862 %attr(640,root,root) %config(noreplace) /etc/logrotate.d/bacula-dir
863 %attr(754,root,root) /etc/rc.d/init.d/bacula-dir
864 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/bacula-dir
865 %attr(755,root,root) %{_sbindir}/bacula-dir
866 %attr(755,root,root) %{_sbindir}/bregex
867 %attr(755,root,root) %{_sbindir}/bwild
868 %attr(755,root,root) %{_sbindir}/bacula-dbcheck
869 %{_mandir}/man8/bacula-dir.8*
870 %{_mandir}/man8/bacula-dbcheck.8*
871 %{_libexecdir}/%{name}/query.sql
872 #%attr(755,root,root) %{_libexecdir}/%{name}/make_catalog_backup
873 #%attr(755,root,root) %{_libexecdir}/%{name}/delete_catalog_backup
876 %defattr(644,root,root,755)
877 %attr(755,root,root) %{_libexecdir}/%{name}/create_postgresql_database
878 %attr(755,root,root) %{_libexecdir}/%{name}/drop_postgresql_database
879 %attr(755,root,root) %{_libexecdir}/%{name}/drop_postgresql_tables
880 %attr(755,root,root) %{_libexecdir}/%{name}/grant_postgresql_privileges
881 %attr(755,root,root) %{_libexecdir}/%{name}/make_postgresql_tables
882 %attr(755,root,root) %{_libexecdir}/%{name}/update_postgresql_*
883 %attr(755,root,root) %{_libdir}/libbacsql-postgresql-5*.so
885 %ghost %attr(755,root,root) %{_libdir}/libbacsql-5*.so
886 %ghost %{_libexecdir}/%{name}/create_bacula_database
887 %ghost %{_libexecdir}/%{name}/drop_bacula_tables
888 %ghost %{_libexecdir}/%{name}/drop_bacula_database
889 %ghost %{_libexecdir}/%{name}/grant_bacula_privileges
890 %ghost %{_libexecdir}/%{name}/make_bacula_tables
891 %ghost %{_libexecdir}/%{name}/update_bacula_tables
894 %defattr(644,root,root,755)
895 %attr(755,root,root) %{_libexecdir}/%{name}/create_mysql_database
896 %attr(755,root,root) %{_libexecdir}/%{name}/drop_mysql_database
897 %attr(755,root,root) %{_libexecdir}/%{name}/drop_mysql_tables
898 %attr(755,root,root) %{_libexecdir}/%{name}/grant_mysql_privileges
899 %attr(755,root,root) %{_libexecdir}/%{name}/make_mysql_tables
900 %attr(755,root,root) %{_libexecdir}/%{name}/update_mysql_*
901 %attr(755,root,root) %{_libdir}/libbacsql-mysql-5*.so
903 %ghost %attr(755,root,root) %{_libdir}/libbacsql-5*.so
904 %ghost %{_libexecdir}/%{name}/create_bacula_database
905 %ghost %{_libexecdir}/%{name}/drop_bacula_tables
906 %ghost %{_libexecdir}/%{name}/drop_bacula_database
907 %ghost %{_libexecdir}/%{name}/grant_bacula_privileges
908 %ghost %{_libexecdir}/%{name}/make_bacula_tables
909 %ghost %{_libexecdir}/%{name}/update_bacula_tables
912 %defattr(644,root,root,755)
913 %attr(755,root,root) %{_libexecdir}/%{name}/create_sqlite3_database
914 %attr(755,root,root) %{_libexecdir}/%{name}/drop_sqlite3_database
915 %attr(755,root,root) %{_libexecdir}/%{name}/drop_sqlite3_tables
916 %attr(755,root,root) %{_libexecdir}/%{name}/grant_sqlite3_privileges
917 %attr(755,root,root) %{_libexecdir}/%{name}/make_sqlite3_tables
918 %attr(755,root,root) %{_libexecdir}/%{name}/update_sqlite3_*
919 %attr(755,root,root) %{_libdir}/libbacsql-sqlite3-5*.so
921 %ghost %attr(755,root,root) %{_libdir}/libbacsql-5*.so
922 %ghost %{_libexecdir}/%{name}/create_bacula_database
923 %ghost %{_libexecdir}/%{name}/drop_bacula_tables
924 %ghost %{_libexecdir}/%{name}/drop_bacula_database
925 %ghost %{_libexecdir}/%{name}/grant_bacula_privileges
926 %ghost %{_libexecdir}/%{name}/make_bacula_tables
927 %ghost %{_libexecdir}/%{name}/update_bacula_tables
930 %defattr(644,root,root,755)
931 %attr(755,root,root) %{_libexecdir}/%{name}/create_postgresql_database
932 %attr(755,root,root) %{_libexecdir}/%{name}/drop_postgresql_database
933 %attr(755,root,root) %{_libexecdir}/%{name}/drop_postgresql_tables
934 %attr(755,root,root) %{_libexecdir}/%{name}/grant_postgresql_privileges
935 %attr(755,root,root) %{_libexecdir}/%{name}/make_postgresql_tables
936 %attr(755,root,root) %{_libexecdir}/%{name}/update_postgresql_*
937 %attr(755,root,root) %{_libexecdir}/%{name}/create_mysql_database
938 %attr(755,root,root) %{_libexecdir}/%{name}/drop_mysql_database
939 %attr(755,root,root) %{_libexecdir}/%{name}/drop_mysql_tables
940 %attr(755,root,root) %{_libexecdir}/%{name}/grant_mysql_privileges
941 %attr(755,root,root) %{_libexecdir}/%{name}/make_mysql_tables
942 %attr(755,root,root) %{_libexecdir}/%{name}/update_mysql_*
943 %attr(755,root,root) %{_libexecdir}/%{name}/create_sqlite3_database
944 %attr(755,root,root) %{_libexecdir}/%{name}/drop_sqlite3_database
945 %attr(755,root,root) %{_libexecdir}/%{name}/drop_sqlite3_tables
946 %attr(755,root,root) %{_libexecdir}/%{name}/grant_sqlite3_privileges
947 %attr(755,root,root) %{_libexecdir}/%{name}/make_sqlite3_tables
948 %attr(755,root,root) %{_libexecdir}/%{name}/update_sqlite3_*
949 %attr(755,root,root) %{_libdir}/libbacsql-dbi-5*.so
951 %ghost %attr(755,root,root) %{_libdir}/libbacsql-5*.so
954 %defattr(644,root,root,755)
956 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bacula-fd.conf
957 %attr(754,root,root) /etc/rc.d/init.d/bacula-fd
958 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/bacula-fd
959 %attr(755,root,root) %{_sbindir}/bacula-fd
960 %attr(755,root,root) %{_libdir}/bpipe-fd.so
961 %{_mandir}/man8/bacula-fd.8*
964 %defattr(644,root,root,755)
966 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bacula-sd.conf
967 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mtx-changer.conf
968 %attr(754,root,root) /etc/rc.d/init.d/bacula-sd
969 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/bacula-sd
970 %attr(755,root,root) %{_sbindir}/bacula-sd
971 %attr(755,root,root) %{_sbindir}/bcopy
972 %attr(755,root,root) %{_sbindir}/bextract
973 %attr(755,root,root) %{_sbindir}/bls
974 %attr(755,root,root) %{_sbindir}/bscan
975 %attr(755,root,root) %{_sbindir}/btape
976 %attr(755,root,root) %{_libexecdir}/%{name}/mtx-changer
977 %attr(755,root,root) %{_libexecdir}/%{name}/disk-changer
978 %attr(755,root,root) %{_libexecdir}/%{name}/dvd-handler
979 %{_mandir}/man8/bacula-sd.8*
980 %{_mandir}/man8/bcopy.8*
981 %{_mandir}/man8/bextract.8*
982 %{_mandir}/man8/bls.8*
983 %{_mandir}/man8/bscan.8*
984 %{_mandir}/man8/btape.8*
987 %defattr(644,root,root,755)
989 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bconsole.conf
990 %attr(755,root,root) %{_sbindir}/bconsole
991 %{_mandir}/man8/bconsole.8*
993 %if %{with console_wx}
995 %defattr(644,root,root,755)
997 %{_pixmapsdir}/%{name}.png
998 %{_desktopdir}/bacula-wx.desktop
999 %attr(640,root,bacula) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bwx-console.conf
1000 %attr(755,root,root) %{_sbindir}/bwx-console
1001 %{_mandir}/man1/bacula-bwxconsole.1*
1006 %defattr(644,root,root,755)
1008 %{_pixmapsdir}/%{name}.png
1009 %{_desktopdir}/bat.desktop
1010 # Do not make this file world-readable or any user will get full access to the
1012 %attr(640,root,bacula) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bat.conf
1013 %attr(755,root,root) %{_bindir}/bat
1014 %{_mandir}/man1/bat.1*
1018 %if %{with console_wx}
1020 %defattr(644,root,root,755)
1022 %attr(755,root,root) %{_sbindir}/bacula-tray-monitor
1023 #%{_pixmapsdir}/%{name}-tray-monitor.xpm
1024 #%{_desktopdir}/%{name}-tray-monitor.desktop
1025 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/tray-monitor.conf
1026 %{_mandir}/man1/bacula-tray-monitor.1*
1031 %defattr(644,root,root,755)
1033 %dir %{_sysconfdir}/rescue
1034 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/backup.etc.list
1035 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/bacula-fd
1036 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/format_floppy
1037 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/getdiskinfo
1038 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/make_rescue_disk
1039 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/restore_bacula
1040 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/restore_etc
1041 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/run_grub
1042 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/run_lilo
1043 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/sfdisk.bz2
1047 %files -n nagios-plugin-check_bacula
1048 %defattr(644,root,root,755)
1049 %attr(755,root,root) %{nagiosplugindir}/check_bacula