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