]> git.pld-linux.org Git - packages/bacula.git/blob - bacula.spec
- add -desktop.patch; renum 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_with     sqlite                  # use SQLite
10 %bcond_without  bat                     # bat Qt4 GUI
11 %bcond_without  mysql                   # use MySQL
12 %bcond_with     pgsql                   # use PostgreSQL
13 %bcond_with     python
14 %bcond_with     rescue
15 %bcond_with     sqlite3                 # use SQLite3 instead of SQLite 2
16 %bcond_with     sqlite3_sync_off        # makes SQLite3 backend much faster, but less reliable
17 %if %{with sqlite}
18 %define         database        sqlite
19 %undefine       with_mysql
20 %undefine       with_pgsql
21 %endif
22 %if %{with sqlite3}
23 %define         database        sqlite3
24 %undefine       with_sqlite
25 %undefine       with_mysql
26 %undefine       with_pgsql
27 %endif
28 %if %{with pgsql}
29 %define         database        postgresql
30 %undefine       with_sqlite
31 %undefine       with_sqlite3
32 %undefine       with_mysql
33 %endif
34 %if %{with mysql}
35 %define         database        mysql
36 %undefine       with_sqlite
37 %undefine       with_sqlite3
38 %undefine       with_pgsql
39 %undefine       with_sqlite3_sync_off
40 %endif
41 #
42 Summary:        Bacula - The Network Backup Solution
43 Summary(pl.UTF-8):      Bacula - rozwiązanie do wykonywania kopii zapasowych po sieci
44 Name:           bacula
45 Version:        3.0.0
46 Release:        0.2
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:  5ea5294c4f66f0d8ba1414f1ca9dc79b
52 Source1:        http://dl.sourceforge.net/bacula/%{name}-docs-%{version}.tar.bz2
53 # Source1-md5:  2c3a1c6ba46b1371240a9b8d053fdf61
54 Source2:        http://dl.sourceforge.net/bacula/%{name}-rescue-%{version}.tar.gz
55 # Source2-md5:  b31af264219f6e6a0985288d810d7bb6
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}-mtx-changer.patch
64 Patch1:         %{name}-link.patch
65 Patch2:         %{name}-tinfo-readline.patch
66 Patch3:         %{name}-branding.patch
67 Patch4:         %{name}-conf.patch
68 Patch5:         %{name}-desktop.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:  QtCore-devel
92 BuildRequires:  QtGui-devel
93 BuildRequires:  qt4-build >= 4.3.3-3
94 BuildRequires:  qt4-qmake >= 4.3.3-3
95 BuildRequires:  qwt-devel >= 5.0.2-2
96 %endif
97 %{?with_mysql:BuildRequires:    mysql-devel}
98 %{?with_pgsql:BuildRequires:    postgresql-devel}
99 BuildRequires:  readline-devel
100 BuildRequires:  rpmbuild(macros) >= 1.268
101 BuildRequires:  sed >= 4.0
102 %{?with_sqlite:BuildRequires:   sqlite-devel}
103 %{?with_sqlite3:BuildRequires:  sqlite3-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 %{database} 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
217 bazy 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 %patch0 -p1
438 %patch1 -p1
439 %patch2 -p1
440 %patch3 -p1
441 %patch4 -p1
442 %patch5 -p1
443
444 tar -xf %{SOURCE2} && ln -s bacula-rescue-* rescue
445
446 sed -i -e 's#bindir=.*#bindir=%{_bindir}#g' \
447         src/cats/create_* src/cats/delete_* src/cats/drop_* \
448         src/cats/grant_* src/cats/make_* src/cats/update_*
449 sed -i -e 's/@hostname@/--hostname--/' src/*/*.conf.in
450
451 %build
452 cp -f %{_datadir}/automake/config.sub autoconf
453 cd autoconf && %{__aclocal} -I bacula-macros -I gettext-macros && cd ..
454 %{__autoconf} --prepend-include=$(pwd)/autoconf autoconf/configure.in > configure
455
456 CPPFLAGS="-I/usr/include/ncurses -I%{_includedir}/readline"
457 WXCONFIG=%{_bindir}/wx-gtk2-unicode-config \
458 %configure \
459         --with-scriptdir=%{_libexecdir}/%{name} \
460         --%{!?with_gnome:dis}%{?with_gnome:en}able-gnome \
461         %{?with_bat:--enable-bat} \
462         --disable-conio \
463         --enable-smartalloc \
464         %{?with_console_wx:--enable-bwx-console} \
465         --enable-tray-monitor \
466         %{?with_python:--with-python} \
467         --with-readline \
468         --with-tcp-wrappers \
469         --with-working-dir=%{_var}/lib/%{name} \
470         --with-dump-email="root@localhost" \
471         --with-job-email="root@localhost" \
472         --with-smtp-host=localhost \
473         --with-pid-dir=/var/run \
474         --with-subsys-dir=/var/lock/subsys \
475         --enable-batch-insert \
476         --with-%{database} \
477         %{?with_sqlite3_sync_off:--enable-extra-sqlite3-init="pragma synchronous=0;"} \
478         --with-dir-password="#FAKE-dir-password#" \
479         --with-fd-password="#FAKE-fd-password#" \
480         --with-sd-password="#FAKE-sd-password#" \
481         --with-mon-dir-password="#FAKE-mon-dir-password#" \
482         --with-mon-fd-password="#FAKE-mon-fd-password#" \
483         --with-mon-sd-password="#FAKE-mon-sd-password#" \
484         --with-openssl
485
486 %if %{with bat}
487 cd src/qt-console
488 qmake-qt4 bat.pro
489 cd ../..
490 %endif
491
492 %{__make}
493
494 %if %{with rescue}
495 cd rescue
496 %configure \
497         --with-bacula=../
498 cd linux/cdrom
499 fakeroot %{__make}
500 %endif
501
502 %install
503 rm -rf $RPM_BUILD_ROOT
504
505 install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,logrotate.d,pam.d,sysconfig}
506 install -d $RPM_BUILD_ROOT%{_sysconfdir}/rescue
507 install -d $RPM_BUILD_ROOT{%{_pixmapsdir},%{_desktopdir},%{_mandir},%{_bindir},/var/log/bacula}
508
509 %{__make} install \
510         DESTDIR=$RPM_BUILD_ROOT
511
512 # static daemon
513 #strip -R.comment -R.note src/filed/static-bacula-fd
514 #install src/filed/static-bacula-fd $RPM_BUILD_ROOT%{_sysconfdir}/rescue/bacula-fd
515
516 install %{SOURCE10} $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-dir
517 install %{SOURCE11} $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-fd
518 install %{SOURCE12} $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-sd
519 install %{SOURCE13} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}-dir
520 install %{SOURCE14} $RPM_BUILD_ROOT/etc/sysconfig/bacula-dir
521 install %{SOURCE15} $RPM_BUILD_ROOT/etc/sysconfig/bacula-fd
522 install %{SOURCE16} $RPM_BUILD_ROOT/etc/sysconfig/bacula-sd
523
524 %if %{with console_wx}
525 # tray-monitor is for regular users
526 mv $RPM_BUILD_ROOT%{_sbindir}/bacula-tray-monitor $RPM_BUILD_ROOT%{_bindir}
527
528 install scripts/bacula.png $RPM_BUILD_ROOT%{_pixmapsdir}/bacula.png
529 install src/tray-monitor/generic.xpm $RPM_BUILD_ROOT%{_pixmapsdir}/bacula-tray-monitor.xpm
530 install scripts/bacula.desktop.gnome2 $RPM_BUILD_ROOT%{_desktopdir}/bacula.desktop
531 sed -e 's/gnome-console/wx-console/g;s/Console/Wx Console/g' \
532         scripts/bacula.desktop.gnome2 > $RPM_BUILD_ROOT%{_desktopdir}/bacula-wx.desktop
533 sed -e 's#%{_sbindir}#%{_bindir}#' \
534         scripts/bacula-tray-monitor.desktop > $RPM_BUILD_ROOT%{_desktopdir}/bacula-tray-monitor.desktop
535 %endif
536
537 %if %{with bat}
538 install src/qt-console/bat $RPM_BUILD_ROOT%{_sbindir}
539 install scripts/bat.desktop $RPM_BUILD_ROOT%{_desktopdir}
540 %endif
541
542 %if %{with rescue}
543 # install the rescue stuff, these are the rescue scripts
544 install rescue/linux/floppy/backup.etc.list $RPM_BUILD_ROOT%{_sysconfdir}/rescue
545 install rescue/linux/floppy/*_* $RPM_BUILD_ROOT%{_sysconfdir}/rescue
546 install rescue/linux/floppy/getdiskinfo $RPM_BUILD_ROOT%{_sysconfdir}/rescue
547 install rescue/linux/floppy/sfdisk.bz2 $RPM_BUILD_ROOT%{_sysconfdir}/rescue
548 %endif
549
550 touch $RPM_BUILD_ROOT/var/log/bacula/log
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 install scripts/mtx-changer.conf $RPM_BUILD_ROOT%{_sysconfdir}/
560
561 # some file changes
562 rm -f $RPM_BUILD_ROOT%{_libexecdir}/%{name}/{gconsole,startmysql,stopmysql,bacula,bconsole,fd}
563 rm -f $RPM_BUILD_ROOT%{_sbindir}/static-bacula-fd
564 %if !%{with console_wx}
565 rm -f $RPM_BUILD_ROOT%{_desktopdir}/bacula-wx.desktop
566 %endif
567 touch $RPM_BUILD_ROOT%{_sysconfdir}/.pw.sed
568
569 %clean
570 rm -rf $RPM_BUILD_ROOT
571
572 %pre common
573 %groupadd -P %{name}-common -g 136 -r -f bacula
574 %useradd -P %{name}-common -u 136 -r -d /var/lib/bacula -s /bin/false -c "Bacula User" -g bacula bacula
575
576 %post common
577 /sbin/ldconfig
578 echo "Updating bacula passwords and names..."
579 cd /etc/bacula
580 for f in *-password ; do
581         if [ ! -s $f ] ; then
582                 openssl rand -base64 33 > $f
583         fi
584         p=`cat $f`
585         for cf in *.conf *.conf.rpmnew ; do
586                 [ -f $cf ] && sed -i -e"s:#FAKE-$f#:$p:" "$cf" || :
587         done
588 done
589 for cf in *.conf *.conf.rpmnew ; do
590         [ -f $cf ] && sed -i -e"s:--hostname--:`hostname`:" "$cf" || :
591 done
592
593 %postun common
594 /sbin/ldconfig
595 if [ "$1" = "0" ]; then
596         %userremove bacula
597         %groupremove bacula
598 fi
599
600 %post dir
601 umask 077
602
603 # XXX: Most of this upgrade procedure is safe for sqlite only. Other databases would require knowledge
604 #      about currently used version so we can't easily support these :(
605
606 %if %{with sqlite} || %{with sqlite3}
607 [ -s %{_localstatedir}/bacula.db ] && \
608         DB_VER=`echo "select * from Version;" | \
609         %{_bindir}/sqlite%{?with_sqlite3:3} %{_localstatedir}/bacula.db | tail -n 1 2>/dev/null`
610
611 if [ -z "$DB_VER" ]; then
612 # grant privileges and create tables
613         %{_libexecdir}/%{name}/grant_bacula_privileges > dev/null
614         %{_libexecdir}/%{name}/create_bacula_database > dev/null
615         %{_libexecdir}/%{name}/make_bacula_tables > dev/null
616 else
617         echo "Backing up bacula tables"
618         echo ".dump" | sqlite%{?with_sqlite3:3} %{_localstatedir}/bacula.db | bzip2 > %{_localstatedir}/bacula_backup.sql.bz2
619
620         db_type="%{database}"
621
622         next_ver=$(($DB_VER + 1))
623         # support up to version 30; increase this if needed
624         for ver in $(seq $next_ver 30); do
625                 prev_ver=$(($ver - 1))
626
627                 if [ -x %{_libexecdir}/%{name}/update_${type}_tables_${prev_ver}_to_${ver} ]; then
628                         echo "Upgrading bacula database: db=${db_type} from ${prev_ver} to ${ver}..."
629                         %{_libexecdir}/%{name}/update_${type}_tables_${prev_ver}_to_${ver}
630                 fi
631         done
632
633         %{_libexecdir}/%{name}/update_bacula_tables
634         echo "If bacula works correctly you can remove the backup file %{_localstatedir}/bacula_backup.sql.bz2"
635 fi
636 chown -R bacula:bacula %{_localstatedir}
637 chmod -R u+rX,go-rwx %{_localstatedir}/*
638 %endif
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 %attr(755,root,root) /%{_libdir}/libbac.so.1.*.*
772 %attr(755,root,root) %ghost /%{_libdir}/libbac.so.1
773 %attr(755,root,root) /%{_libdir}/libbaccfg.so.1.*.*
774 %attr(755,root,root) %ghost /%{_libdir}/libbaccfg.so.1
775 %attr(755,root,root) /%{_libdir}/libbacfind.so.1.*.*
776 %attr(755,root,root) %ghost /%{_libdir}/libbacfind.so.1
777 %attr(755,root,root) /%{_libdir}/libbacpy.so.1.*.*
778 %attr(755,root,root) %ghost /%{_libdir}/libbacpy.so.1
779 %attr(755,root,root) /%{_libdir}/libbacsql.so.1.*.*
780 %attr(755,root,root) %ghost /%{_libdir}/libbacsql.so.1
781 %{_mandir}/man8/bacula.8*
782 %{_mandir}/man1/bsmtp.1*
783 %{_mandir}/man8/btraceback.8*
784 %dir %{_libexecdir}/%{name}
785 %{_libexecdir}/%{name}/btraceback.dbx
786 %{_libexecdir}/%{name}/btraceback.gdb
787 %attr(770,root,bacula) %dir %{_localstatedir}
788 %attr(750,bacula,logs) %dir /var/log/bacula
789 %attr(640,bacula,logs) %ghost /var/log/bacula/log
790
791 %files dir
792 %defattr(644,root,root,755)
793 %doc ChangeLog CheckList ReleaseNotes kernstodo LICENSE
794 #%doc examples %{name}-docs-%{version}/manual/{*.pdf,bacula}
795 %attr(640,root,bacula) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bacula-dir.conf
796 %ghost %{_sysconfdir}/.pw.sed
797 %attr(640,root,root) %config(noreplace) /etc/logrotate.d/bacula-dir
798 %attr(754,root,root) /etc/rc.d/init.d/bacula-dir
799 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/bacula-dir
800 %attr(755,root,root) %{_sbindir}/bacula-dir
801 %attr(755,root,root) %{_sbindir}/bregex
802 %attr(755,root,root) %{_sbindir}/bwild
803 %attr(755,root,root) %{_sbindir}/dbcheck
804 %{_mandir}/man8/bacula-dir.8*
805 %{_mandir}/man8/dbcheck.8*
806 %{_libexecdir}/%{name}/query.sql
807 %if %{with sqlite3}
808 %attr(755,root,root) %{_libexecdir}/%{name}/create_sqlite3_database
809 %attr(755,root,root) %{_libexecdir}/%{name}/drop_sqlite3_database
810 %attr(755,root,root) %{_libexecdir}/%{name}/drop_sqlite3_tables
811 %attr(755,root,root) %{_libexecdir}/%{name}/grant_sqlite3_privileges
812 %attr(755,root,root) %{_libexecdir}/%{name}/make_sqlite3_tables
813 %attr(755,root,root) %{_libexecdir}/%{name}/update_sqlite3_*
814 %endif
815 %if %{with sqlite}
816 %attr(755,root,root) %{_libexecdir}/%{name}/create_sqlite_database
817 %attr(755,root,root) %{_libexecdir}/%{name}/drop_sqlite_database
818 %attr(755,root,root) %{_libexecdir}/%{name}/drop_sqlite_tables
819 %attr(755,root,root) %{_libexecdir}/%{name}/grant_sqlite_privileges
820 %attr(755,root,root) %{_libexecdir}/%{name}/make_sqlite_tables
821 %attr(755,root,root) %{_libexecdir}/%{name}/update_sqlite_*
822 %endif
823 %if %{with mysql}
824 %attr(755,root,root) %{_libexecdir}/%{name}/create_mysql_database
825 %attr(755,root,root) %{_libexecdir}/%{name}/drop_mysql_database
826 %attr(755,root,root) %{_libexecdir}/%{name}/drop_mysql_tables
827 %attr(755,root,root) %{_libexecdir}/%{name}/grant_mysql_privileges
828 %attr(755,root,root) %{_libexecdir}/%{name}/make_mysql_tables
829 %attr(755,root,root) %{_libexecdir}/%{name}/update_mysql_*
830 %endif
831 %if %{with pgsql}
832 %attr(755,root,root) %{_libexecdir}/%{name}/create_postgresql_database
833 %attr(755,root,root) %{_libexecdir}/%{name}/drop_postgresql_database
834 %attr(755,root,root) %{_libexecdir}/%{name}/drop_postgresql_tables
835 %attr(755,root,root) %{_libexecdir}/%{name}/grant_postgresql_privileges
836 %attr(755,root,root) %{_libexecdir}/%{name}/make_postgresql_tables
837 %attr(755,root,root) %{_libexecdir}/%{name}/update_postgresql_*
838 %endif
839 %attr(755,root,root) %{_libexecdir}/%{name}/create_bacula_database
840 %attr(755,root,root) %{_libexecdir}/%{name}/drop_bacula_database
841 %attr(755,root,root) %{_libexecdir}/%{name}/drop_bacula_tables
842 %attr(755,root,root) %{_libexecdir}/%{name}/grant_bacula_privileges
843 %attr(755,root,root) %{_libexecdir}/%{name}/make_bacula_tables
844 %attr(755,root,root) %{_libexecdir}/%{name}/update_bacula_tables
845 %attr(755,root,root) %{_libexecdir}/%{name}/make_catalog_backup
846 %attr(755,root,root) %{_libexecdir}/%{name}/delete_catalog_backup
847
848 %files fd
849 %defattr(644,root,root,755)
850 %doc LICENSE
851 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bacula-fd.conf
852 %attr(754,root,root) /etc/rc.d/init.d/bacula-fd
853 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/bacula-fd
854 %attr(755,root,root) %{_sbindir}/bacula-fd
855 %{_mandir}/man8/bacula-fd.8*
856
857 %files sd
858 %defattr(644,root,root,755)
859 %doc LICENSE
860 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bacula-sd.conf
861 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mtx-changer.conf
862 %attr(754,root,root) /etc/rc.d/init.d/bacula-sd
863 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/bacula-sd
864 %attr(755,root,root) %{_sbindir}/bacula-sd
865 %attr(755,root,root) %{_sbindir}/bcopy
866 %attr(755,root,root) %{_sbindir}/bextract
867 %attr(755,root,root) %{_sbindir}/bls
868 %attr(755,root,root) %{_sbindir}/bscan
869 %attr(755,root,root) %{_sbindir}/btape
870 %attr(755,root,root) %{_libexecdir}/%{name}/mtx-changer
871 %attr(755,root,root) %{_libexecdir}/%{name}/disk-changer
872 %attr(755,root,root) %{_libexecdir}/%{name}/dvd-handler
873 %{_mandir}/man8/bacula-sd.8*
874 %{_mandir}/man8/bcopy.8*
875 %{_mandir}/man8/bextract.8*
876 %{_mandir}/man8/bls.8*
877 %{_mandir}/man8/bscan.8*
878 %{_mandir}/man8/btape.8*
879
880 %files console
881 %defattr(644,root,root,755)
882 %doc LICENSE
883 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bconsole.conf
884 %attr(755,root,root) %{_sbindir}/bconsole
885 %{_mandir}/man8/bconsole.8*
886
887 %if %{with console_wx}
888 %files console-wx
889 %defattr(644,root,root,755)
890 %doc LICENSE
891 %{_pixmapsdir}/%{name}.png
892 %{_desktopdir}/bacula-wx.desktop
893 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bwx-console.conf
894 %attr(755,root,root) %{_sbindir}/bwx-console
895 %{_mandir}/man1/bacula-bwxconsole.1*
896 %endif
897
898 %if %{with gnome}
899 %files console-gnome
900 %defattr(644,root,root,755)
901 %doc LICENSE
902 %{_pixmapsdir}/%{name}.png
903 %{_desktopdir}/bacula.desktop
904 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bgnome-console.conf
905 %attr(755,root,root) %{_sbindir}/bgnome-console
906 %{_mandir}/man1/bacula-bgnome-console.1*
907 %endif
908
909 %if %{with bat}
910 %files console-qt4
911 %defattr(644,root,root,755)
912 %doc LICENSE
913 %{_pixmapsdir}/%{name}.png
914 %{_desktopdir}/bat.desktop
915 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bat.conf
916 %attr(755,root,root) %{_sbindir}/bat
917 %{_mandir}/man1/bat.1*
918 %endif
919
920 %if %{with console_wx}
921 %files tray-monitor
922 %defattr(644,root,root,755)
923 %doc LICENSE
924 %{_pixmapsdir}/%{name}-tray-monitor.xpm
925 %{_desktopdir}/%{name}-tray-monitor.desktop
926 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/tray-monitor.conf
927 %attr(755,root,root) %{_bindir}/bacula-tray-monitor
928 %{_mandir}/man1/bacula-tray-monitor.1*
929 %endif
930
931 %if %{with rescue}
932 %files rescue
933 %defattr(644,root,root,755)
934 %doc LICENSE
935 %dir %{_sysconfdir}/rescue
936 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/backup.etc.list
937 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/bacula-fd
938 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/format_floppy
939 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/getdiskinfo
940 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/make_rescue_disk
941 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/restore_bacula
942 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/restore_etc
943 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/run_grub
944 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/run_lilo
945 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/sfdisk.bz2
946 %endif
This page took 0.090704 seconds and 4 git commands to generate.