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