]> git.pld-linux.org Git - packages/bacula.git/blame_incremental - bacula.spec
- release 2
[packages/bacula.git] / bacula.spec
... / ...
CommitLineData
1# TODO:
2# - update desktop files, think about su-wrappers for console (with .desktop files)
3# - package web admin
4# - fix log file permissions
5# - no longer builds:
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#
10# Conditional build:
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
17%bcond_without python
18%bcond_with nagios # build nagios plugin
19%bcond_with rescue
20%bcond_with sqlite3_sync_off # makes SQLite3 backend much faster, but less reliable
21
22%if %{without sqlite3}
23%undefine with_sqlite3_sync_off
24%endif
25
26Summary: Bacula - The Network Backup Solution
27Summary(pl.UTF-8): Bacula - rozwiązanie do wykonywania kopii zapasowych po sieci
28Name: bacula
29Version: 5.0.2
30Release: 2
31License: extended GPL v2
32Group: Networking/Utilities
33Source0: http://downloads.sourceforge.net/bacula/%{name}-%{version}.tar.gz
34# Source0-md5: e9204d2e772f12662de28da3327853de
35Source1: http://downloads.sourceforge.net/bacula/%{name}-docs-%{version}.tar.bz2
36# Source1-md5: 7a6afbf592dde4fae0240d82ed3cb10d
37Source2: http://downloads.sourceforge.net/bacula/%{name}-rescue-5.0.0.tar.gz
38# Source2-md5: 349623581cfe0bcd798dd137abac959a
39Source10: %{name}-dir.init
40Source11: %{name}-fd.init
41Source12: %{name}-sd.init
42Source13: %{name}.logrotate
43Source14: %{name}-dir.sysconfig
44Source15: %{name}-fd.sysconfig
45Source16: %{name}-sd.sysconfig
46Patch0: %{name}-mtx-changer.patch
47Patch1: %{name}-link.patch
48Patch2: %{name}-tinfo-readline.patch
49Patch3: %{name}-branding.patch
50Patch4: %{name}-conf.patch
51Patch5: %{name}-desktop.patch
52Patch7: %{name}-dbi_fixes.patch
53Patch8: %{name}-dbi_dbcheck.patch
54Patch9: %{name}-openssl1.patch
55URL: http://www.bacula.org/
56BuildRequires: acl-devel
57BuildRequires: autoconf
58BuildRequires: automake
59BuildRequires: gettext-devel
60BuildRequires: gtk+2-devel
61BuildRequires: libcap-devel
62%{?with_dbi:BuildRequires: libdbi-devel >= 0.8.4}
63BuildRequires: libtool
64%if %{with rescue}
65BuildRequires: fakeroot
66%endif
67BuildRequires: libwrap-devel
68BuildRequires: ncurses-devel
69BuildRequires: openssl-devel
70BuildRequires: pkgconfig
71%if %{with python}
72BuildRequires: python-devel
73BuildRequires: python-modules
74%endif
75%if %{with bat}
76BuildRequires: QtCore-devel
77BuildRequires: QtGui-devel
78BuildRequires: qt4-build >= 4.3.3-3
79BuildRequires: qt4-qmake >= 4.3.3-3
80#BuildRequires: qwt-devel >= 5.0.2-2
81%endif
82%{?with_mysql:BuildRequires: mysql-devel}
83%{?with_pgsql:BuildRequires: postgresql-devel}
84BuildRequires: readline-devel
85BuildRequires: rpm-pythonprov
86BuildRequires: rpmbuild(macros) >= 1.268
87BuildRequires: sed >= 4.0
88%{?with_sqlite3:BuildRequires: sqlite3-devel}
89BuildRequires: which
90%if %{with console_wx}
91BuildRequires: wxGTK2-unicode-devel >= 2.4.0
92%endif
93BuildRequires: zlib-devel
94BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
95
96%define _sysconfdir /etc/%{name}
97%define _localstatedir /var/lib/%{name}
98%define nagiosplugindir %{_prefix}/lib/nagios/plugins
99
100# from 'the worst' to 'the best'
101%define databases %{?with_dbi:dbi} %{?with_sqlite3:sqlite3} %{?with_mysql:mysql} %{?with_pgsql:postgresql}
102
103# dependency section is broken. ccache usage is instead to makefiles
104%undefine with_ccache
105
106%description
107Bacula - It comes by night and sucks the vital essence from your
108computers.
109
110Bacula is a set of computer programs that permit you (or the system
111administrator) to manage backup, recovery, and verification of
112computer data across a network of computers of different kinds. In
113technical terms, it is a network client/server based backup program.
114Bacula is relatively easy to use and efficient, while offering many
115advanced storage management features that make it easy to find and
116recover lost or damaged files.
117
118%description -l pl.UTF-8
119Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
120
121Bacula to zbiór programów umożliwiających administratorowi na
122zarządzanie kopiami zapasowymi, odzyskiwaniem i weryfikacją danych w
123sieci komputerów różnego rodzaju. W terminologii technicznej jest to
124program do kopii zapasowych pracujący w architekturze klient-serwer.
125Bacula jest stosunkowo łatwa w użyciu i wydajna, oferując przy tym
126wiele zaawansowanych możliwości przy zarządzaniu nośnikami,
127ułatwiających znalezienie i odzyskanie utraconych lub uszkodzonych
128plików.
129
130%package common
131Summary: Common files for bacula package
132Summary(pl.UTF-8): Pliki wspólne dla pakietu bacula
133Group: Networking/Utilities
134Requires(post): openssl-tools
135Requires(post): sed >= 4.0
136Requires(post,preun): /sbin/chkconfig
137Requires(postun): /usr/sbin/groupdel
138Requires(postun): /usr/sbin/userdel
139Requires(pre): /usr/sbin/groupadd
140Requires(pre): /usr/sbin/useradd
141Conflicts: bacula-console < 0:1.34.6
142Conflicts: bacula-dir < 0:1.34.6
143Conflicts: bacula-fd < 0:1.34.6
144Conflicts: bacula-sd < 0:1.34.6
145
146%description common
147Bacula - It comes by night and sucks the vital essence from your
148computers.
149
150Bacula is a set of computer programs that permit you (or the system
151administrator) to manage backup, recovery, and verification of
152computer data across a network of computers of different kinds. In
153technical terms, it is a network client/server based backup program.
154Bacula is relatively easy to use and efficient, while offering many
155advanced storage management features that make it easy to find and
156recover lost or damaged files.
157
158%description common -l pl.UTF-8
159Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
160
161Bacula to zbiór programów umożliwiających administratorowi na
162zarządzanie kopiami zapasowymi, odzyskiwaniem i weryfikacją danych w
163sieci komputerów różnego rodzaju. W terminologii technicznej jest to
164program do kopii zapasowych pracujący w architekturze klient-serwer.
165Bacula jest stosunkowo łatwa w użyciu i wydajna, oferując przy tym
166wiele zaawansowanych możliwości przy zarządzaniu nośnikami,
167ułatwiających znalezienie i odzyskanie utraconych lub uszkodzonych
168plików.
169
170%package dir
171Summary: Bacula Director and Catalog services
172Summary(pl.UTF-8): Usługi Bacula Director i Catalog
173Group: Networking/Utilities
174Requires(post): sed >= 4.0
175Requires: %{name}-common = %{version}-%{release}
176Requires: bacula(db) = %{version}-%{release}
177Obsoletes: bacula-updatedb
178
179%description dir
180Bacula - It comes by night and sucks the vital essence from your
181computers.
182
183Bacula Director is the program that supervises all the backup,
184restore, verify and archive operations. The system administrator uses
185the Bacula Director to schedule backups and to recover files. Catalog
186services are comprised of the software programs responsible for
187maintaining the file indexes and volume databases for all files backed
188up. The Catalog services permit the System Administrator or user to
189quickly locate and restore any desired file, since it maintains a
190record of all Volumes used, all Jobs run, and all Files saved.
191
192%description dir -l pl.UTF-8
193Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
194
195Bacula Director to program nadzorujący wszystkie operacje wykonywania
196kopii zapasowych, odzyskiwania, weryfikacji i archiwizowania.
197Administrator używa Bacula Directora do szeregowania kopii zapasowych
198oraz odzyskiwania plików. Usługi katalogowe (Catalog services) są
199używane przez programy odpowiedzialne za zarządzanie indeksami plików
200i bazą danych wolumenów dla wszystkich kopiowanych plików. Usługi
201katalogowe umożliwiają administratorowi lub użytkownikowi szybko
202zlokalizować i odtworzyć dowolny plik, ponieważ utrzymują rekord ze
203wszystkimi używanymi wolumenami, uruchomionymi zadaniami i zapisanymi
204plikami.
205
206%package console
207Summary: Bacula Console
208Summary(pl.UTF-8): Konsola Baculi
209Group: Networking/Utilities
210Requires(post): sed >= 4.0
211Requires: %{name}-common = %{version}-%{release}
212
213%description console
214Bacula - It comes by night and sucks the vital essence from your
215computers.
216
217Bacula Console is the program that allows the administrator or user to
218communicate with the Bacula Director. This is the text only console
219interface.
220
221%description console -l pl.UTF-8
222Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
223
224Bacula Console to program umożliwiający administratorowi lub
225użytkownikowi komunikowanie się z programem Bacula Director. To jest
226interfejs czysto tekstowy.
227
228%package console-wx
229Summary: Bacula wxWidgets Console
230Summary(pl.UTF-8): Konsola Baculi oparta na wxWidgets
231Group: Networking/Utilities
232Requires(post): sed >= 4.0
233Requires: %{name}-common = %{version}-%{release}
234
235%description console-wx
236Bacula - It comes by night and sucks the vital essence from your
237computers.
238
239Bacula Console is the program that allows the administrator or user to
240communicate with the Bacula Director. This is the wxWidgets GUI
241interface.
242
243%description console-wx -l pl.UTF-8
244Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
245
246Bacula Console to program umożliwiający administratorowi lub
247użytkownikowi komunikowanie się z programem Bacula Director. To jest
248interfejs graficzny oparty na wxWidgets.
249
250%package console-qt4
251Summary: Bacula Qt4 Console
252Summary(pl.UTF-8): Konsola Baculi oparta na Qt4
253Group: Networking/Utilities
254Requires(post): sed >= 4.0
255Requires: %{name}-common = %{version}-%{release}
256
257%description console-qt4
258Bacula - It comes by night and sucks the vital essence from your
259computers.
260
261Bacula Console is the program that allows the administrator or user to
262communicate with the Bacula Director. This is the Qt4 GUI interface.
263
264%description console-qt4 -l pl.UTF-8
265Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
266
267Bacula Console to program umożliwiający administratorowi lub
268użytkownikowi komunikowanie się z programem Bacula Director. To jest
269interfejs graficzny oparty na Qt4.
270
271%package tray-monitor
272Summary: Bacula Tray Monitor
273Group: Networking/Utilities
274Requires(post): sed >= 4.0
275Requires: %{name}-common = %{version}-%{release}
276
277%description tray-monitor
278Bacula - It comes by night and sucks the vital essence from your
279computers.
280
281The Monitor program is typically an icon in the system tray. However,
282once the icon is expanded into a full window, the administrator or
283user can obtain status information about the Director or the backup
284status on the local workstation or any other Bacula daemon that is
285configured.
286
287%package fd
288Summary: Bacula File services (Client)
289Summary(pl.UTF-8): Usługi Bacula File (klient)
290Group: Networking/Utilities
291Requires(post): sed >= 4.0
292Requires: %{name}-common = %{version}-%{release}
293
294%description fd
295Bacula - It comes by night and sucks the vital essence from your
296computers.
297
298Bacula File services (or Client program) is the software program that
299is installed on the machine to be backed up. It is specific to the
300operating system on which it runs and is responsible for providing the
301file attributes and data when requested by the Director. The File
302services are also responsible for the file system dependent part of
303restoring the file attributes and data during a recovery operation.
304This program runs as a daemon on the machine to be backed up, and in
305some of the documentation, the File daemon is referred to as the
306Client (for example in Bacula configuration file).
307
308%description fd -l pl.UTF-8
309Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
310
311Usługi Bacula File (inaczej program kliencki) to oprogramowanie, które
312instaluje się na maszynach, z których mają być wykonywane kopie
313zapasowe. Są one specyficzne dla systemu operacyjnego, pod którym
314działa dana maszyna i odpowiadają za dostarczanie atrybutów i danych
315plików na żądanie Directora. Usługi plikowe są także odpowiedzialne za
316zależną od systemu plików część odzyskiwania atrybutów i danych plików
317podczas operacji odzyskiwania danych. Program działa jako demon na
318maszynie, która ma być backupowana i w części dokumentacji demon ten
319(File) jest nazywany klientem (na przykład w pliku konfiguracyjnym
320Baculi).
321
322%package sd
323Summary: Bacula Storage services
324Summary(pl.UTF-8): Usługi Bacula Storage
325Group: Networking/Utilities
326Requires(post): sed >= 4.0
327Requires: %{name}-common = %{version}-%{release}
328Conflicts: dvd+rw-tools <= 5.21.4.10.8-1
329
330%description sd
331Bacula - It comes by night and sucks the vital essence from your
332computers.
333
334Bacula Storage services consist of the software programs that perform
335the storage and recovery of the file attributes and data to the
336physical backup media or volumes. In other words, the Storage daemon
337is responsible for reading and writing your tapes (or other storage
338media, e.g. files). The Storage services runs as a daemon on the
339machine that has the backup device (usually a tape drive).
340
341%description sd -l pl.UTF-8
342Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
343
344Usługi Bacula Storage składają się z programów obsługujących
345przechowywanie danych oraz odzyskiwanie atrybutów i danych na
346fizycznych nośnikach lub wolumenach. Innymi słowy, demon Storage jest
347odpowiedzialny za odczyt i zapis taśm (lub innych nośników do
348przechowywania danych, np. plików). Usługi Storage działają jako demon
349na maszynie, która zawiera urządzenie backupowe (zwykle napęd
350taśmowy).
351
352%package db-postgresql
353Summary: PostgreSQL database driver for Bacula
354Summary(pl.UTF-8): Sterownik bazy PostgreSQL dla Baculi
355Group: Networking/Utilities
356Requires(post): /sbin/ldconfig
357Requires: %{name}-common = %{version}-%{release}
358Provides: bacula(db) = %{version}-%{release}
359Obsoletes: bacula(db)
360
361%description db-postgresql
362PostgreSQL database driver for Bacula.
363
364%description db-postgresql -l pl.UTF-8
365Sterownik bazy PostgreSQL dla Baculi.
366
367%package db-mysql
368Summary: MySQL database driver for Bacula
369Summary(pl.UTF-8): Sterownik bazy MySQL dla Baculi
370Group: Networking/Utilities
371Requires(post): /sbin/ldconfig
372Requires: %{name}-common = %{version}-%{release}
373Provides: bacula(db) = %{version}-%{release}
374Obsoletes: bacula(db)
375
376%description db-mysql
377MySQL database driver for Bacula.
378
379%description db-mysql -l pl.UTF-8
380Sterownik bazy MySQL dla Baculi.
381
382%package db-sqlite3
383Summary: SQLite database driver for Bacula
384Summary(pl.UTF-8): Sterownik bazy SQLite dla Baculi
385Group: Networking/Utilities
386Requires(post): /sbin/ldconfig
387Requires: %{name}-common = %{version}-%{release}
388Provides: bacula(db) = %{version}-%{release}
389Obsoletes: bacula(db)
390
391%description db-sqlite3
392SQLite database driver for Bacula.
393
394%description db-sqlite3 -l pl.UTF-8
395Sterownik bazy SQLite dla Baculi.
396
397%package db-dbi
398Summary: libdbi database driver for Bacula
399Summary(pl.UTF-8): Sterownik bazy libdbi dla Baculi
400Group: Networking/Utilities
401Requires(post): /sbin/ldconfig
402Requires: %{name}-common = %{version}-%{release}
403Provides: bacula(db) = %{version}-%{release}
404Obsoletes: bacula(db)
405
406%description db-dbi
407libdbi database driver for Bacula.
408
409%description db-dbi -l pl.UTF-8
410Sterownik baz libdbi dla Baculi.
411
412%package rescue
413Summary: Bacula - The Network Backup Solution
414Summary(pl.UTF-8): Bacula - rozwiązanie do wykonywania kopii zapasowych po sieci
415Group: Networking/Utilities
416Requires: %{name}-fd = %{version}-%{release}
417Requires: coreutils
418Requires: util-linux
419
420%description rescue
421Bacula - It comes by night and sucks the vital essence from your
422computers.
423
424Bacula is a set of computer programs that permit you (or the system
425administrator) to manage backup, recovery, and verification of
426computer data across a network of computers of different kinds. In
427technical terms, it is a network client/server based backup program.
428Bacula is relatively easy to use and efficient, while offering many
429advanced storage management features that make it easy to find and
430recover lost or damaged files.
431
432This package installs scripts for disaster recovery and builds rescue
433floppy disk for bare metal recovery.
434
435%description rescue -l pl.UTF-8
436Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
437
438Bacula to zbiór programów umożliwiających administratorowi na
439zarządzanie kopiami zapasowymi, odzyskiwaniem i weryfikacją danych w
440sieci komputerów różnego rodzaju. W terminologii technicznej jest to
441program do kopii zapasowych pracujący w architekturze klient-serwer.
442Bacula jest stosunkowo łatwa w użyciu i wydajna, oferując przy tym
443wiele zaawansowanych możliwości przy zarządzaniu nośnikami,
444ułatwiających znalezienie i odzyskanie utraconych lub uszkodzonych
445plików.
446
447Ten pakiet zawiera skrypty do odtwarzania po awarii i tworzy dyskietkę
448ratunkowe do odtwarzania systemu od zera.
449
450%package -n nagios-plugin-check_bacula
451Summary: Nagios plugin to check bacula
452Group: Networking
453Requires: nagios-common
454
455%description -n nagios-plugin-check_bacula
456Nagios plugin to check bacula.
457
458%prep
459%setup -q -a 1
460%patch0 -p1
461%patch1 -p1
462%patch2 -p1
463%patch3 -p1
464%patch4 -p1
465%patch5 -p1
466%patch7 -p1
467%patch8 -p1
468%patch9 -p1
469
470tar -xf %{SOURCE2} && ln -s bacula-rescue-* rescue
471
472sed -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_*
475sed -i -e 's/@hostname@/--hostname--/' src/*/*.conf.in
476
477%if %{with dbi}
478for dbtype in mysql postgresql sqlite3; do
479 sed -i -e "s,@DB_TYPE@,$dbtype,g" src/cats/*_${dbtype}_*
480done
481%endif
482
483%build
484cd autoconf
485%{__aclocal} -I bacula-macros -I gettext-macros
486# $BUILD_DIR not seen by libtoolize, export it
487BUILD_DIR=.. %{__libtoolize}
488cd ..
489%{__autoconf} --prepend-include=$(pwd)/autoconf autoconf/configure.in > configure
490
491CPPFLAGS="-I/usr/include/ncurses -I%{_includedir}/readline"
492
493# we wan't the 'base' build built with the last database in the list,
494# to make sure it is full-featured
495for database in %{databases}; do
496 WXCONFIG=%{_bindir}/wx-gtk2-unicode-config \
497 QMAKE=%{_bindir}/qt4-qmake \
498 %configure \
499 --with-scriptdir=%{_libexecdir}/%{name} \
500 %{?with_bat:--enable-bat} \
501 --disable-conio \
502 --enable-smartalloc \
503 %{?with_console_wx:--enable-bwx-console} \
504 --enable-tray-monitor \
505 %{?with_python:--with-python} \
506 --with-readline \
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 \
515 --with-$database \
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#" \
523 --with-openssl
524
525 # build the database library
526 %{__make} -C src/cats clean
527 %{__make} -C src/cats
528
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
532done
533
534%if %{with bat}
535cd src/qt-console
536qmake-qt4 bat.pro
537cd ../..
538%endif
539
540%{__make}
541
542%if %{with nagios}
543# nagios plugin
544%{__make} -C examples/nagios/check_bacula
545%endif
546
547%if %{with rescue}
548cd rescue
549%configure \
550 --with-bacula=../
551cd linux/cdrom
552fakeroot %{__make}
553%endif
554
555%install
556rm -rf $RPM_BUILD_ROOT
557
558install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,logrotate.d,pam.d,sysconfig}
559install -d $RPM_BUILD_ROOT%{_sysconfdir}/rescue
560install -d $RPM_BUILD_ROOT{%{_pixmapsdir},%{_desktopdir},%{_mandir},%{_bindir},/var/log/bacula}
561
562%{__make} install \
563 DESTDIR=$RPM_BUILD_ROOT
564
565# install libraries for all the database backends
566# ldconfig will add the soname symlinks when one of the packages is installed
567for 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
575 done
576done
577
578install -p %{SOURCE10} $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-dir
579install -p %{SOURCE11} $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-fd
580install -p %{SOURCE12} $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-sd
581cp -a %{SOURCE13} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}-dir
582cp -a %{SOURCE14} $RPM_BUILD_ROOT/etc/sysconfig/bacula-dir
583cp -a %{SOURCE15} $RPM_BUILD_ROOT/etc/sysconfig/bacula-fd
584cp -a %{SOURCE16} $RPM_BUILD_ROOT/etc/sysconfig/bacula-sd
585
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}
589
590cp -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
592sed -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
596%endif
597
598%if %{with bat}
599# TODO: libtool install
600#libtool --silent --mode=install install src/qt-console/bat $RPM_BUILD_ROOT%{_bindir}
601install src/qt-console/.libs/bat $RPM_BUILD_ROOT%{_bindir}
602cp -a scripts/bat.desktop $RPM_BUILD_ROOT%{_desktopdir}
603%endif
604
605%if %{with rescue}
606# install the rescue stuff, these are the rescue scripts
607cp -a rescue/linux/floppy/backup.etc.list $RPM_BUILD_ROOT%{_sysconfdir}/rescue
608cp -a rescue/linux/floppy/sfdisk.bz2 $RPM_BUILD_ROOT%{_sysconfdir}/rescue
609install -p rescue/linux/floppy/*_* $RPM_BUILD_ROOT%{_sysconfdir}/rescue
610install -p rescue/linux/floppy/getdiskinfo $RPM_BUILD_ROOT%{_sysconfdir}/rescue
611%endif
612
613touch $RPM_BUILD_ROOT/var/log/bacula/log
614
615# install the updatedb scripts
616install -p updatedb/update_sqlite* $RPM_BUILD_ROOT%{_libexecdir}/%{name}
617
618# place for site passwords
619touch $RPM_BUILD_ROOT%{_sysconfdir}/{dir-password,fd-password,sd-password}
620touch $RPM_BUILD_ROOT%{_sysconfdir}/{mon-dir-password,mon-fd-password,mon-sd-password}
621
622mv $RPM_BUILD_ROOT%{_libdir}/bacula/mtx-changer.conf $RPM_BUILD_ROOT/etc/bacula/mtx-changer.conf
623
624# some file changes
625rm -f $RPM_BUILD_ROOT%{_libexecdir}/%{name}/{gconsole,startmysql,stopmysql,bacula,bconsole,fd}
626%if %{without console_wx}
627rm -f $RPM_BUILD_ROOT%{_desktopdir}/bacula-wx.desktop
628%endif
629touch $RPM_BUILD_ROOT%{_sysconfdir}/.pw.sed
630
631rm $RPM_BUILD_ROOT%{_docdir}/bacula/ChangeLog
632rm $RPM_BUILD_ROOT%{_docdir}/bacula/INSTALL
633rm $RPM_BUILD_ROOT%{_docdir}/bacula/LICENSE
634rm $RPM_BUILD_ROOT%{_docdir}/bacula/README
635rm $RPM_BUILD_ROOT%{_docdir}/bacula/ReleaseNotes
636rm $RPM_BUILD_ROOT%{_docdir}/bacula/VERIFYING
637rm $RPM_BUILD_ROOT%{_docdir}/bacula/technotes
638
639# startup scripts, those in /etc/rc.d/init.d are better
640rm $RPM_BUILD_ROOT%{_sbindir}/bacula
641rm $RPM_BUILD_ROOT%{_libexecdir}/%{name}/bacula-ctl-*
642
643# unsupported
644rm $RPM_BUILD_ROOT%{_libexecdir}/%{name}/*_bdb_*
645
646# rename to avoid possible conflicts
647mv $RPM_BUILD_ROOT%{_sbindir}/{,bacula-}dbcheck
648mv $RPM_BUILD_ROOT%{_mandir}/man8/{,bacula-}dbcheck.8.gz
649
650# no -devel files packaged, so this is also useless
651rm $RPM_BUILD_ROOT%{_libdir}/libbac{,cfg,find,py,sql}.{so,la}
652
653# placeholders for the symlinks set in %%post db-*
654for f in create_bacula_database drop_bacula_database drop_bacula_tables \
655 grant_bacula_privileges make_bacula_tables update_bacula_tables ; do
656
657 ln -sf /dev/null $RPM_BUILD_ROOT%{_libexecdir}/%{name}/$f
658done
659
660%if %{with nagios}
661%{__make} -C examples/nagios/check_bacula install \
662 sbindir=%{nagiosplugindir} \
663 DESTDIR=$RPM_BUILD_ROOT
664%endif
665
666%clean
667rm -rf $RPM_BUILD_ROOT
668
669%pre common
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
672
673
674%define update_configs \
675echo "Updating bacula passwords and names..." | %banner \
676cd /etc/bacula \
677for f in *-password ; do \
678 if [ ! -s $f ] ; then \
679 openssl rand -base64 33 > $f \
680 fi \
681 p=`cat $f` \
682 for cf in *.conf *.conf.rpmnew ; do \
683 [ -f $cf ] && sed -i -e"s:#FAKE-$f#:$p:" "$cf" || : \
684 done \
685done \
686for cf in *.conf *.conf.rpmnew ; do \
687 [ -f $cf ] && sed -i -e"s:--hostname--:`hostname`:" "$cf" || : \
688done
689
690%post common
691/sbin/ldconfig
692%update_configs
693
694%postun common
695/sbin/ldconfig
696if [ "$1" = "0" ]; then
697 %userremove bacula
698 %groupremove bacula
699fi
700
701%triggerpostun dir -- %{name}-dir < 5.0
702%banner bacula-dir -t3 <<EOF
703You have upgraded from an older version of Bacula director.
704
705You will probably need to call %{_libexecdir}/%{name}/update_bacula_tables
706script to upgrade the database.
707EOF
708
709%post dir
710%update_configs
711/sbin/chkconfig --add bacula-dir
712%service bacula-dir restart "Bacula Director daemon"
713
714%preun dir
715if [ "$1" = "0" ]; then
716 %service bacula-dir stop
717 /sbin/chkconfig --del bacula-dir
718fi
719
720%post fd
721%update_configs
722/sbin/chkconfig --add bacula-fd
723%service bacula-fd restart "Bacula File daemon"
724
725%preun fd
726if [ "$1" = "0" ]; then
727 %service bacula-fd stop
728 /sbin/chkconfig --del bacula-fd
729fi
730
731%post sd
732%update_configs
733/sbin/chkconfig --add bacula-sd
734%service bacula-sd restart "Bacula Storage daemon"
735
736%preun sd
737if [ "$1" = "0" ]; then
738 %service bacula-sd stop
739 /sbin/chkconfig --del bacula-sd
740fi
741
742%pre console
743if [ -e %{_sysconfdir}/console.conf -a ! -e %{_sysconfdir}/bconsole.conf ]; then
744 mv %{_sysconfdir}/console.conf %{_sysconfdir}/bconsole.conf
745fi
746
747%post console
748%update_configs
749
750%post console-wx
751%update_configs
752
753%triggerpostun common -- %{name}-common < 5.0.1-2
754find /etc/bacula/bat.conf* -perm /007 -print0 | xargs -0 -r chmod 600 || :
755
756%post console-qt4
757%update_configs
758
759%post tray-monitor
760%update_configs
761
762%post rescue
763# link our current installed conf file to the rescue directory
764ln -sf %{_sysconfdir}/bacula-fd.conf %{_sysconfdir}/rescue/bacula-fd.conf
765
766# run getdiskinfo
767echo "Creating rescue files for this system..."
768cd %{_sysconfdir}/rescue
769./getdiskinfo
770
771%preun rescue
772# remove the files created after the initial rpm installation
773if [ "$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/*
781fi
782
783%define db_post() \
784/sbin/ldconfig \
785for 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}" || : \
789done \
790%service bacula-dir restart "Bacula Director daemon"
791
792%define db_postun() \
793/sbin/ldconfig \
794if [ "$1" = "0" ]; then \
795 for f in %{_libexecdir}/%{name}/*_bacula_*; do \
796 if [ -L "$f" -a ! -e "$f" ]; then \
797 rm "$f" \
798 fi \
799 done \
800fi
801
802%post db-postgresql
803%db_post postgresql
804
805%postun db-postgresql
806%db_postun postgresql
807
808%post db-mysql
809%db_post mysql
810
811%postun db-mysql
812%db_postun mysql
813
814%post db-sqlite3
815%db_post sqlite3
816
817%postun db-sqlite3
818%db_postun sqlite3
819
820# dbi backend is different, as it is not bound with a specific db engine
821%post db-dbi
822/sbin/ldconfig
823%service bacula-dir restart "Bacula Director daemon"
824
825%postun db-dbi -p /sbin/ldconfig
826
827%files common
828%defattr(644,root,root,755)
829%doc LICENSE
830%dir %{_sysconfdir}
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
849
850%files dir
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
868
869%files db-postgresql
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
878
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
886
887%files db-mysql
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
896
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
904
905%files db-sqlite3
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
915
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
923
924%files db-dbi
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
946
947%ghost %attr(755,root,root) %{_libdir}/libbacsql-5*.so
948
949%files fd
950%defattr(644,root,root,755)
951%doc LICENSE
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*
958
959%files sd
960%defattr(644,root,root,755)
961%doc LICENSE
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*
981
982%files console
983%defattr(644,root,root,755)
984%doc LICENSE
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*
988
989%if %{with console_wx}
990%files console-wx
991%defattr(644,root,root,755)
992%doc LICENSE
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*
998%endif
999
1000%if %{with bat}
1001%files console-qt4
1002%defattr(644,root,root,755)
1003%doc LICENSE
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
1007# backup system
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*
1011%{_docdir}/%{name}
1012%endif
1013
1014%if %{with console_wx}
1015%files tray-monitor
1016%defattr(644,root,root,755)
1017%doc LICENSE
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*
1023%endif
1024
1025%if %{with rescue}
1026%files rescue
1027%defattr(644,root,root,755)
1028%doc LICENSE
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
1040%endif
1041
1042%if %{with nagios}
1043%files -n nagios-plugin-check_bacula
1044%defattr(644,root,root,755)
1045%attr(755,root,root) %{nagiosplugindir}/check_bacula
1046%endif
This page took 0.072873 seconds and 4 git commands to generate.