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