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