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