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