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