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