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