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