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