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: 9de254ae39cab0587fdb2f5d8d90b03b
35 Source1: http://downloads.sourceforge.net/bacula/%{name}-docs-%{version}.tar.bz2
36 # Source1-md5: 7a00557dcf0dfa40de9e74176fefd1ae
37 Source2: http://downloads.sourceforge.net/bacula/%{name}-rescue-5.0.1.tar.gz
38 # Source2-md5: bb194aed8e204f54bf2f61d7e721f257
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 Patch7: %{name}-dbi_fixes.patch
53 Patch8: %{name}-dbi_dbcheck.patch
54 Patch9: %{name}-openssl1.patch
55 URL: http://www.bacula.org/
56 BuildRequires: acl-devel
57 BuildRequires: autoconf
58 BuildRequires: automake
59 BuildRequires: gettext-devel
60 BuildRequires: gtk+2-devel
61 BuildRequires: libcap-devel
62 %{?with_dbi:BuildRequires: libdbi-devel >= 0.8.4}
63 BuildRequires: libtool >= 2:2.2
65 BuildRequires: fakeroot
67 BuildRequires: libwrap-devel
68 BuildRequires: ncurses-devel
69 BuildRequires: openssl-devel
70 BuildRequires: pkgconfig
72 BuildRequires: python-devel
73 BuildRequires: python-modules
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: rpm-pythonprov
86 BuildRequires: rpmbuild(macros) >= 1.268
87 BuildRequires: sed >= 4.0
88 %{?with_sqlite3:BuildRequires: sqlite3-devel}
90 %if %{with console_wx}
91 BuildRequires: wxGTK2-unicode-devel >= 2.4.0
93 BuildRequires: zlib-devel
94 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
96 %define _sysconfdir /etc/%{name}
97 %define _localstatedir /var/lib/%{name}
98 %define nagiosplugindir %{_prefix}/lib/nagios/plugins
100 # from 'the worst' to 'the best'
101 %define databases %{?with_dbi:dbi} %{?with_sqlite3:sqlite3} %{?with_mysql:mysql} %{?with_pgsql:postgresql}
103 # dependency section is broken. ccache usage is instead to makefiles
104 %undefine with_ccache
107 Bacula - It comes by night and sucks the vital essence from your
110 Bacula is a set of computer programs that permit you (or the system
111 administrator) to manage backup, recovery, and verification of
112 computer data across a network of computers of different kinds. In
113 technical terms, it is a network client/server based backup program.
114 Bacula is relatively easy to use and efficient, while offering many
115 advanced storage management features that make it easy to find and
116 recover lost or damaged files.
118 %description -l pl.UTF-8
119 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
121 Bacula to zbiór programów umożliwiających administratorowi na
122 zarządzanie kopiami zapasowymi, odzyskiwaniem i weryfikacją danych w
123 sieci komputerów różnego rodzaju. W terminologii technicznej jest to
124 program do kopii zapasowych pracujący w architekturze klient-serwer.
125 Bacula jest stosunkowo łatwa w użyciu i wydajna, oferując przy tym
126 wiele zaawansowanych możliwości przy zarządzaniu nośnikami,
127 ułatwiających znalezienie i odzyskanie utraconych lub uszkodzonych
131 Summary: Common files for bacula package
132 Summary(pl.UTF-8): Pliki wspólne dla pakietu bacula
133 Group: Networking/Utilities
134 Requires(post): openssl-tools
135 Requires(post): sed >= 4.0
136 Requires(post,preun): /sbin/chkconfig
137 Requires(postun): /usr/sbin/groupdel
138 Requires(postun): /usr/sbin/userdel
139 Requires(pre): /usr/sbin/groupadd
140 Requires(pre): /usr/sbin/useradd
141 Conflicts: bacula-console < 0:1.34.6
142 Conflicts: bacula-dir < 0:1.34.6
143 Conflicts: bacula-fd < 0:1.34.6
144 Conflicts: bacula-sd < 0:1.34.6
147 Bacula - It comes by night and sucks the vital essence from your
150 Bacula is a set of computer programs that permit you (or the system
151 administrator) to manage backup, recovery, and verification of
152 computer data across a network of computers of different kinds. In
153 technical terms, it is a network client/server based backup program.
154 Bacula is relatively easy to use and efficient, while offering many
155 advanced storage management features that make it easy to find and
156 recover lost or damaged files.
158 %description common -l pl.UTF-8
159 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
161 Bacula to zbiór programów umożliwiających administratorowi na
162 zarządzanie kopiami zapasowymi, odzyskiwaniem i weryfikacją danych w
163 sieci komputerów różnego rodzaju. W terminologii technicznej jest to
164 program do kopii zapasowych pracujący w architekturze klient-serwer.
165 Bacula jest stosunkowo łatwa w użyciu i wydajna, oferując przy tym
166 wiele zaawansowanych możliwości przy zarządzaniu nośnikami,
167 ułatwiających znalezienie i odzyskanie utraconych lub uszkodzonych
171 Summary: Bacula Director and Catalog services
172 Summary(pl.UTF-8): Usługi Bacula Director i Catalog
173 Group: Networking/Utilities
174 Requires(post): sed >= 4.0
175 Requires: %{name}-common = %{version}-%{release}
176 Requires: bacula(db) = %{version}-%{release}
177 Obsoletes: bacula-updatedb
180 Bacula - It comes by night and sucks the vital essence from your
183 Bacula Director is the program that supervises all the backup,
184 restore, verify and archive operations. The system administrator uses
185 the Bacula Director to schedule backups and to recover files. Catalog
186 services are comprised of the software programs responsible for
187 maintaining the file indexes and volume databases for all files backed
188 up. The Catalog services permit the System Administrator or user to
189 quickly locate and restore any desired file, since it maintains a
190 record of all Volumes used, all Jobs run, and all Files saved.
192 %description dir -l pl.UTF-8
193 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
195 Bacula Director to program nadzorujący wszystkie operacje wykonywania
196 kopii zapasowych, odzyskiwania, weryfikacji i archiwizowania.
197 Administrator używa Bacula Directora do szeregowania kopii zapasowych
198 oraz odzyskiwania plików. Usługi katalogowe (Catalog services) są
199 używane przez programy odpowiedzialne za zarządzanie indeksami plików
200 i bazą danych wolumenów dla wszystkich kopiowanych plików. Usługi
201 katalogowe umożliwiają administratorowi lub użytkownikowi szybko
202 zlokalizować i odtworzyć dowolny plik, ponieważ utrzymują rekord ze
203 wszystkimi używanymi wolumenami, uruchomionymi zadaniami i zapisanymi
207 Summary: Bacula Console
208 Summary(pl.UTF-8): Konsola Baculi
209 Group: Networking/Utilities
210 Requires(post): sed >= 4.0
211 Requires: %{name}-common = %{version}-%{release}
214 Bacula - It comes by night and sucks the vital essence from your
217 Bacula Console is the program that allows the administrator or user to
218 communicate with the Bacula Director. This is the text only console
221 %description console -l pl.UTF-8
222 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
224 Bacula Console to program umożliwiający administratorowi lub
225 użytkownikowi komunikowanie się z programem Bacula Director. To jest
226 interfejs czysto tekstowy.
229 Summary: Bacula wxWidgets Console
230 Summary(pl.UTF-8): Konsola Baculi oparta na wxWidgets
231 Group: Networking/Utilities
232 Requires(post): sed >= 4.0
233 Requires: %{name}-common = %{version}-%{release}
235 %description console-wx
236 Bacula - It comes by night and sucks the vital essence from your
239 Bacula Console is the program that allows the administrator or user to
240 communicate with the Bacula Director. This is the wxWidgets GUI
243 %description console-wx -l pl.UTF-8
244 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
246 Bacula Console to program umożliwiający administratorowi lub
247 użytkownikowi komunikowanie się z programem Bacula Director. To jest
248 interfejs graficzny oparty na wxWidgets.
251 Summary: Bacula Qt4 Console
252 Summary(pl.UTF-8): Konsola Baculi oparta na Qt4
253 Group: Networking/Utilities
254 Requires(post): sed >= 4.0
255 Requires: %{name}-common = %{version}-%{release}
257 %description console-qt4
258 Bacula - It comes by night and sucks the vital essence from your
261 Bacula Console is the program that allows the administrator or user to
262 communicate with the Bacula Director. This is the Qt4 GUI interface.
264 %description console-qt4 -l pl.UTF-8
265 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
267 Bacula Console to program umożliwiający administratorowi lub
268 użytkownikowi komunikowanie się z programem Bacula Director. To jest
269 interfejs graficzny oparty na Qt4.
271 %package tray-monitor
272 Summary: Bacula Tray Monitor
273 Group: Networking/Utilities
274 Requires(post): sed >= 4.0
275 Requires: %{name}-common = %{version}-%{release}
277 %description tray-monitor
278 Bacula - It comes by night and sucks the vital essence from your
281 The Monitor program is typically an icon in the system tray. However,
282 once the icon is expanded into a full window, the administrator or
283 user can obtain status information about the Director or the backup
284 status on the local workstation or any other Bacula daemon that is
288 Summary: Bacula File services (Client)
289 Summary(pl.UTF-8): Usługi Bacula File (klient)
290 Group: Networking/Utilities
291 Requires(post): sed >= 4.0
292 Requires: %{name}-common = %{version}-%{release}
295 Bacula - It comes by night and sucks the vital essence from your
298 Bacula File services (or Client program) is the software program that
299 is installed on the machine to be backed up. It is specific to the
300 operating system on which it runs and is responsible for providing the
301 file attributes and data when requested by the Director. The File
302 services are also responsible for the file system dependent part of
303 restoring the file attributes and data during a recovery operation.
304 This program runs as a daemon on the machine to be backed up, and in
305 some of the documentation, the File daemon is referred to as the
306 Client (for example in Bacula configuration file).
308 %description fd -l pl.UTF-8
309 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
311 Usługi Bacula File (inaczej program kliencki) to oprogramowanie, które
312 instaluje się na maszynach, z których mają być wykonywane kopie
313 zapasowe. Są one specyficzne dla systemu operacyjnego, pod którym
314 działa dana maszyna i odpowiadają za dostarczanie atrybutów i danych
315 plików na żądanie Directora. Usługi plikowe są także odpowiedzialne za
316 zależną od systemu plików część odzyskiwania atrybutów i danych plików
317 podczas operacji odzyskiwania danych. Program działa jako demon na
318 maszynie, która ma być backupowana i w części dokumentacji demon ten
319 (File) jest nazywany klientem (na przykład w pliku konfiguracyjnym
323 Summary: Bacula Storage services
324 Summary(pl.UTF-8): Usługi Bacula Storage
325 Group: Networking/Utilities
326 Requires(post): sed >= 4.0
327 Requires: %{name}-common = %{version}-%{release}
328 Conflicts: dvd+rw-tools <= 5.21.4.10.8-1
331 Bacula - It comes by night and sucks the vital essence from your
334 Bacula Storage services consist of the software programs that perform
335 the storage and recovery of the file attributes and data to the
336 physical backup media or volumes. In other words, the Storage daemon
337 is responsible for reading and writing your tapes (or other storage
338 media, e.g. files). The Storage services runs as a daemon on the
339 machine that has the backup device (usually a tape drive).
341 %description sd -l pl.UTF-8
342 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
344 Usługi Bacula Storage składają się z programów obsługujących
345 przechowywanie danych oraz odzyskiwanie atrybutów i danych na
346 fizycznych nośnikach lub wolumenach. Innymi słowy, demon Storage jest
347 odpowiedzialny za odczyt i zapis taśm (lub innych nośników do
348 przechowywania danych, np. plików). Usługi Storage działają jako demon
349 na maszynie, która zawiera urządzenie backupowe (zwykle napęd
352 %package db-postgresql
353 Summary: PostgreSQL database driver for Bacula
354 Summary(pl.UTF-8): Sterownik bazy PostgreSQL dla Baculi
355 Group: Networking/Utilities
356 Requires(post): /sbin/ldconfig
357 Requires: %{name}-common = %{version}-%{release}
358 Provides: bacula(db) = %{version}-%{release}
359 Obsoletes: bacula(db)
361 %description db-postgresql
362 PostgreSQL database driver for Bacula.
364 %description db-postgresql -l pl.UTF-8
365 Sterownik bazy PostgreSQL dla Baculi.
368 Summary: MySQL database driver for Bacula
369 Summary(pl.UTF-8): Sterownik bazy MySQL dla Baculi
370 Group: Networking/Utilities
371 Requires(post): /sbin/ldconfig
372 Requires: %{name}-common = %{version}-%{release}
373 Provides: bacula(db) = %{version}-%{release}
374 Obsoletes: bacula(db)
376 %description db-mysql
377 MySQL database driver for Bacula.
379 %description db-mysql -l pl.UTF-8
380 Sterownik bazy MySQL dla Baculi.
383 Summary: SQLite database driver for Bacula
384 Summary(pl.UTF-8): Sterownik bazy SQLite dla Baculi
385 Group: Networking/Utilities
386 Requires(post): /sbin/ldconfig
387 Requires: %{name}-common = %{version}-%{release}
388 Provides: bacula(db) = %{version}-%{release}
389 Obsoletes: bacula(db)
391 %description db-sqlite3
392 SQLite database driver for Bacula.
394 %description db-sqlite3 -l pl.UTF-8
395 Sterownik bazy SQLite dla Baculi.
398 Summary: libdbi database driver for Bacula
399 Summary(pl.UTF-8): Sterownik bazy libdbi dla Baculi
400 Group: Networking/Utilities
401 Requires(post): /sbin/ldconfig
402 Requires: %{name}-common = %{version}-%{release}
403 Provides: bacula(db) = %{version}-%{release}
404 Obsoletes: bacula(db)
407 libdbi database driver for Bacula.
409 %description db-dbi -l pl.UTF-8
410 Sterownik baz libdbi dla Baculi.
413 Summary: Bacula - The Network Backup Solution
414 Summary(pl.UTF-8): Bacula - rozwiązanie do wykonywania kopii zapasowych po sieci
415 Group: Networking/Utilities
416 Requires: %{name}-fd = %{version}-%{release}
421 Bacula - It comes by night and sucks the vital essence from your
424 Bacula is a set of computer programs that permit you (or the system
425 administrator) to manage backup, recovery, and verification of
426 computer data across a network of computers of different kinds. In
427 technical terms, it is a network client/server based backup program.
428 Bacula is relatively easy to use and efficient, while offering many
429 advanced storage management features that make it easy to find and
430 recover lost or damaged files.
432 This package installs scripts for disaster recovery and builds rescue
433 floppy disk for bare metal recovery.
435 %description rescue -l pl.UTF-8
436 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
438 Bacula to zbiór programów umożliwiających administratorowi na
439 zarządzanie kopiami zapasowymi, odzyskiwaniem i weryfikacją danych w
440 sieci komputerów różnego rodzaju. W terminologii technicznej jest to
441 program do kopii zapasowych pracujący w architekturze klient-serwer.
442 Bacula jest stosunkowo łatwa w użyciu i wydajna, oferując przy tym
443 wiele zaawansowanych możliwości przy zarządzaniu nośnikami,
444 ułatwiających znalezienie i odzyskanie utraconych lub uszkodzonych
447 Ten pakiet zawiera skrypty do odtwarzania po awarii i tworzy dyskietkę
448 ratunkowe do odtwarzania systemu od zera.
450 %package -n nagios-plugin-check_bacula
451 Summary: Nagios plugin to check bacula
453 Requires: nagios-common
455 %description -n nagios-plugin-check_bacula
456 Nagios plugin to check bacula.
470 tar -xf %{SOURCE2} && ln -s bacula-rescue-* rescue
472 sed -i -e 's#bindir=.*#bindir=%{_bindir}#g' \
473 src/cats/create_* src/cats/delete_* src/cats/drop_* \
474 src/cats/grant_* src/cats/make_* src/cats/update_*
475 sed -i -e 's/@hostname@/--hostname--/' src/*/*.conf.in
478 for dbtype in mysql postgresql sqlite3; do
479 sed -i -e "s,@DB_TYPE@,$dbtype,g" src/cats/*_${dbtype}_*
485 %{__aclocal} -I bacula-macros -I gettext-macros
486 # $BUILD_DIR not seen by libtoolize, export it
487 BUILD_DIR=.. %{__libtoolize}
489 %{__autoconf} --prepend-include=$(pwd)/autoconf autoconf/configure.in > configure
491 CPPFLAGS="-I/usr/include/ncurses -I%{_includedir}/readline"
493 # we wan't the 'base' build built with the last database in the list,
494 # to make sure it is full-featured
495 for database in %{databases}; do
496 WXCONFIG=%{_bindir}/wx-gtk2-unicode-config \
497 QMAKE=%{_bindir}/qt4-qmake \
499 --with-scriptdir=%{_libexecdir}/%{name} \
500 %{?with_bat:--enable-bat} \
502 --enable-smartalloc \
503 %{?with_console_wx:--enable-bwx-console} \
504 --enable-tray-monitor \
505 %{?with_python:--with-python} \
507 --with-tcp-wrappers \
508 --with-working-dir=%{_var}/lib/%{name} \
509 --with-dump-email="root@localhost" \
510 --with-job-email="root@localhost" \
511 --with-smtp-host=localhost \
512 --with-pid-dir=/var/run \
513 --with-subsys-dir=/var/lock/subsys \
514 --enable-batch-insert \
516 %{?with_sqlite3_sync_off:--enable-extra-sqlite3-init="pragma synchronous=0;"} \
517 --with-dir-password="#FAKE-dir-password#" \
518 --with-fd-password="#FAKE-fd-password#" \
519 --with-sd-password="#FAKE-sd-password#" \
520 --with-mon-dir-password="#FAKE-mon-dir-password#" \
521 --with-mon-fd-password="#FAKE-mon-fd-password#" \
522 --with-mon-sd-password="#FAKE-mon-sd-password#" \
525 # build the database library
526 %{__make} -C src/cats clean
527 %{__make} -C src/cats
529 # install the database library in a temporary location
530 install -d libbacsql/$database%{_libdir}
531 %{__make} -C src/cats libtool-install DESTDIR=$PWD/libbacsql/$database
544 %{__make} -C examples/nagios/check_bacula
556 rm -rf $RPM_BUILD_ROOT
558 install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,logrotate.d,pam.d,sysconfig}
559 install -d $RPM_BUILD_ROOT%{_sysconfdir}/rescue
560 install -d $RPM_BUILD_ROOT{%{_pixmapsdir},%{_desktopdir},%{_mandir},%{_bindir},/var/log/bacula}
563 DESTDIR=$RPM_BUILD_ROOT
565 # install libraries for all the database backends
566 # ldconfig will add the soname symlinks when one of the packages is installed
567 for database in %{databases}; do
568 for libfile in libbacsql/$database%{_libdir}/lib*-*.so; do
569 orig_name=${libfile##*/}
570 file_prefix=${orig_name%%-*.so}
571 file_suffix=${orig_name#*-}
572 file_name=$file_prefix-$database-$file_suffix
573 install -p $libfile $RPM_BUILD_ROOT/%{_libdir}/$file_name
574 touch $RPM_BUILD_ROOT/%{_libdir}/$orig_name
578 install -p %{SOURCE10} $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-dir
579 install -p %{SOURCE11} $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-fd
580 install -p %{SOURCE12} $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-sd
581 cp -a %{SOURCE13} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}-dir
582 cp -a %{SOURCE14} $RPM_BUILD_ROOT/etc/sysconfig/bacula-dir
583 cp -a %{SOURCE15} $RPM_BUILD_ROOT/etc/sysconfig/bacula-fd
584 cp -a %{SOURCE16} $RPM_BUILD_ROOT/etc/sysconfig/bacula-sd
586 %if %{with console_wx}
587 # tray-monitor is for regular users
588 #mv $RPM_BUILD_ROOT%{_sbindir}/bacula-tray-monitor $RPM_BUILD_ROOT%{_bindir}
590 cp -a scripts/bacula.png $RPM_BUILD_ROOT%{_pixmapsdir}/bacula.png
591 #install src/tray-monitor/generic.xpm $RPM_BUILD_ROOT%{_pixmapsdir}/bacula-tray-monitor.xpm
592 sed -e 's/gnome-console/wx-console/g;s/Console/Wx Console/g' \
593 scripts/bacula.desktop.gnome2 > $RPM_BUILD_ROOT%{_desktopdir}/bacula-wx.desktop
594 #sed -e 's#%{_sbindir}#%{_bindir}#' \
595 # scripts/bacula-tray-monitor.desktop > $RPM_BUILD_ROOT%{_desktopdir}/bacula-tray-monitor.desktop
599 # TODO: libtool install
600 #libtool --silent --mode=install install src/qt-console/bat $RPM_BUILD_ROOT%{_bindir}
601 install src/qt-console/.libs/bat $RPM_BUILD_ROOT%{_bindir}
602 cp -a scripts/bat.desktop $RPM_BUILD_ROOT%{_desktopdir}
606 # install the rescue stuff, these are the rescue scripts
607 cp -a rescue/linux/floppy/backup.etc.list $RPM_BUILD_ROOT%{_sysconfdir}/rescue
608 cp -a rescue/linux/floppy/sfdisk.bz2 $RPM_BUILD_ROOT%{_sysconfdir}/rescue
609 install -p rescue/linux/floppy/*_* $RPM_BUILD_ROOT%{_sysconfdir}/rescue
610 install -p rescue/linux/floppy/getdiskinfo $RPM_BUILD_ROOT%{_sysconfdir}/rescue
613 touch $RPM_BUILD_ROOT/var/log/bacula/log
615 # install the updatedb scripts
616 install -p updatedb/update_sqlite* $RPM_BUILD_ROOT%{_libexecdir}/%{name}
618 # place for site passwords
619 touch $RPM_BUILD_ROOT%{_sysconfdir}/{dir-password,fd-password,sd-password}
620 touch $RPM_BUILD_ROOT%{_sysconfdir}/{mon-dir-password,mon-fd-password,mon-sd-password}
622 mv $RPM_BUILD_ROOT%{_libdir}/bacula/mtx-changer.conf $RPM_BUILD_ROOT/etc/bacula/mtx-changer.conf
625 rm -f $RPM_BUILD_ROOT%{_libexecdir}/%{name}/{gconsole,startmysql,stopmysql,bacula,bconsole,fd}
626 %if %{without console_wx}
627 rm -f $RPM_BUILD_ROOT%{_desktopdir}/bacula-wx.desktop
629 touch $RPM_BUILD_ROOT%{_sysconfdir}/.pw.sed
631 rm $RPM_BUILD_ROOT%{_docdir}/bacula/ChangeLog
632 rm $RPM_BUILD_ROOT%{_docdir}/bacula/INSTALL
633 rm $RPM_BUILD_ROOT%{_docdir}/bacula/LICENSE
634 rm $RPM_BUILD_ROOT%{_docdir}/bacula/README
635 rm $RPM_BUILD_ROOT%{_docdir}/bacula/ReleaseNotes
636 rm $RPM_BUILD_ROOT%{_docdir}/bacula/VERIFYING
637 rm $RPM_BUILD_ROOT%{_docdir}/bacula/technotes
639 # startup scripts, those in /etc/rc.d/init.d are better
640 rm $RPM_BUILD_ROOT%{_sbindir}/bacula
641 rm $RPM_BUILD_ROOT%{_libexecdir}/%{name}/bacula-ctl-*
644 #rm $RPM_BUILD_ROOT%{_libexecdir}/%{name}/*_bdb_*
646 # rename to avoid possible conflicts
647 mv $RPM_BUILD_ROOT%{_sbindir}/{,bacula-}dbcheck
648 mv $RPM_BUILD_ROOT%{_mandir}/man8/{,bacula-}dbcheck.8.gz
650 # no -devel files packaged, so this is also useless
651 rm $RPM_BUILD_ROOT%{_libdir}/libbac{,cfg,find,py,sql}.{so,la}
653 # placeholders for the symlinks set in %%post db-*
654 for f in create_bacula_database drop_bacula_database drop_bacula_tables \
655 grant_bacula_privileges make_bacula_tables update_bacula_tables ; do
657 ln -sf /dev/null $RPM_BUILD_ROOT%{_libexecdir}/%{name}/$f
661 %{__make} -C examples/nagios/check_bacula install \
662 sbindir=%{nagiosplugindir} \
663 DESTDIR=$RPM_BUILD_ROOT
667 rm -rf $RPM_BUILD_ROOT
670 %groupadd -P %{name}-common -g 136 -r -f bacula
671 %useradd -P %{name}-common -u 136 -r -d /var/lib/bacula -s /bin/false -c "Bacula User" -g bacula bacula
674 %define update_configs \
675 echo "Updating bacula passwords and names..." | %banner \
677 for f in *-password ; do \
678 if [ ! -s $f ] ; then \
679 openssl rand -base64 33 > $f \
682 for cf in *.conf *.conf.rpmnew ; do \
683 [ -f $cf ] && sed -i -e"s:#FAKE-$f#:$p:" "$cf" || : \
686 for cf in *.conf *.conf.rpmnew ; do \
687 [ -f $cf ] && sed -i -e"s:--hostname--:`hostname`:" "$cf" || : \
696 if [ "$1" = "0" ]; then
701 %triggerpostun dir -- %{name}-dir < 5.0
702 %banner bacula-dir -t3 <<EOF
703 You have upgraded from an older version of Bacula director.
705 You will probably need to call %{_libexecdir}/%{name}/update_bacula_tables
706 script to upgrade the database.
711 /sbin/chkconfig --add bacula-dir
712 %service bacula-dir restart "Bacula Director daemon"
715 if [ "$1" = "0" ]; then
716 %service bacula-dir stop
717 /sbin/chkconfig --del bacula-dir
722 /sbin/chkconfig --add bacula-fd
723 %service bacula-fd restart "Bacula File daemon"
726 if [ "$1" = "0" ]; then
727 %service bacula-fd stop
728 /sbin/chkconfig --del bacula-fd
733 /sbin/chkconfig --add bacula-sd
734 %service bacula-sd restart "Bacula Storage daemon"
737 if [ "$1" = "0" ]; then
738 %service bacula-sd stop
739 /sbin/chkconfig --del bacula-sd
743 if [ -e %{_sysconfdir}/console.conf -a ! -e %{_sysconfdir}/bconsole.conf ]; then
744 mv %{_sysconfdir}/console.conf %{_sysconfdir}/bconsole.conf
753 %triggerpostun common -- %{name}-common < 5.0.1-2
754 find /etc/bacula/bat.conf* -perm /007 -print0 | xargs -0 -r chmod 600 || :
763 # link our current installed conf file to the rescue directory
764 ln -sf %{_sysconfdir}/bacula-fd.conf %{_sysconfdir}/rescue/bacula-fd.conf
767 echo "Creating rescue files for this system..."
768 cd %{_sysconfdir}/rescue
772 # remove the files created after the initial rpm installation
773 if [ "$1" = "0" ]; then
774 rm -f %{_sysconfdir}/rescue/bacula-fd.conf
775 rm -f %{_sysconfdir}/rescue/partition.*
776 rm -f %{_sysconfdir}/rescue/format.*
777 rm -f %{_sysconfdir}/rescue/mount_drives
778 rm -f %{_sysconfdir}/rescue/start_network
779 rm -f %{_sysconfdir}/rescue/sfdisk
780 rm -rf %{_sysconfdir}/rescue/diskinfo/*
785 for name in "create database" "drop tables" "drop database" "grant privileges" "make tables" "update tables"; do \
786 prefix="${name%% *}" \
787 suffix="${name#* }" \
788 ln -sf "${prefix}_%{1}_${suffix}" %{_libexecdir}/%{name}/"${prefix}_bacula_${suffix}" || : \
790 %service bacula-dir restart "Bacula Director daemon"
792 %define db_postun() \
794 if [ "$1" = "0" ]; then \
795 for f in %{_libexecdir}/%{name}/*_bacula_*; do \
796 if [ -L "$f" -a ! -e "$f" ]; then \
805 %postun db-postgresql
806 %db_postun postgresql
820 # dbi backend is different, as it is not bound with a specific db engine
823 %service bacula-dir restart "Bacula Director daemon"
825 %postun db-dbi -p /sbin/ldconfig
828 %defattr(644,root,root,755)
831 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*-password
832 # do not remove bsmtp from files. Fix build if it is not installed.
833 %attr(755,root,root) %{_sbindir}/bsmtp
834 %attr(755,root,root) %{_sbindir}/btraceback
835 %attr(755,root,root) %{_libdir}/libbac-5*.so
836 %attr(755,root,root) %{_libdir}/libbaccfg-5*.so
837 %attr(755,root,root) %{_libdir}/libbacfind-5*.so
838 %attr(755,root,root) %{_libdir}/libbacpy-5*.so
839 %{_mandir}/man8/bacula.8*
840 %{_mandir}/man1/bsmtp.1*
841 %{_mandir}/man8/btraceback.8*
842 %dir %{_libexecdir}/%{name}
843 %{_libexecdir}/%{name}/btraceback.dbx
844 %{_libexecdir}/%{name}/btraceback.gdb
845 %{_libexecdir}/%{name}/bacula_config
846 %attr(770,root,bacula) %dir %{_localstatedir}
847 %attr(750,bacula,logs) %dir /var/log/bacula
848 %attr(640,bacula,logs) %ghost /var/log/bacula/log
851 %defattr(644,root,root,755)
852 %doc ChangeLog CheckList ReleaseNotes kernstodo LICENSE
853 #%doc examples %{name}-docs-%{version}/manual/{*.pdf,bacula}
854 %attr(640,root,bacula) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bacula-dir.conf
855 %ghost %{_sysconfdir}/.pw.sed
856 %attr(640,root,root) %config(noreplace) /etc/logrotate.d/bacula-dir
857 %attr(754,root,root) /etc/rc.d/init.d/bacula-dir
858 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/bacula-dir
859 %attr(755,root,root) %{_sbindir}/bacula-dir
860 %attr(755,root,root) %{_sbindir}/bregex
861 %attr(755,root,root) %{_sbindir}/bwild
862 %attr(755,root,root) %{_sbindir}/bacula-dbcheck
863 %{_mandir}/man8/bacula-dir.8*
864 %{_mandir}/man8/bacula-dbcheck.8*
865 %{_libexecdir}/%{name}/query.sql
866 #%attr(755,root,root) %{_libexecdir}/%{name}/make_catalog_backup
867 #%attr(755,root,root) %{_libexecdir}/%{name}/delete_catalog_backup
870 %defattr(644,root,root,755)
871 %attr(755,root,root) %{_libexecdir}/%{name}/create_postgresql_database
872 %attr(755,root,root) %{_libexecdir}/%{name}/drop_postgresql_database
873 %attr(755,root,root) %{_libexecdir}/%{name}/drop_postgresql_tables
874 %attr(755,root,root) %{_libexecdir}/%{name}/grant_postgresql_privileges
875 %attr(755,root,root) %{_libexecdir}/%{name}/make_postgresql_tables
876 %attr(755,root,root) %{_libexecdir}/%{name}/update_postgresql_*
877 %attr(755,root,root) %{_libdir}/libbacsql-postgresql-5*.so
879 %ghost %attr(755,root,root) %{_libdir}/libbacsql-5*.so
880 %ghost %{_libexecdir}/%{name}/create_bacula_database
881 %ghost %{_libexecdir}/%{name}/drop_bacula_tables
882 %ghost %{_libexecdir}/%{name}/drop_bacula_database
883 %ghost %{_libexecdir}/%{name}/grant_bacula_privileges
884 %ghost %{_libexecdir}/%{name}/make_bacula_tables
885 %ghost %{_libexecdir}/%{name}/update_bacula_tables
888 %defattr(644,root,root,755)
889 %attr(755,root,root) %{_libexecdir}/%{name}/create_mysql_database
890 %attr(755,root,root) %{_libexecdir}/%{name}/drop_mysql_database
891 %attr(755,root,root) %{_libexecdir}/%{name}/drop_mysql_tables
892 %attr(755,root,root) %{_libexecdir}/%{name}/grant_mysql_privileges
893 %attr(755,root,root) %{_libexecdir}/%{name}/make_mysql_tables
894 %attr(755,root,root) %{_libexecdir}/%{name}/update_mysql_*
895 %attr(755,root,root) %{_libdir}/libbacsql-mysql-5*.so
897 %ghost %attr(755,root,root) %{_libdir}/libbacsql-5*.so
898 %ghost %{_libexecdir}/%{name}/create_bacula_database
899 %ghost %{_libexecdir}/%{name}/drop_bacula_tables
900 %ghost %{_libexecdir}/%{name}/drop_bacula_database
901 %ghost %{_libexecdir}/%{name}/grant_bacula_privileges
902 %ghost %{_libexecdir}/%{name}/make_bacula_tables
903 %ghost %{_libexecdir}/%{name}/update_bacula_tables
906 %defattr(644,root,root,755)
907 %attr(755,root,root) %{_libexecdir}/%{name}/create_sqlite3_database
908 %attr(755,root,root) %{_libexecdir}/%{name}/drop_sqlite3_database
909 %attr(755,root,root) %{_libexecdir}/%{name}/drop_sqlite3_tables
910 %attr(755,root,root) %{_libexecdir}/%{name}/grant_sqlite3_privileges
911 %attr(755,root,root) %{_libexecdir}/%{name}/make_sqlite3_tables
912 %attr(755,root,root) %{_libexecdir}/%{name}/update_sqlite3_*
913 %attr(755,root,root) %{_libexecdir}/%{name}/update_sqlite_*
914 %attr(755,root,root) %{_libdir}/libbacsql-sqlite3-5*.so
916 %ghost %attr(755,root,root) %{_libdir}/libbacsql-5*.so
917 %ghost %{_libexecdir}/%{name}/create_bacula_database
918 %ghost %{_libexecdir}/%{name}/drop_bacula_tables
919 %ghost %{_libexecdir}/%{name}/drop_bacula_database
920 %ghost %{_libexecdir}/%{name}/grant_bacula_privileges
921 %ghost %{_libexecdir}/%{name}/make_bacula_tables
922 %ghost %{_libexecdir}/%{name}/update_bacula_tables
925 %defattr(644,root,root,755)
926 %attr(755,root,root) %{_libexecdir}/%{name}/create_postgresql_database
927 %attr(755,root,root) %{_libexecdir}/%{name}/drop_postgresql_database
928 %attr(755,root,root) %{_libexecdir}/%{name}/drop_postgresql_tables
929 %attr(755,root,root) %{_libexecdir}/%{name}/grant_postgresql_privileges
930 %attr(755,root,root) %{_libexecdir}/%{name}/make_postgresql_tables
931 %attr(755,root,root) %{_libexecdir}/%{name}/update_postgresql_*
932 %attr(755,root,root) %{_libexecdir}/%{name}/create_mysql_database
933 %attr(755,root,root) %{_libexecdir}/%{name}/drop_mysql_database
934 %attr(755,root,root) %{_libexecdir}/%{name}/drop_mysql_tables
935 %attr(755,root,root) %{_libexecdir}/%{name}/grant_mysql_privileges
936 %attr(755,root,root) %{_libexecdir}/%{name}/make_mysql_tables
937 %attr(755,root,root) %{_libexecdir}/%{name}/update_mysql_*
938 %attr(755,root,root) %{_libexecdir}/%{name}/create_sqlite3_database
939 %attr(755,root,root) %{_libexecdir}/%{name}/drop_sqlite3_database
940 %attr(755,root,root) %{_libexecdir}/%{name}/drop_sqlite3_tables
941 %attr(755,root,root) %{_libexecdir}/%{name}/grant_sqlite3_privileges
942 %attr(755,root,root) %{_libexecdir}/%{name}/make_sqlite3_tables
943 %attr(755,root,root) %{_libexecdir}/%{name}/update_sqlite3_*
944 %attr(755,root,root) %{_libexecdir}/%{name}/update_sqlite_*
945 %attr(755,root,root) %{_libdir}/libbacsql-dbi-5*.so
947 %ghost %attr(755,root,root) %{_libdir}/libbacsql-5*.so
950 %defattr(644,root,root,755)
952 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bacula-fd.conf
953 %attr(754,root,root) /etc/rc.d/init.d/bacula-fd
954 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/bacula-fd
955 %attr(755,root,root) %{_sbindir}/bacula-fd
956 %attr(755,root,root) %{_libdir}/bpipe-fd.so
957 %{_mandir}/man8/bacula-fd.8*
960 %defattr(644,root,root,755)
962 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bacula-sd.conf
963 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mtx-changer.conf
964 %attr(754,root,root) /etc/rc.d/init.d/bacula-sd
965 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/bacula-sd
966 %attr(755,root,root) %{_sbindir}/bacula-sd
967 %attr(755,root,root) %{_sbindir}/bcopy
968 %attr(755,root,root) %{_sbindir}/bextract
969 %attr(755,root,root) %{_sbindir}/bls
970 %attr(755,root,root) %{_sbindir}/bscan
971 %attr(755,root,root) %{_sbindir}/btape
972 %attr(755,root,root) %{_libexecdir}/%{name}/mtx-changer
973 %attr(755,root,root) %{_libexecdir}/%{name}/disk-changer
974 %attr(755,root,root) %{_libexecdir}/%{name}/dvd-handler
975 %{_mandir}/man8/bacula-sd.8*
976 %{_mandir}/man8/bcopy.8*
977 %{_mandir}/man8/bextract.8*
978 %{_mandir}/man8/bls.8*
979 %{_mandir}/man8/bscan.8*
980 %{_mandir}/man8/btape.8*
983 %defattr(644,root,root,755)
985 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bconsole.conf
986 %attr(755,root,root) %{_sbindir}/bconsole
987 %{_mandir}/man8/bconsole.8*
989 %if %{with console_wx}
991 %defattr(644,root,root,755)
993 %{_pixmapsdir}/%{name}.png
994 %{_desktopdir}/bacula-wx.desktop
995 %attr(640,root,bacula) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bwx-console.conf
996 %attr(755,root,root) %{_sbindir}/bwx-console
997 %{_mandir}/man1/bacula-bwxconsole.1*
1002 %defattr(644,root,root,755)
1004 %{_pixmapsdir}/%{name}.png
1005 %{_desktopdir}/bat.desktop
1006 # Do not make this file world-readable or any user will get full access to the
1008 %attr(640,root,bacula) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bat.conf
1009 %attr(755,root,root) %{_bindir}/bat
1010 %{_mandir}/man1/bat.1*
1014 %if %{with console_wx}
1016 %defattr(644,root,root,755)
1018 %attr(755,root,root) %{_sbindir}/bacula-tray-monitor
1019 #%{_pixmapsdir}/%{name}-tray-monitor.xpm
1020 #%{_desktopdir}/%{name}-tray-monitor.desktop
1021 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/tray-monitor.conf
1022 %{_mandir}/man1/bacula-tray-monitor.1*
1027 %defattr(644,root,root,755)
1029 %dir %{_sysconfdir}/rescue
1030 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/backup.etc.list
1031 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/bacula-fd
1032 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/format_floppy
1033 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/getdiskinfo
1034 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/make_rescue_disk
1035 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/restore_bacula
1036 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/restore_etc
1037 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/run_grub
1038 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/run_lilo
1039 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/sfdisk.bz2
1043 %files -n nagios-plugin-check_bacula
1044 %defattr(644,root,root,755)
1045 %attr(755,root,root) %{nagiosplugindir}/check_bacula