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