]> git.pld-linux.org Git - packages/bacula.git/blame - bacula.spec
- outdated
[packages/bacula.git] / bacula.spec
CommitLineData
237bfacd
JK
1# TODO:
2# - update desktop files, think about su-wrappers for console
2b68b0cb 3# - package web admin
2007449a 4# - fix log file permissions
2b68b0cb 5#
f2527d22 6# Conditional build:
2b68b0cb
AM
7%bcond_without console_wx # wx-console program
8%bcond_without gnome # gnome-console program
a0e7dec7 9%bcond_without sqlite # use sqlite
c19580f6 10%bcond_with bat # bat Qt4 GUI
a0e7dec7 11%bcond_with mysql # use mysql
e090896a 12%bcond_with pgsql # use PostgreSQL
2b68b0cb
AM
13%bcond_with python
14%bcond_with rescue
7425cb9d 15%bcond_with sqlite3 # use sqlite3 insted sqlite
aa6db71e 16%bcond_with sqlite3_sync_off # makes sqlite3 backend much faster, but less reliable
e090896a
JK
17%if %{with sqlite}
18%define _database sqlite
19%endif
20%if %{with sqlite3}
21%define _database sqlite3
22%undefine with_sqlite
23%undefine with_mysql
24%undefine with_pgsql
25%endif
26%if %{with pgsql}
27%define _database postgresql
28%undefine with_sqlite
29%undefine with_sqlite3
30%undefine with_mysql
31%endif
aeaed87e 32%if %{with mysql}
e090896a 33%define _database mysql
aeaed87e 34%undefine with_sqlite
35%undefine with_sqlite3
e090896a 36%undefine with_pgsql
aeaed87e 37%undefine with_sqlite3_sync_off
38%endif
f2527d22 39#
bb6e7dc5 40Summary: Bacula - The Network Backup Solution
6a00efc0 41Summary(pl.UTF-8): Bacula - rozwiązanie do wykonywania kopii zapasowych po sieci
bb6e7dc5 42Name: bacula
87cf07e8 43Version: 2.2.5
44Release: 0.1
5ce18635 45Epoch: 0
237bfacd 46License: extended GPL v2
52504a6d 47Group: Networking/Utilities
bb6e7dc5 48Source0: http://dl.sourceforge.net/bacula/%{name}-%{version}.tar.gz
87cf07e8 49# Source0-md5: 175a796b96c28fc28cbedb1dc881826f
41ac7784 50Source1: http://dl.sourceforge.net/bacula/%{name}-docs-%{version}.tar.bz2
87cf07e8 51# Source1-md5: 578e4221afd009d711f1430e392823d6
52Source2: http://dl.sourceforge.net/bacula/%{name}-rescue-%{version}.tar.gz
53# Source2-md5: 266e3e814482c2c33e071607cb25d38f
5ce18635
AM
54Source10: %{name}-dir.init
55Source11: %{name}-fd.init
56Source12: %{name}-sd.init
57Source13: %{name}.logrotate
4280e495
JK
58Source14: %{name}-dir.sysconfig
59Source15: %{name}-fd.sysconfig
60Source16: %{name}-sd.sysconfig
329073aa 61Patch0: %{name}-dvd-handler_path.patch
38a7d6ba
JK
62Patch1: %{name}-link.patch
63Patch2: %{name}-compile.patch
64Patch3: %{name}-wx28.patch
aa6db71e 65Patch4: %{name}-sqlite3_init_query.patch
bb6e7dc5 66URL: http://www.bacula.org/
cc01862b 67BuildRequires: acl-static
f2337569 68BuildRequires: automake
7425cb9d
JK
69%if %{with rescue}
70BuildRequires: fakeroot
71%endif
cc01862b 72BuildRequires: glibc-static
e75759f3 73%if %{with gnome}
237bfacd
JK
74BuildRequires: libgnome-devel >= 2.0
75BuildRequires: libgnomeui-devel >= 2.0
e75759f3 76%endif
cc01862b
JB
77BuildRequires: libstdc++-static
78BuildRequires: libwrap-static
d907cd57 79BuildRequires: mtx
cc01862b 80BuildRequires: ncurses-devel
bb6e7dc5 81BuildRequires: openssl-devel
c74b041d 82BuildRequires: openssl-static
bb6e7dc5 83BuildRequires: pkgconfig
7425cb9d
JK
84%if %{with python}
85BuildRequires: python-static
86%endif
c19580f6 87%if %{with bat}
e3dd858d 88BuildRequires: qwt-devel
89BuildRequires: QtGui-devel
c19580f6 90%endif
bb6e7dc5 91BuildRequires: readline-devel
52504a6d 92BuildRequires: rpmbuild(macros) >= 1.268
cc01862b 93BuildRequires: sed >= 4.0
aeaed87e 94%{?with_sqlite3:BuildRequires: sqlite3-devel}
95%{?with_sqlite:BuildRequires: sqlite-devel}
96%{?with_mysql:BuildRequires: mysql-devel}
e090896a 97%{?with_pgsql:BuildRequires: postgresql-devel}
1376b552 98%if %{with console_wx}
7425cb9d 99BuildRequires: wxGTK2-unicode-devel >= 2.4.0
1376b552 100%endif
bb6e7dc5 101BuildRequires: zlib-devel
1376b552 102BuildRequires: zlib-static
bb6e7dc5
AM
103BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
104
105%define _sysconfdir /etc/%{name}
1a72afd2 106%define _localstatedir /var/lib/%{name}
bb6e7dc5 107
b60fe5cb
ER
108# dependency section is broken. ccache usage is instead to makefiles
109%undefine with_ccache
110
bb6e7dc5
AM
111%description
112Bacula - It comes by night and sucks the vital essence from your
113computers.
114
115Bacula is a set of computer programs that permit you (or the system
116administrator) to manage backup, recovery, and verification of
117computer data across a network of computers of different kinds. In
118technical terms, it is a network client/server based backup program.
119Bacula is relatively easy to use and efficient, while offering many
120advanced storage management features that make it easy to find and
5ce18635 121recover lost or damaged files.
bb6e7dc5 122
192fbfcf
JR
123%description -l pl.UTF-8
124Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
cc01862b 125
192fbfcf
JR
126Bacula to zbiór programów umożliwiających administratorowi na
127zarządzanie kopiami zapasowymi, odzyskiwaniem i weryfikacją danych w
128sieci komputerów różnego rodzaju. W terminologii technicznej jest to
129program do kopii zapasowych pracujący w architekturze klient-serwer.
130Bacula jest stosunkowo łatwa w użyciu i wydajna, oferując przy tym
131wiele zaawansowanych możliwości przy zarządzaniu nośnikami,
132ułatwiających znalezienie i odzyskanie utraconych lub uszkodzonych
133plików.
cc01862b 134
5ce18635
AM
135%package common
136Summary: Common files for bacula package
6a00efc0 137Summary(pl.UTF-8): Pliki wspólne dla pakietu bacula
bb6e7dc5 138Group: Networking/Utilities
237bfacd
JK
139Requires(post): openssl-tools
140Requires(post): sed >= 4.0
1bd568e8 141Requires(post,preun): /sbin/chkconfig
65253ffd
JK
142Requires(postun): /usr/sbin/groupdel
143Requires(postun): /usr/sbin/userdel
1b0a2248 144Requires(pre): /usr/sbin/groupadd
145Requires(pre): /usr/sbin/useradd
abdcd1c5
JB
146Conflicts: bacula-console < 0:1.34.6
147Conflicts: bacula-dir < 0:1.34.6
148Conflicts: bacula-fd < 0:1.34.6
149Conflicts: bacula-sd < 0:1.34.6
bb6e7dc5 150
5ce18635 151%description common
bb6e7dc5
AM
152Bacula - It comes by night and sucks the vital essence from your
153computers.
154
155Bacula is a set of computer programs that permit you (or the system
156administrator) to manage backup, recovery, and verification of
157computer data across a network of computers of different kinds. In
158technical terms, it is a network client/server based backup program.
159Bacula is relatively easy to use and efficient, while offering many
160advanced storage management features that make it easy to find and
5ce18635 161recover lost or damaged files.
bb6e7dc5 162
192fbfcf
JR
163%description common -l pl.UTF-8
164Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
cc01862b 165
192fbfcf
JR
166Bacula to zbiór programów umożliwiających administratorowi na
167zarządzanie kopiami zapasowymi, odzyskiwaniem i weryfikacją danych w
168sieci komputerów różnego rodzaju. W terminologii technicznej jest to
169program do kopii zapasowych pracujący w architekturze klient-serwer.
170Bacula jest stosunkowo łatwa w użyciu i wydajna, oferując przy tym
171wiele zaawansowanych możliwości przy zarządzaniu nośnikami,
172ułatwiających znalezienie i odzyskanie utraconych lub uszkodzonych
173plików.
cc01862b 174
5ce18635
AM
175%package dir
176Summary: Bacula Director and Catalog services
6a00efc0 177Summary(pl.UTF-8): Usługi Bacula Director i Catalog
5ce18635 178Group: Networking/Utilities
237bfacd 179Requires(post): sed >= 4.0
abdcd1c5
JB
180Requires: %{name}-common = %{epoch}:%{version}-%{release}
181Obsoletes: bacula-updatedb
bb6e7dc5 182
5ce18635
AM
183%description dir
184Bacula - It comes by night and sucks the vital essence from your
185computers.
186
187Bacula Director is the program that supervises all the backup,
188restore, verify and archive operations. The system administrator uses
189the Bacula Director to schedule backups and to recover files. Catalog
190services are comprised of the software programs responsible for
191maintaining the file indexes and volume databases for all files backed
192up. The Catalog services permit the System Administrator or user to
193quickly locate and restore any desired file, since it maintains a
194record of all Volumes used, all Jobs run, and all Files saved. This
cece716a 195build requires sqlite%{?with_sqlite3:3} to be installed separately as the catalog
5ce18635
AM
196database.
197
192fbfcf
JR
198%description dir -l pl.UTF-8
199Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
cc01862b 200
192fbfcf 201Bacula Director to program nadzorujący wszystkie operacje wykonywania
cc01862b 202kopii zapasowych, odzyskiwania, weryfikacji i archiwizowania.
192fbfcf
JR
203Administrator używa Bacula Directora do szeregowania kopii zapasowych
204oraz odzyskiwania plików. Usługi katalogowe (Catalog services) są
205używane przez programy odpowiedzialne za zarządzanie indeksami plików
206i bazą danych wolumenów dla wszystkich kopiowanych plików. Usługi
207katalogowe umożliwiają administratorowi lub użytkownikowi szybko
208zlokalizować i odtworzyć dowolny plik, ponieważ utrzymują rekord ze
209wszystkimi używanymi wolumenami, uruchomionymi zadaniami i zapisanymi
e090896a 210plikami. Pakiet wymaga %{_database} zainstalowanego oddzielnie jako bazy
cc01862b
JB
211danych dla katalogu.
212
5ce18635
AM
213%package console
214Summary: Bacula Console
6a00efc0 215Summary(pl.UTF-8): Konsola Baculi
5ce18635 216Group: Networking/Utilities
237bfacd 217Requires(post): sed >= 4.0
abdcd1c5 218Requires: %{name}-common = %{epoch}:%{version}-%{release}
5ce18635
AM
219
220%description console
221Bacula - It comes by night and sucks the vital essence from your
222computers.
223
224Bacula Console is the program that allows the administrator or user to
225communicate with the Bacula Director. This is the text only console
226interface.
227
192fbfcf
JR
228%description console -l pl.UTF-8
229Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
cc01862b 230
192fbfcf
JR
231Bacula Console to program umożliwiający administratorowi lub
232użytkownikowi komunikowanie się z programem Bacula Director. To jest
cc01862b
JB
233interfejs czysto tekstowy.
234
5ce18635 235%package console-wx
cc01862b 236Summary: Bacula wxWidgets Console
6a00efc0 237Summary(pl.UTF-8): Konsola Baculi oparta na wxWidgets
5ce18635 238Group: Networking/Utilities
237bfacd 239Requires(post): sed >= 4.0
abdcd1c5 240Requires: %{name}-common = %{epoch}:%{version}-%{release}
5ce18635
AM
241
242%description console-wx
243Bacula - It comes by night and sucks the vital essence from your
244computers.
245
246Bacula Console is the program that allows the administrator or user to
cc01862b 247communicate with the Bacula Director. This is the wxWidgets GUI
5ce18635
AM
248interface.
249
192fbfcf
JR
250%description console-wx -l pl.UTF-8
251Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
cc01862b 252
192fbfcf
JR
253Bacula Console to program umożliwiający administratorowi lub
254użytkownikowi komunikowanie się z programem Bacula Director. To jest
cc01862b
JB
255interfejs graficzny oparty na wxWidgets.
256
237bfacd
JK
257%package console-gnome
258Summary: Bacula GNOME Console
6a00efc0 259Summary(pl.UTF-8): Konsola Baculi oparta dla GNOME
237bfacd 260Group: Networking/Utilities
237bfacd 261Requires(post): sed >= 4.0
abdcd1c5 262Requires: %{name}-common = %{epoch}:%{version}-%{release}
237bfacd
JK
263
264%description console-gnome
265Bacula - It comes by night and sucks the vital essence from your
266computers.
267
268Bacula Console is the program that allows the administrator or user to
1bd568e8 269communicate with the Bacula Director. This is the GNOME GUI interface.
237bfacd 270
192fbfcf
JR
271%description console-gnome -l pl.UTF-8
272Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
237bfacd 273
192fbfcf
JR
274Bacula Console to program umożliwiający administratorowi lub
275użytkownikowi komunikowanie się z programem Bacula Director. To jest
237bfacd
JK
276interfejs graficzny oparty na GNOME.
277
278%package tray-monitor
279Summary: Bacula Tray Monitor
280Group: Networking/Utilities
237bfacd 281Requires(post): sed >= 4.0
abdcd1c5 282Requires: %{name}-common = %{epoch}:%{version}-%{release}
237bfacd
JK
283
284%description tray-monitor
285Bacula - It comes by night and sucks the vital essence from your
286computers.
287
1b0a2248 288The Monitor program is typically an icon in the system tray. However,
289once the icon is expanded into a full window, the administrator or
290user can obtain status information about the Director or the backup
291status on the local workstation or any other Bacula daemon that is
292configured.
237bfacd 293
5ce18635
AM
294%package fd
295Summary: Bacula File services (Client)
6a00efc0 296Summary(pl.UTF-8): Usługi Bacula File (klient)
5ce18635 297Group: Networking/Utilities
237bfacd 298Requires(post): sed >= 4.0
abdcd1c5 299Requires: %{name}-common = %{epoch}:%{version}-%{release}
5ce18635
AM
300
301%description fd
302Bacula - It comes by night and sucks the vital essence from your
303computers.
304
305Bacula File services (or Client program) is the software program that
306is installed on the machine to be backed up. It is specific to the
307operating system on which it runs and is responsible for providing the
308file attributes and data when requested by the Director. The File
309services are also responsible for the file system dependent part of
310restoring the file attributes and data during a recovery operation.
311This program runs as a daemon on the machine to be backed up, and in
312some of the documentation, the File daemon is referred to as the
313Client (for example in Bacula configuration file).
314
192fbfcf
JR
315%description fd -l pl.UTF-8
316Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
317
318Usługi Bacula File (inaczej program kliencki) to oprogramowanie, które
319instaluje się na maszynach, z których mają być wykonywane kopie
320zapasowe. Są one specyficzne dla systemu operacyjnego, pod którym
321działa dana maszyna i odpowiadają za dostarczanie atrybutów i danych
322plików na żądanie Directora. Usługi plikowe są także odpowiedzialne za
323zależną od systemu plików część odzyskiwania atrybutów i danych plików
324podczas operacji odzyskiwania danych. Program działa jako demon na
325maszynie, która ma być backupowana i w części dokumentacji demon ten
326(File) jest nazywany klientem (na przykład w pliku konfiguracyjnym
cc01862b
JB
327Baculi).
328
5ce18635
AM
329%package sd
330Summary: Bacula Storage services
6a00efc0 331Summary(pl.UTF-8): Usługi Bacula Storage
5ce18635 332Group: Networking/Utilities
237bfacd 333Requires(post): sed >= 4.0
abdcd1c5 334Requires: %{name}-common = %{epoch}:%{version}-%{release}
329073aa 335Conflicts: dvd+rw-tools <= 5.21.4.10.8-1
5ce18635
AM
336
337%description sd
338Bacula - It comes by night and sucks the vital essence from your
339computers.
340
341Bacula Storage services consist of the software programs that perform
342the storage and recovery of the file attributes and data to the
343physical backup media or volumes. In other words, the Storage daemon
344is responsible for reading and writing your tapes (or other storage
345media, e.g. files). The Storage services runs as a daemon on the
346machine that has the backup device (usually a tape drive).
bb6e7dc5 347
192fbfcf
JR
348%description sd -l pl.UTF-8
349Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
cc01862b 350
192fbfcf
JR
351Usługi Bacula Storage składają się z programów obsługujących
352przechowywanie danych oraz odzyskiwanie atrybutów i danych na
353fizycznych nośnikach lub wolumenach. Innymi słowy, demon Storage jest
354odpowiedzialny za odczyt i zapis taśm (lub innych nośników do
355przechowywania danych, np. plików). Usługi Storage działają jako demon
356na maszynie, która zawiera urządzenie backupowe (zwykle napęd
357taśmowy).
cc01862b 358
5ce18635 359%package rescue
bb6e7dc5 360Summary: Bacula - The Network Backup Solution
6a00efc0 361Summary(pl.UTF-8): Bacula - rozwiązanie do wykonywania kopii zapasowych po sieci
bb6e7dc5 362Group: Networking/Utilities
cc01862b 363Requires: %{name}-fd = %{epoch}:%{version}-%{release}
bb6e7dc5
AM
364Requires: coreutils
365Requires: util-linux
bb6e7dc5
AM
366
367%description rescue
368Bacula - It comes by night and sucks the vital essence from your
369computers.
370
371Bacula is a set of computer programs that permit you (or the system
372administrator) to manage backup, recovery, and verification of
373computer data across a network of computers of different kinds. In
374technical terms, it is a network client/server based backup program.
375Bacula is relatively easy to use and efficient, while offering many
376advanced storage management features that make it easy to find and
cc01862b 377recover lost or damaged files.
bb6e7dc5
AM
378
379This package installs scripts for disaster recovery and builds rescue
1b0a2248 380floppy disk for bare metal recovery.
237bfacd 381
cd23ba7c
ER
382To make the bacula rescue disk run "./make_rescue_disk
383--copy-static-bacula
384- --copy-etc-files" from the %{_sysconfdir}/rescue directory. To
385 recreate the rescue information for this system run ./getdiskinfo
386 again.
cc01862b 387
192fbfcf
JR
388%description rescue -l pl.UTF-8
389Bacula - przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
cc01862b 390
192fbfcf
JR
391Bacula to zbiór programów umożliwiających administratorowi na
392zarządzanie kopiami zapasowymi, odzyskiwaniem i weryfikacją danych w
393sieci komputerów różnego rodzaju. W terminologii technicznej jest to
394program do kopii zapasowych pracujący w architekturze klient-serwer.
395Bacula jest stosunkowo łatwa w użyciu i wydajna, oferując przy tym
396wiele zaawansowanych możliwości przy zarządzaniu nośnikami,
397ułatwiających znalezienie i odzyskanie utraconych lub uszkodzonych
398plików.
cc01862b 399
192fbfcf 400Ten pakiet zawiera skrypty do odtwarzania po awarii i tworzy dyskietkę
1b0a2248 401ratunkowe do odtwarzania systemu od zera.
cc01862b 402
192fbfcf 403Aby stworzyć dyskietkę ratunkową Baculi, należy uruchomić "./make_rescue_disk
cc01862b 404--copy-static-bacula - --copy-etc-files" z katalogu
192fbfcf
JR
405%{_sysconfdir}/rescue . Aby ponownie utworzyć informacje ratunkowe dla
406danego systemu, należy ponownie uruchomić ./getdiskinfo .
bb6e7dc5 407
bb6e7dc5 408%prep
7425cb9d 409%setup -q -a 1
329073aa 410%patch0 -p1
2007449a 411%patch1 -p1
41ac7784 412#%patch2 -p1
413#%patch3 -p1
414#%patch4 -p1
aa6db71e 415
783dd8b1 416tar -xf %{SOURCE2} && ln -s bacula-rescue-* rescue
7425cb9d 417sed -i -e 's#wx-config#wx-gtk2-unicode-config#g' configure*
2b68b0cb 418sed -i -e 's#-lreadline -lhistory -ltermcap#-lreadline -lhistory#g' configure*
10650249
AM
419sed -i -e 's#bindir=.*#bindir=%{_bindir}#g' \
420 src/cats/create_* src/cats/delete_* src/cats/drop_* \
421 src/cats/grant_* src/cats/make_* src/cats/update_*
237bfacd 422sed -i -e 's/@hostname@/--hostname--/' src/*/*.conf.in
bb6e7dc5
AM
423
424%build
e7f64ac8 425cp -f %{_datadir}/automake/config.sub autoconf
1bd568e8 426CPPFLAGS="-I/usr/include/ncurses -I%{_includedir}/readline"
bb6e7dc5 427%configure \
5ce18635 428 --with-scriptdir=%{_libexecdir}/%{name} \
e75759f3 429 --%{!?with_gnome:dis}%{?with_gnome:en}able-gnome \
c19580f6 430 %{?with_bat:--enable-bat} \
bb6e7dc5 431 --disable-conio \
5ce18635 432 --enable-smartalloc \
e3dd858d 433 %{?with_console_wx:--enable-bwx-console} \
237bfacd 434 --enable-tray-monitor \
2007449a 435 %{?with_python:--with-python} \
bb6e7dc5
AM
436 --with-readline \
437 --with-tcp-wrappers \
438 --with-working-dir=%{_var}/lib/%{name} \
439 --with-dump-email="root@localhost" \
440 --with-job-email="root@localhost" \
441 --with-smtp-host=localhost \
442 --with-pid-dir=/var/run \
443 --with-subsys-dir=/var/lock/subsys \
e090896a 444 --with-%{_database} \
aa6db71e 445 %{?with_sqlite3_sync_off:--enable-extra-sqlite3-init="pragma synchronous=0;"} \
237bfacd
JK
446 --with-dir-password="#FAKE-dir-password#" \
447 --with-fd-password="#FAKE-fd-password#" \
448 --with-sd-password="#FAKE-sd-password#" \
449 --with-mon-dir-password="#FAKE-mon-dir-password#" \
450 --with-mon-fd-password="#FAKE-mon-fd-password#" \
451 --with-mon-sd-password="#FAKE-mon-sd-password#" \
2b68b0cb 452 --with-openssl
bb6e7dc5
AM
453%{__make}
454
2b68b0cb
AM
455%if %{with rescue}
456cd rescue
457%configure \
458 --with-bacula=../
459cd linux/cdrom
460fakeroot %{__make}
461%endif
462
bb6e7dc5
AM
463%install
464rm -rf $RPM_BUILD_ROOT
465
237bfacd
JK
466install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,logrotate.d,pam.d,sysconfig}
467install -d $RPM_BUILD_ROOT%{_sysconfdir}/rescue
468install -d $RPM_BUILD_ROOT{%{_pixmapsdir},%{_desktopdir},%{_mandir},%{_bindir}}
bb6e7dc5
AM
469
470%{__make} install \
471 DESTDIR=$RPM_BUILD_ROOT
472
d907cd57 473# static daemon
41ac7784 474#strip -R.comment -R.note src/filed/static-bacula-fd
475#install src/filed/static-bacula-fd $RPM_BUILD_ROOT%{_sysconfdir}/rescue/bacula-fd
d907cd57 476
5ce18635
AM
477install %{SOURCE10} $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-dir
478install %{SOURCE11} $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-fd
479install %{SOURCE12} $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-sd
1a72afd2 480install %{SOURCE13} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}-dir
4280e495
JK
481install %{SOURCE14} $RPM_BUILD_ROOT/etc/sysconfig/bacula-dir
482install %{SOURCE15} $RPM_BUILD_ROOT/etc/sysconfig/bacula-fd
483install %{SOURCE16} $RPM_BUILD_ROOT/etc/sysconfig/bacula-sd
d907cd57 484
cacc89f5
AZ
485%if %{with console_wx}
486# tray-monitor is for regular users
487mv $RPM_BUILD_ROOT%{_sbindir}/bacula-tray-monitor $RPM_BUILD_ROOT%{_bindir}
488
d907cd57 489install scripts/bacula.png $RPM_BUILD_ROOT%{_pixmapsdir}/bacula.png
237bfacd
JK
490install src/tray-monitor/generic.xpm $RPM_BUILD_ROOT%{_pixmapsdir}/bacula-tray-monitor.xpm
491install scripts/bacula.desktop.gnome2 $RPM_BUILD_ROOT%{_desktopdir}/bacula.desktop
492sed -e 's/gnome-console/wx-console/g;s/Console/Wx Console/g' \
493 scripts/bacula.desktop.gnome2 > $RPM_BUILD_ROOT%{_desktopdir}/bacula-wx.desktop
494sed -e 's#%{_sbindir}#%{_bindir}#' \
495 scripts/bacula-tray-monitor.desktop > $RPM_BUILD_ROOT%{_desktopdir}/bacula-tray-monitor.desktop
cacc89f5 496%endif
d907cd57 497
2b68b0cb 498%if %{with rescue}
d907cd57 499# install the rescue stuff, these are the rescue scripts
237bfacd
JK
500install rescue/linux/floppy/backup.etc.list $RPM_BUILD_ROOT%{_sysconfdir}/rescue
501install rescue/linux/floppy/*_* $RPM_BUILD_ROOT%{_sysconfdir}/rescue
502install rescue/linux/floppy/getdiskinfo $RPM_BUILD_ROOT%{_sysconfdir}/rescue
503install rescue/linux/floppy/sfdisk.bz2 $RPM_BUILD_ROOT%{_sysconfdir}/rescue
2b68b0cb 504%endif
bb6e7dc5
AM
505
506# install the updatedb scripts
237bfacd 507install updatedb/update_sqlite* $RPM_BUILD_ROOT%{_libexecdir}/%{name}
d907cd57 508
237bfacd
JK
509# place for site passwords
510touch $RPM_BUILD_ROOT%{_sysconfdir}/{dir-password,fd-password,sd-password}
511touch $RPM_BUILD_ROOT%{_sysconfdir}/{mon-dir-password,mon-fd-password,mon-sd-password}
bb6e7dc5 512
1a72afd2
AM
513# some file changes
514rm -f $RPM_BUILD_ROOT%{_libexecdir}/%{name}/{gconsole,startmysql,stopmysql,bacula,bconsole,fd}
515rm -f $RPM_BUILD_ROOT%{_sbindir}/static-bacula-fd
d5d063ee 516%if !%{with console_wx}
1376b552 517rm -f $RPM_BUILD_ROOT%{_desktopdir}/bacula-wx.desktop
1376b552 518%endif
1a72afd2
AM
519touch $RPM_BUILD_ROOT%{_sysconfdir}/.pw.sed
520
f2337569
JB
521%clean
522rm -rf $RPM_BUILD_ROOT
523
5ce18635 524%pre common
fbc59152
ER
525%groupadd -P %{name}-common -g 136 -r -f bacula
526%useradd -P %{name}-common -u 136 -r -d /var/lib/bacula -s /bin/false -c "Bacula User" -g bacula bacula
5ce18635 527
237bfacd
JK
528%post common
529echo "Updating bacula passwords and names..."
530cd /etc/bacula
531for f in *-password ; do
fbc59152 532 if [ ! -s $f ] ; then
237bfacd
JK
533 openssl rand -base64 33 > $f
534 fi
535 p=`cat $f`
b41d8966 536 for cf in *.conf *.conf.rpmnew ; do
237bfacd
JK
537 [ -f $cf ] && sed -i -e"s:#FAKE-$f#:$p:" "$cf" || :
538 done
539done
b41d8966 540for cf in *.conf *.conf.rpmnew ; do
237bfacd
JK
541 [ -f $cf ] && sed -i -e"s:--hostname--:`hostname`:" "$cf" || :
542done
543
5ce18635 544%postun common
28c9f5d0
AM
545if [ "$1" = "0" ]; then
546 %userremove bacula
547 %groupremove bacula
548fi
5ce18635
AM
549
550%post dir
551umask 077
1a72afd2 552[ -s %{_localstatedir}/bacula.db ] && \
9aa69d51 553 DB_VER=`echo "select * from Version;" | \
cece716a 554 %{_bindir}/sqlite%{?with_sqlite3:3} %{_localstatedir}/bacula.db | tail -n 1 2>/dev/null`
5ce18635
AM
555if [ -z "$DB_VER" ]; then
556# grant privileges and create tables
9aa69d51 557 %{_libexecdir}/%{name}/grant_bacula_privileges > dev/null
558 %{_libexecdir}/%{name}/create_bacula_database > dev/null
559 %{_libexecdir}/%{name}/make_bacula_tables > dev/null
2007449a 560elif [ "$DB_VER" -lt "9" ]; then
9aa69d51 561 echo "Backing up bacula tables"
cece716a 562 echo ".dump" | sqlite%{?with_sqlite3:3} %{_localstatedir}/bacula.db | bzip2 > %{_localstatedir}/bacula_backup.sql.bz2
9aa69d51 563 echo "Upgrading bacula tables"
cece716a
JK
564 %if %{with sqlite3}
565 type=sqlite3
566 if [ "$DB_VER" -lt "9" ]; then
567 %{_libexecdir}/%{name}/update_${type}_tables_8_to_9
568 fi
aeaed87e 569 %endif
570 %if %{with sqlite}
cece716a
JK
571 type=sqlite
572 if [ "$DB_VER" -lt "9" ]; then
573 if [ "$DB_VER" -lt "8" ]; then
574 if [ "$DB_VER" -lt "7" ]; then
575 if [ "$DB_VER" -lt "6" ]; then
576 if [ "$DB_VER" -lt "5" ]; then
577 %{_libexecdir}/%{name}/update_${type}_tables_4_to_5
578 fi
579 %{_libexecdir}/%{name}/update_${type}_tables_5_to_6
2007449a 580 fi
cece716a 581 %{_libexecdir}/%{name}/update_${type}_tables_6_to_7
2b68b0cb 582 fi
cece716a 583 %{_libexecdir}/%{name}/update_${type}_tables_7_to_8
237bfacd 584 fi
cece716a 585 %{_libexecdir}/%{name}/update_${type}_tables_8_to_9
9aa69d51 586 fi
cece716a 587 %endif
9aa69d51 588 %{_libexecdir}/%{name}/update_bacula_tables
589 echo "If bacula works correctly you can remove the backup file %{_localstatedir}/bacula_backup.sql.bz2"
bb6e7dc5 590fi
28c9f5d0
AM
591chown -R bacula:bacula %{_localstatedir}
592chmod -R u+rX,go-rwx %{_localstatedir}/*
bb6e7dc5 593
237bfacd
JK
594echo "Updating Bacula passwords and names..."
595cd /etc/bacula
596for f in *-password ; do
597 p=`cat $f`
329073aa 598 sed -i -e"s:#FAKE-$f#:$p:" *.conf *.conf.rpmnew 2>/dev/null || :
237bfacd 599done
329073aa 600sed -i -e"s:--hostname--:`hostname`:" *.conf *.conf.rpmnew 2>/dev/null || :
237bfacd 601
1a72afd2 602/sbin/chkconfig --add bacula-dir
52504a6d 603%service bacula-dir restart "Bacula Director daemon"
bb6e7dc5 604
5ce18635 605%preun dir
1a72afd2 606if [ "$1" = "0" ]; then
52504a6d 607 %service bacula-dir stop
9aa69d51 608 /sbin/chkconfig --del bacula-dir
1a72afd2 609fi
bb6e7dc5 610
5ce18635 611%post fd
237bfacd
JK
612echo "Updating Bacula passwords and names..."
613cd /etc/bacula
614for f in *-password ; do
615 p=`cat $f`
329073aa 616 sed -i -e"s:#FAKE-$f#:$p:" *.conf *.conf.rpmnew 2>/dev/null || :
237bfacd 617done
329073aa 618sed -i -e"s:--hostname--:`hostname`:" *.conf *.conf.rpmnew 2>/dev/null || :
237bfacd 619
1a72afd2 620/sbin/chkconfig --add bacula-fd
52504a6d 621%service bacula-fd restart "Bacula File daemon"
bb6e7dc5 622
5ce18635 623%preun fd
1a72afd2 624if [ "$1" = "0" ]; then
52504a6d 625 %service bacula-fd stop
9aa69d51 626 /sbin/chkconfig --del bacula-fd
1a72afd2 627fi
5ce18635
AM
628
629%post sd
237bfacd
JK
630echo "Updating Bacula passwords and names..."
631cd /etc/bacula
632for f in *-password ; do
633 p=`cat $f`
329073aa 634 sed -i -e"s:#FAKE-$f#:$p:" *.conf *.conf.rpmnew 2>/dev/null || :
237bfacd 635done
329073aa 636sed -i -e"s:--hostname--:`hostname`:" *.conf *.conf.rpmnew 2>/dev/null || :
237bfacd 637
1a72afd2 638/sbin/chkconfig --add bacula-sd
52504a6d 639%service bacula-sd restart "Bacula Storage daemon"
bb6e7dc5 640
5ce18635 641%preun sd
1a72afd2 642if [ "$1" = "0" ]; then
52504a6d 643 %service bacula-sd stop
9aa69d51 644 /sbin/chkconfig --del bacula-sd
1a72afd2 645fi
5ce18635
AM
646
647%pre console
648if [ -e %{_sysconfdir}/console.conf -a ! -e %{_sysconfdir}/bconsole.conf ]; then
9aa69d51 649 mv %{_sysconfdir}/console.conf %{_sysconfdir}/bconsole.conf
bb6e7dc5
AM
650fi
651
237bfacd
JK
652%post console
653echo "Updating Bacula passwords and names..."
654cd /etc/bacula
655for f in *-password ; do
656 p=`cat $f`
329073aa 657 sed -i -e"s:#FAKE-$f#:$p:" *.conf *.conf.rpmnew 2>/dev/null || :
237bfacd 658done
329073aa 659sed -i -e"s:--hostname--:`hostname`:" *.conf *.conf.rpmnew 2>/dev/null || :
237bfacd
JK
660
661%post console-wx
662echo "Updating Bacula passwords and names..."
663cd /etc/bacula
664for f in *-password ; do
665 p=`cat $f`
329073aa 666 sed -i -e"s:#FAKE-$f#:$p:" *.conf *.conf.rpmnew 2>/dev/null || :
237bfacd 667done
329073aa 668sed -i -e"s:--hostname--:`hostname`:" *.conf *.conf.rpmnew 2>/dev/null || :
237bfacd
JK
669
670%post console-gnome
671echo "Updating Bacula passwords and names..."
672cd /etc/bacula
673for f in *-password ; do
674 p=`cat $f`
329073aa 675 sed -i -e"s:#FAKE-$f#:$p:" *.conf *.conf.rpmnew 2>/dev/null || :
237bfacd 676done
329073aa 677sed -i -e"s:--hostname--:`hostname`:" *.conf *.conf.rpmnew 2>/dev/null || :
237bfacd
JK
678
679%post tray-monitor
680echo "Updating Bacula passwords and names..."
681cd /etc/bacula
682for f in *-password ; do
683 p=`cat $f`
329073aa 684 sed -i -e"s:#FAKE-$f#:$p:" *.conf *.conf.rpmnew 2>/dev/null || :
237bfacd 685done
329073aa 686sed -i -e"s:--hostname--:`hostname`:" *.conf *.conf.rpmnew 2>/dev/null || :
bb6e7dc5 687
bb6e7dc5
AM
688%post rescue
689# link our current installed conf file to the rescue directory
f2337569 690ln -sf %{_sysconfdir}/bacula-fd.conf %{_sysconfdir}/rescue/bacula-fd.conf
bb6e7dc5
AM
691
692# run getdiskinfo
693echo "Creating rescue files for this system..."
d907cd57 694cd %{_sysconfdir}/rescue
bb6e7dc5
AM
695./getdiskinfo
696
697%preun rescue
698# remove the files created after the initial rpm installation
f2337569
JB
699if [ "$1" = "0" ]; then
700 rm -f %{_sysconfdir}/rescue/bacula-fd.conf
701 rm -f %{_sysconfdir}/rescue/partition.*
702 rm -f %{_sysconfdir}/rescue/format.*
703 rm -f %{_sysconfdir}/rescue/mount_drives
704 rm -f %{_sysconfdir}/rescue/start_network
705 rm -f %{_sysconfdir}/rescue/sfdisk
706 rm -rf %{_sysconfdir}/rescue/diskinfo/*
707fi
bb6e7dc5 708
5ce18635
AM
709%files common
710%defattr(644,root,root,755)
237bfacd 711%doc LICENSE
1a72afd2 712%dir %{_sysconfdir}
1b0a2248 713%attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*-password
79d0fef6 714%attr(755,root,root) %{_sbindir}/bsmtp
7425cb9d 715%attr(755,root,root) %{_sbindir}/btraceback
c74b041d 716%{_mandir}/man8/bacula.8*
7425cb9d
JK
717%{_mandir}/man1/bsmtp.1*
718%{_mandir}/man8/btraceback.8*
5ce18635 719%dir %{_libexecdir}/%{name}
1376b552 720%{_libexecdir}/%{name}/btraceback.dbx
5ce18635 721%{_libexecdir}/%{name}/btraceback.gdb
d6dbe33c 722%attr(770,root,bacula) %dir %{_localstatedir}
5ce18635
AM
723
724%files dir
bb6e7dc5 725%defattr(644,root,root,755)
237bfacd 726%doc ChangeLog CheckList ReleaseNotes kernstodo LICENSE
28647453 727#%doc examples %{name}-docs-%{version}/manual/{*.pdf,bacula}
1b0a2248 728%attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bacula-dir.conf
1a72afd2 729%ghost %{_sysconfdir}/.pw.sed
28c9f5d0 730%attr(640,root,root) %config(noreplace) /etc/logrotate.d/bacula-dir
1a72afd2 731%attr(754,root,root) /etc/rc.d/init.d/bacula-dir
cd23ba7c 732%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/bacula-dir
5ff0b6a3 733%attr(755,root,root) %{_sbindir}/bacula-dir
cacc89f5
AZ
734%attr(755,root,root) %{_sbindir}/bregex
735%attr(755,root,root) %{_sbindir}/bwild
5ce18635 736%attr(755,root,root) %{_sbindir}/dbcheck
79d0fef6 737%{_mandir}/man8/bacula-dir.8*
7425cb9d 738%{_mandir}/man8/dbcheck.8*
79d0fef6 739%{_libexecdir}/%{name}/query.sql
7425cb9d
JK
740%if %{with sqlite3}
741%attr(755,root,root) %{_libexecdir}/%{name}/create_sqlite3_database
742%attr(755,root,root) %{_libexecdir}/%{name}/drop_sqlite3_database
743%attr(755,root,root) %{_libexecdir}/%{name}/drop_sqlite3_tables
744%attr(755,root,root) %{_libexecdir}/%{name}/grant_sqlite3_privileges
745%attr(755,root,root) %{_libexecdir}/%{name}/make_sqlite3_tables
746%attr(755,root,root) %{_libexecdir}/%{name}/update_sqlite3_*
aeaed87e 747%endif
748%if %{with sqlite}
f0a88766 749%attr(755,root,root) %{_libexecdir}/%{name}/create_sqlite_database
750%attr(755,root,root) %{_libexecdir}/%{name}/drop_sqlite_database
751%attr(755,root,root) %{_libexecdir}/%{name}/drop_sqlite_tables
752%attr(755,root,root) %{_libexecdir}/%{name}/grant_sqlite_privileges
753%attr(755,root,root) %{_libexecdir}/%{name}/make_sqlite_tables
7425cb9d
JK
754%attr(755,root,root) %{_libexecdir}/%{name}/update_sqlite_*
755%endif
aeaed87e 756%if %{with mysql}
757%attr(755,root,root) %{_libexecdir}/%{name}/create_mysql_database
758%attr(755,root,root) %{_libexecdir}/%{name}/drop_mysql_database
759%attr(755,root,root) %{_libexecdir}/%{name}/drop_mysql_tables
760%attr(755,root,root) %{_libexecdir}/%{name}/grant_mysql_privileges
761%attr(755,root,root) %{_libexecdir}/%{name}/make_mysql_tables
762%attr(755,root,root) %{_libexecdir}/%{name}/update_mysql_*
763%endif
e090896a
JK
764%if %{with pgsql}
765%attr(755,root,root) %{_libexecdir}/%{name}/create_postgresql_database
766%attr(755,root,root) %{_libexecdir}/%{name}/drop_postgresql_database
767%attr(755,root,root) %{_libexecdir}/%{name}/drop_postgresql_tables
768%attr(755,root,root) %{_libexecdir}/%{name}/grant_postgresql_privileges
769%attr(755,root,root) %{_libexecdir}/%{name}/make_postgresql_tables
770%attr(755,root,root) %{_libexecdir}/%{name}/update_postgresql_*
771%endif
f0a88766 772%attr(755,root,root) %{_libexecdir}/%{name}/create_bacula_database
773%attr(755,root,root) %{_libexecdir}/%{name}/drop_bacula_database
774%attr(755,root,root) %{_libexecdir}/%{name}/drop_bacula_tables
775%attr(755,root,root) %{_libexecdir}/%{name}/grant_bacula_privileges
776%attr(755,root,root) %{_libexecdir}/%{name}/make_bacula_tables
777%attr(755,root,root) %{_libexecdir}/%{name}/update_bacula_tables
778%attr(755,root,root) %{_libexecdir}/%{name}/make_catalog_backup
779%attr(755,root,root) %{_libexecdir}/%{name}/delete_catalog_backup
5ce18635
AM
780
781%files fd
782%defattr(644,root,root,755)
237bfacd 783%doc LICENSE
1b0a2248 784%attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bacula-fd.conf
1a72afd2 785%attr(754,root,root) /etc/rc.d/init.d/bacula-fd
cd23ba7c 786%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/bacula-fd
5ff0b6a3 787%attr(755,root,root) %{_sbindir}/bacula-fd
79d0fef6 788%{_mandir}/man8/bacula-fd.8*
5ce18635
AM
789
790%files sd
791%defattr(644,root,root,755)
237bfacd 792%doc LICENSE
1a72afd2 793%dir %{_sysconfdir}
1b0a2248 794%attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bacula-sd.conf
1a72afd2 795%attr(754,root,root) /etc/rc.d/init.d/bacula-sd
cd23ba7c 796%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/bacula-sd
5ff0b6a3
AM
797%attr(755,root,root) %{_sbindir}/bacula-sd
798%attr(755,root,root) %{_sbindir}/bcopy
799%attr(755,root,root) %{_sbindir}/bextract
800%attr(755,root,root) %{_sbindir}/bls
801%attr(755,root,root) %{_sbindir}/bscan
802%attr(755,root,root) %{_sbindir}/btape
329073aa 803%attr(755,root,root) %{_libexecdir}/%{name}/mtx-changer
150db1c2 804%attr(755,root,root) %{_libexecdir}/%{name}/disk-changer
329073aa 805%attr(755,root,root) %{_libexecdir}/%{name}/dvd-handler
5ce18635 806%{_mandir}/man8/bacula-sd.8*
7425cb9d
JK
807%{_mandir}/man8/bcopy.8*
808%{_mandir}/man8/bextract.8*
809%{_mandir}/man8/bls.8*
810%{_mandir}/man8/bscan.8*
811%{_mandir}/man8/btape.8*
5ce18635
AM
812
813%files console
bb6e7dc5 814%defattr(644,root,root,755)
237bfacd 815%doc LICENSE
1b0a2248 816%attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bconsole.conf
1a72afd2 817%attr(755,root,root) %{_sbindir}/bconsole
7425cb9d 818%{_mandir}/man8/bconsole.8*
5ce18635 819
1376b552 820%if %{with console_wx}
5ce18635
AM
821%files console-wx
822%defattr(644,root,root,755)
237bfacd 823%doc LICENSE
1a72afd2 824%{_pixmapsdir}/%{name}.png
237bfacd 825%{_desktopdir}/bacula-wx.desktop
e3dd858d 826%attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bwx-console.conf
827%attr(755,root,root) %{_sbindir}/bwx-console
828%{_mandir}/man1/bacula-bwxconsole.1*
1376b552 829%endif
bb6e7dc5 830
e75759f3 831%if %{with gnome}
237bfacd
JK
832%files console-gnome
833%defattr(644,root,root,755)
834%doc LICENSE
835%{_pixmapsdir}/%{name}.png
836%{_desktopdir}/bacula.desktop
e3dd858d 837%attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bgnome-console.conf
838%attr(755,root,root) %{_sbindir}/bgnome-console
839%{_mandir}/man1/bacula-bgnome-console.1*
e75759f3 840%endif
237bfacd 841
cacc89f5 842%if %{with console_wx}
237bfacd
JK
843%files tray-monitor
844%defattr(644,root,root,755)
845%doc LICENSE
846%{_pixmapsdir}/%{name}-tray-monitor.xpm
847%{_desktopdir}/%{name}-tray-monitor.desktop
cd23ba7c 848%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/tray-monitor.conf
237bfacd 849%attr(755,root,root) %{_bindir}/bacula-tray-monitor
7425cb9d 850%{_mandir}/man1/bacula-tray-monitor.1*
cacc89f5 851%endif
237bfacd 852
2b68b0cb 853%if %{with rescue}
bb6e7dc5
AM
854%files rescue
855%defattr(644,root,root,755)
c741b8e0 856%doc LICENSE
4280e495 857%dir %{_sysconfdir}/rescue
1b0a2248 858%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/backup.etc.list
859%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/bacula-fd
860%attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/format_floppy
861%attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/getdiskinfo
862%attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/make_rescue_disk
863%attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/restore_bacula
864%attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/restore_etc
865%attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/run_grub
866%attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/run_lilo
867%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/sfdisk.bz2
2b68b0cb 868%endif
This page took 0.235632 seconds and 4 git commands to generate.