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