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