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
12 #*** WARNING: identical binaries are copied, not linked:
17 %bcond_without console_wx # wx-console program
18 %bcond_without bat # bat Qt4 GUI
19 %bcond_without dbi # use Database Independent Abstraction Layer (libdbi)
20 %bcond_without mysql # use MySQL
21 %bcond_without pgsql # use PostgreSQL
22 %bcond_without sqlite3 # use SQLite3
24 %bcond_without nagios # build nagios plugin
26 %bcond_with sqlite3_sync_off # makes SQLite3 backend much faster, but less reliable
28 %if %{without sqlite3}
29 %undefine with_sqlite3_sync_off
32 Summary: Bacula - The Network Backup Solution
33 Summary(pl.UTF-8): Bacula - rozwiązanie do wykonywania kopii zapasowych po sieci
37 License: extended GPL v2
38 Group: Networking/Utilities
39 Source0: http://downloads.sourceforge.net/bacula/%{name}-%{version}.tar.gz
40 # Source0-md5: 9de254ae39cab0587fdb2f5d8d90b03b
41 Source1: http://downloads.sourceforge.net/bacula/%{name}-docs-%{version}.tar.bz2
42 # Source1-md5: 7a00557dcf0dfa40de9e74176fefd1ae
43 Source2: http://downloads.sourceforge.net/bacula/%{name}-rescue-5.0.1.tar.gz
44 # Source2-md5: bb194aed8e204f54bf2f61d7e721f257
45 Source10: %{name}-dir.init
46 Source11: %{name}-fd.init
47 Source12: %{name}-sd.init
48 Source13: %{name}.logrotate
49 Source14: %{name}-dir.sysconfig
50 Source15: %{name}-fd.sysconfig
51 Source16: %{name}-sd.sysconfig
52 Patch0: %{name}-mtx-changer.patch
53 Patch1: %{name}-link.patch
54 Patch2: %{name}-tinfo-readline.patch
55 Patch3: %{name}-branding.patch
56 Patch4: %{name}-conf.patch
57 Patch5: %{name}-desktop.patch
58 Patch7: %{name}-dbi_fixes.patch
59 Patch8: %{name}-dbi_dbcheck.patch
60 Patch9: %{name}-openssl1.patch
61 Patch10: %{name}-dvd_rewind.patch
62 URL: http://www.bacula.org/
63 BuildRequires: acl-devel
64 BuildRequires: autoconf
65 BuildRequires: automake
66 BuildRequires: gettext-devel
67 BuildRequires: gtk+2-devel
68 BuildRequires: libcap-devel
69 %{?with_dbi:BuildRequires: libdbi-devel >= 0.8.4}
70 BuildRequires: libtool >= 2:2.2
72 BuildRequires: fakeroot
74 BuildRequires: libwrap-devel
75 BuildRequires: ncurses-devel
76 BuildRequires: openssl-devel
77 BuildRequires: pkgconfig
79 BuildRequires: python-devel
80 BuildRequires: python-modules
83 BuildRequires: QtCore-devel
84 BuildRequires: QtGui-devel
85 BuildRequires: qt4-build >= 4.3.3-3
86 BuildRequires: qt4-qmake >= 4.3.3-3
87 #BuildRequires: qwt-devel >= 5.0.2-2
89 %{?with_mysql:BuildRequires: mysql-devel}
90 %{?with_pgsql:BuildRequires: postgresql-devel}
91 BuildRequires: readline-devel
92 BuildRequires: rpm-pythonprov
93 BuildRequires: rpmbuild(macros) >= 1.268
94 BuildRequires: sed >= 4.0
95 %{?with_sqlite3:BuildRequires: sqlite3-devel}
97 %if %{with console_wx}
98 BuildRequires: wxGTK2-unicode-devel >= 2.4.0
100 BuildRequires: zlib-devel
101 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
103 %define _sysconfdir /etc/%{name}
104 %define _localstatedir /var/lib/%{name}
105 %define nagiosplugindir %{_prefix}/lib/nagios/plugins
107 # from 'the worst' to 'the best'
108 %define databases %{?with_dbi:dbi} %{?with_sqlite3:sqlite3} %{?with_mysql:mysql} %{?with_pgsql:postgresql}
110 # dependency section is broken. ccache usage is instead to makefiles
111 %undefine with_ccache
114 Bacula - It comes by night and sucks the vital essence from your
117 Bacula is a set of computer programs that permit you (or the system
118 administrator) to manage backup, recovery, and verification of
119 computer data across a network of computers of different kinds. In
120 technical terms, it is a network client/server based backup program.
121 Bacula is relatively easy to use and efficient, while offering many
122 advanced storage management features that make it easy to find and
123 recover lost or damaged files.
125 %description -l pl.UTF-8
126 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
128 Bacula to zbiór programów umożliwiających administratorowi na
129 zarządzanie kopiami zapasowymi, odzyskiwaniem i weryfikacją danych w
130 sieci komputerów różnego rodzaju. W terminologii technicznej jest to
131 program do kopii zapasowych pracujący w architekturze klient-serwer.
132 Bacula jest stosunkowo łatwa w użyciu i wydajna, oferując przy tym
133 wiele zaawansowanych możliwości przy zarządzaniu nośnikami,
134 ułatwiających znalezienie i odzyskanie utraconych lub uszkodzonych
138 Summary: Common files for bacula package
139 Summary(pl.UTF-8): Pliki wspólne dla pakietu bacula
140 Group: Networking/Utilities
141 Requires(post): openssl-tools
142 Requires(post): sed >= 4.0
143 Requires(post,preun): /sbin/chkconfig
144 Requires(postun): /usr/sbin/groupdel
145 Requires(postun): /usr/sbin/userdel
146 Requires(pre): /usr/sbin/groupadd
147 Requires(pre): /usr/sbin/useradd
148 Conflicts: bacula-console < 0:1.34.6
149 Conflicts: bacula-dir < 0:1.34.6
150 Conflicts: bacula-fd < 0:1.34.6
151 Conflicts: bacula-sd < 0:1.34.6
154 Bacula - It comes by night and sucks the vital essence from your
157 Bacula is a set of computer programs that permit you (or the system
158 administrator) to manage backup, recovery, and verification of
159 computer data across a network of computers of different kinds. In
160 technical terms, it is a network client/server based backup program.
161 Bacula is relatively easy to use and efficient, while offering many
162 advanced storage management features that make it easy to find and
163 recover lost or damaged files.
165 %description common -l pl.UTF-8
166 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
168 Bacula to zbiór programów umożliwiających administratorowi na
169 zarządzanie kopiami zapasowymi, odzyskiwaniem i weryfikacją danych w
170 sieci komputerów różnego rodzaju. W terminologii technicznej jest to
171 program do kopii zapasowych pracujący w architekturze klient-serwer.
172 Bacula jest stosunkowo łatwa w użyciu i wydajna, oferując przy tym
173 wiele zaawansowanych możliwości przy zarządzaniu nośnikami,
174 ułatwiających znalezienie i odzyskanie utraconych lub uszkodzonych
178 Summary: Bacula Director and Catalog services
179 Summary(pl.UTF-8): Usługi Bacula Director i Catalog
180 Group: Networking/Utilities
181 Requires(post): sed >= 4.0
182 Requires: %{name}-common = %{version}-%{release}
183 Requires: bacula(db) = %{version}-%{release}
184 Obsoletes: bacula-updatedb
187 Bacula - It comes by night and sucks the vital essence from your
190 Bacula Director is the program that supervises all the backup,
191 restore, verify and archive operations. The system administrator uses
192 the Bacula Director to schedule backups and to recover files. Catalog
193 services are comprised of the software programs responsible for
194 maintaining the file indexes and volume databases for all files backed
195 up. The Catalog services permit the System Administrator or user to
196 quickly locate and restore any desired file, since it maintains a
197 record of all Volumes used, all Jobs run, and all Files saved.
199 %description dir -l pl.UTF-8
200 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
202 Bacula Director to program nadzorujący wszystkie operacje wykonywania
203 kopii zapasowych, odzyskiwania, weryfikacji i archiwizowania.
204 Administrator używa Bacula Directora do szeregowania kopii zapasowych
205 oraz odzyskiwania plików. Usługi katalogowe (Catalog services) są
206 używane przez programy odpowiedzialne za zarządzanie indeksami plików
207 i bazą danych wolumenów dla wszystkich kopiowanych plików. Usługi
208 katalogowe umożliwiają administratorowi lub użytkownikowi szybko
209 zlokalizować i odtworzyć dowolny plik, ponieważ utrzymują rekord ze
210 wszystkimi używanymi wolumenami, uruchomionymi zadaniami i zapisanymi
214 Summary: Bacula Console
215 Summary(pl.UTF-8): Konsola Baculi
216 Group: Networking/Utilities
217 Requires(post): sed >= 4.0
218 Requires: %{name}-common = %{version}-%{release}
221 Bacula - It comes by night and sucks the vital essence from your
224 Bacula Console is the program that allows the administrator or user to
225 communicate with the Bacula Director. This is the text only console
228 %description console -l pl.UTF-8
229 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
231 Bacula Console to program umożliwiający administratorowi lub
232 użytkownikowi komunikowanie się z programem Bacula Director. To jest
233 interfejs czysto tekstowy.
236 Summary: Bacula wxWidgets Console
237 Summary(pl.UTF-8): Konsola Baculi oparta na wxWidgets
238 Group: Networking/Utilities
239 Requires(post): sed >= 4.0
240 Requires: %{name}-common = %{version}-%{release}
242 %description console-wx
243 Bacula - It comes by night and sucks the vital essence from your
246 Bacula Console is the program that allows the administrator or user to
247 communicate with the Bacula Director. This is the wxWidgets GUI
250 %description console-wx -l pl.UTF-8
251 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
253 Bacula Console to program umożliwiający administratorowi lub
254 użytkownikowi komunikowanie się z programem Bacula Director. To jest
255 interfejs graficzny oparty na wxWidgets.
258 Summary: Bacula Qt4 Console
259 Summary(pl.UTF-8): Konsola Baculi oparta na Qt4
260 Group: Networking/Utilities
261 Requires(post): sed >= 4.0
262 Requires: %{name}-common = %{version}-%{release}
264 %description console-qt4
265 Bacula - It comes by night and sucks the vital essence from your
268 Bacula Console is the program that allows the administrator or user to
269 communicate with the Bacula Director. This is the Qt4 GUI interface.
271 %description console-qt4 -l pl.UTF-8
272 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
274 Bacula Console to program umożliwiający administratorowi lub
275 użytkownikowi komunikowanie się z programem Bacula Director. To jest
276 interfejs graficzny oparty na Qt4.
278 %package tray-monitor
279 Summary: Bacula Tray Monitor
280 Group: Networking/Utilities
281 Requires(post): sed >= 4.0
282 Requires: %{name}-common = %{version}-%{release}
284 %description tray-monitor
285 Bacula - It comes by night and sucks the vital essence from your
288 The Monitor program is typically an icon in the system tray. However,
289 once the icon is expanded into a full window, the administrator or
290 user can obtain status information about the Director or the backup
291 status on the local workstation or any other Bacula daemon that is
295 Summary: Bacula File services (Client)
296 Summary(pl.UTF-8): Usługi Bacula File (klient)
297 Group: Networking/Utilities
298 Requires(post): sed >= 4.0
299 Requires: %{name}-common = %{version}-%{release}
302 Bacula - It comes by night and sucks the vital essence from your
305 Bacula File services (or Client program) is the software program that
306 is installed on the machine to be backed up. It is specific to the
307 operating system on which it runs and is responsible for providing the
308 file attributes and data when requested by the Director. The File
309 services are also responsible for the file system dependent part of
310 restoring the file attributes and data during a recovery operation.
311 This program runs as a daemon on the machine to be backed up, and in
312 some of the documentation, the File daemon is referred to as the
313 Client (for example in Bacula configuration file).
315 %description fd -l pl.UTF-8
316 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
318 Usługi Bacula File (inaczej program kliencki) to oprogramowanie, które
319 instaluje się na maszynach, z których mają być wykonywane kopie
320 zapasowe. Są one specyficzne dla systemu operacyjnego, pod którym
321 działa dana maszyna i odpowiadają za dostarczanie atrybutów i danych
322 plików na żądanie Directora. Usługi plikowe są także odpowiedzialne za
323 zależną od systemu plików część odzyskiwania atrybutów i danych plików
324 podczas operacji odzyskiwania danych. Program działa jako demon na
325 maszynie, która ma być backupowana i w części dokumentacji demon ten
326 (File) jest nazywany klientem (na przykład w pliku konfiguracyjnym
330 Summary: Bacula Storage services
331 Summary(pl.UTF-8): Usługi Bacula Storage
332 Group: Networking/Utilities
333 Requires(post): sed >= 4.0
334 Requires: %{name}-common = %{version}-%{release}
335 Conflicts: dvd+rw-tools <= 5.21.4.10.8-1
338 Bacula - It comes by night and sucks the vital essence from your
341 Bacula Storage services consist of the software programs that perform
342 the storage and recovery of the file attributes and data to the
343 physical backup media or volumes. In other words, the Storage daemon
344 is responsible for reading and writing your tapes (or other storage
345 media, e.g. files). The Storage services runs as a daemon on the
346 machine that has the backup device (usually a tape drive).
348 %description sd -l pl.UTF-8
349 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
351 Usługi Bacula Storage składają się z programów obsługujących
352 przechowywanie danych oraz odzyskiwanie atrybutów i danych na
353 fizycznych nośnikach lub wolumenach. Innymi słowy, demon Storage jest
354 odpowiedzialny za odczyt i zapis taśm (lub innych nośników do
355 przechowywania danych, np. plików). Usługi Storage działają jako demon
356 na maszynie, która zawiera urządzenie backupowe (zwykle napęd
359 %package db-postgresql
360 Summary: PostgreSQL database driver for Bacula
361 Summary(pl.UTF-8): Sterownik bazy PostgreSQL dla Baculi
362 Group: Networking/Utilities
363 Requires(post): /sbin/ldconfig
364 Requires: %{name}-common = %{version}-%{release}
365 Provides: bacula(db) = %{version}-%{release}
366 Obsoletes: bacula(db)
368 %description db-postgresql
369 PostgreSQL database driver for Bacula.
371 %description db-postgresql -l pl.UTF-8
372 Sterownik bazy PostgreSQL dla Baculi.
375 Summary: MySQL database driver for Bacula
376 Summary(pl.UTF-8): Sterownik bazy MySQL dla Baculi
377 Group: Networking/Utilities
378 Requires(post): /sbin/ldconfig
379 Requires: %{name}-common = %{version}-%{release}
380 Provides: bacula(db) = %{version}-%{release}
381 Obsoletes: bacula(db)
383 %description db-mysql
384 MySQL database driver for Bacula.
386 %description db-mysql -l pl.UTF-8
387 Sterownik bazy MySQL dla Baculi.
390 Summary: SQLite database driver for Bacula
391 Summary(pl.UTF-8): Sterownik bazy SQLite dla Baculi
392 Group: Networking/Utilities
393 Requires(post): /sbin/ldconfig
394 Requires: %{name}-common = %{version}-%{release}
395 Provides: bacula(db) = %{version}-%{release}
396 Obsoletes: bacula(db)
398 %description db-sqlite3
399 SQLite database driver for Bacula.
401 %description db-sqlite3 -l pl.UTF-8
402 Sterownik bazy SQLite dla Baculi.
405 Summary: libdbi database driver for Bacula
406 Summary(pl.UTF-8): Sterownik bazy libdbi dla Baculi
407 Group: Networking/Utilities
408 Requires(post): /sbin/ldconfig
409 Requires: %{name}-common = %{version}-%{release}
410 Provides: bacula(db) = %{version}-%{release}
411 Obsoletes: bacula(db)
414 libdbi database driver for Bacula.
416 %description db-dbi -l pl.UTF-8
417 Sterownik baz libdbi dla Baculi.
420 Summary: Bacula - The Network Backup Solution
421 Summary(pl.UTF-8): Bacula - rozwiązanie do wykonywania kopii zapasowych po sieci
422 Group: Networking/Utilities
423 Requires: %{name}-fd = %{version}-%{release}
428 Bacula - It comes by night and sucks the vital essence from your
431 Bacula is a set of computer programs that permit you (or the system
432 administrator) to manage backup, recovery, and verification of
433 computer data across a network of computers of different kinds. In
434 technical terms, it is a network client/server based backup program.
435 Bacula is relatively easy to use and efficient, while offering many
436 advanced storage management features that make it easy to find and
437 recover lost or damaged files.
439 This package installs scripts for disaster recovery and builds rescue
440 floppy disk for bare metal recovery.
442 %description rescue -l pl.UTF-8
443 Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
445 Bacula to zbiór programów umożliwiających administratorowi na
446 zarządzanie kopiami zapasowymi, odzyskiwaniem i weryfikacją danych w
447 sieci komputerów różnego rodzaju. W terminologii technicznej jest to
448 program do kopii zapasowych pracujący w architekturze klient-serwer.
449 Bacula jest stosunkowo łatwa w użyciu i wydajna, oferując przy tym
450 wiele zaawansowanych możliwości przy zarządzaniu nośnikami,
451 ułatwiających znalezienie i odzyskanie utraconych lub uszkodzonych
454 Ten pakiet zawiera skrypty do odtwarzania po awarii i tworzy dyskietkę
455 ratunkowe do odtwarzania systemu od zera.
457 %package -n nagios-plugin-check_bacula
458 Summary: Nagios plugin to check bacula
460 Requires: nagios-common
462 %description -n nagios-plugin-check_bacula
463 Nagios plugin to check bacula.
478 tar -xf %{SOURCE2} && ln -s bacula-rescue-* rescue
480 sed -i -e 's#bindir=.*#bindir=%{_bindir}#g' \
481 src/cats/create_* src/cats/delete_* src/cats/drop_* \
482 src/cats/grant_* src/cats/make_* src/cats/update_*
483 sed -i -e 's/@hostname@/--hostname--/' src/*/*.conf.in
486 for dbtype in mysql postgresql sqlite3; do
487 sed -i -e "s,@DB_TYPE@,$dbtype,g" src/cats/*_${dbtype}_*
493 %{__aclocal} -I bacula-macros -I gettext-macros
494 # $BUILD_DIR not seen by libtoolize, export it
495 BUILD_DIR=.. %{__libtoolize}
497 %{__autoconf} --prepend-include=$(pwd)/autoconf autoconf/configure.in > configure
499 CPPFLAGS="-I/usr/include/ncurses -I%{_includedir}/readline"
501 # we wan't the 'base' build built with the last database in the list,
502 # to make sure it is full-featured
503 for database in %{databases}; do
504 WXCONFIG=%{_bindir}/wx-gtk2-unicode-config \
505 QMAKE=%{_bindir}/qt4-qmake \
507 --with-scriptdir=%{_libexecdir}/%{name} \
508 %{?with_bat:--enable-bat} \
510 --enable-smartalloc \
511 %{?with_console_wx:--enable-bwx-console} \
512 --enable-tray-monitor \
513 %{?with_python:--with-python} \
515 --with-tcp-wrappers \
516 --with-working-dir=%{_var}/lib/%{name} \
517 --with-dump-email="root@localhost" \
518 --with-job-email="root@localhost" \
519 --with-smtp-host=localhost \
520 --with-pid-dir=/var/run \
521 --with-subsys-dir=/var/lock/subsys \
522 --enable-batch-insert \
524 %{?with_sqlite3_sync_off:--enable-extra-sqlite3-init="pragma synchronous=0;"} \
525 --with-dir-password="#FAKE-dir-password#" \
526 --with-fd-password="#FAKE-fd-password#" \
527 --with-sd-password="#FAKE-sd-password#" \
528 --with-mon-dir-password="#FAKE-mon-dir-password#" \
529 --with-mon-fd-password="#FAKE-mon-fd-password#" \
530 --with-mon-sd-password="#FAKE-mon-sd-password#" \
533 # build the database library
534 %{__make} -C src/cats clean
535 %{__make} -C src/cats
537 # install the database library in a temporary location
538 install -d libbacsql/$database%{_libdir}
539 %{__make} -C src/cats libtool-install DESTDIR=$PWD/libbacsql/$database
552 %{__make} -C examples/nagios/check_bacula
564 rm -rf $RPM_BUILD_ROOT
565 install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,logrotate.d,pam.d,sysconfig}
566 install -d $RPM_BUILD_ROOT%{_sysconfdir}/rescue
567 install -d $RPM_BUILD_ROOT{%{_pixmapsdir},%{_desktopdir},%{_mandir},%{_bindir},/var/log/bacula}
570 DESTDIR=$RPM_BUILD_ROOT
572 # install libraries for all the database backends
573 # ldconfig will add the soname symlinks when one of the packages is installed
574 for database in %{databases}; do
575 for libfile in libbacsql/$database%{_libdir}/lib*-*.so; do
576 orig_name=${libfile##*/}
577 file_prefix=${orig_name%%-*.so}
578 file_suffix=${orig_name#*-}
579 file_name=$file_prefix-$database-$file_suffix
580 install -p $libfile $RPM_BUILD_ROOT%{_libdir}/$file_name
581 touch $RPM_BUILD_ROOT%{_libdir}/$orig_name
585 # replace with empty file, replaced by ldconfig from each db-* package on intsall
586 rm -f $RPM_BUILD_ROOT%{_libdir}/libbacsql-%{version}.so
587 touch $RPM_BUILD_ROOT%{_libdir}/libbacsql-%{version}.so
589 install -p %{SOURCE10} $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-dir
590 install -p %{SOURCE11} $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-fd
591 install -p %{SOURCE12} $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-sd
592 cp -a %{SOURCE13} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}-dir
593 cp -a %{SOURCE14} $RPM_BUILD_ROOT/etc/sysconfig/bacula-dir
594 cp -a %{SOURCE15} $RPM_BUILD_ROOT/etc/sysconfig/bacula-fd
595 cp -a %{SOURCE16} $RPM_BUILD_ROOT/etc/sysconfig/bacula-sd
597 %if %{with console_wx}
598 # tray-monitor is for regular users
599 #mv $RPM_BUILD_ROOT%{_sbindir}/bacula-tray-monitor $RPM_BUILD_ROOT%{_bindir}
601 cp -a scripts/bacula.png $RPM_BUILD_ROOT%{_pixmapsdir}/bacula.png
602 #install src/tray-monitor/generic.xpm $RPM_BUILD_ROOT%{_pixmapsdir}/bacula-tray-monitor.xpm
603 sed -e 's/gnome-console/wx-console/g;s/Console/Wx Console/g' \
604 scripts/bacula.desktop.gnome2 > $RPM_BUILD_ROOT%{_desktopdir}/bacula-wx.desktop
605 #sed -e 's#%{_sbindir}#%{_bindir}#' \
606 # scripts/bacula-tray-monitor.desktop > $RPM_BUILD_ROOT%{_desktopdir}/bacula-tray-monitor.desktop
610 # TODO: libtool install
611 #libtool --silent --mode=install install src/qt-console/bat $RPM_BUILD_ROOT%{_bindir}
612 install src/qt-console/.libs/bat $RPM_BUILD_ROOT%{_bindir}
613 cp -a scripts/bat.desktop $RPM_BUILD_ROOT%{_desktopdir}
617 # install the rescue stuff, these are the rescue scripts
618 cp -a rescue/linux/floppy/backup.etc.list $RPM_BUILD_ROOT%{_sysconfdir}/rescue
619 cp -a rescue/linux/floppy/sfdisk.bz2 $RPM_BUILD_ROOT%{_sysconfdir}/rescue
620 install -p rescue/linux/floppy/*_* $RPM_BUILD_ROOT%{_sysconfdir}/rescue
621 install -p rescue/linux/floppy/getdiskinfo $RPM_BUILD_ROOT%{_sysconfdir}/rescue
624 touch $RPM_BUILD_ROOT/var/log/bacula/log
626 # install the updatedb scripts for older versions that last full release
627 # 2.0 -> 3.0 : 10_to_11
628 install -p updatedb/update_*_tables_10_to_11 $RPM_BUILD_ROOT%{_libexecdir}/%{name}
630 # place for site passwords
631 touch $RPM_BUILD_ROOT%{_sysconfdir}/{dir-password,fd-password,sd-password}
632 touch $RPM_BUILD_ROOT%{_sysconfdir}/{mon-dir-password,mon-fd-password,mon-sd-password}
634 mv $RPM_BUILD_ROOT%{_libdir}/bacula/mtx-changer.conf $RPM_BUILD_ROOT/etc/bacula/mtx-changer.conf
637 rm -f $RPM_BUILD_ROOT%{_libexecdir}/%{name}/{gconsole,startmysql,stopmysql,bacula,bconsole,fd}
638 %if %{without console_wx}
639 rm -f $RPM_BUILD_ROOT%{_desktopdir}/bacula-wx.desktop
641 touch $RPM_BUILD_ROOT%{_sysconfdir}/.pw.sed
643 rm $RPM_BUILD_ROOT%{_docdir}/bacula/ChangeLog
644 rm $RPM_BUILD_ROOT%{_docdir}/bacula/INSTALL
645 rm $RPM_BUILD_ROOT%{_docdir}/bacula/LICENSE
646 rm $RPM_BUILD_ROOT%{_docdir}/bacula/README
647 rm $RPM_BUILD_ROOT%{_docdir}/bacula/ReleaseNotes
648 rm $RPM_BUILD_ROOT%{_docdir}/bacula/VERIFYING
649 rm $RPM_BUILD_ROOT%{_docdir}/bacula/technotes
651 # startup scripts, those in /etc/rc.d/init.d are better
652 rm $RPM_BUILD_ROOT%{_sbindir}/bacula
653 rm $RPM_BUILD_ROOT%{_libexecdir}/%{name}/bacula-ctl-*
656 #rm $RPM_BUILD_ROOT%{_libexecdir}/%{name}/*_bdb_*
658 # rename to avoid possible conflicts
659 mv $RPM_BUILD_ROOT%{_sbindir}/{,bacula-}dbcheck
660 mv $RPM_BUILD_ROOT%{_mandir}/man8/{,bacula-}dbcheck.8.gz
662 # no -devel files packaged, so this is also useless
663 rm $RPM_BUILD_ROOT%{_libdir}/libbac{,cfg,find,py,sql}.{so,la}
665 # placeholders for the symlinks set in %%post db-*
666 for f in create_bacula_database drop_bacula_database drop_bacula_tables \
667 grant_bacula_privileges make_bacula_tables update_bacula_tables ; do
669 ln -sf /dev/null $RPM_BUILD_ROOT%{_libexecdir}/%{name}/$f
673 install -d $RPM_BUILD_ROOT%{nagiosplugindir}
674 %{__make} -C examples/nagios/check_bacula install \
675 sbindir=%{nagiosplugindir} \
676 DESTDIR=$RPM_BUILD_ROOT
680 rm -rf $RPM_BUILD_ROOT
683 %groupadd -P %{name}-common -g 136 -r -f bacula
684 %useradd -P %{name}-common -u 136 -r -d /var/lib/bacula -s /bin/false -c "Bacula User" -g bacula bacula
686 %define update_configs \
687 echo "Updating bacula passwords and names..." | %banner -a %{name} \
689 for f in *-password; do \
690 if [ ! -s $f ]; then \
691 openssl rand -base64 33 > $f \
694 for cf in *.conf *.conf.rpmnew; do \
695 [ -f $cf ] && sed -i -e"s:#FAKE-$f#:$p:" "$cf" || : \
698 for cf in *.conf *.conf.rpmnew; do \
699 [ -f $cf ] && sed -i -e"s:--hostname--:`hostname`:" "$cf" || : \
708 if [ "$1" = "0" ]; then
713 %triggerpostun dir -- %{name}-dir < 5.0
714 %banner bacula-dir -t3 <<EOF
715 You have upgraded from an older version of Bacula director.
717 You will probably need to call %{_libexecdir}/%{name}/update_bacula_tables
718 script to upgrade the database.
723 /sbin/chkconfig --add bacula-dir
724 %service bacula-dir restart "Bacula Director daemon"
727 if [ "$1" = "0" ]; then
728 %service bacula-dir stop
729 /sbin/chkconfig --del bacula-dir
734 /sbin/chkconfig --add bacula-fd
735 %service bacula-fd restart "Bacula File daemon"
738 if [ "$1" = "0" ]; then
739 %service bacula-fd stop
740 /sbin/chkconfig --del bacula-fd
745 /sbin/chkconfig --add bacula-sd
746 %service bacula-sd restart "Bacula Storage daemon"
749 if [ "$1" = "0" ]; then
750 %service bacula-sd stop
751 /sbin/chkconfig --del bacula-sd
755 if [ -e %{_sysconfdir}/console.conf -a ! -e %{_sysconfdir}/bconsole.conf ]; then
756 mv %{_sysconfdir}/console.conf %{_sysconfdir}/bconsole.conf
765 %triggerpostun common -- %{name}-common < 5.0.1-2
766 find /etc/bacula/bat.conf* -perm /007 -print0 | xargs -0 -r chmod 600 || :
775 # link our current installed conf file to the rescue directory
776 ln -sf %{_sysconfdir}/bacula-fd.conf %{_sysconfdir}/rescue/bacula-fd.conf
779 echo "Creating rescue files for this system..."
780 cd %{_sysconfdir}/rescue
784 # remove the files created after the initial rpm installation
785 if [ "$1" = "0" ]; then
786 rm -f %{_sysconfdir}/rescue/bacula-fd.conf
787 rm -f %{_sysconfdir}/rescue/partition.*
788 rm -f %{_sysconfdir}/rescue/format.*
789 rm -f %{_sysconfdir}/rescue/mount_drives
790 rm -f %{_sysconfdir}/rescue/start_network
791 rm -f %{_sysconfdir}/rescue/sfdisk
792 rm -rf %{_sysconfdir}/rescue/diskinfo/*
797 for name in "create database" "drop tables" "drop database" "grant privileges" "make tables" "update tables"; do \
798 prefix="${name%% *}" \
799 suffix="${name#* }" \
800 ln -sf "${prefix}_%{1}_${suffix}" %{_libexecdir}/%{name}/"${prefix}_bacula_${suffix}" || : \
802 %service bacula-dir restart "Bacula Director daemon"
804 %define db_postun() \
806 if [ "$1" = "0" ]; then \
807 for f in %{_libexecdir}/%{name}/*_bacula_*; do \
808 if [ -L "$f" -a ! -e "$f" ]; then \
817 %postun db-postgresql
818 %db_postun postgresql
832 # dbi backend is different, as it is not bound with a specific db engine
835 %service bacula-dir restart "Bacula Director daemon"
837 %postun db-dbi -p /sbin/ldconfig
840 %defattr(644,root,root,755)
843 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*-password
844 # do not remove bsmtp from files. Fix build if it is not installed.
845 %attr(755,root,root) %{_sbindir}/bsmtp
846 %attr(755,root,root) %{_sbindir}/btraceback
847 %attr(755,root,root) %{_libdir}/libbac-5*.so
848 %attr(755,root,root) %{_libdir}/libbaccfg-5*.so
849 %attr(755,root,root) %{_libdir}/libbacfind-5*.so
850 %attr(755,root,root) %{_libdir}/libbacpy-5*.so
851 %{_mandir}/man8/bacula.8*
852 %{_mandir}/man1/bsmtp.1*
853 %{_mandir}/man8/btraceback.8*
854 %dir %{_libexecdir}/%{name}
855 %{_libexecdir}/%{name}/btraceback.dbx
856 %{_libexecdir}/%{name}/btraceback.gdb
857 %{_libexecdir}/%{name}/bacula_config
858 %attr(770,root,bacula) %dir %{_localstatedir}
859 %attr(750,bacula,logs) %dir /var/log/bacula
860 %attr(640,bacula,logs) %ghost /var/log/bacula/log
863 %defattr(644,root,root,755)
864 %doc ChangeLog CheckList ReleaseNotes kernstodo LICENSE
865 #%doc examples %{name}-docs-%{version}/manual/{*.pdf,bacula}
866 %attr(640,root,bacula) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bacula-dir.conf
867 %ghost %{_sysconfdir}/.pw.sed
868 %attr(640,root,root) %config(noreplace) /etc/logrotate.d/bacula-dir
869 %attr(754,root,root) /etc/rc.d/init.d/bacula-dir
870 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/bacula-dir
871 %attr(755,root,root) %{_sbindir}/bacula-dir
872 %attr(755,root,root) %{_sbindir}/bregex
873 %attr(755,root,root) %{_sbindir}/bwild
874 %attr(755,root,root) %{_sbindir}/bacula-dbcheck
875 %{_mandir}/man8/bacula-dir.8*
876 %{_mandir}/man8/bacula-dbcheck.8*
877 %{_libexecdir}/%{name}/query.sql
878 #%attr(755,root,root) %{_libexecdir}/%{name}/make_catalog_backup
879 #%attr(755,root,root) %{_libexecdir}/%{name}/delete_catalog_backup
882 %defattr(644,root,root,755)
883 %attr(755,root,root) %{_libexecdir}/%{name}/create_postgresql_database
884 %attr(755,root,root) %{_libexecdir}/%{name}/drop_postgresql_database
885 %attr(755,root,root) %{_libexecdir}/%{name}/drop_postgresql_tables
886 %attr(755,root,root) %{_libexecdir}/%{name}/grant_postgresql_privileges
887 %attr(755,root,root) %{_libexecdir}/%{name}/make_postgresql_tables
888 %attr(755,root,root) %{_libexecdir}/%{name}/update_postgresql_*
889 %attr(755,root,root) %{_libdir}/libbacsql-postgresql-5*.so
891 %ghost %attr(755,root,root) %{_libdir}/libbacsql-5*.so
892 %ghost %{_libexecdir}/%{name}/create_bacula_database
893 %ghost %{_libexecdir}/%{name}/drop_bacula_tables
894 %ghost %{_libexecdir}/%{name}/drop_bacula_database
895 %ghost %{_libexecdir}/%{name}/grant_bacula_privileges
896 %ghost %{_libexecdir}/%{name}/make_bacula_tables
897 %ghost %{_libexecdir}/%{name}/update_bacula_tables
900 %defattr(644,root,root,755)
901 %attr(755,root,root) %{_libexecdir}/%{name}/create_mysql_database
902 %attr(755,root,root) %{_libexecdir}/%{name}/drop_mysql_database
903 %attr(755,root,root) %{_libexecdir}/%{name}/drop_mysql_tables
904 %attr(755,root,root) %{_libexecdir}/%{name}/grant_mysql_privileges
905 %attr(755,root,root) %{_libexecdir}/%{name}/make_mysql_tables
906 %attr(755,root,root) %{_libexecdir}/%{name}/update_mysql_*
907 %attr(755,root,root) %{_libdir}/libbacsql-mysql-5*.so
909 %ghost %attr(755,root,root) %{_libdir}/libbacsql-5*.so
910 %ghost %{_libexecdir}/%{name}/create_bacula_database
911 %ghost %{_libexecdir}/%{name}/drop_bacula_tables
912 %ghost %{_libexecdir}/%{name}/drop_bacula_database
913 %ghost %{_libexecdir}/%{name}/grant_bacula_privileges
914 %ghost %{_libexecdir}/%{name}/make_bacula_tables
915 %ghost %{_libexecdir}/%{name}/update_bacula_tables
918 %defattr(644,root,root,755)
919 %attr(755,root,root) %{_libexecdir}/%{name}/create_sqlite3_database
920 %attr(755,root,root) %{_libexecdir}/%{name}/drop_sqlite3_database
921 %attr(755,root,root) %{_libexecdir}/%{name}/drop_sqlite3_tables
922 %attr(755,root,root) %{_libexecdir}/%{name}/grant_sqlite3_privileges
923 %attr(755,root,root) %{_libexecdir}/%{name}/make_sqlite3_tables
924 %attr(755,root,root) %{_libexecdir}/%{name}/update_sqlite3_*
925 %attr(755,root,root) %{_libdir}/libbacsql-sqlite3-5*.so
927 %ghost %attr(755,root,root) %{_libdir}/libbacsql-5*.so
928 %ghost %{_libexecdir}/%{name}/create_bacula_database
929 %ghost %{_libexecdir}/%{name}/drop_bacula_tables
930 %ghost %{_libexecdir}/%{name}/drop_bacula_database
931 %ghost %{_libexecdir}/%{name}/grant_bacula_privileges
932 %ghost %{_libexecdir}/%{name}/make_bacula_tables
933 %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
960 %defattr(644,root,root,755)
962 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bacula-fd.conf
963 %attr(754,root,root) /etc/rc.d/init.d/bacula-fd
964 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/bacula-fd
965 %attr(755,root,root) %{_sbindir}/bacula-fd
966 %attr(755,root,root) %{_libdir}/bpipe-fd.so
967 %{_mandir}/man8/bacula-fd.8*
970 %defattr(644,root,root,755)
972 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bacula-sd.conf
973 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mtx-changer.conf
974 %attr(754,root,root) /etc/rc.d/init.d/bacula-sd
975 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/bacula-sd
976 %attr(755,root,root) %{_sbindir}/bacula-sd
977 %attr(755,root,root) %{_sbindir}/bcopy
978 %attr(755,root,root) %{_sbindir}/bextract
979 %attr(755,root,root) %{_sbindir}/bls
980 %attr(755,root,root) %{_sbindir}/bscan
981 %attr(755,root,root) %{_sbindir}/btape
982 %attr(755,root,root) %{_libexecdir}/%{name}/mtx-changer
983 %attr(755,root,root) %{_libexecdir}/%{name}/disk-changer
984 %attr(755,root,root) %{_libexecdir}/%{name}/dvd-handler
985 %{_mandir}/man8/bacula-sd.8*
986 %{_mandir}/man8/bcopy.8*
987 %{_mandir}/man8/bextract.8*
988 %{_mandir}/man8/bls.8*
989 %{_mandir}/man8/bscan.8*
990 %{_mandir}/man8/btape.8*
993 %defattr(644,root,root,755)
995 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bconsole.conf
996 %attr(755,root,root) %{_sbindir}/bconsole
997 %{_mandir}/man8/bconsole.8*
999 %if %{with console_wx}
1001 %defattr(644,root,root,755)
1003 %{_pixmapsdir}/%{name}.png
1004 %{_desktopdir}/bacula-wx.desktop
1005 %attr(640,root,bacula) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bwx-console.conf
1006 %attr(755,root,root) %{_sbindir}/bwx-console
1007 %{_mandir}/man1/bacula-bwxconsole.1*
1012 %defattr(644,root,root,755)
1014 %{_pixmapsdir}/%{name}.png
1015 %{_desktopdir}/bat.desktop
1016 # Do not make this file world-readable or any user will get full access to the
1018 %attr(640,root,bacula) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bat.conf
1019 %attr(755,root,root) %{_bindir}/bat
1020 %{_mandir}/man1/bat.1*
1024 %if %{with console_wx}
1026 %defattr(644,root,root,755)
1028 %attr(755,root,root) %{_sbindir}/bacula-tray-monitor
1029 #%{_pixmapsdir}/%{name}-tray-monitor.xpm
1030 #%{_desktopdir}/%{name}-tray-monitor.desktop
1031 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/tray-monitor.conf
1032 %{_mandir}/man1/bacula-tray-monitor.1*
1037 %defattr(644,root,root,755)
1039 %dir %{_sysconfdir}/rescue
1040 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/backup.etc.list
1041 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/bacula-fd
1042 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/format_floppy
1043 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/getdiskinfo
1044 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/make_rescue_disk
1045 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/restore_bacula
1046 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/restore_etc
1047 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/run_grub
1048 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/run_lilo
1049 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/sfdisk.bz2
1053 %files -n nagios-plugin-check_bacula
1054 %defattr(644,root,root,755)
1055 %attr(755,root,root) %{nagiosplugindir}/check_bacula