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