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