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