]> git.pld-linux.org Git - packages/bacula.git/blob - bacula.spec
- started update; nfy
[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.0
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:  872f5b86404e5c9b47bd56b9ffcb107c
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:  b8b10ca59a23c132cf4658c55103b85e
26 Source3:        http://dl.sourceforge.net/bacula/%{name}-gui-%{version}.tar.gz
27 # Source3-md5:  a8671ae6a26299c4f987c5b35157b0e9
28 Source4:        http://dl.sourceforge.net/bacula/%{name}-rescue-1.8.1.tar.gz
29 # Source4-md5:  a5833354917125127b4a1f5e68521834
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 URL:            http://www.bacula.org/
38 BuildRequires:  acl-static
39 BuildRequires:  automake
40 %{?with_rescue:BuildRequires:   fakeroot}
41 BuildRequires:  glibc-static
42 %if %{with gnome}
43 BuildRequires:  libgnome-devel >= 2.0
44 BuildRequires:  libgnomeui-devel >= 2.0
45 %endif
46 BuildRequires:  libstdc++-static
47 BuildRequires:  libwrap-static
48 BuildRequires:  mtx
49 BuildRequires:  ncurses-devel
50 BuildRequires:  openssl-devel
51 BuildRequires:  pkgconfig
52 %{?with_python:BuildRequires:   python-static}
53 BuildRequires:  readline-devel
54 BuildRequires:  rpmbuild(macros) >= 1.202
55 BuildRequires:  sed >= 4.0
56 BuildRequires:  sqlite-devel
57 %if %{with console_wx}
58 BuildRequires:  wxGTK2-devel >= 2.4.0
59 %endif
60 BuildRequires:  tetex-latex
61 BuildRequires:  tetex-makeindex
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
86 w 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 Conflicts:      bacula-dir < 0:1.34.6
98 Conflicts:      bacula-fd < 0:1.34.6
99 Conflicts:      bacula-sd < 0:1.34.6
100 Conflicts:      bacula-console < 0:1.34.6
101 Requires(post): openssl-tools
102 Requires(post): sed >= 4.0
103 Requires(pre):  /usr/sbin/groupadd
104 Requires(pre):  /usr/sbin/useradd
105 Requires(post,preun):   /sbin/chkconfig
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
124 w 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 Obsoletes:      %{name}-updatedb
136 PreReq:         bacula-common = %{epoch}:%{version}-%{release}
137 Requires(post): sed >= 4.0
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 PreReq:         bacula-common = %{epoch}:%{version}-%{release}
174 Requires(post): sed >= 4.0
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 PreReq:         bacula-common = %{epoch}:%{version}-%{release}
196 Requires(post): sed >= 4.0
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 PreReq:         bacula-common = %{epoch}:%{version}-%{release}
218 Requires(post): sed >= 4.0
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
226 interface.
227
228 %description console-gnome -l pl
229 Bacula - przychodzi noc± i wysysa ¿ywotny ekstrakt z komputerów.
230
231 Bacula Console to program umo¿liwiaj±cy administratorowi lub
232 u¿ytkownikowi komunikowanie siê z programem Bacula Director. To jest
233 interfejs graficzny oparty na GNOME.
234
235 %package tray-monitor
236 Summary:        Bacula Tray Monitor
237 Group:          Networking/Utilities
238 PreReq:         bacula-common = %{epoch}:%{version}-%{release}
239 Requires(post): sed >= 4.0
240
241 %description tray-monitor
242 Bacula - It comes by night and sucks the vital essence from your
243 computers.
244
245 The Monitor program is typically an icon in the system tray. However, once the
246 icon is expanded into a full window, the administrator or user can obtain
247 status information about the Director or the backup status on the local
248 workstation or any other Bacula daemon that is configured.
249
250 %package fd
251 Summary:        Bacula File services (Client)
252 Summary(pl):    Us³ugi Bacula File (klient)
253 Group:          Networking/Utilities
254 PreReq:         bacula-common = %{epoch}:%{version}-%{release}
255 Requires(post): sed >= 4.0
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 PreReq:         bacula-common = %{epoch}:%{version}-%{release}
290 Requires(post): sed >= 4.0
291
292 %description sd
293 Bacula - It comes by night and sucks the vital essence from your
294 computers.
295
296 Bacula Storage services consist of the software programs that perform
297 the storage and recovery of the file attributes and data to the
298 physical backup media or volumes. In other words, the Storage daemon
299 is responsible for reading and writing your tapes (or other storage
300 media, e.g. files). The Storage services runs as a daemon on the
301 machine that has the backup device (usually a tape drive).
302
303 %description sd -l pl
304 Bacula - przychodzi noc± i wysysa ¿ywotny ekstrakt z komputerów.
305
306 Us³ugi Bacula Storage sk³adaj± siê z programów obs³uguj±cych
307 przechowywanie danych oraz odzyskiwanie atrybutów i danych na
308 fizycznych no¶nikach lub wolumenach. Innymi s³owy, demon Storage jest
309 odpowiedzialny za odczyt i zapis ta¶m (lub innych no¶ników do
310 przechowywania danych, np. plików). Us³ugi Storage dzia³aj± jako demon
311 na maszynie, która zawiera urz±dzenie backupowe (zwykle napêd
312 ta¶mowy).
313
314 %package rescue
315 Summary:        Bacula - The Network Backup Solution
316 Summary(pl):    Bacula - rozwi±zanie do wykonywania kopii zapasowych po sieci
317 Group:          Networking/Utilities
318 Requires:       %{name}-fd = %{epoch}:%{version}-%{release}
319 Requires:       coreutils
320 Requires:       util-linux
321
322 %description rescue
323 Bacula - It comes by night and sucks the vital essence from your
324 computers.
325
326 Bacula is a set of computer programs that permit you (or the system
327 administrator) to manage backup, recovery, and verification of
328 computer data across a network of computers of different kinds. In
329 technical terms, it is a network client/server based backup program.
330 Bacula is relatively easy to use and efficient, while offering many
331 advanced storage management features that make it easy to find and
332 recover lost or damaged files.
333
334 This package installs scripts for disaster recovery and builds rescue
335 floppy disk for bare metal recovery. 
336
337 To make the bacula rescue disk run "./make_rescue_disk --copy-static-bacula
338 - --copy-etc-files" from the %{_sysconfdir}/rescue directory. To recreate the
339 rescue information for this system run ./getdiskinfo again.
340
341 %description rescue -l pl
342 Bacula - przychodzi noc± i wysysa ¿ywotny ekstrakt z komputerów.
343
344 Bacula to zbiór programów umo¿liwiaj±cych administratorowi na
345 zarz±dzanie kopiami zapasowymi, odzyskiwaniem i weryfikacj± danych
346 w sieci komputerów ró¿nego rodzaju. W terminologii technicznej jest to
347 program do kopii zapasowych pracuj±cy w architekturze klient-serwer.
348 Bacula jest stosunkowo ³atwa w u¿yciu i wydajna, oferuj±c przy tym
349 wiele zaawansowanych mo¿liwo¶ci przy zarz±dzaniu no¶nikami,
350 u³atwiaj±cych znalezienie i odzyskanie utraconych lub uszkodzonych
351 plików.
352
353 Ten pakiet zawiera skrypty do odtwarzania po awarii i tworzy dyskietkê
354 ratunkowe do odtwarzania systemu od zera. 
355
356 Aby stworzyæ dyskietkê ratunkow± Baculi, nale¿y uruchomiæ "./make_rescue_disk
357 --copy-static-bacula - --copy-etc-files" z katalogu
358 %{_sysconfdir}/rescue . Aby ponownie utworzyæ informacje ratunkowe dla
359 danego systemu, nale¿y ponownie uruchomiæ ./getdiskinfo .
360
361 %prep
362 %setup -q -a 1 -a 2
363 tar -xf %{SOURCE3}
364 tar -xf %{SOURCE4} && ln -s bacula-rescue-* rescue
365 sed -i -e 's#wx-config#wx-gtk2-ansi-config#g' configure*
366 sed -i -e 's#-lreadline -lhistory -ltermcap#-lreadline -lhistory#g' configure*
367 sed -i -e 's#bindir=.*#bindir=%{_bindir}#g' \
368         src/cats/create_* src/cats/delete_* src/cats/drop_* \
369         src/cats/grant_* src/cats/make_* src/cats/update_*
370 sed -i -e 's/@hostname@/--hostname--/' src/*/*.conf.in
371
372 %build
373 cp -f %{_datadir}/automake/config.sub autoconf
374 CPPFLAGS="-I%{_includedir}/ncurses -I%{_includedir}/readline"
375 %configure \
376         --with-scriptdir=%{_libexecdir}/%{name} \
377         --%{!?with_gnome:dis}%{?with_gnome:en}able-gnome \
378         --disable-conio \
379         --enable-smartalloc \
380         %{?with_console_wx:--enable-wx-console} \
381         --enable-tray-monitor \
382         --with-readline \
383         --with-tcp-wrappers \
384         --with-working-dir=%{_var}/lib/%{name} \
385         --with-dump-email="root@localhost" \
386         --with-job-email="root@localhost" \
387         --with-smtp-host=localhost \
388         --with-pid-dir=/var/run \
389         --with-subsys-dir=/var/lock/subsys \
390         --with-sqlite \
391         --with-dir-password="#FAKE-dir-password#" \
392         --with-fd-password="#FAKE-fd-password#" \
393         --with-sd-password="#FAKE-sd-password#" \
394         --with-mon-dir-password="#FAKE-mon-dir-password#" \
395         --with-mon-fd-password="#FAKE-mon-fd-password#" \
396         --with-mon-sd-password="#FAKE-mon-sd-password#" \
397         --enable-static-fd \
398         --with-openssl
399
400 %{__make}
401
402 cd %{name}-docs-%{version}
403 %configure \
404         --with-bacula=../
405 %{__make}
406 cd ..
407
408 %if %{with rescue}
409 cd rescue
410 %configure \
411         --with-bacula=../
412 cd linux/cdrom
413 fakeroot %{__make}
414 %endif
415
416 %install
417 rm -rf $RPM_BUILD_ROOT
418
419 install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,logrotate.d,pam.d,sysconfig}
420 install -d $RPM_BUILD_ROOT%{_sysconfdir}/rescue
421 install -d $RPM_BUILD_ROOT{%{_pixmapsdir},%{_desktopdir},%{_mandir},%{_bindir}}
422
423 %{__make} install \
424         DESTDIR=$RPM_BUILD_ROOT
425
426 # static daemon
427 strip -R.comment -R.note src/filed/static-bacula-fd
428 install src/filed/static-bacula-fd $RPM_BUILD_ROOT%{_sysconfdir}/rescue/bacula-fd
429
430 # tray-monitor is for regular users
431 mv $RPM_BUILD_ROOT%{_sbindir}/bacula-tray-monitor $RPM_BUILD_ROOT%{_bindir}
432
433 install %{SOURCE10} $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-dir
434 install %{SOURCE11} $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-fd
435 install %{SOURCE12} $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-sd
436 install %{SOURCE13} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}-dir
437 install %{SOURCE14} $RPM_BUILD_ROOT/etc/sysconfig/bacula-dir
438 install %{SOURCE15} $RPM_BUILD_ROOT/etc/sysconfig/bacula-fd
439 install %{SOURCE16} $RPM_BUILD_ROOT/etc/sysconfig/bacula-sd
440
441 install scripts/bacula.png $RPM_BUILD_ROOT%{_pixmapsdir}/bacula.png
442 install src/tray-monitor/generic.xpm $RPM_BUILD_ROOT%{_pixmapsdir}/bacula-tray-monitor.xpm
443 install scripts/bacula.desktop.gnome2 $RPM_BUILD_ROOT%{_desktopdir}/bacula.desktop
444 sed -e 's/gnome-console/wx-console/g;s/Console/Wx Console/g' \
445         scripts/bacula.desktop.gnome2 > $RPM_BUILD_ROOT%{_desktopdir}/bacula-wx.desktop
446 sed -e 's#%{_sbindir}#%{_bindir}#' \
447         scripts/bacula-tray-monitor.desktop > $RPM_BUILD_ROOT%{_desktopdir}/bacula-tray-monitor.desktop
448
449 %if %{with rescue}
450 # install the rescue stuff, these are the rescue scripts
451 install rescue/linux/floppy/backup.etc.list $RPM_BUILD_ROOT%{_sysconfdir}/rescue
452 install rescue/linux/floppy/*_* $RPM_BUILD_ROOT%{_sysconfdir}/rescue
453 install rescue/linux/floppy/getdiskinfo $RPM_BUILD_ROOT%{_sysconfdir}/rescue
454 install rescue/linux/floppy/sfdisk.bz2 $RPM_BUILD_ROOT%{_sysconfdir}/rescue
455 %endif
456
457 # install the updatedb scripts
458 install updatedb/update_sqlite* $RPM_BUILD_ROOT%{_libexecdir}/%{name}
459
460 # manual
461 cp -a man1 man8 $RPM_BUILD_ROOT%{_mandir}
462
463 # place for site passwords
464 touch $RPM_BUILD_ROOT%{_sysconfdir}/{dir-password,fd-password,sd-password}
465 touch $RPM_BUILD_ROOT%{_sysconfdir}/{mon-dir-password,mon-fd-password,mon-sd-password}
466
467 # some file changes
468 rm -f $RPM_BUILD_ROOT%{_libexecdir}/%{name}/{gconsole,startmysql,stopmysql,bacula,bconsole,fd}
469 rm -f $RPM_BUILD_ROOT%{_sbindir}/static-bacula-fd
470 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/gnome*
471 %if %{without console_wx}
472 rm -f $RPM_BUILD_ROOT%{_desktopdir}/bacula-wx.desktop
473 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/wx-console*
474 %endif
475 touch $RPM_BUILD_ROOT%{_sysconfdir}/.pw.sed
476
477 %clean
478 rm -rf $RPM_BUILD_ROOT
479
480 %pre common
481 %groupadd -P %{name}-common -g 136 -r -f bacula
482 %useradd -P %{name}-common -u 136 -r -d /var/lib/bacula -s /bin/false -c "Bacula User" -g bacula bacula
483
484 %post common
485 echo "Updating bacula passwords and names..."
486 cd /etc/bacula
487 for f in *-password ; do
488         if [ ! -s $f ] ; then
489                 openssl rand -base64 33 > $f
490         fi
491         p=`cat $f`
492         for cf in *.conf *.conf.rpmnew ; do
493                 [ -f $cf ] && sed -i -e"s:#FAKE-$f#:$p:" "$cf" || :
494         done
495 done
496 for cf in *.conf *.conf.rpmnew ; do
497         [ -f $cf ] && sed -i -e"s:--hostname--:`hostname`:" "$cf" || :
498 done
499
500 %postun common
501 if [ "$1" = "0" ]; then
502         %userremove bacula
503         %groupremove bacula
504 fi
505
506 %post dir
507 umask 077
508 [ -s %{_localstatedir}/bacula.db ] && \
509         DB_VER=`echo "select * from Version;" | \
510         %{_bindir}/sqlite %{_localstatedir}/bacula.db | tail -n 1 2>/dev/null`
511 if [ -z "$DB_VER" ]; then
512 # grant privileges and create tables
513         %{_libexecdir}/%{name}/grant_bacula_privileges > dev/null
514         %{_libexecdir}/%{name}/create_bacula_database > dev/null
515         %{_libexecdir}/%{name}/make_bacula_tables > dev/null
516 elif [ "$DB_VER" -lt "8" ]; then
517         echo "Backing up bacula tables"
518         echo ".dump" | sqlite %{_localstatedir}/bacula.db | bzip2 > %{_localstatedir}/bacula_backup.sql.bz2
519         type=sqlite
520         echo "Upgrading bacula tables"
521         if [ "$DB_VER" -lt "8" ]; then
522                 if [ "$DB_VER" -lt "7" ]; then
523                         if [ "$DB_VER" -lt "6" ]; then
524                                 if [ "$DB_VER" -lt "5" ]; then
525                                         %{_libexecdir}/%{name}/update_${type}_tables_4_to_5
526                                 fi
527                                 %{_libexecdir}/%{name}/update_${type}_tables_5_to_6
528                         fi
529                         %{_libexecdir}/%{name}/update_${type}_tables_6_to_7
530                 fi
531                 %{_libexecdir}/%{name}/update_${type}_tables_7_to_8
532         fi
533         %{_libexecdir}/%{name}/update_bacula_tables
534         echo "If bacula works correctly you can remove the backup file %{_localstatedir}/bacula_backup.sql.bz2"
535 fi
536 chown -R bacula:bacula %{_localstatedir}
537 chmod -R u+rX,go-rwx %{_localstatedir}/*
538
539 echo "Updating Bacula passwords and names..."
540 cd /etc/bacula
541 for f in *-password ; do
542         p=`cat $f`
543         sed -i -e"s:#FAKE-$f#:$p:" *.conf *.conf.rpmnew
544 done
545 sed -i -e"s:--hostname--:`hostname`:" *.conf *.conf.rpmnew
546
547 /sbin/chkconfig --add bacula-dir
548 if [ -f /var/lock/subsys/bacula-dir ]; then
549         /etc/rc.d/init.d/bacula-dir restart 1>&2
550 else
551         echo "Run \"/etc/rc.d/init.d/bacula-dir start\" to start Bacula Director daemon."
552 fi
553
554 %preun dir
555 if [ "$1" = "0" ]; then
556         if [ -f /var/lock/subsys/bacula-dir ]; then
557                 /etc/rc.d/init.d/bacula-dir stop 1>&2
558         fi
559         /sbin/chkconfig --del bacula-dir
560 fi
561
562 %post fd
563 echo "Updating Bacula passwords and names..."
564 cd /etc/bacula
565 for f in *-password ; do
566         p=`cat $f`
567         sed -i -e"s:#FAKE-$f#:$p:" *.conf *.conf.rpmnew
568 done
569 sed -i -e"s:--hostname--:`hostname`:" *.conf *.conf.rpmnew
570
571 /sbin/chkconfig --add bacula-fd
572 if [ -f /var/lock/subsys/bacula-fd ]; then
573         /etc/rc.d/init.d/bacula-fd restart 1>&2
574 else
575         echo "Run \"/etc/rc.d/init.d/bacula-fd start\" to start Bacula File daemon."
576 fi
577
578 %preun fd
579 if [ "$1" = "0" ]; then
580         if [ -f /var/lock/subsys/bacula-fd ]; then
581                 /etc/rc.d/init.d/bacula-fd stop 1>&2
582         fi
583         /sbin/chkconfig --del bacula-fd
584 fi
585
586 %post sd
587 echo "Updating Bacula passwords and names..."
588 cd /etc/bacula
589 for f in *-password ; do
590         p=`cat $f`
591         sed -i -e"s:#FAKE-$f#:$p:" *.conf *.conf.rpmnew
592 done
593 sed -i -e"s:--hostname--:`hostname`:" *.conf *.conf.rpmnew
594
595 /sbin/chkconfig --add bacula-sd
596 if [ -f /var/lock/subsys/bacula-sd ]; then
597         /etc/rc.d/init.d/bacula-sd restart 1>&2
598 else
599         echo "Run \"/etc/rc.d/init.d/bacula-sd start\" to start Bacula Storage daemon."
600 fi
601
602 %preun sd
603 if [ "$1" = "0" ]; then
604         if [ -f /var/lock/subsys/bacula-sd ]; then
605                 /etc/rc.d/init.d/bacula-sd stop 1>&2
606         fi
607         /sbin/chkconfig --del bacula-sd
608 fi
609
610 %pre console
611 if [ -e %{_sysconfdir}/console.conf -a ! -e %{_sysconfdir}/bconsole.conf ]; then
612         mv %{_sysconfdir}/console.conf %{_sysconfdir}/bconsole.conf
613 fi
614
615 %post console
616 echo "Updating Bacula passwords and names..."
617 cd /etc/bacula
618 for f in *-password ; do
619         p=`cat $f`
620         sed -i -e"s:#FAKE-$f#:$p:" *.conf *.conf.rpmnew
621 done
622 sed -i -e"s:--hostname--:`hostname`:" *.conf *.conf.rpmnew
623
624 %post console-wx
625 echo "Updating Bacula passwords and names..."
626 cd /etc/bacula
627 for f in *-password ; do
628         p=`cat $f`
629         sed -i -e"s:#FAKE-$f#:$p:" *.conf *.conf.rpmnew
630 done
631 sed -i -e"s:--hostname--:`hostname`:" *.conf *.conf.rpmnew
632
633 %post console-gnome
634 echo "Updating Bacula passwords and names..."
635 cd /etc/bacula
636 for f in *-password ; do
637         p=`cat $f`
638         sed -i -e"s:#FAKE-$f#:$p:" *.conf *.conf.rpmnew
639 done
640 sed -i -e"s:--hostname--:`hostname`:" *.conf *.conf.rpmnew
641
642 %post tray-monitor
643 echo "Updating Bacula passwords and names..."
644 cd /etc/bacula
645 for f in *-password ; do
646         p=`cat $f`
647         sed -i -e"s:#FAKE-$f#:$p:" *.conf *.conf.rpmnew
648 done
649 sed -i -e"s:--hostname--:`hostname`:" *.conf *.conf.rpmnew
650
651 %post rescue
652 # link our current installed conf file to the rescue directory
653 ln -sf %{_sysconfdir}/bacula-fd.conf %{_sysconfdir}/rescue/bacula-fd.conf
654
655 # run getdiskinfo
656 echo "Creating rescue files for this system..."
657 cd %{_sysconfdir}/rescue
658 ./getdiskinfo
659
660 %preun rescue
661 # remove the files created after the initial rpm installation
662 if [ "$1" = "0" ]; then
663         rm -f %{_sysconfdir}/rescue/bacula-fd.conf
664         rm -f %{_sysconfdir}/rescue/partition.*
665         rm -f %{_sysconfdir}/rescue/format.*
666         rm -f %{_sysconfdir}/rescue/mount_drives
667         rm -f %{_sysconfdir}/rescue/start_network
668         rm -f %{_sysconfdir}/rescue/sfdisk
669         rm -rf %{_sysconfdir}/rescue/diskinfo/*
670 fi
671
672 %files common
673 %defattr(644,root,root,755)
674 %doc LICENSE
675 %dir %{_sysconfdir}
676 %attr(600,root,root) %config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/*-password
677 %attr(755,root,root) %{_sbindir}/btraceback
678 %attr(755,root,root) %{_sbindir}/bsmtp
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 doc/*.pdf examples %{name}-docs-%{version}/html-manual
688 %attr(600,root,root) %config(noreplace) %verify(not md5 size mtime) %{_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 %attr(644,root,root) %config(noreplace) %verify(not md5 size mtime) /etc/sysconfig/bacula-dir
693 %attr(755,root,root) %{_sbindir}/bacula-dir
694 %attr(755,root,root) %{_sbindir}/dbcheck
695 %{_mandir}/man8/bacula-dir.8*
696 %{_mandir}/man1/dbcheck.1*
697 %{_libexecdir}/%{name}/query.sql
698 %attr(755,root,root) %{_libexecdir}/%{name}/create_sqlite_database
699 %attr(755,root,root) %{_libexecdir}/%{name}/drop_sqlite_database
700 %attr(755,root,root) %{_libexecdir}/%{name}/drop_sqlite_tables
701 %attr(755,root,root) %{_libexecdir}/%{name}/grant_sqlite_privileges
702 %attr(755,root,root) %{_libexecdir}/%{name}/make_sqlite_tables
703 %attr(755,root,root) %{_libexecdir}/%{name}/update_sqlite_tables*
704 %attr(755,root,root) %{_libexecdir}/%{name}/create_bacula_database
705 %attr(755,root,root) %{_libexecdir}/%{name}/drop_bacula_database
706 %attr(755,root,root) %{_libexecdir}/%{name}/drop_bacula_tables
707 %attr(755,root,root) %{_libexecdir}/%{name}/grant_bacula_privileges
708 %attr(755,root,root) %{_libexecdir}/%{name}/make_bacula_tables
709 %attr(755,root,root) %{_libexecdir}/%{name}/update_bacula_tables
710 %attr(755,root,root) %{_libexecdir}/%{name}/make_catalog_backup
711 %attr(755,root,root) %{_libexecdir}/%{name}/delete_catalog_backup
712
713 %files fd
714 %defattr(644,root,root,755)
715 %doc LICENSE
716 %attr(600,root,root) %config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/bacula-fd.conf
717 %attr(754,root,root) /etc/rc.d/init.d/bacula-fd
718 %attr(644,root,root) %config(noreplace) %verify(not md5 size mtime) /etc/sysconfig/bacula-fd
719 %attr(755,root,root) %{_sbindir}/bacula-fd
720 %{_mandir}/man8/bacula-fd.8*
721
722 %files sd
723 %defattr(644,root,root,755)
724 %doc LICENSE
725 %dir %{_sysconfdir}
726 %attr(600,root,root) %config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/bacula-sd.conf
727 %attr(754,root,root) /etc/rc.d/init.d/bacula-sd
728 %attr(644,root,root) %config(noreplace) %verify(not md5 size mtime) /etc/sysconfig/bacula-sd
729 %attr(755,root,root) %{_sbindir}/bacula-sd
730 %attr(755,root,root) %{_sbindir}/bcopy
731 %attr(755,root,root) %{_sbindir}/bextract
732 %attr(755,root,root) %{_sbindir}/bls
733 %attr(755,root,root) %{_sbindir}/bscan
734 %attr(755,root,root) %{_sbindir}/btape
735 %{_libexecdir}/%{name}/mtx-changer
736 %{_mandir}/man8/bacula-sd.8*
737 %{_mandir}/man1/bcopy.1*
738 %{_mandir}/man1/bextract.1*
739 %{_mandir}/man1/bls.1*
740 %{_mandir}/man1/bscan.1*
741 %{_mandir}/man1/btape.1*
742
743 %files console
744 %defattr(644,root,root,755)
745 %doc LICENSE
746 %attr(600,root,root) %config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/bconsole.conf
747 %attr(755,root,root) %{_sbindir}/bconsole
748 %{_mandir}/man1/bconsole.1*
749
750 %if %{with console_wx}
751 %files console-wx
752 %defattr(644,root,root,755)
753 %doc LICENSE
754 %{_pixmapsdir}/%{name}.png
755 %{_desktopdir}/bacula-wx.desktop
756 %attr(600,root,root) %config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/wx-console.conf
757 %attr(755,root,root) %{_sbindir}/wx-console
758 %{_mandir}/man1/wx-console.1*
759 %endif
760
761 %if %{with gnome}
762 %files console-gnome
763 %defattr(644,root,root,755)
764 %doc LICENSE
765 %{_pixmapsdir}/%{name}.png
766 %{_desktopdir}/bacula.desktop
767 %attr(600,root,root) %config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/gnome-console.conf
768 %attr(755,root,root) %{_sbindir}/gnome-console
769 #%{_mandir}/man1/gnome-console.1*
770 %endif
771
772 %files tray-monitor
773 %defattr(644,root,root,755)
774 %doc LICENSE
775 %{_pixmapsdir}/%{name}-tray-monitor.xpm
776 %{_desktopdir}/%{name}-tray-monitor.desktop
777 %attr(644,root,root) %config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/tray-monitor.conf
778 %attr(755,root,root) %{_bindir}/bacula-tray-monitor
779 #%{_mandir}/man1/bacula-tray-monitor.1*
780
781 %if %{with rescue}
782 %files rescue
783 %defattr(644,root,root,755)
784 %doc LICENSE
785 %dir %{_sysconfdir}/rescue
786 %config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/rescue/backup.etc.list
787 %config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/rescue/bacula-fd
788 %attr(755,root,root) %config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/rescue/format_floppy
789 %attr(755,root,root) %config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/rescue/getdiskinfo
790 %attr(755,root,root) %config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/rescue/make_rescue_disk
791 %attr(755,root,root) %config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/rescue/restore_bacula
792 %attr(755,root,root) %config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/rescue/restore_etc
793 %attr(755,root,root) %config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/rescue/run_grub
794 %attr(755,root,root) %config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/rescue/run_lilo
795 %config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/rescue/sfdisk.bz2
796 %endif
This page took 0.101196 seconds and 4 git commands to generate.