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