]> git.pld-linux.org Git - packages/bacula.git/blob - bacula.spec
- spaces -> tabs & other cosmetics
[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.1
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:  3bbf805b873716ef782ae12c92a778b4
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:  523ce33d8f038e9b16cdf03f5c2b66f0
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.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:  openssl-static
52 BuildRequires:  pkgconfig
53 %{?with_python:BuildRequires:   python-static}
54 BuildRequires:  readline-devel
55 BuildRequires:  rpmbuild(macros) >= 1.202
56 BuildRequires:  sed >= 4.0
57 BuildRequires:  sqlite-devel
58 %if %{with console_wx}
59 BuildRequires:  wxGTK2-devel >= 2.4.0
60 %endif
61 BuildRequires:  zlib-devel
62 BuildRequires:  zlib-static
63 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
64
65 %define         _sysconfdir     /etc/%{name}
66 %define         _localstatedir  /var/lib/%{name}
67
68 %description
69 Bacula - It comes by night and sucks the vital essence from your
70 computers.
71
72 Bacula is a set of computer programs that permit you (or the system
73 administrator) to manage backup, recovery, and verification of
74 computer data across a network of computers of different kinds. In
75 technical terms, it is a network client/server based backup program.
76 Bacula is relatively easy to use and efficient, while offering many
77 advanced storage management features that make it easy to find and
78 recover lost or damaged files.
79
80 %description -l pl
81 Bacula - przychodzi noc± i wysysa ¿ywotny ekstrakt z komputerów.
82
83 Bacula to zbiór programów umo¿liwiaj±cych administratorowi na
84 zarz±dzanie kopiami zapasowymi, odzyskiwaniem i weryfikacj± danych
85 w sieci komputerów ró¿nego rodzaju. W terminologii technicznej jest to
86 program do kopii zapasowych pracuj±cy w architekturze klient-serwer.
87 Bacula jest stosunkowo ³atwa w u¿yciu i wydajna, oferuj±c przy tym
88 wiele zaawansowanych mo¿liwo¶ci przy zarz±dzaniu no¶nikami,
89 u³atwiaj±cych znalezienie i odzyskanie utraconych lub uszkodzonych
90 plików.
91
92 %package common
93 Summary:        Common files for bacula package
94 Summary(pl):    Pliki wspólne dla pakietu bacula
95 Group:          Networking/Utilities
96 Conflicts:      bacula-dir < 0:1.34.6
97 Conflicts:      bacula-fd < 0:1.34.6
98 Conflicts:      bacula-sd < 0:1.34.6
99 Conflicts:      bacula-console < 0:1.34.6
100 Requires(post): openssl-tools
101 Requires(post): sed >= 4.0
102 Requires(pre):  /usr/sbin/groupadd
103 Requires(pre):  /usr/sbin/useradd
104 Requires(post,preun):   /sbin/chkconfig
105
106 %description common
107 Bacula - It comes by night and sucks the vital essence from your
108 computers.
109
110 Bacula is a set of computer programs that permit you (or the system
111 administrator) to manage backup, recovery, and verification of
112 computer data across a network of computers of different kinds. In
113 technical terms, it is a network client/server based backup program.
114 Bacula is relatively easy to use and efficient, while offering many
115 advanced storage management features that make it easy to find and
116 recover lost or damaged files.
117
118 %description common -l pl
119 Bacula - przychodzi noc± i wysysa ¿ywotny ekstrakt z komputerów.
120
121 Bacula to zbiór programów umo¿liwiaj±cych administratorowi na
122 zarz±dzanie kopiami zapasowymi, odzyskiwaniem i weryfikacj± danych
123 w sieci komputerów ró¿nego rodzaju. W terminologii technicznej jest to
124 program do kopii zapasowych pracuj±cy w architekturze klient-serwer.
125 Bacula jest stosunkowo ³atwa w u¿yciu i wydajna, oferuj±c przy tym
126 wiele zaawansowanych mo¿liwo¶ci przy zarz±dzaniu no¶nikami,
127 u³atwiaj±cych znalezienie i odzyskanie utraconych lub uszkodzonych
128 plików.
129
130 %package dir
131 Summary:        Bacula Director and Catalog services
132 Summary(pl):    Us³ugi Bacula Director i Catalog
133 Group:          Networking/Utilities
134 Obsoletes:      %{name}-updatedb
135 PreReq:         bacula-common = %{epoch}:%{version}-%{release}
136 Requires(post): sed >= 4.0
137
138 %description dir
139 Bacula - It comes by night and sucks the vital essence from your
140 computers.
141
142 Bacula Director is the program that supervises all the backup,
143 restore, verify and archive operations. The system administrator uses
144 the Bacula Director to schedule backups and to recover files. Catalog
145 services are comprised of the software programs responsible for
146 maintaining the file indexes and volume databases for all files backed
147 up. The Catalog services permit the System Administrator or user to
148 quickly locate and restore any desired file, since it maintains a
149 record of all Volumes used, all Jobs run, and all Files saved. This
150 build requires sqlite to be installed separately as the catalog
151 database.
152
153 %description dir -l pl
154 Bacula - przychodzi noc± i wysysa ¿ywotny ekstrakt z komputerów.
155
156 Bacula Director to program nadzoruj±cy wszystkie operacje wykonywania
157 kopii zapasowych, odzyskiwania, weryfikacji i archiwizowania.
158 Administrator u¿ywa Bacula Directora do szeregowania kopii zapasowych
159 oraz odzyskiwania plików. Us³ugi katalogowe (Catalog services) s±
160 u¿ywane przez programy odpowiedzialne za zarz±dzanie indeksami plików
161 i baz± danych wolumenów dla wszystkich kopiowanych plików. Us³ugi
162 katalogowe umo¿liwiaj± administratorowi lub u¿ytkownikowi szybko
163 zlokalizowaæ i odtworzyæ dowolny plik, poniewa¿ utrzymuj± rekord ze
164 wszystkimi u¿ywanymi wolumenami, uruchomionymi zadaniami i zapisanymi
165 plikami. Pakiet wymaga sqlite zainstalowanego oddzielnie jako bazy
166 danych dla katalogu.
167
168 %package console
169 Summary:        Bacula Console
170 Summary(pl):    Konsola Baculi
171 Group:          Networking/Utilities
172 PreReq:         bacula-common = %{epoch}:%{version}-%{release}
173 Requires(post): sed >= 4.0
174
175 %description console
176 Bacula - It comes by night and sucks the vital essence from your
177 computers.
178
179 Bacula Console is the program that allows the administrator or user to
180 communicate with the Bacula Director. This is the text only console
181 interface.
182
183 %description console -l pl
184 Bacula - przychodzi noc± i wysysa ¿ywotny ekstrakt z komputerów.
185
186 Bacula Console to program umo¿liwiaj±cy administratorowi lub
187 u¿ytkownikowi komunikowanie siê z programem Bacula Director. To jest
188 interfejs czysto tekstowy.
189
190 %package console-wx
191 Summary:        Bacula wxWidgets Console
192 Summary(pl):    Konsola Baculi oparta na wxWidgets
193 Group:          Networking/Utilities
194 PreReq:         bacula-common = %{epoch}:%{version}-%{release}
195 Requires(post): sed >= 4.0
196
197 %description console-wx
198 Bacula - It comes by night and sucks the vital essence from your
199 computers.
200
201 Bacula Console is the program that allows the administrator or user to
202 communicate with the Bacula Director. This is the wxWidgets GUI
203 interface.
204
205 %description console-wx -l pl
206 Bacula - przychodzi noc± i wysysa ¿ywotny ekstrakt z komputerów.
207
208 Bacula Console to program umo¿liwiaj±cy administratorowi lub
209 u¿ytkownikowi komunikowanie siê z programem Bacula Director. To jest
210 interfejs graficzny oparty na wxWidgets.
211
212 %package console-gnome
213 Summary:        Bacula GNOME Console
214 Summary(pl):    Konsola Baculi oparta dla GNOME
215 Group:          Networking/Utilities
216 PreReq:         bacula-common = %{epoch}:%{version}-%{release}
217 Requires(post): sed >= 4.0
218
219 %description console-gnome
220 Bacula - It comes by night and sucks the vital essence from your
221 computers.
222
223 Bacula Console is the program that allows the administrator or user to
224 communicate with the Bacula Director. This is the GNOME GUI
225 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 PreReq:         bacula-common = %{epoch}:%{version}-%{release}
238 Requires(post): sed >= 4.0
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 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 %if %{with rescue}
403 cd rescue
404 %configure \
405         --with-bacula=../
406 cd linux/cdrom
407 fakeroot %{__make}
408 %endif
409
410 %install
411 rm -rf $RPM_BUILD_ROOT
412
413 install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,logrotate.d,pam.d,sysconfig}
414 install -d $RPM_BUILD_ROOT%{_sysconfdir}/rescue
415 install -d $RPM_BUILD_ROOT{%{_pixmapsdir},%{_desktopdir},%{_mandir},%{_bindir}}
416
417 %{__make} install \
418         DESTDIR=$RPM_BUILD_ROOT
419
420 # static daemon
421 strip -R.comment -R.note src/filed/static-bacula-fd
422 install src/filed/static-bacula-fd $RPM_BUILD_ROOT%{_sysconfdir}/rescue/bacula-fd
423
424 # tray-monitor is for regular users
425 mv $RPM_BUILD_ROOT%{_sbindir}/bacula-tray-monitor $RPM_BUILD_ROOT%{_bindir}
426
427 install %{SOURCE10} $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-dir
428 install %{SOURCE11} $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-fd
429 install %{SOURCE12} $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-sd
430 install %{SOURCE13} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}-dir
431 install %{SOURCE14} $RPM_BUILD_ROOT/etc/sysconfig/bacula-dir
432 install %{SOURCE15} $RPM_BUILD_ROOT/etc/sysconfig/bacula-fd
433 install %{SOURCE16} $RPM_BUILD_ROOT/etc/sysconfig/bacula-sd
434
435 install scripts/bacula.png $RPM_BUILD_ROOT%{_pixmapsdir}/bacula.png
436 install src/tray-monitor/generic.xpm $RPM_BUILD_ROOT%{_pixmapsdir}/bacula-tray-monitor.xpm
437 install scripts/bacula.desktop.gnome2 $RPM_BUILD_ROOT%{_desktopdir}/bacula.desktop
438 sed -e 's/gnome-console/wx-console/g;s/Console/Wx Console/g' \
439         scripts/bacula.desktop.gnome2 > $RPM_BUILD_ROOT%{_desktopdir}/bacula-wx.desktop
440 sed -e 's#%{_sbindir}#%{_bindir}#' \
441         scripts/bacula-tray-monitor.desktop > $RPM_BUILD_ROOT%{_desktopdir}/bacula-tray-monitor.desktop
442
443 %if %{with rescue}
444 # install the rescue stuff, these are the rescue scripts
445 install rescue/linux/floppy/backup.etc.list $RPM_BUILD_ROOT%{_sysconfdir}/rescue
446 install rescue/linux/floppy/*_* $RPM_BUILD_ROOT%{_sysconfdir}/rescue
447 install rescue/linux/floppy/getdiskinfo $RPM_BUILD_ROOT%{_sysconfdir}/rescue
448 install rescue/linux/floppy/sfdisk.bz2 $RPM_BUILD_ROOT%{_sysconfdir}/rescue
449 %endif
450
451 # install the updatedb scripts
452 install updatedb/update_sqlite* $RPM_BUILD_ROOT%{_libexecdir}/%{name}
453
454 # manual
455 cp -a man1 man8 $RPM_BUILD_ROOT%{_mandir}
456
457 # place for site passwords
458 touch $RPM_BUILD_ROOT%{_sysconfdir}/{dir-password,fd-password,sd-password}
459 touch $RPM_BUILD_ROOT%{_sysconfdir}/{mon-dir-password,mon-fd-password,mon-sd-password}
460
461 # some file changes
462 rm -f $RPM_BUILD_ROOT%{_libexecdir}/%{name}/{gconsole,startmysql,stopmysql,bacula,bconsole,fd}
463 rm -f $RPM_BUILD_ROOT%{_sbindir}/static-bacula-fd
464 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/gnome*
465 %if %{without console_wx}
466 rm -f $RPM_BUILD_ROOT%{_desktopdir}/bacula-wx.desktop
467 rm -f $RPM_BUILD_ROOT%{_mandir}/man1/wx-console*
468 %endif
469 touch $RPM_BUILD_ROOT%{_sysconfdir}/.pw.sed
470
471 %clean
472 rm -rf $RPM_BUILD_ROOT
473
474 %pre common
475 %groupadd -P %{name}-common -g 136 -r -f bacula
476 %useradd -P %{name}-common -u 136 -r -d /var/lib/bacula -s /bin/false -c "Bacula User" -g bacula bacula
477
478 %post common
479 echo "Updating bacula passwords and names..."
480 cd /etc/bacula
481 for f in *-password ; do
482         if [ ! -s $f ] ; then
483                 openssl rand -base64 33 > $f
484         fi
485         p=`cat $f`
486         for cf in *.conf *.conf.rpmnew ; do
487                 [ -f $cf ] && sed -i -e"s:#FAKE-$f#:$p:" "$cf" || :
488         done
489 done
490 for cf in *.conf *.conf.rpmnew ; do
491         [ -f $cf ] && sed -i -e"s:--hostname--:`hostname`:" "$cf" || :
492 done
493
494 %postun common
495 if [ "$1" = "0" ]; then
496         %userremove bacula
497         %groupremove bacula
498 fi
499
500 %post dir
501 umask 077
502 [ -s %{_localstatedir}/bacula.db ] && \
503         DB_VER=`echo "select * from Version;" | \
504         %{_bindir}/sqlite %{_localstatedir}/bacula.db | tail -n 1 2>/dev/null`
505 if [ -z "$DB_VER" ]; then
506 # grant privileges and create tables
507         %{_libexecdir}/%{name}/grant_bacula_privileges > dev/null
508         %{_libexecdir}/%{name}/create_bacula_database > dev/null
509         %{_libexecdir}/%{name}/make_bacula_tables > dev/null
510 elif [ "$DB_VER" -lt "8" ]; then
511         echo "Backing up bacula tables"
512         echo ".dump" | sqlite %{_localstatedir}/bacula.db | bzip2 > %{_localstatedir}/bacula_backup.sql.bz2
513         type=sqlite
514         echo "Upgrading bacula tables"
515         if [ "$DB_VER" -lt "8" ]; then
516                 if [ "$DB_VER" -lt "7" ]; then
517                         if [ "$DB_VER" -lt "6" ]; then
518                                 if [ "$DB_VER" -lt "5" ]; then
519                                         %{_libexecdir}/%{name}/update_${type}_tables_4_to_5
520                                 fi
521                                 %{_libexecdir}/%{name}/update_${type}_tables_5_to_6
522                         fi
523                         %{_libexecdir}/%{name}/update_${type}_tables_6_to_7
524                 fi
525                 %{_libexecdir}/%{name}/update_${type}_tables_7_to_8
526         fi
527         %{_libexecdir}/%{name}/update_bacula_tables
528         echo "If bacula works correctly you can remove the backup file %{_localstatedir}/bacula_backup.sql.bz2"
529 fi
530 chown -R bacula:bacula %{_localstatedir}
531 chmod -R u+rX,go-rwx %{_localstatedir}/*
532
533 echo "Updating Bacula passwords and names..."
534 cd /etc/bacula
535 for f in *-password ; do
536         p=`cat $f`
537         sed -i -e"s:#FAKE-$f#:$p:" *.conf *.conf.rpmnew
538 done
539 sed -i -e"s:--hostname--:`hostname`:" *.conf *.conf.rpmnew
540
541 /sbin/chkconfig --add bacula-dir
542 if [ -f /var/lock/subsys/bacula-dir ]; then
543         /etc/rc.d/init.d/bacula-dir restart 1>&2
544 else
545         echo "Run \"/etc/rc.d/init.d/bacula-dir start\" to start Bacula Director daemon."
546 fi
547
548 %preun dir
549 if [ "$1" = "0" ]; then
550         if [ -f /var/lock/subsys/bacula-dir ]; then
551                 /etc/rc.d/init.d/bacula-dir stop 1>&2
552         fi
553         /sbin/chkconfig --del bacula-dir
554 fi
555
556 %post fd
557 echo "Updating Bacula passwords and names..."
558 cd /etc/bacula
559 for f in *-password ; do
560         p=`cat $f`
561         sed -i -e"s:#FAKE-$f#:$p:" *.conf *.conf.rpmnew
562 done
563 sed -i -e"s:--hostname--:`hostname`:" *.conf *.conf.rpmnew
564
565 /sbin/chkconfig --add bacula-fd
566 if [ -f /var/lock/subsys/bacula-fd ]; then
567         /etc/rc.d/init.d/bacula-fd restart 1>&2
568 else
569         echo "Run \"/etc/rc.d/init.d/bacula-fd start\" to start Bacula File daemon."
570 fi
571
572 %preun fd
573 if [ "$1" = "0" ]; then
574         if [ -f /var/lock/subsys/bacula-fd ]; then
575                 /etc/rc.d/init.d/bacula-fd stop 1>&2
576         fi
577         /sbin/chkconfig --del bacula-fd
578 fi
579
580 %post sd
581 echo "Updating Bacula passwords and names..."
582 cd /etc/bacula
583 for f in *-password ; do
584         p=`cat $f`
585         sed -i -e"s:#FAKE-$f#:$p:" *.conf *.conf.rpmnew
586 done
587 sed -i -e"s:--hostname--:`hostname`:" *.conf *.conf.rpmnew
588
589 /sbin/chkconfig --add bacula-sd
590 if [ -f /var/lock/subsys/bacula-sd ]; then
591         /etc/rc.d/init.d/bacula-sd restart 1>&2
592 else
593         echo "Run \"/etc/rc.d/init.d/bacula-sd start\" to start Bacula Storage daemon."
594 fi
595
596 %preun sd
597 if [ "$1" = "0" ]; then
598         if [ -f /var/lock/subsys/bacula-sd ]; then
599                 /etc/rc.d/init.d/bacula-sd stop 1>&2
600         fi
601         /sbin/chkconfig --del bacula-sd
602 fi
603
604 %pre console
605 if [ -e %{_sysconfdir}/console.conf -a ! -e %{_sysconfdir}/bconsole.conf ]; then
606         mv %{_sysconfdir}/console.conf %{_sysconfdir}/bconsole.conf
607 fi
608
609 %post console
610 echo "Updating Bacula passwords and names..."
611 cd /etc/bacula
612 for f in *-password ; do
613         p=`cat $f`
614         sed -i -e"s:#FAKE-$f#:$p:" *.conf *.conf.rpmnew
615 done
616 sed -i -e"s:--hostname--:`hostname`:" *.conf *.conf.rpmnew
617
618 %post console-wx
619 echo "Updating Bacula passwords and names..."
620 cd /etc/bacula
621 for f in *-password ; do
622         p=`cat $f`
623         sed -i -e"s:#FAKE-$f#:$p:" *.conf *.conf.rpmnew
624 done
625 sed -i -e"s:--hostname--:`hostname`:" *.conf *.conf.rpmnew
626
627 %post console-gnome
628 echo "Updating Bacula passwords and names..."
629 cd /etc/bacula
630 for f in *-password ; do
631         p=`cat $f`
632         sed -i -e"s:#FAKE-$f#:$p:" *.conf *.conf.rpmnew
633 done
634 sed -i -e"s:--hostname--:`hostname`:" *.conf *.conf.rpmnew
635
636 %post tray-monitor
637 echo "Updating Bacula passwords and names..."
638 cd /etc/bacula
639 for f in *-password ; do
640         p=`cat $f`
641         sed -i -e"s:#FAKE-$f#:$p:" *.conf *.conf.rpmnew
642 done
643 sed -i -e"s:--hostname--:`hostname`:" *.conf *.conf.rpmnew
644
645 %post rescue
646 # link our current installed conf file to the rescue directory
647 ln -sf %{_sysconfdir}/bacula-fd.conf %{_sysconfdir}/rescue/bacula-fd.conf
648
649 # run getdiskinfo
650 echo "Creating rescue files for this system..."
651 cd %{_sysconfdir}/rescue
652 ./getdiskinfo
653
654 %preun rescue
655 # remove the files created after the initial rpm installation
656 if [ "$1" = "0" ]; then
657         rm -f %{_sysconfdir}/rescue/bacula-fd.conf
658         rm -f %{_sysconfdir}/rescue/partition.*
659         rm -f %{_sysconfdir}/rescue/format.*
660         rm -f %{_sysconfdir}/rescue/mount_drives
661         rm -f %{_sysconfdir}/rescue/start_network
662         rm -f %{_sysconfdir}/rescue/sfdisk
663         rm -rf %{_sysconfdir}/rescue/diskinfo/*
664 fi
665
666 %files common
667 %defattr(644,root,root,755)
668 %doc LICENSE
669 %dir %{_sysconfdir}
670 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*-password
671 %attr(755,root,root) %{_sbindir}/btraceback
672 %attr(755,root,root) %{_sbindir}/bsmtp
673 %{_mandir}/man8/bacula.8*
674 %dir %{_libexecdir}/%{name}
675 %{_libexecdir}/%{name}/btraceback.dbx
676 %{_libexecdir}/%{name}/btraceback.gdb
677 %attr(770,root,bacula) %dir %{_localstatedir}
678
679 %files dir
680 %defattr(644,root,root,755)
681 %doc ChangeLog CheckList ReleaseNotes kernstodo LICENSE
682 %doc examples %{name}-docs-%{version}/manual/{*.pdf,bacula}
683 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bacula-dir.conf
684 %ghost %{_sysconfdir}/.pw.sed
685 %attr(640,root,root) %config(noreplace) /etc/logrotate.d/bacula-dir
686 %attr(754,root,root) /etc/rc.d/init.d/bacula-dir
687 %attr(644,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/bacula-dir
688 %attr(755,root,root) %{_sbindir}/bacula-dir
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 %attr(644,root,root) %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 %attr(644,root,root) %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 %{_libexecdir}/%{name}/mtx-changer
731 %{_mandir}/man8/bacula-sd.8*
732 %{_mandir}/man1/bcopy.1*
733 %{_mandir}/man1/bextract.1*
734 %{_mandir}/man1/bls.1*
735 %{_mandir}/man1/bscan.1*
736 %{_mandir}/man1/btape.1*
737
738 %files console
739 %defattr(644,root,root,755)
740 %doc LICENSE
741 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bconsole.conf
742 %attr(755,root,root) %{_sbindir}/bconsole
743 %{_mandir}/man1/bconsole.1*
744
745 %if %{with console_wx}
746 %files console-wx
747 %defattr(644,root,root,755)
748 %doc LICENSE
749 %{_pixmapsdir}/%{name}.png
750 %{_desktopdir}/bacula-wx.desktop
751 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/wx-console.conf
752 %attr(755,root,root) %{_sbindir}/wx-console
753 %{_mandir}/man1/wx-console.1*
754 %endif
755
756 %if %{with gnome}
757 %files console-gnome
758 %defattr(644,root,root,755)
759 %doc LICENSE
760 %{_pixmapsdir}/%{name}.png
761 %{_desktopdir}/bacula.desktop
762 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/gnome-console.conf
763 %attr(755,root,root) %{_sbindir}/gnome-console
764 #%{_mandir}/man1/gnome-console.1*
765 %endif
766
767 %files tray-monitor
768 %defattr(644,root,root,755)
769 %doc LICENSE
770 %{_pixmapsdir}/%{name}-tray-monitor.xpm
771 %{_desktopdir}/%{name}-tray-monitor.desktop
772 %attr(644,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/tray-monitor.conf
773 %attr(755,root,root) %{_bindir}/bacula-tray-monitor
774 #%{_mandir}/man1/bacula-tray-monitor.1*
775
776 %if %{with rescue}
777 %files rescue
778 %defattr(644,root,root,755)
779 %doc LICENSE
780 %dir %{_sysconfdir}/rescue
781 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/backup.etc.list
782 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/bacula-fd
783 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/format_floppy
784 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/getdiskinfo
785 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/make_rescue_disk
786 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/restore_bacula
787 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/restore_etc
788 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/run_grub
789 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/run_lilo
790 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rescue/sfdisk.bz2
791 %endif
This page took 0.096846 seconds and 4 git commands to generate.