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