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