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