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