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