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