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