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