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