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