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