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