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