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