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