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