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