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