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