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