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