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