]> git.pld-linux.org Git - packages/bacula.git/blame_incremental - bacula.spec
- fix bat install on ac
[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_without 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.3
30Release: 6
31License: extended GPL v2
32Group: Networking/Utilities
33Source0: http://downloads.sourceforge.net/bacula/%{name}-%{version}.tar.gz
34# Source0-md5: 9de254ae39cab0587fdb2f5d8d90b03b
35Source1: http://downloads.sourceforge.net/bacula/%{name}-docs-%{version}.tar.bz2
36# Source1-md5: 7a00557dcf0dfa40de9e74176fefd1ae
37Source2: http://downloads.sourceforge.net/bacula/%{name}-rescue-5.0.1.tar.gz
38# Source2-md5: bb194aed8e204f54bf2f61d7e721f257
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
55Patch10: %{name}-dvd_rewind.patch
56URL: http://www.bacula.org/
57BuildRequires: acl-devel
58BuildRequires: autoconf
59BuildRequires: automake
60BuildRequires: gettext-devel
61BuildRequires: gtk+2-devel
62BuildRequires: libcap-devel
63%{?with_dbi:BuildRequires: libdbi-devel >= 0.8.4}
64BuildRequires: libtool >= 2:2.2
65%if %{with rescue}
66BuildRequires: fakeroot
67%endif
68BuildRequires: libwrap-devel
69BuildRequires: ncurses-devel
70BuildRequires: openssl-devel
71BuildRequires: pkgconfig
72%if %{with python}
73BuildRequires: python-devel
74BuildRequires: python-modules
75%endif
76%if %{with bat}
77BuildRequires: QtCore-devel
78BuildRequires: QtGui-devel
79BuildRequires: qt4-build >= 4.3.3-3
80BuildRequires: qt4-qmake >= 4.3.3-3
81#BuildRequires: qwt-devel >= 5.0.2-2
82%endif
83%{?with_mysql:BuildRequires: mysql-devel}
84%{?with_pgsql:BuildRequires: postgresql-devel}
85BuildRequires: readline-devel
86BuildRequires: rpm-pythonprov
87BuildRequires: rpmbuild(macros) >= 1.268
88BuildRequires: sed >= 4.0
89%{?with_sqlite3:BuildRequires: sqlite3-devel}
90BuildRequires: which
91%if %{with console_wx}
92BuildRequires: wxGTK2-unicode-devel >= 2.4.0
93%endif
94BuildRequires: zlib-devel
95BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
96
97%define _sysconfdir /etc/%{name}
98%define _localstatedir /var/lib/%{name}
99%define nagiosplugindir %{_libdir}/nagios/plugins
100
101# from 'the worst' to 'the best'
102%define databases %{?with_dbi:dbi} %{?with_sqlite3:sqlite3} %{?with_mysql:mysql} %{?with_pgsql:postgresql}
103
104# dependency section is broken. ccache usage is instead to makefiles
105%undefine with_ccache
106
107%description
108Bacula - It comes by night and sucks the vital essence from your
109computers.
110
111Bacula is a set of computer programs that permit you (or the system
112administrator) to manage backup, recovery, and verification of
113computer data across a network of computers of different kinds. In
114technical terms, it is a network client/server based backup program.
115Bacula is relatively easy to use and efficient, while offering many
116advanced storage management features that make it easy to find and
117recover lost or damaged files.
118
119%description -l pl.UTF-8
120Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
121
122Bacula to zbiór programów umożliwiających administratorowi na
123zarządzanie kopiami zapasowymi, odzyskiwaniem i weryfikacją danych w
124sieci komputerów różnego rodzaju. W terminologii technicznej jest to
125program do kopii zapasowych pracujący w architekturze klient-serwer.
126Bacula jest stosunkowo łatwa w użyciu i wydajna, oferując przy tym
127wiele zaawansowanych możliwości przy zarządzaniu nośnikami,
128ułatwiających znalezienie i odzyskanie utraconych lub uszkodzonych
129plików.
130
131%package common
132Summary: Common files for bacula package
133Summary(pl.UTF-8): Pliki wspólne dla pakietu bacula
134Group: Networking/Utilities
135Requires(post): openssl-tools
136Requires(post): sed >= 4.0
137Requires(post,preun): /sbin/chkconfig
138Requires(postun): /usr/sbin/groupdel
139Requires(postun): /usr/sbin/userdel
140Requires(pre): /usr/sbin/groupadd
141Requires(pre): /usr/sbin/useradd
142Conflicts: bacula-console < 0:1.34.6
143Conflicts: bacula-dir < 0:1.34.6
144Conflicts: bacula-fd < 0:1.34.6
145Conflicts: bacula-sd < 0:1.34.6
146
147%description common
148Bacula - It comes by night and sucks the vital essence from your
149computers.
150
151Bacula is a set of computer programs that permit you (or the system
152administrator) to manage backup, recovery, and verification of
153computer data across a network of computers of different kinds. In
154technical terms, it is a network client/server based backup program.
155Bacula is relatively easy to use and efficient, while offering many
156advanced storage management features that make it easy to find and
157recover lost or damaged files.
158
159%description common -l pl.UTF-8
160Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
161
162Bacula to zbiór programów umożliwiających administratorowi na
163zarządzanie kopiami zapasowymi, odzyskiwaniem i weryfikacją danych w
164sieci komputerów różnego rodzaju. W terminologii technicznej jest to
165program do kopii zapasowych pracujący w architekturze klient-serwer.
166Bacula jest stosunkowo łatwa w użyciu i wydajna, oferując przy tym
167wiele zaawansowanych możliwości przy zarządzaniu nośnikami,
168ułatwiających znalezienie i odzyskanie utraconych lub uszkodzonych
169plików.
170
171%package dir
172Summary: Bacula Director and Catalog services
173Summary(pl.UTF-8): Usługi Bacula Director i Catalog
174Group: Networking/Utilities
175Requires(post): sed >= 4.0
176Requires: %{name}-common = %{version}-%{release}
177Requires: bacula(db) = %{version}-%{release}
178Obsoletes: bacula-updatedb
179
180%description dir
181Bacula - It comes by night and sucks the vital essence from your
182computers.
183
184Bacula Director is the program that supervises all the backup,
185restore, verify and archive operations. The system administrator uses
186the Bacula Director to schedule backups and to recover files. Catalog
187services are comprised of the software programs responsible for
188maintaining the file indexes and volume databases for all files backed
189up. The Catalog services permit the System Administrator or user to
190quickly locate and restore any desired file, since it maintains a
191record of all Volumes used, all Jobs run, and all Files saved.
192
193%description dir -l pl.UTF-8
194Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
195
196Bacula Director to program nadzorujący wszystkie operacje wykonywania
197kopii zapasowych, odzyskiwania, weryfikacji i archiwizowania.
198Administrator używa Bacula Directora do szeregowania kopii zapasowych
199oraz odzyskiwania plików. Usługi katalogowe (Catalog services) są
200używane przez programy odpowiedzialne za zarządzanie indeksami plików
201i bazą danych wolumenów dla wszystkich kopiowanych plików. Usługi
202katalogowe umożliwiają administratorowi lub użytkownikowi szybko
203zlokalizować i odtworzyć dowolny plik, ponieważ utrzymują rekord ze
204wszystkimi używanymi wolumenami, uruchomionymi zadaniami i zapisanymi
205plikami.
206
207%package console
208Summary: Bacula Console
209Summary(pl.UTF-8): Konsola Baculi
210Group: Networking/Utilities
211Requires(post): sed >= 4.0
212Requires: %{name}-common = %{version}-%{release}
213
214%description console
215Bacula - It comes by night and sucks the vital essence from your
216computers.
217
218Bacula Console is the program that allows the administrator or user to
219communicate with the Bacula Director. This is the text only console
220interface.
221
222%description console -l pl.UTF-8
223Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
224
225Bacula Console to program umożliwiający administratorowi lub
226użytkownikowi komunikowanie się z programem Bacula Director. To jest
227interfejs czysto tekstowy.
228
229%package console-wx
230Summary: Bacula wxWidgets Console
231Summary(pl.UTF-8): Konsola Baculi oparta na wxWidgets
232Group: Networking/Utilities
233Requires(post): sed >= 4.0
234Requires: %{name}-common = %{version}-%{release}
235
236%description console-wx
237Bacula - It comes by night and sucks the vital essence from your
238computers.
239
240Bacula Console is the program that allows the administrator or user to
241communicate with the Bacula Director. This is the wxWidgets GUI
242interface.
243
244%description console-wx -l pl.UTF-8
245Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
246
247Bacula Console to program umożliwiający administratorowi lub
248użytkownikowi komunikowanie się z programem Bacula Director. To jest
249interfejs graficzny oparty na wxWidgets.
250
251%package console-qt4
252Summary: Bacula Qt4 Console
253Summary(pl.UTF-8): Konsola Baculi oparta na Qt4
254Group: Networking/Utilities
255Requires(post): sed >= 4.0
256Requires: %{name}-common = %{version}-%{release}
257
258%description console-qt4
259Bacula - It comes by night and sucks the vital essence from your
260computers.
261
262Bacula Console is the program that allows the administrator or user to
263communicate with the Bacula Director. This is the Qt4 GUI interface.
264
265%description console-qt4 -l pl.UTF-8
266Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
267
268Bacula Console to program umożliwiający administratorowi lub
269użytkownikowi komunikowanie się z programem Bacula Director. To jest
270interfejs graficzny oparty na Qt4.
271
272%package tray-monitor
273Summary: Bacula Tray Monitor
274Group: Networking/Utilities
275Requires(post): sed >= 4.0
276Requires: %{name}-common = %{version}-%{release}
277
278%description tray-monitor
279Bacula - It comes by night and sucks the vital essence from your
280computers.
281
282The Monitor program is typically an icon in the system tray. However,
283once the icon is expanded into a full window, the administrator or
284user can obtain status information about the Director or the backup
285status on the local workstation or any other Bacula daemon that is
286configured.
287
288%package fd
289Summary: Bacula File services (Client)
290Summary(pl.UTF-8): Usługi Bacula File (klient)
291Group: Networking/Utilities
292Requires(post): sed >= 4.0
293Requires: %{name}-common = %{version}-%{release}
294
295%description fd
296Bacula - It comes by night and sucks the vital essence from your
297computers.
298
299Bacula File services (or Client program) is the software program that
300is installed on the machine to be backed up. It is specific to the
301operating system on which it runs and is responsible for providing the
302file attributes and data when requested by the Director. The File
303services are also responsible for the file system dependent part of
304restoring the file attributes and data during a recovery operation.
305This program runs as a daemon on the machine to be backed up, and in
306some of the documentation, the File daemon is referred to as the
307Client (for example in Bacula configuration file).
308
309%description fd -l pl.UTF-8
310Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
311
312Usługi Bacula File (inaczej program kliencki) to oprogramowanie, które
313instaluje się na maszynach, z których mają być wykonywane kopie
314zapasowe. Są one specyficzne dla systemu operacyjnego, pod którym
315działa dana maszyna i odpowiadają za dostarczanie atrybutów i danych
316plików na żądanie Directora. Usługi plikowe są także odpowiedzialne za
317zależną od systemu plików część odzyskiwania atrybutów i danych plików
318podczas operacji odzyskiwania danych. Program działa jako demon na
319maszynie, która ma być backupowana i w części dokumentacji demon ten
320(File) jest nazywany klientem (na przykład w pliku konfiguracyjnym
321Baculi).
322
323%package sd
324Summary: Bacula Storage services
325Summary(pl.UTF-8): Usługi Bacula Storage
326Group: Networking/Utilities
327Requires(post): sed >= 4.0
328Requires: %{name}-common = %{version}-%{release}
329Conflicts: dvd+rw-tools <= 5.21.4.10.8-1
330
331%description sd
332Bacula - It comes by night and sucks the vital essence from your
333computers.
334
335Bacula Storage services consist of the software programs that perform
336the storage and recovery of the file attributes and data to the
337physical backup media or volumes. In other words, the Storage daemon
338is responsible for reading and writing your tapes (or other storage
339media, e.g. files). The Storage services runs as a daemon on the
340machine that has the backup device (usually a tape drive).
341
342%description sd -l pl.UTF-8
343Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
344
345Usługi Bacula Storage składają się z programów obsługujących
346przechowywanie danych oraz odzyskiwanie atrybutów i danych na
347fizycznych nośnikach lub wolumenach. Innymi słowy, demon Storage jest
348odpowiedzialny za odczyt i zapis taśm (lub innych nośników do
349przechowywania danych, np. plików). Usługi Storage działają jako demon
350na maszynie, która zawiera urządzenie backupowe (zwykle napęd
351taśmowy).
352
353%package db-postgresql
354Summary: PostgreSQL database driver for Bacula
355Summary(pl.UTF-8): Sterownik bazy PostgreSQL dla Baculi
356Group: Networking/Utilities
357Requires(post): /sbin/ldconfig
358Requires: %{name}-common = %{version}-%{release}
359Provides: bacula(db) = %{version}-%{release}
360Obsoletes: bacula(db)
361
362%description db-postgresql
363PostgreSQL database driver for Bacula.
364
365%description db-postgresql -l pl.UTF-8
366Sterownik bazy PostgreSQL dla Baculi.
367
368%package db-mysql
369Summary: MySQL database driver for Bacula
370Summary(pl.UTF-8): Sterownik bazy MySQL dla Baculi
371Group: Networking/Utilities
372Requires(post): /sbin/ldconfig
373Requires: %{name}-common = %{version}-%{release}
374Provides: bacula(db) = %{version}-%{release}
375Obsoletes: bacula(db)
376
377%description db-mysql
378MySQL database driver for Bacula.
379
380%description db-mysql -l pl.UTF-8
381Sterownik bazy MySQL dla Baculi.
382
383%package db-sqlite3
384Summary: SQLite database driver for Bacula
385Summary(pl.UTF-8): Sterownik bazy SQLite dla Baculi
386Group: Networking/Utilities
387Requires(post): /sbin/ldconfig
388Requires: %{name}-common = %{version}-%{release}
389Provides: bacula(db) = %{version}-%{release}
390Obsoletes: bacula(db)
391
392%description db-sqlite3
393SQLite database driver for Bacula.
394
395%description db-sqlite3 -l pl.UTF-8
396Sterownik bazy SQLite dla Baculi.
397
398%package db-dbi
399Summary: libdbi database driver for Bacula
400Summary(pl.UTF-8): Sterownik bazy libdbi dla Baculi
401Group: Networking/Utilities
402Requires(post): /sbin/ldconfig
403Requires: %{name}-common = %{version}-%{release}
404Provides: bacula(db) = %{version}-%{release}
405Obsoletes: bacula(db)
406
407%description db-dbi
408libdbi database driver for Bacula.
409
410%description db-dbi -l pl.UTF-8
411Sterownik baz libdbi dla Baculi.
412
413%package rescue
414Summary: Bacula - The Network Backup Solution
415Summary(pl.UTF-8): Bacula - rozwiązanie do wykonywania kopii zapasowych po sieci
416Group: Networking/Utilities
417Requires: %{name}-fd = %{version}-%{release}
418Requires: coreutils
419Requires: util-linux
420
421%description rescue
422Bacula - It comes by night and sucks the vital essence from your
423computers.
424
425Bacula is a set of computer programs that permit you (or the system
426administrator) to manage backup, recovery, and verification of
427computer data across a network of computers of different kinds. In
428technical terms, it is a network client/server based backup program.
429Bacula is relatively easy to use and efficient, while offering many
430advanced storage management features that make it easy to find and
431recover lost or damaged files.
432
433This package installs scripts for disaster recovery and builds rescue
434floppy disk for bare metal recovery.
435
436%description rescue -l pl.UTF-8
437Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
438
439Bacula to zbiór programów umożliwiających administratorowi na
440zarządzanie kopiami zapasowymi, odzyskiwaniem i weryfikacją danych w
441sieci komputerów różnego rodzaju. W terminologii technicznej jest to
442program do kopii zapasowych pracujący w architekturze klient-serwer.
443Bacula jest stosunkowo łatwa w użyciu i wydajna, oferując przy tym
444wiele zaawansowanych możliwości przy zarządzaniu nośnikami,
445ułatwiających znalezienie i odzyskanie utraconych lub uszkodzonych
446plików.
447
448Ten pakiet zawiera skrypty do odtwarzania po awarii i tworzy dyskietkę
449ratunkowe do odtwarzania systemu od zera.
450
451%package -n nagios-plugin-check_bacula
452Summary: Nagios plugin to check bacula
453Group: Networking
454Requires: nagios-common
455
456%description -n nagios-plugin-check_bacula
457Nagios plugin to check bacula.
458
459%prep
460%setup -q -a 1
461%patch0 -p1
462%patch1 -p0
463%patch2 -p1
464%patch3 -p1
465%patch4 -p1
466%patch5 -p1
467%patch7 -p1
468%patch8 -p1
469%patch9 -p1
470%patch10 -p1
471
472tar -xf %{SOURCE2} && ln -s bacula-rescue-* rescue
473
474sed -i -e 's#bindir=.*#bindir=%{_bindir}#g' \
475 src/cats/create_* src/cats/delete_* src/cats/drop_* \
476 src/cats/grant_* src/cats/make_* src/cats/update_*
477sed -i -e 's/@hostname@/--hostname--/' src/*/*.conf.in
478
479%if %{with dbi}
480for dbtype in mysql postgresql sqlite3; do
481 sed -i -e "s,@DB_TYPE@,$dbtype,g" src/cats/*_${dbtype}_*
482done
483%endif
484
485%build
486cd autoconf
487%{__aclocal} -I bacula-macros -I gettext-macros
488# $BUILD_DIR not seen by libtoolize, export it
489BUILD_DIR=.. %{__libtoolize}
490cd ..
491%{__autoconf} --prepend-include=$(pwd)/autoconf autoconf/configure.in > configure
492
493CPPFLAGS="-I/usr/include/ncurses -I%{_includedir}/readline"
494
495# we wan't the 'base' build built with the last database in the list,
496# to make sure it is full-featured
497for database in %{databases}; do
498 WXCONFIG=%{_bindir}/wx-gtk2-unicode-config \
499 QMAKE=%{_bindir}/qt4-qmake \
500 %configure \
501 --with-scriptdir=%{_libexecdir}/%{name} \
502 %{?with_bat:--enable-bat} \
503 --disable-conio \
504 --enable-smartalloc \
505 %{?with_console_wx:--enable-bwx-console} \
506 --enable-tray-monitor \
507 %{?with_python:--with-python} \
508 --with-readline \
509 --with-tcp-wrappers \
510 --with-working-dir=%{_var}/lib/%{name} \
511 --with-dump-email="root@localhost" \
512 --with-job-email="root@localhost" \
513 --with-smtp-host=localhost \
514 --with-pid-dir=/var/run \
515 --with-subsys-dir=/var/lock/subsys \
516 --enable-batch-insert \
517 --with-$database \
518 %{?with_sqlite3_sync_off:--enable-extra-sqlite3-init="pragma synchronous=0;"} \
519 --with-dir-password="#FAKE-dir-password#" \
520 --with-fd-password="#FAKE-fd-password#" \
521 --with-sd-password="#FAKE-sd-password#" \
522 --with-mon-dir-password="#FAKE-mon-dir-password#" \
523 --with-mon-fd-password="#FAKE-mon-fd-password#" \
524 --with-mon-sd-password="#FAKE-mon-sd-password#" \
525 --with-openssl
526
527 # build the database library
528 %{__make} -C src/cats clean
529 %{__make} -C src/cats
530
531 # install the database library in a temporary location
532 install -d libbacsql/$database%{_libdir}
533 %{__make} -C src/cats libtool-install DESTDIR=$PWD/libbacsql/$database
534done
535
536%if %{with bat}
537cd src/qt-console
538qmake-qt4 bat.pro
539cd ../..
540%endif
541
542%{__make}
543
544%if %{with nagios}
545# nagios plugin
546%{__make} -C examples/nagios/check_bacula
547%endif
548
549%if %{with rescue}
550cd rescue
551%configure \
552 --with-bacula=../
553cd linux/cdrom
554fakeroot %{__make}
555%endif
556
557%install
558rm -rf $RPM_BUILD_ROOT
559install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,logrotate.d,pam.d,sysconfig}
560install -d $RPM_BUILD_ROOT%{_sysconfdir}/rescue
561install -d $RPM_BUILD_ROOT{%{_pixmapsdir},%{_desktopdir},%{_mandir},%{_bindir},/var/log/bacula}
562
563%{__make} install \
564 DESTDIR=$RPM_BUILD_ROOT
565
566# install libraries for all the database backends
567# ldconfig will add the soname symlinks when one of the packages is installed
568for database in %{databases}; do
569 for libfile in libbacsql/$database%{_libdir}/lib*-*.so; do
570 orig_name=${libfile##*/}
571 file_prefix=${orig_name%%-*.so}
572 file_suffix=${orig_name#*-}
573 file_name=$file_prefix-$database-$file_suffix
574 install -p $libfile $RPM_BUILD_ROOT%{_libdir}/$file_name
575 touch $RPM_BUILD_ROOT%{_libdir}/$orig_name
576 done
577done
578
579# replace with empty file, replaced by ldconfig from each db-* package on intsall
580rm -f $RPM_BUILD_ROOT%{_libdir}/libbacsql-%{version}.so
581touch $RPM_BUILD_ROOT%{_libdir}/libbacsql-%{version}.so
582
583install -p %{SOURCE10} $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-dir
584install -p %{SOURCE11} $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-fd
585install -p %{SOURCE12} $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-sd
586cp -a %{SOURCE13} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}-dir
587cp -a %{SOURCE14} $RPM_BUILD_ROOT/etc/sysconfig/bacula-dir
588cp -a %{SOURCE15} $RPM_BUILD_ROOT/etc/sysconfig/bacula-fd
589cp -a %{SOURCE16} $RPM_BUILD_ROOT/etc/sysconfig/bacula-sd
590
591%if %{with console_wx}
592# tray-monitor is for regular users
593#mv $RPM_BUILD_ROOT%{_sbindir}/bacula-tray-monitor $RPM_BUILD_ROOT%{_bindir}
594
595cp -a scripts/bacula.png $RPM_BUILD_ROOT%{_pixmapsdir}/bacula.png
596#install src/tray-monitor/generic.xpm $RPM_BUILD_ROOT%{_pixmapsdir}/bacula-tray-monitor.xpm
597sed -e 's/gnome-console/wx-console/g;s/Console/Wx Console/g' \
598 scripts/bacula.desktop.gnome2 > $RPM_BUILD_ROOT%{_desktopdir}/bacula-wx.desktop
599#sed -e 's#%{_sbindir}#%{_bindir}#' \
600# scripts/bacula-tray-monitor.desktop > $RPM_BUILD_ROOT%{_desktopdir}/bacula-tray-monitor.desktop
601%endif
602
603%if %{with bat}
604%{__make} -C src/qt-console install \
605 DESTDIR=$RPM_BUILD_ROOT
606mv $RPM_BUILD_ROOT{%{_sbindir},%{_bindir}}/bat
607cp -a scripts/bat.desktop $RPM_BUILD_ROOT%{_desktopdir}
608%endif
609
610%if %{with rescue}
611# install the rescue stuff, these are the rescue scripts
612cp -a rescue/linux/floppy/backup.etc.list $RPM_BUILD_ROOT%{_sysconfdir}/rescue
613cp -a rescue/linux/floppy/sfdisk.bz2 $RPM_BUILD_ROOT%{_sysconfdir}/rescue
614install -p rescue/linux/floppy/*_* $RPM_BUILD_ROOT%{_sysconfdir}/rescue
615install -p rescue/linux/floppy/getdiskinfo $RPM_BUILD_ROOT%{_sysconfdir}/rescue
616%endif
617
618touch $RPM_BUILD_ROOT/var/log/bacula/log
619
620# install the updatedb scripts for older versions that last full release
621# 2.0 -> 3.0 : 10_to_11
622install -p updatedb/update_*_tables_10_to_11 $RPM_BUILD_ROOT%{_libexecdir}/%{name}
623
624# place for site passwords
625touch $RPM_BUILD_ROOT%{_sysconfdir}/{dir-password,fd-password,sd-password}
626touch $RPM_BUILD_ROOT%{_sysconfdir}/{mon-dir-password,mon-fd-password,mon-sd-password}
627
628mv $RPM_BUILD_ROOT%{_libdir}/bacula/mtx-changer.conf $RPM_BUILD_ROOT/etc/bacula/mtx-changer.conf
629
630# some file changes
631rm -f $RPM_BUILD_ROOT%{_libexecdir}/%{name}/{gconsole,startmysql,stopmysql,bacula,bconsole,fd}
632%if %{without console_wx}
633rm -f $RPM_BUILD_ROOT%{_desktopdir}/bacula-wx.desktop
634%endif
635touch $RPM_BUILD_ROOT%{_sysconfdir}/.pw.sed
636
637rm $RPM_BUILD_ROOT%{_docdir}/bacula/ChangeLog
638rm $RPM_BUILD_ROOT%{_docdir}/bacula/INSTALL
639rm $RPM_BUILD_ROOT%{_docdir}/bacula/LICENSE
640rm $RPM_BUILD_ROOT%{_docdir}/bacula/README
641rm $RPM_BUILD_ROOT%{_docdir}/bacula/ReleaseNotes
642rm $RPM_BUILD_ROOT%{_docdir}/bacula/VERIFYING
643rm $RPM_BUILD_ROOT%{_docdir}/bacula/technotes
644
645# startup scripts, those in /etc/rc.d/init.d are better
646rm $RPM_BUILD_ROOT%{_sbindir}/bacula
647rm $RPM_BUILD_ROOT%{_libexecdir}/%{name}/bacula-ctl-*
648
649# unsupported
650rm $RPM_BUILD_ROOT%{_libexecdir}/%{name}/btraceback.mdb
651
652# rename to avoid possible conflicts
653mv $RPM_BUILD_ROOT%{_sbindir}/{,bacula-}dbcheck
654mv $RPM_BUILD_ROOT%{_mandir}/man8/{,bacula-}dbcheck.8.gz
655
656# no -devel files packaged, so this is also useless
657rm $RPM_BUILD_ROOT%{_libdir}/libbac{,cfg,find,py,sql}.{so,la}
658
659# placeholders for the symlinks set in %%post db-*
660for f in create_bacula_database drop_bacula_database drop_bacula_tables \
661 grant_bacula_privileges make_bacula_tables update_bacula_tables ; do
662
663 touch $RPM_BUILD_ROOT%{_libexecdir}/%{name}/$f
664done
665
666%if %{with nagios}
667install -d $RPM_BUILD_ROOT%{nagiosplugindir}
668%{__make} -C examples/nagios/check_bacula install \
669 sbindir=%{nagiosplugindir} \
670 INSTALL_PROGRAM="libtool --mode=install install -p" \
671 DESTDIR=$RPM_BUILD_ROOT
672%endif
673
674%clean
675rm -rf $RPM_BUILD_ROOT
676
677%pre common
678%groupadd -P %{name}-common -g 136 -r -f bacula
679%useradd -P %{name}-common -u 136 -r -d /var/lib/bacula -s /bin/false -c "Bacula User" -g bacula bacula
680
681%define update_configs \
682echo "Updating bacula passwords and names..." | %banner -a %{name} \
683cd /etc/bacula \
684for f in *-password; do \
685 if [ ! -s $f ]; then \
686 openssl rand -base64 33 > $f \
687 fi \
688 p=$(cat $f) \
689 for cf in *.conf *.conf.rpmnew; do \
690 [ -f $cf ] && sed -i -e"s:#FAKE-$f#:$p:" "$cf" || : \
691 done \
692done \
693for cf in *.conf *.conf.rpmnew; do \
694 [ -f $cf ] && sed -i -e"s:--hostname--:`hostname`:" "$cf" || : \
695done
696
697%post common
698/sbin/ldconfig
699%update_configs
700
701%postun common
702/sbin/ldconfig
703if [ "$1" = "0" ]; then
704 %userremove bacula
705 %groupremove bacula
706fi
707
708%triggerpostun dir -- %{name}-dir < 5.0
709%banner bacula-dir -t3 <<EOF
710You have upgraded from an older version of Bacula director.
711
712You will probably need to call %{_libexecdir}/%{name}/update_bacula_tables
713script to upgrade the database.
714EOF
715
716%post dir
717%update_configs
718/sbin/chkconfig --add bacula-dir
719%service bacula-dir restart "Bacula Director daemon"
720
721%preun dir
722if [ "$1" = "0" ]; then
723 %service bacula-dir stop
724 /sbin/chkconfig --del bacula-dir
725fi
726
727%post fd
728%update_configs
729/sbin/chkconfig --add bacula-fd
730%service bacula-fd restart "Bacula File daemon"
731
732%preun fd
733if [ "$1" = "0" ]; then
734 %service bacula-fd stop
735 /sbin/chkconfig --del bacula-fd
736fi
737
738%post sd
739%update_configs
740/sbin/chkconfig --add bacula-sd
741%service bacula-sd restart "Bacula Storage daemon"
742
743%preun sd
744if [ "$1" = "0" ]; then
745 %service bacula-sd stop
746 /sbin/chkconfig --del bacula-sd
747fi
748
749%pre console
750if [ -e %{_sysconfdir}/console.conf -a ! -e %{_sysconfdir}/bconsole.conf ]; then
751 mv %{_sysconfdir}/console.conf %{_sysconfdir}/bconsole.conf
752fi
753
754%post console
755%update_configs
756
757%post console-wx
758%update_configs
759
760%triggerpostun common -- %{name}-common < 5.0.1-2
761find /etc/bacula/bat.conf* -perm /007 -print0 | xargs -0 -r chmod 600 || :
762
763%post console-qt4
764%update_configs
765
766%post tray-monitor
767%update_configs
768
769%post rescue
770# link our current installed conf file to the rescue directory
771ln -sf %{_sysconfdir}/bacula-fd.conf %{_sysconfdir}/rescue/bacula-fd.conf
772
773# run getdiskinfo
774echo "Creating rescue files for this system..."
775cd %{_sysconfdir}/rescue
776./getdiskinfo
777
778%preun rescue
779# remove the files created after the initial rpm installation
780if [ "$1" = "0" ]; then
781 rm -f %{_sysconfdir}/rescue/bacula-fd.conf
782 rm -f %{_sysconfdir}/rescue/partition.*
783 rm -f %{_sysconfdir}/rescue/format.*
784 rm -f %{_sysconfdir}/rescue/mount_drives
785 rm -f %{_sysconfdir}/rescue/start_network
786 rm -f %{_sysconfdir}/rescue/sfdisk
787 rm -rf %{_sysconfdir}/rescue/diskinfo/*
788fi
789
790%define db_post() \
791/sbin/ldconfig \
792for name in "create database" "drop tables" "drop database" "grant privileges" "make tables" "update tables"; do \
793 prefix="${name%% *}" \
794 suffix="${name#* }" \
795 ln -sf "${prefix}_%{1}_${suffix}" %{_libexecdir}/%{name}/"${prefix}_bacula_${suffix}" || : \
796done \
797%service bacula-dir restart "Bacula Director daemon"
798
799%define db_postun() \
800/sbin/ldconfig \
801if [ "$1" = "0" ]; then \
802 for f in %{_libexecdir}/%{name}/*_bacula_*; do \
803 if [ -L "$f" -a ! -e "$f" ]; then \
804 rm "$f" \
805 fi \
806 done \
807fi
808
809%post db-postgresql
810%db_post postgresql
811
812%postun db-postgresql
813%db_postun postgresql
814
815%post db-mysql
816%db_post mysql
817
818%postun db-mysql
819%db_postun mysql
820
821%post db-sqlite3
822%db_post sqlite3
823
824%postun db-sqlite3
825%db_postun sqlite3
826
827# dbi backend is different, as it is not bound with a specific db engine
828%post db-dbi
829/sbin/ldconfig
830%service bacula-dir restart "Bacula Director daemon"
831
832%postun db-dbi -p /sbin/ldconfig
833
834%files common
835%defattr(644,root,root,755)
836%doc LICENSE
837%dir %{_sysconfdir}
838%attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*-password
839# do not remove bsmtp from files. Fix build if it is not installed.
840%attr(755,root,root) %{_sbindir}/bsmtp
841%attr(755,root,root) %{_sbindir}/btraceback
842%attr(755,root,root) %{_libdir}/libbac-5*.so
843%attr(755,root,root) %{_libdir}/libbaccfg-5*.so
844%attr(755,root,root) %{_libdir}/libbacfind-5*.so
845%attr(755,root,root) %{_libdir}/libbacpy-5*.so
846%{_mandir}/man8/bacula.8*
847%{_mandir}/man1/bsmtp.1*
848%{_mandir}/man8/btraceback.8*
849%dir %{_libexecdir}/%{name}
850%{_libexecdir}/%{name}/btraceback.dbx
851%{_libexecdir}/%{name}/btraceback.gdb
852%{_libexecdir}/%{name}/bacula_config
853%attr(770,root,bacula) %dir %{_localstatedir}
854%attr(750,bacula,logs) %dir /var/log/bacula
855%attr(640,bacula,logs) %ghost /var/log/bacula/log
856
857%files dir
858%defattr(644,root,root,755)
859%doc ChangeLog CheckList ReleaseNotes kernstodo LICENSE
860#%doc examples %{name}-docs-%{version}/manual/{*.pdf,bacula}
861%attr(640,root,bacula) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bacula-dir.conf
862%ghost %{_sysconfdir}/.pw.sed
863%attr(640,root,root) %config(noreplace) /etc/logrotate.d/bacula-dir
864%attr(754,root,root) /etc/rc.d/init.d/bacula-dir
865%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/bacula-dir
866%attr(755,root,root) %{_sbindir}/bacula-dir
867%attr(755,root,root) %{_sbindir}/bregex
868%attr(755,root,root) %{_sbindir}/bwild
869%attr(755,root,root) %{_sbindir}/bacula-dbcheck
870%{_mandir}/man8/bacula-dir.8*
871%{_mandir}/man8/bacula-dbcheck.8*
872%{_libexecdir}/%{name}/query.sql
873#%attr(755,root,root) %{_libexecdir}/%{name}/make_catalog_backup
874#%attr(755,root,root) %{_libexecdir}/%{name}/delete_catalog_backup
875
876%files db-postgresql
877%defattr(644,root,root,755)
878%attr(755,root,root) %{_libexecdir}/%{name}/create_postgresql_database
879%attr(755,root,root) %{_libexecdir}/%{name}/drop_postgresql_database
880%attr(755,root,root) %{_libexecdir}/%{name}/drop_postgresql_tables
881%attr(755,root,root) %{_libexecdir}/%{name}/grant_postgresql_privileges
882%attr(755,root,root) %{_libexecdir}/%{name}/make_postgresql_tables
883%attr(755,root,root) %{_libexecdir}/%{name}/update_postgresql_*
884%attr(755,root,root) %{_libdir}/libbacsql-postgresql-5*.so
885
886%ghost %attr(755,root,root) %{_libdir}/libbacsql-5*.so
887%ghost %{_libexecdir}/%{name}/create_bacula_database
888%ghost %{_libexecdir}/%{name}/drop_bacula_tables
889%ghost %{_libexecdir}/%{name}/drop_bacula_database
890%ghost %{_libexecdir}/%{name}/grant_bacula_privileges
891%ghost %{_libexecdir}/%{name}/make_bacula_tables
892%ghost %{_libexecdir}/%{name}/update_bacula_tables
893
894%files db-mysql
895%defattr(644,root,root,755)
896%attr(755,root,root) %{_libexecdir}/%{name}/create_mysql_database
897%attr(755,root,root) %{_libexecdir}/%{name}/drop_mysql_database
898%attr(755,root,root) %{_libexecdir}/%{name}/drop_mysql_tables
899%attr(755,root,root) %{_libexecdir}/%{name}/grant_mysql_privileges
900%attr(755,root,root) %{_libexecdir}/%{name}/make_mysql_tables
901%attr(755,root,root) %{_libexecdir}/%{name}/update_mysql_*
902%attr(755,root,root) %{_libdir}/libbacsql-mysql-5*.so
903
904%ghost %attr(755,root,root) %{_libdir}/libbacsql-5*.so
905%ghost %{_libexecdir}/%{name}/create_bacula_database
906%ghost %{_libexecdir}/%{name}/drop_bacula_tables
907%ghost %{_libexecdir}/%{name}/drop_bacula_database
908%ghost %{_libexecdir}/%{name}/grant_bacula_privileges
909%ghost %{_libexecdir}/%{name}/make_bacula_tables
910%ghost %{_libexecdir}/%{name}/update_bacula_tables
911
912%files db-sqlite3
913%defattr(644,root,root,755)
914%attr(755,root,root) %{_libexecdir}/%{name}/create_sqlite3_database
915%attr(755,root,root) %{_libexecdir}/%{name}/drop_sqlite3_database
916%attr(755,root,root) %{_libexecdir}/%{name}/drop_sqlite3_tables
917%attr(755,root,root) %{_libexecdir}/%{name}/grant_sqlite3_privileges
918%attr(755,root,root) %{_libexecdir}/%{name}/make_sqlite3_tables
919%attr(755,root,root) %{_libexecdir}/%{name}/update_sqlite3_*
920%attr(755,root,root) %{_libdir}/libbacsql-sqlite3-5*.so
921
922%ghost %attr(755,root,root) %{_libdir}/libbacsql-5*.so
923%ghost %{_libexecdir}/%{name}/create_bacula_database
924%ghost %{_libexecdir}/%{name}/drop_bacula_tables
925%ghost %{_libexecdir}/%{name}/drop_bacula_database
926%ghost %{_libexecdir}/%{name}/grant_bacula_privileges
927%ghost %{_libexecdir}/%{name}/make_bacula_tables
928%ghost %{_libexecdir}/%{name}/update_bacula_tables
929
930%if %{with dbi}
931%files db-dbi
932%defattr(644,root,root,755)
933%attr(755,root,root) %{_libexecdir}/%{name}/create_postgresql_database
934%attr(755,root,root) %{_libexecdir}/%{name}/drop_postgresql_database
935%attr(755,root,root) %{_libexecdir}/%{name}/drop_postgresql_tables
936%attr(755,root,root) %{_libexecdir}/%{name}/grant_postgresql_privileges
937%attr(755,root,root) %{_libexecdir}/%{name}/make_postgresql_tables
938%attr(755,root,root) %{_libexecdir}/%{name}/update_postgresql_*
939%attr(755,root,root) %{_libexecdir}/%{name}/create_mysql_database
940%attr(755,root,root) %{_libexecdir}/%{name}/drop_mysql_database
941%attr(755,root,root) %{_libexecdir}/%{name}/drop_mysql_tables
942%attr(755,root,root) %{_libexecdir}/%{name}/grant_mysql_privileges
943%attr(755,root,root) %{_libexecdir}/%{name}/make_mysql_tables
944%attr(755,root,root) %{_libexecdir}/%{name}/update_mysql_*
945%attr(755,root,root) %{_libexecdir}/%{name}/create_sqlite3_database
946%attr(755,root,root) %{_libexecdir}/%{name}/drop_sqlite3_database
947%attr(755,root,root) %{_libexecdir}/%{name}/drop_sqlite3_tables
948%attr(755,root,root) %{_libexecdir}/%{name}/grant_sqlite3_privileges
949%attr(755,root,root) %{_libexecdir}/%{name}/make_sqlite3_tables
950%attr(755,root,root) %{_libexecdir}/%{name}/update_sqlite3_*
951%attr(755,root,root) %{_libdir}/libbacsql-dbi-5*.so
952
953%ghost %attr(755,root,root) %{_libdir}/libbacsql-5*.so
954%endif
955
956%files fd
957%defattr(644,root,root,755)
958%doc LICENSE
959%attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bacula-fd.conf
960%attr(754,root,root) /etc/rc.d/init.d/bacula-fd
961%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/bacula-fd
962%attr(755,root,root) %{_sbindir}/bacula-fd
963%attr(755,root,root) %{_libdir}/bpipe-fd.so
964%{_mandir}/man8/bacula-fd.8*
965
966%files sd
967%defattr(644,root,root,755)
968%doc LICENSE
969%attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bacula-sd.conf
970%attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mtx-changer.conf
971%attr(754,root,root) /etc/rc.d/init.d/bacula-sd
972%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/bacula-sd
973%attr(755,root,root) %{_sbindir}/bacula-sd
974%attr(755,root,root) %{_sbindir}/bcopy
975%attr(755,root,root) %{_sbindir}/bextract
976%attr(755,root,root) %{_sbindir}/bls
977%attr(755,root,root) %{_sbindir}/bscan
978%attr(755,root,root) %{_sbindir}/btape
979%attr(755,root,root) %{_libexecdir}/%{name}/mtx-changer
980%attr(755,root,root) %{_libexecdir}/%{name}/disk-changer
981%attr(755,root,root) %{_libexecdir}/%{name}/dvd-handler
982%{_mandir}/man8/bacula-sd.8*
983%{_mandir}/man8/bcopy.8*
984%{_mandir}/man8/bextract.8*
985%{_mandir}/man8/bls.8*
986%{_mandir}/man8/bscan.8*
987%{_mandir}/man8/btape.8*
988
989%files console
990%defattr(644,root,root,755)
991%doc LICENSE
992%attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bconsole.conf
993%attr(755,root,root) %{_sbindir}/bconsole
994%{_mandir}/man8/bconsole.8*
995
996%if %{with console_wx}
997%files console-wx
998%defattr(644,root,root,755)
999%doc LICENSE
1000%{_pixmapsdir}/%{name}.png
1001%{_desktopdir}/bacula-wx.desktop
1002%attr(640,root,bacula) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bwx-console.conf
1003%attr(755,root,root) %{_sbindir}/bwx-console
1004%{_mandir}/man1/bacula-bwxconsole.1*
1005%endif
1006
1007%if %{with bat}
1008%files console-qt4
1009%defattr(644,root,root,755)
1010%doc LICENSE
1011%{_pixmapsdir}/%{name}.png
1012%{_desktopdir}/bat.desktop
1013# Do not make this file world-readable or any user will get full access to the
1014# backup system
1015%attr(640,root,bacula) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bat.conf
1016%attr(755,root,root) %{_bindir}/bat
1017%{_mandir}/man1/bat.1*
1018%{_docdir}/%{name}
1019%endif
1020
1021%if %{with console_wx}
1022%files tray-monitor
1023%defattr(644,root,root,755)
1024%doc LICENSE
1025%attr(755,root,root) %{_sbindir}/bacula-tray-monitor
1026#%{_pixmapsdir}/%{name}-tray-monitor.xpm
1027#%{_desktopdir}/%{name}-tray-monitor.desktop
1028%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/tray-monitor.conf
1029%{_mandir}/man1/bacula-tray-monitor.1*
1030%endif
1031
1032%if %{with rescue}
1033%files rescue
1034%defattr(644,root,root,755)
1035%doc LICENSE
1036%dir %{_sysconfdir}/rescue
1037%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/backup.etc.list
1038%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/bacula-fd
1039%attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/format_floppy
1040%attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/getdiskinfo
1041%attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/make_rescue_disk
1042%attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/restore_bacula
1043%attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/restore_etc
1044%attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/run_grub
1045%attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/run_lilo
1046%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/sfdisk.bz2
1047%endif
1048
1049%if %{with nagios}
1050%files -n nagios-plugin-check_bacula
1051%defattr(644,root,root,755)
1052%attr(755,root,root) %{nagiosplugindir}/check_bacula
1053%endif
This page took 0.054447 seconds and 4 git commands to generate.