]> git.pld-linux.org Git - packages/bacula.git/blame - bacula.spec
Up to 7.4.4
[packages/bacula.git] / bacula.spec
CommitLineData
c0d46bda
JK
1## TODO:
2# - fix libtoolize
b0473ed3 3# - update desktop files, think about su-wrappers for console (with .desktop files)
2007449a 4# - fix log file permissions
2b68b0cb 5#
f2527d22 6# Conditional build:
12eebbf8 7%if "%{pld_release}" == "ac"
dae4f8f4 8%bcond_with qt # BAT / qt-console Qt4 GUI
12eebbf8 9%else
dae4f8f4 10%bcond_without qt # BAT / qt-console Qt4 GUI
12eebbf8 11%endif
41bc1b6e
JK
12%bcond_without mysql # use MySQL
13%bcond_without pgsql # use PostgreSQL
41bc1b6e 14%bcond_without sqlite3 # use SQLite3
819cd4b0 15%bcond_without nagios # build nagios plugin
6d11b02b 16%bcond_with sqlite3_sync_off # makes SQLite3 backend much faster, but less reliable
0eba139b 17
8ba087a4 18%if %{without sqlite3}
aeaed87e 19%undefine with_sqlite3_sync_off
20%endif
0eba139b 21
cbbef7da 22%define qtver 4.8.4
bb6e7dc5 23Summary: Bacula - The Network Backup Solution
6a00efc0 24Summary(pl.UTF-8): Bacula - rozwiązanie do wykonywania kopii zapasowych po sieci
bb6e7dc5 25Name: bacula
09ca754c
MM
26Version: 7.4.4
27Release: 1
ccb5f851 28License: AGPL v3
52504a6d 29Group: Networking/Utilities
71a8c088 30Source0: http://downloads.sourceforge.net/bacula/%{name}-%{version}.tar.gz
09ca754c 31# Source0-md5: aed11c1eef1198ffc76c6fca55cea3ad
5ce18635
AM
32Source10: %{name}-dir.init
33Source11: %{name}-fd.init
34Source12: %{name}-sd.init
35Source13: %{name}.logrotate
4280e495
JK
36Source14: %{name}-dir.sysconfig
37Source15: %{name}-fd.sysconfig
38Source16: %{name}-sd.sysconfig
b6e1a6b6
JK
39Source17: %{name}-dir.service
40Source18: %{name}-fd.service
41Source19: %{name}-sd.service
0a03f92d 42Patch0: %{name}-mtx-changer.patch
53a3431c 43Patch1: %{name}-branding.patch
c0d46bda
JK
44Patch2: %{name}-desktop.patch
45Patch3: make_catalog_backup-setup-home.patch
46Patch4: %{name}-no_lockmgr.patch
bb6e7dc5 47URL: http://www.bacula.org/
0819f86f 48BuildRequires: acl-devel
f6b184fc 49BuildRequires: autoconf >= 2.61
f2337569 50BuildRequires: automake
1c4c1905 51BuildRequires: gettext-tools
0819f86f 52BuildRequires: libcap-devel
2ddca527 53BuildRequires: libtool >= 2:2.2
f183f7ef 54BuildRequires: libwrap-devel
cc01862b 55BuildRequires: ncurses-devel
bb6e7dc5
AM
56BuildRequires: openssl-devel
57BuildRequires: pkgconfig
c0d46bda 58BuildRequires: python
b403dd64 59BuildRequires: python-modules
dae4f8f4 60%if %{with qt}
304bb97e 61BuildRequires: QtCore-devel
e3dd858d 62BuildRequires: QtGui-devel
95ed03d9
ER
63BuildRequires: qt4-build >= %{qtver}
64BuildRequires: qt4-qmake >= %{qtver}
c19580f6 65%endif
4c7199dc
SP
66%{?with_mysql:BuildRequires: mysql-devel}
67%{?with_pgsql:BuildRequires: postgresql-devel}
bb6e7dc5 68BuildRequires: readline-devel
12eebbf8 69BuildRequires: rpm >= 4.4.9-56
b403dd64 70BuildRequires: rpm-pythonprov
b6e1a6b6 71BuildRequires: rpmbuild(macros) >= 1.644
cc01862b 72BuildRequires: sed >= 4.0
6d11b02b 73%{?with_sqlite3:BuildRequires: sqlite3-devel}
b403dd64 74BuildRequires: which
bb6e7dc5 75BuildRequires: zlib-devel
377f2efa 76Requires: systemd-units >= 38
bb6e7dc5
AM
77BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
78
d5e827d3 79%define _sysconfdir /etc/%{name}
1a72afd2 80%define _localstatedir /var/lib/%{name}
d5e827d3 81%define nagiosplugindir %{_libdir}/nagios/plugins
bb6e7dc5 82
9a766d73
AM
83# db packages contain duplicates
84%define _duplicate_files_terminate_build 0
85
b8003eec 86# from 'the worst' to 'the best'
53a3431c 87%define databases %{?with_sqlite3:sqlite3} %{?with_mysql:mysql} %{?with_pgsql:postgresql}
41bc1b6e 88
b60fe5cb
ER
89# dependency section is broken. ccache usage is instead to makefiles
90%undefine with_ccache
91
bb6e7dc5
AM
92%description
93Bacula - It comes by night and sucks the vital essence from your
94computers.
95
96Bacula is a set of computer programs that permit you (or the system
97administrator) to manage backup, recovery, and verification of
98computer data across a network of computers of different kinds. In
99technical terms, it is a network client/server based backup program.
100Bacula is relatively easy to use and efficient, while offering many
101advanced storage management features that make it easy to find and
5ce18635 102recover lost or damaged files.
bb6e7dc5 103
192fbfcf
JR
104%description -l pl.UTF-8
105Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
cc01862b 106
192fbfcf
JR
107Bacula to zbiór programów umożliwiających administratorowi na
108zarządzanie kopiami zapasowymi, odzyskiwaniem i weryfikacją danych w
168306e6
ER
109sieci komputerów różnego rodzaju. W terminologii technicznej jest to
110program do kopii zapasowych pracujący w architekturze klient-serwer.
111Bacula jest stosunkowo łatwa w użyciu i wydajna, oferując przy tym
112wiele zaawansowanych możliwości przy zarządzaniu nośnikami,
113ułatwiających znalezienie i odzyskanie utraconych lub uszkodzonych
114plików.
cc01862b 115
5ce18635
AM
116%package common
117Summary: Common files for bacula package
6a00efc0 118Summary(pl.UTF-8): Pliki wspólne dla pakietu bacula
bb6e7dc5 119Group: Networking/Utilities
237bfacd
JK
120Requires(post): openssl-tools
121Requires(post): sed >= 4.0
1bd568e8 122Requires(post,preun): /sbin/chkconfig
65253ffd
JK
123Requires(postun): /usr/sbin/groupdel
124Requires(postun): /usr/sbin/userdel
1b0a2248 125Requires(pre): /usr/sbin/groupadd
126Requires(pre): /usr/sbin/useradd
abdcd1c5
JB
127Conflicts: bacula-console < 0:1.34.6
128Conflicts: bacula-dir < 0:1.34.6
129Conflicts: bacula-fd < 0:1.34.6
130Conflicts: bacula-sd < 0:1.34.6
5c4729e7 131Conflicts: logrotate < 3.8.0
bb6e7dc5 132
5ce18635 133%description common
bb6e7dc5
AM
134Bacula - It comes by night and sucks the vital essence from your
135computers.
136
137Bacula is a set of computer programs that permit you (or the system
138administrator) to manage backup, recovery, and verification of
139computer data across a network of computers of different kinds. In
140technical terms, it is a network client/server based backup program.
141Bacula is relatively easy to use and efficient, while offering many
142advanced storage management features that make it easy to find and
5ce18635 143recover lost or damaged files.
bb6e7dc5 144
192fbfcf
JR
145%description common -l pl.UTF-8
146Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
cc01862b 147
192fbfcf
JR
148Bacula to zbiór programów umożliwiających administratorowi na
149zarządzanie kopiami zapasowymi, odzyskiwaniem i weryfikacją danych w
168306e6
ER
150sieci komputerów różnego rodzaju. W terminologii technicznej jest to
151program do kopii zapasowych pracujący w architekturze klient-serwer.
152Bacula jest stosunkowo łatwa w użyciu i wydajna, oferując przy tym
153wiele zaawansowanych możliwości przy zarządzaniu nośnikami,
154ułatwiających znalezienie i odzyskanie utraconych lub uszkodzonych
155plików.
cc01862b 156
5ce18635
AM
157%package dir
158Summary: Bacula Director and Catalog services
6a00efc0 159Summary(pl.UTF-8): Usługi Bacula Director i Catalog
5ce18635 160Group: Networking/Utilities
237bfacd 161Requires(post): sed >= 4.0
74c2ad1c
ER
162Requires: %{name}-common = %{version}-%{release}
163Requires: bacula(db) = %{version}-%{release}
377f2efa 164Requires: systemd-units >= 38
abdcd1c5 165Obsoletes: bacula-updatedb
bb6e7dc5 166
5ce18635
AM
167%description dir
168Bacula - It comes by night and sucks the vital essence from your
169computers.
170
171Bacula Director is the program that supervises all the backup,
172restore, verify and archive operations. The system administrator uses
173the Bacula Director to schedule backups and to recover files. Catalog
174services are comprised of the software programs responsible for
175maintaining the file indexes and volume databases for all files backed
176up. The Catalog services permit the System Administrator or user to
177quickly locate and restore any desired file, since it maintains a
7533d19f 178record of all Volumes used, all Jobs run, and all Files saved.
5ce18635 179
192fbfcf
JR
180%description dir -l pl.UTF-8
181Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
cc01862b 182
192fbfcf 183Bacula Director to program nadzorujący wszystkie operacje wykonywania
cc01862b 184kopii zapasowych, odzyskiwania, weryfikacji i archiwizowania.
192fbfcf
JR
185Administrator używa Bacula Directora do szeregowania kopii zapasowych
186oraz odzyskiwania plików. Usługi katalogowe (Catalog services) są
168306e6
ER
187używane przez programy odpowiedzialne za zarządzanie indeksami plików
188i bazą danych wolumenów dla wszystkich kopiowanych plików. Usługi
189katalogowe umożliwiają administratorowi lub użytkownikowi szybko
190zlokalizować i odtworzyć dowolny plik, ponieważ utrzymują rekord ze
191wszystkimi używanymi wolumenami, uruchomionymi zadaniami i zapisanymi
192plikami.
cc01862b 193
5ce18635
AM
194%package console
195Summary: Bacula Console
6a00efc0 196Summary(pl.UTF-8): Konsola Baculi
5ce18635 197Group: Networking/Utilities
237bfacd 198Requires(post): sed >= 4.0
74c2ad1c 199Requires: %{name}-common = %{version}-%{release}
5ce18635
AM
200
201%description console
202Bacula - It comes by night and sucks the vital essence from your
203computers.
204
205Bacula Console is the program that allows the administrator or user to
206communicate with the Bacula Director. This is the text only console
207interface.
208
192fbfcf
JR
209%description console -l pl.UTF-8
210Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
cc01862b 211
192fbfcf
JR
212Bacula Console to program umożliwiający administratorowi lub
213użytkownikowi komunikowanie się z programem Bacula Director. To jest
cc01862b
JB
214interfejs czysto tekstowy.
215
348912a8
JK
216%package console-qt
217Summary: bat – The Bacula Administration Tool
218Summary(pl.UTF-8): bat – narzędzie administratora Baculi
304bb97e
AM
219Group: Networking/Utilities
220Requires(post): sed >= 4.0
74c2ad1c 221Requires: %{name}-common = %{version}-%{release}
12eebbf8 222Requires: QtCore >= %{qtver}
30caee93 223Obsoletes: bacula-console-qt4 < 5.2.13-1
304bb97e 224
348912a8 225%description console-qt
304bb97e
AM
226Bacula - It comes by night and sucks the vital essence from your
227computers.
228
82139dcc
JK
229bat is short for Bacula Administration Tool. It is a GUI form of
230bconsole, but with many additional features.
304bb97e 231
348912a8 232%description console-qt -l pl.UTF-8
304bb97e
AM
233Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
234
348912a8
JK
235bat, czyli Bacula Administration Tool, jest graficznym odpowiednikiem
236bconsole, z wieloma dodatkowymi funkcjami.
304bb97e 237
237bfacd
JK
238%package tray-monitor
239Summary: Bacula Tray Monitor
240Group: Networking/Utilities
237bfacd 241Requires(post): sed >= 4.0
74c2ad1c 242Requires: %{name}-common = %{version}-%{release}
237bfacd
JK
243
244%description tray-monitor
245Bacula - It comes by night and sucks the vital essence from your
246computers.
247
1b0a2248 248The Monitor program is typically an icon in the system tray. However,
249once the icon is expanded into a full window, the administrator or
250user can obtain status information about the Director or the backup
251status on the local workstation or any other Bacula daemon that is
252configured.
237bfacd 253
5ce18635
AM
254%package fd
255Summary: Bacula File services (Client)
6a00efc0 256Summary(pl.UTF-8): Usługi Bacula File (klient)
5ce18635 257Group: Networking/Utilities
237bfacd 258Requires(post): sed >= 4.0
74c2ad1c 259Requires: %{name}-common = %{version}-%{release}
377f2efa 260Requires: systemd-units >= 38
5ce18635
AM
261
262%description fd
263Bacula - It comes by night and sucks the vital essence from your
264computers.
265
266Bacula File services (or Client program) is the software program that
267is installed on the machine to be backed up. It is specific to the
268operating system on which it runs and is responsible for providing the
269file attributes and data when requested by the Director. The File
270services are also responsible for the file system dependent part of
271restoring the file attributes and data during a recovery operation.
272This program runs as a daemon on the machine to be backed up, and in
273some of the documentation, the File daemon is referred to as the
274Client (for example in Bacula configuration file).
275
192fbfcf
JR
276%description fd -l pl.UTF-8
277Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
278
168306e6
ER
279Usługi Bacula File (inaczej program kliencki) to oprogramowanie, które
280instaluje się na maszynach, z których mają być wykonywane kopie
281zapasowe. Są one specyficzne dla systemu operacyjnego, pod którym
282działa dana maszyna i odpowiadają za dostarczanie atrybutów i danych
283plików na żądanie Directora. Usługi plikowe są także odpowiedzialne za
284zależną od systemu plików część odzyskiwania atrybutów i danych plików
285podczas operacji odzyskiwania danych. Program działa jako demon na
286maszynie, która ma być backupowana i w części dokumentacji demon ten
287(File) jest nazywany klientem (na przykład w pliku konfiguracyjnym
288Baculi).
cc01862b 289
5ce18635
AM
290%package sd
291Summary: Bacula Storage services
6a00efc0 292Summary(pl.UTF-8): Usługi Bacula Storage
5ce18635 293Group: Networking/Utilities
237bfacd 294Requires(post): sed >= 4.0
74c2ad1c 295Requires: %{name}-common = %{version}-%{release}
377f2efa 296Requires: systemd-units >= 38
82139dcc 297Suggests: mtx
329073aa 298Conflicts: dvd+rw-tools <= 5.21.4.10.8-1
5ce18635
AM
299
300%description sd
301Bacula - It comes by night and sucks the vital essence from your
302computers.
303
304Bacula Storage services consist of the software programs that perform
305the storage and recovery of the file attributes and data to the
306physical backup media or volumes. In other words, the Storage daemon
307is responsible for reading and writing your tapes (or other storage
308media, e.g. files). The Storage services runs as a daemon on the
309machine that has the backup device (usually a tape drive).
bb6e7dc5 310
192fbfcf
JR
311%description sd -l pl.UTF-8
312Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
cc01862b 313
192fbfcf
JR
314Usługi Bacula Storage składają się z programów obsługujących
315przechowywanie danych oraz odzyskiwanie atrybutów i danych na
168306e6
ER
316fizycznych nośnikach lub wolumenach. Innymi słowy, demon Storage jest
317odpowiedzialny za odczyt i zapis taśm (lub innych nośników do
318przechowywania danych, np. plików). Usługi Storage działają jako demon
319na maszynie, która zawiera urządzenie backupowe (zwykle napęd
192fbfcf 320taśmowy).
cc01862b 321
41bc1b6e
JK
322%package db-postgresql
323Summary: PostgreSQL database driver for Bacula
324Summary(pl.UTF-8): Sterownik bazy PostgreSQL dla Baculi
325Group: Networking/Utilities
326Requires(post): /sbin/ldconfig
74c2ad1c
ER
327Requires: %{name}-common = %{version}-%{release}
328Provides: bacula(db) = %{version}-%{release}
168306e6 329Obsoletes: bacula(db)
41bc1b6e
JK
330
331%description db-postgresql
332PostgreSQL database driver for Bacula.
333
334%description db-postgresql -l pl.UTF-8
335Sterownik bazy PostgreSQL dla Baculi.
336
337%package db-mysql
338Summary: MySQL database driver for Bacula
339Summary(pl.UTF-8): Sterownik bazy MySQL dla Baculi
340Group: Networking/Utilities
341Requires(post): /sbin/ldconfig
74c2ad1c
ER
342Requires: %{name}-common = %{version}-%{release}
343Provides: bacula(db) = %{version}-%{release}
168306e6 344Obsoletes: bacula(db)
41bc1b6e
JK
345
346%description db-mysql
347MySQL database driver for Bacula.
348
349%description db-mysql -l pl.UTF-8
350Sterownik bazy MySQL dla Baculi.
351
352%package db-sqlite3
353Summary: SQLite database driver for Bacula
354Summary(pl.UTF-8): Sterownik bazy SQLite dla Baculi
355Group: Networking/Utilities
356Requires(post): /sbin/ldconfig
74c2ad1c
ER
357Requires: %{name}-common = %{version}-%{release}
358Provides: bacula(db) = %{version}-%{release}
168306e6 359Obsoletes: bacula(db)
41bc1b6e
JK
360
361%description db-sqlite3
362SQLite database driver for Bacula.
363
364%description db-sqlite3 -l pl.UTF-8
365Sterownik bazy SQLite dla Baculi.
366
b0473ed3
ER
367%package -n nagios-plugin-check_bacula
368Summary: Nagios plugin to check bacula
369Group: Networking
370Requires: nagios-common
371
372%description -n nagios-plugin-check_bacula
373Nagios plugin to check bacula.
374
77ce6669 375%define _noautoreq libbaccats-%{version}.so
82139dcc 376# provided by various db libraries as a symlink
77ce6669 377
bb6e7dc5 378%prep
c0d46bda 379%setup -q
0a03f92d 380%patch0 -p1
53a3431c 381%patch1 -p1
cf0cfe65 382%patch2 -p1
ecb9bab1 383%patch3 -p1
e740cd49 384%patch4 -p1
cf50297e 385
10650249
AM
386sed -i -e 's#bindir=.*#bindir=%{_bindir}#g' \
387 src/cats/create_* src/cats/delete_* src/cats/drop_* \
388 src/cats/grant_* src/cats/make_* src/cats/update_*
237bfacd 389sed -i -e 's/@hostname@/--hostname--/' src/*/*.conf.in
efb15923 390sed -i -e 's/@basename@/--hostname--/' src/*/*.conf.in
bb6e7dc5
AM
391
392%build
4a39c080 393cd autoconf
c0d46bda
JK
394%{__aclocal} -I bacula-macros -I gettext-macros -I libtool
395## $BUILD_DIR not seen by libtoolize, export it
396#BUILD_DIR=.. %%{__libtoolize}
4a39c080 397cd ..
cf50297e
AM
398%{__autoconf} --prepend-include=$(pwd)/autoconf autoconf/configure.in > configure
399
dae3a0bd
JK
400CPPFLAGS="-I/usr/include/ncurses -I%{_includedir}/readline"
401
5df0c27c 402QMAKE=%{_bindir}/qmake-qt4 \
53a3431c 403%configure \
c0d46bda 404 DISTNAME=pld-linux \
53a3431c 405 --with-scriptdir=%{_libexecdir}/%{name} \
dae4f8f4 406 %{?with_qt:--enable-bat} \
53a3431c
AM
407 --disable-conio \
408 --enable-smartalloc \
53a3431c
AM
409 --with-readline \
410 --with-tcp-wrappers \
411 --with-working-dir=%{_var}/lib/%{name} \
412 --with-dump-email="root@localhost" \
413 --with-job-email="root@localhost" \
414 --with-smtp-host=localhost \
415 --with-pid-dir=/var/run \
416 --with-subsys-dir=/var/lock/subsys \
82139dcc 417 --with-systemd=%{systemdunitdir} \
53a3431c
AM
418 --enable-batch-insert \
419 %{?with_pgsql:--with-postgresql} \
420 %{?with_mysql:--with-mysql} \
421 %{?with_sqlite3:--with-sqlite3} \
422 %{?with_sqlite3_sync_off:--enable-extra-sqlite3-init="pragma synchronous=0;"} \
423 --with-dir-password="#FAKE-dir-password#" \
424 --with-fd-password="#FAKE-fd-password#" \
425 --with-sd-password="#FAKE-sd-password#" \
426 --with-mon-dir-password="#FAKE-mon-dir-password#" \
427 --with-mon-fd-password="#FAKE-mon-fd-password#" \
428 --with-mon-sd-password="#FAKE-mon-sd-password#" \
429 --with-openssl
bb6e7dc5 430
dae4f8f4 431%if %{with qt}
b8003eec
JK
432cd src/qt-console
433qmake-qt4 bat.pro
434cd ../..
435%endif
436
ffb67df4
AM
437%{__make} 2>&1 | tee log
438# check for build errors
439grep "Error in" log && exit 1
b8003eec 440
b0473ed3
ER
441%if %{with nagios}
442# nagios plugin
443%{__make} -C examples/nagios/check_bacula
444%endif
445
bb6e7dc5
AM
446%install
447rm -rf $RPM_BUILD_ROOT
b6e1a6b6 448install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,logrotate.d,pam.d,sysconfig} \
b6e1a6b6 449 $RPM_BUILD_ROOT{%{_pixmapsdir},%{_desktopdir}} \
3f2aae08 450 $RPM_BUILD_ROOT{%{_mandir},%{_bindir},/var/log{,/archive}/bacula} \
b6e1a6b6 451 $RPM_BUILD_ROOT%{systemdunitdir}
bb6e7dc5
AM
452
453%{__make} install \
454 DESTDIR=$RPM_BUILD_ROOT
455
21838166
AM
456# create copies of make_catalog_backup for specific databases; zeore default one (will be ghost)
457for database in %{databases}; do
458 sed -e "s#default_db_type=.*#default_db_type=${database}#g" \
459 $RPM_BUILD_ROOT%{_libdir}/%{name}/make_catalog_backup \
460 > $RPM_BUILD_ROOT%{_libdir}/%{name}/make_${database}_catalog_backup
461 chmod 755 $RPM_BUILD_ROOT%{_libdir}/%{name}/make_${database}_catalog_backup
462done
463:> $RPM_BUILD_ROOT%{_libdir}/%{name}/make_catalog_backup
464
5a48616e 465# we use db dependant (at compile time) shell script only
53a3431c 466rm $RPM_BUILD_ROOT%{_libexecdir}/%{name}/make_catalog_backup.pl
5a48616e 467
53a3431c 468## replace with empty file, replaced by ldconfig from each db-* package on intsall
21838166
AM
469rm $RPM_BUILD_ROOT%{_libdir}/libbaccats-%{version}.so
470touch $RPM_BUILD_ROOT%{_libdir}/libbaccats-%{version}.so
aa70ead8 471
8b9ffa69
ER
472install -p %{SOURCE10} $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-dir
473install -p %{SOURCE11} $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-fd
474install -p %{SOURCE12} $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-sd
475cp -a %{SOURCE13} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}-dir
476cp -a %{SOURCE14} $RPM_BUILD_ROOT/etc/sysconfig/bacula-dir
477cp -a %{SOURCE15} $RPM_BUILD_ROOT/etc/sysconfig/bacula-fd
478cp -a %{SOURCE16} $RPM_BUILD_ROOT/etc/sysconfig/bacula-sd
b6e1a6b6
JK
479cp -a %{SOURCE17} $RPM_BUILD_ROOT%{systemdunitdir}/bacula-dir.service
480cp -a %{SOURCE18} $RPM_BUILD_ROOT%{systemdunitdir}/bacula-fd.service
481cp -a %{SOURCE19} $RPM_BUILD_ROOT%{systemdunitdir}/bacula-sd.service
d907cd57 482
dae4f8f4 483%if %{with qt}
37bd6446
ER
484# qmake somewhy does not always create install_bins target. install our own the bin
485rm -f $RPM_BUILD_ROOT%{_sbindir}/bat
486libtool --silent --mode=install install src/qt-console/bat $RPM_BUILD_ROOT%{_bindir}
8edc54f3 487cp -a scripts/bacula.png $RPM_BUILD_ROOT%{_pixmapsdir}/bacula.png
b0473ed3 488cp -a scripts/bat.desktop $RPM_BUILD_ROOT%{_desktopdir}
304bb97e
AM
489%endif
490
3c0eac7c
AM
491touch $RPM_BUILD_ROOT/var/log/bacula/log
492
2f8e46d4
ER
493# install the updatedb scripts for older versions that last full release
494# 2.0 -> 3.0 : 10_to_11
21838166 495# 5.0 -> 5.2 : 12_to_14
2f8e46d4 496install -p updatedb/update_*_tables_10_to_11 $RPM_BUILD_ROOT%{_libexecdir}/%{name}
21838166 497install -p updatedb/update_*_tables_11_to_12 $RPM_BUILD_ROOT%{_libexecdir}/%{name}
d907cd57 498
237bfacd
JK
499# place for site passwords
500touch $RPM_BUILD_ROOT%{_sysconfdir}/{dir-password,fd-password,sd-password}
501touch $RPM_BUILD_ROOT%{_sysconfdir}/{mon-dir-password,mon-fd-password,mon-sd-password}
bb6e7dc5 502
5a48616e 503mv $RPM_BUILD_ROOT%{_libexecdir}/%{name}/mtx-changer.conf $RPM_BUILD_ROOT%{_sysconfdir}/mtx-changer.conf
0a03f92d 504
1a72afd2
AM
505# some file changes
506rm -f $RPM_BUILD_ROOT%{_libexecdir}/%{name}/{gconsole,startmysql,stopmysql,bacula,bconsole,fd}
1a72afd2 507
8ba087a4
ER
508rm $RPM_BUILD_ROOT%{_docdir}/bacula/ChangeLog
509rm $RPM_BUILD_ROOT%{_docdir}/bacula/INSTALL
510rm $RPM_BUILD_ROOT%{_docdir}/bacula/LICENSE
511rm $RPM_BUILD_ROOT%{_docdir}/bacula/README
512rm $RPM_BUILD_ROOT%{_docdir}/bacula/ReleaseNotes
513rm $RPM_BUILD_ROOT%{_docdir}/bacula/VERIFYING
8ba087a4 514
7545e94f
JK
515# startup scripts, those in /etc/rc.d/init.d are better
516rm $RPM_BUILD_ROOT%{_sbindir}/bacula
517rm $RPM_BUILD_ROOT%{_libexecdir}/%{name}/bacula-ctl-*
518
41bc1b6e 519# unsupported
8fb2ca23 520rm $RPM_BUILD_ROOT%{_libexecdir}/%{name}/btraceback.mdb
41bc1b6e 521
7545e94f
JK
522# rename to avoid possible conflicts
523mv $RPM_BUILD_ROOT%{_sbindir}/{,bacula-}dbcheck
524mv $RPM_BUILD_ROOT%{_mandir}/man8/{,bacula-}dbcheck.8.gz
525
526# no -devel files packaged, so this is also useless
c0d46bda 527rm $RPM_BUILD_ROOT%{_libdir}/libbac{,cfg,find,sql,cats}.{so,la}
fe739daa
JK
528#rm $RPM_BUILD_ROOT%{_libdir}/libbaccats*.{so,la}
529%{?with_mysql:rm $RPM_BUILD_ROOT%{_libdir}/libbaccats-mysql.{la,so}}
530%{?with_pgsql:rm $RPM_BUILD_ROOT%{_libdir}/libbaccats-postgresql.{la,so}}
531%{?with_sqlite3:rm $RPM_BUILD_ROOT%{_libdir}/libbaccats-sqlite3.{la,so}}
7545e94f 532
b0473ed3 533%if %{with nagios}
819cd4b0 534install -d $RPM_BUILD_ROOT%{nagiosplugindir}
b0473ed3
ER
535%{__make} -C examples/nagios/check_bacula install \
536 sbindir=%{nagiosplugindir} \
537 DESTDIR=$RPM_BUILD_ROOT
538%endif
7545e94f 539
f2337569
JB
540%clean
541rm -rf $RPM_BUILD_ROOT
542
5ce18635 543%pre common
fbc59152
ER
544%groupadd -P %{name}-common -g 136 -r -f bacula
545%useradd -P %{name}-common -u 136 -r -d /var/lib/bacula -s /bin/false -c "Bacula User" -g bacula bacula
5ce18635 546
b8003eec 547%define update_configs \
210f992b 548echo "Updating bacula passwords and names..." | %banner -a %{name} \
5a48616e 549cd %{_sysconfdir} \
2f8e46d4
ER
550for f in *-password; do \
551 if [ ! -s $f ]; then \
b8003eec
JK
552 openssl rand -base64 33 > $f \
553 fi \
2f8e46d4
ER
554 p=$(cat $f) \
555 for cf in *.conf *.conf.rpmnew; do \
b8003eec
JK
556 [ -f $cf ] && sed -i -e"s:#FAKE-$f#:$p:" "$cf" || : \
557 done \
558done \
2f8e46d4 559for cf in *.conf *.conf.rpmnew; do \
b8003eec
JK
560 [ -f $cf ] && sed -i -e"s:--hostname--:`hostname`:" "$cf" || : \
561done
562
237bfacd 563%post common
0a03f92d 564/sbin/ldconfig
b8003eec 565%update_configs
237bfacd 566
5ce18635 567%postun common
0a03f92d 568/sbin/ldconfig
28c9f5d0
AM
569if [ "$1" = "0" ]; then
570 %userremove bacula
571 %groupremove bacula
572fi
5ce18635 573
e31a1707 574%triggerpostun dir -- %{name}-dir < %{version}-0
b8003eec
JK
575%banner bacula-dir -t3 <<EOF
576You have upgraded from an older version of Bacula director.
bb6e7dc5 577
b8003eec
JK
578You will probably need to call %{_libexecdir}/%{name}/update_bacula_tables
579script to upgrade the database.
f0b67fde
ER
580
581Ensure you database partition has enough free space before you run the upgrade,
582i.e check that there is enough room to rebuild 'File' table (it is the largest
583in bacula db).
584
b8003eec 585EOF
237bfacd 586
b8003eec
JK
587%post dir
588%update_configs
1a72afd2 589/sbin/chkconfig --add bacula-dir
52504a6d 590%service bacula-dir restart "Bacula Director daemon"
b6e1a6b6 591%systemd_post bacula-dir.service
bb6e7dc5 592
5ce18635 593%preun dir
1a72afd2 594if [ "$1" = "0" ]; then
52504a6d 595 %service bacula-dir stop
9aa69d51 596 /sbin/chkconfig --del bacula-dir
1a72afd2 597fi
b6e1a6b6
JK
598%systemd_preun bacula-dir.service
599
600%postun dir
601%systemd_reload
bb6e7dc5 602
5ce18635 603%post fd
b8003eec 604%update_configs
1a72afd2 605/sbin/chkconfig --add bacula-fd
52504a6d 606%service bacula-fd restart "Bacula File daemon"
b6e1a6b6 607%systemd_post bacula-fd.service
bb6e7dc5 608
5ce18635 609%preun fd
1a72afd2 610if [ "$1" = "0" ]; then
52504a6d 611 %service bacula-fd stop
9aa69d51 612 /sbin/chkconfig --del bacula-fd
1a72afd2 613fi
b6e1a6b6
JK
614%systemd_preun bacula-fd.service
615
616%postun fd
617%systemd_reload
5ce18635
AM
618
619%post sd
b8003eec 620%update_configs
1a72afd2 621/sbin/chkconfig --add bacula-sd
52504a6d 622%service bacula-sd restart "Bacula Storage daemon"
b6e1a6b6 623%systemd_post bacula-sd.service
bb6e7dc5 624
5ce18635 625%preun sd
1a72afd2 626if [ "$1" = "0" ]; then
52504a6d 627 %service bacula-sd stop
9aa69d51 628 /sbin/chkconfig --del bacula-sd
1a72afd2 629fi
b6e1a6b6
JK
630%systemd_preun bacula-sd.service
631
632%postun sd
633%systemd_reload
5ce18635
AM
634
635%pre console
636if [ -e %{_sysconfdir}/console.conf -a ! -e %{_sysconfdir}/bconsole.conf ]; then
9aa69d51 637 mv %{_sysconfdir}/console.conf %{_sysconfdir}/bconsole.conf
bb6e7dc5
AM
638fi
639
237bfacd 640%post console
b8003eec 641%update_configs
237bfacd 642
827db798 643%triggerpostun common -- %{name}-common < 5.0.1-2
44069e22 644find %{_sysconfdir}/bat.conf* -perm /007 -print0 2>/dev/null | xargs -0 -r chmod 600 || :
3a5cd5d7 645
348912a8 646%post console-qt
b8003eec 647%update_configs
304bb97e 648
237bfacd 649%post tray-monitor
b8003eec 650%update_configs
bb6e7dc5 651
41bc1b6e
JK
652%define db_post() \
653/sbin/ldconfig \
b0473ed3 654for name in "create database" "drop tables" "drop database" "grant privileges" "make tables" "update tables"; do \
41bc1b6e
JK
655 prefix="${name%% *}" \
656 suffix="${name#* }" \
b0473ed3 657 ln -sf "${prefix}_%{1}_${suffix}" %{_libexecdir}/%{name}/"${prefix}_bacula_${suffix}" || : \
dae3a0bd 658done \
5a48616e 659ln -sf "make_%{1}_catalog_backup" %{_libexecdir}/%{name}/make_catalog_backup || : \
21838166 660ln -sf libbaccats-%{1}-%{version}.so %{_libdir}/libbaccats-%{version}.so || : \
dae3a0bd
JK
661%service bacula-dir restart "Bacula Director daemon"
662
41bc1b6e
JK
663%post db-postgresql
664%db_post postgresql
665
dfef965d 666%postun db-postgresql -p /sbin/ldconfig
dae3a0bd 667
41bc1b6e
JK
668%post db-mysql
669%db_post mysql
670
dfef965d 671%postun db-mysql -p /sbin/ldconfig
dae3a0bd 672
41bc1b6e
JK
673%post db-sqlite3
674%db_post sqlite3
675
dfef965d 676%postun db-sqlite3 -p /sbin/ldconfig
dae3a0bd 677
5ce18635
AM
678%files common
679%defattr(644,root,root,755)
237bfacd 680%doc LICENSE
1a72afd2 681%dir %{_sysconfdir}
1b0a2248 682%attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*-password
7545e94f
JK
683# do not remove bsmtp from files. Fix build if it is not installed.
684%attr(755,root,root) %{_sbindir}/bsmtp
7425cb9d 685%attr(755,root,root) %{_sbindir}/btraceback
c0d46bda
JK
686%attr(755,root,root) %{_libdir}/libbac-7*.so
687%attr(755,root,root) %{_libdir}/libbaccfg-7*.so
688%attr(755,root,root) %{_libdir}/libbacfind-7*.so
689%attr(755,root,root) %{_libdir}/libbacsql-7*.so
c74b041d 690%{_mandir}/man8/bacula.8*
7425cb9d
JK
691%{_mandir}/man1/bsmtp.1*
692%{_mandir}/man8/btraceback.8*
5ce18635 693%dir %{_libexecdir}/%{name}
1376b552 694%{_libexecdir}/%{name}/btraceback.dbx
5ce18635 695%{_libexecdir}/%{name}/btraceback.gdb
7545e94f 696%{_libexecdir}/%{name}/bacula_config
d6dbe33c 697%attr(770,root,bacula) %dir %{_localstatedir}
3c0eac7c
AM
698%attr(750,bacula,logs) %dir /var/log/bacula
699%attr(640,bacula,logs) %ghost /var/log/bacula/log
3f2aae08 700%attr(750,bacula,logs) %dir /var/log/archive/bacula
5ce18635
AM
701
702%files dir
bb6e7dc5 703%defattr(644,root,root,755)
c0d46bda 704%doc ChangeLog ReleaseNotes LICENSE
28647453 705#%doc examples %{name}-docs-%{version}/manual/{*.pdf,bacula}
cc515592 706%attr(640,root,bacula) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bacula-dir.conf
28c9f5d0 707%attr(640,root,root) %config(noreplace) /etc/logrotate.d/bacula-dir
1a72afd2 708%attr(754,root,root) /etc/rc.d/init.d/bacula-dir
cd23ba7c 709%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/bacula-dir
b6e1a6b6 710%{systemdunitdir}/bacula-dir.service
5ff0b6a3 711%attr(755,root,root) %{_sbindir}/bacula-dir
7545e94f
JK
712%attr(755,root,root) %{_sbindir}/bregex
713%attr(755,root,root) %{_sbindir}/bwild
714%attr(755,root,root) %{_sbindir}/bacula-dbcheck
79d0fef6 715%{_mandir}/man8/bacula-dir.8*
7545e94f 716%{_mandir}/man8/bacula-dbcheck.8*
3f7627bd
AM
717%{_mandir}/man8/bregex.8*
718%{_mandir}/man8/bwild.8*
79d0fef6 719%{_libexecdir}/%{name}/query.sql
5a48616e 720%attr(755,root,root) %{_libexecdir}/%{name}/delete_catalog_backup
41bc1b6e 721
722880a5 722%if %{with pgsql}
41bc1b6e
JK
723%files db-postgresql
724%defattr(644,root,root,755)
725%attr(755,root,root) %{_libexecdir}/%{name}/create_postgresql_database
726%attr(755,root,root) %{_libexecdir}/%{name}/drop_postgresql_database
727%attr(755,root,root) %{_libexecdir}/%{name}/drop_postgresql_tables
728%attr(755,root,root) %{_libexecdir}/%{name}/grant_postgresql_privileges
729%attr(755,root,root) %{_libexecdir}/%{name}/make_postgresql_tables
730%attr(755,root,root) %{_libexecdir}/%{name}/update_postgresql_*
21838166 731%attr(755,root,root) %{_libexecdir}/%{name}/make_postgresql_catalog_backup
c0d46bda 732%attr(755,root,root) %{_libdir}/libbaccats-postgresql-7*.so
41bc1b6e 733
c0d46bda 734%ghost %attr(755,root,root) %{_libdir}/libbaccats-7*.so
41bc1b6e
JK
735%ghost %{_libexecdir}/%{name}/create_bacula_database
736%ghost %{_libexecdir}/%{name}/drop_bacula_tables
737%ghost %{_libexecdir}/%{name}/drop_bacula_database
738%ghost %{_libexecdir}/%{name}/grant_bacula_privileges
739%ghost %{_libexecdir}/%{name}/make_bacula_tables
740%ghost %{_libexecdir}/%{name}/update_bacula_tables
21838166 741%ghost %{_libexecdir}/%{name}/make_catalog_backup
722880a5 742%endif
41bc1b6e 743
722880a5 744%if %{with mysql}
41bc1b6e
JK
745%files db-mysql
746%defattr(644,root,root,755)
aeaed87e 747%attr(755,root,root) %{_libexecdir}/%{name}/create_mysql_database
748%attr(755,root,root) %{_libexecdir}/%{name}/drop_mysql_database
749%attr(755,root,root) %{_libexecdir}/%{name}/drop_mysql_tables
750%attr(755,root,root) %{_libexecdir}/%{name}/grant_mysql_privileges
751%attr(755,root,root) %{_libexecdir}/%{name}/make_mysql_tables
752%attr(755,root,root) %{_libexecdir}/%{name}/update_mysql_*
21838166 753%attr(755,root,root) %{_libexecdir}/%{name}/make_mysql_catalog_backup
c0d46bda 754%attr(755,root,root) %{_libdir}/libbaccats-mysql-7*.so
41bc1b6e 755
c0d46bda 756%ghost %attr(755,root,root) %{_libdir}/libbaccats-7*.so
41bc1b6e
JK
757%ghost %{_libexecdir}/%{name}/create_bacula_database
758%ghost %{_libexecdir}/%{name}/drop_bacula_tables
759%ghost %{_libexecdir}/%{name}/drop_bacula_database
760%ghost %{_libexecdir}/%{name}/grant_bacula_privileges
761%ghost %{_libexecdir}/%{name}/make_bacula_tables
762%ghost %{_libexecdir}/%{name}/update_bacula_tables
21838166 763%ghost %{_libexecdir}/%{name}/make_catalog_backup
722880a5 764%endif
41bc1b6e 765
722880a5 766%if %{with sqlite3}
41bc1b6e
JK
767%files db-sqlite3
768%defattr(644,root,root,755)
769%attr(755,root,root) %{_libexecdir}/%{name}/create_sqlite3_database
770%attr(755,root,root) %{_libexecdir}/%{name}/drop_sqlite3_database
771%attr(755,root,root) %{_libexecdir}/%{name}/drop_sqlite3_tables
772%attr(755,root,root) %{_libexecdir}/%{name}/grant_sqlite3_privileges
773%attr(755,root,root) %{_libexecdir}/%{name}/make_sqlite3_tables
774%attr(755,root,root) %{_libexecdir}/%{name}/update_sqlite3_*
21838166 775%attr(755,root,root) %{_libexecdir}/%{name}/make_sqlite3_catalog_backup
c0d46bda 776%attr(755,root,root) %{_libdir}/libbaccats-sqlite3-7*.so
41bc1b6e 777
c0d46bda 778%ghost %attr(755,root,root) %{_libdir}/libbaccats-7*.so
41bc1b6e
JK
779%ghost %{_libexecdir}/%{name}/create_bacula_database
780%ghost %{_libexecdir}/%{name}/drop_bacula_tables
781%ghost %{_libexecdir}/%{name}/drop_bacula_database
782%ghost %{_libexecdir}/%{name}/grant_bacula_privileges
783%ghost %{_libexecdir}/%{name}/make_bacula_tables
784%ghost %{_libexecdir}/%{name}/update_bacula_tables
21838166 785%ghost %{_libexecdir}/%{name}/make_catalog_backup
722880a5 786%endif
41bc1b6e 787
5ce18635
AM
788%files fd
789%defattr(644,root,root,755)
237bfacd 790%doc LICENSE
efb15923 791%attr(640,root,bacula) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bacula-fd.conf
1a72afd2 792%attr(754,root,root) /etc/rc.d/init.d/bacula-fd
cd23ba7c 793%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/bacula-fd
b6e1a6b6 794%{systemdunitdir}/bacula-fd.service
5ff0b6a3 795%attr(755,root,root) %{_sbindir}/bacula-fd
7545e94f 796%attr(755,root,root) %{_libdir}/bpipe-fd.so
79d0fef6 797%{_mandir}/man8/bacula-fd.8*
5ce18635
AM
798
799%files sd
800%defattr(644,root,root,755)
237bfacd 801%doc LICENSE
efb15923 802%attr(640,root,bacula) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bacula-sd.conf
803%attr(640,root,bacula) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mtx-changer.conf
1a72afd2 804%attr(754,root,root) /etc/rc.d/init.d/bacula-sd
cd23ba7c 805%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/bacula-sd
b6e1a6b6 806%{systemdunitdir}/bacula-sd.service
5ff0b6a3
AM
807%attr(755,root,root) %{_sbindir}/bacula-sd
808%attr(755,root,root) %{_sbindir}/bcopy
809%attr(755,root,root) %{_sbindir}/bextract
810%attr(755,root,root) %{_sbindir}/bls
811%attr(755,root,root) %{_sbindir}/bscan
812%attr(755,root,root) %{_sbindir}/btape
329073aa 813%attr(755,root,root) %{_libexecdir}/%{name}/mtx-changer
150db1c2 814%attr(755,root,root) %{_libexecdir}/%{name}/disk-changer
329073aa 815%attr(755,root,root) %{_libexecdir}/%{name}/dvd-handler
5ce18635 816%{_mandir}/man8/bacula-sd.8*
7425cb9d
JK
817%{_mandir}/man8/bcopy.8*
818%{_mandir}/man8/bextract.8*
819%{_mandir}/man8/bls.8*
820%{_mandir}/man8/bscan.8*
821%{_mandir}/man8/btape.8*
5ce18635
AM
822
823%files console
bb6e7dc5 824%defattr(644,root,root,755)
237bfacd 825%doc LICENSE
efb15923 826%attr(640,root,bacula) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bconsole.conf
1a72afd2 827%attr(755,root,root) %{_sbindir}/bconsole
7425cb9d 828%{_mandir}/man8/bconsole.8*
5ce18635 829
dae4f8f4 830%if %{with qt}
348912a8 831%files console-qt
304bb97e
AM
832%defattr(644,root,root,755)
833%doc LICENSE
834%{_pixmapsdir}/%{name}.png
835%{_desktopdir}/bat.desktop
2264d68c 836# Do not make this file world-readable or any user will get full access to the
b0473ed3 837# backup system
2264d68c
JK
838%attr(640,root,bacula) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bat.conf
839%attr(755,root,root) %{_bindir}/bat
304bb97e 840%{_mandir}/man1/bat.1*
7545e94f 841%{_docdir}/%{name}
304bb97e
AM
842%endif
843
b0473ed3
ER
844%if %{with nagios}
845%files -n nagios-plugin-check_bacula
846%defattr(644,root,root,755)
847%attr(755,root,root) %{nagiosplugindir}/check_bacula
848%endif
This page took 0.464982 seconds and 4 git commands to generate.