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