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