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