]> git.pld-linux.org Git - packages/bacula.git/blame - bacula.spec
- new
[packages/bacula.git] / bacula.spec
CommitLineData
bb6e7dc5 1# TODO:
bb6e7dc5 2# - files section
d907cd57 3# - rpm scripts
bb6e7dc5
AM
4#
5Summary: Bacula - The Network Backup Solution
6Name: bacula
7Version: 1.34.6
8Release: 0.1
5ce18635 9Epoch: 0
bb6e7dc5
AM
10Group: Networking/Utilities
11License: GPL v2
12Source0: http://dl.sourceforge.net/bacula/%{name}-%{version}.tar.gz
9e525e0e 13# Source0-md5: 9de593cb206df126a8e27774281c5bf6
bb6e7dc5
AM
14Source1: http://www.tux.org/pub/distributions/tinylinux/tomsrtbt/tomsrtbt-2.0.103.tar.gz
15# Source1-md5: d5ee50efb28986d564547d5da5de2483
5ce18635
AM
16Source2: %{name}-manpages.tar.bz2
17# Source2-md5: e4dae86d6574b360e831efd3913e7f4c
18Source10: %{name}-dir.init
19Source11: %{name}-fd.init
20Source12: %{name}-sd.init
21Source13: %{name}.logrotate
bb6e7dc5 22URL: http://www.bacula.org/
d907cd57 23BuildRequires: mtx
bb6e7dc5
AM
24BuildRequires: wxGTK2-devel
25BuildRequires: openssl-devel
26BuildRequires: pkgconfig
27BuildRequires: ncurses-devel
28BuildRequires: readline-devel
29BuildRequires: sqlite2-devel
30BuildRequires: libwrap-devel
31BuildRequires: zlib-devel
32BuildRequires: acl-devel
33BuildRequires: libstdc++-devel
d907cd57
AM
34BuildRequires: glibc-static
35BuildRequires: acl-static
36BuildRequires: libwrap-static
37BuildRequires: libstdc++-static
bb6e7dc5
AM
38BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
39
40%define _sysconfdir /etc/%{name}
41
42%description
43Bacula - It comes by night and sucks the vital essence from your
44computers.
45
46Bacula is a set of computer programs that permit you (or the system
47administrator) to manage backup, recovery, and verification of
48computer data across a network of computers of different kinds. In
49technical terms, it is a network client/server based backup program.
50Bacula is relatively easy to use and efficient, while offering many
51advanced storage management features that make it easy to find and
5ce18635 52recover lost or damaged files.
bb6e7dc5 53
5ce18635
AM
54%package common
55Summary: Common files for bacula package
bb6e7dc5 56Group: Networking/Utilities
5ce18635
AM
57Conflicts: bacula-dir < %{epoch}:%{version}-%{release}
58Conflicts: bacula-fd < %{epoch}:%{version}-%{release}
59Conflicts: bacula-sd < %{epoch}:%{version}-%{release}
60Conflicts: bacula-console < %{epoch}:%{version}-%{release}
bb6e7dc5 61
5ce18635 62%description common
bb6e7dc5
AM
63Bacula - It comes by night and sucks the vital essence from your
64computers.
65
66Bacula is a set of computer programs that permit you (or the system
67administrator) to manage backup, recovery, and verification of
68computer data across a network of computers of different kinds. In
69technical terms, it is a network client/server based backup program.
70Bacula is relatively easy to use and efficient, while offering many
71advanced storage management features that make it easy to find and
5ce18635 72recover lost or damaged files.
bb6e7dc5 73
5ce18635
AM
74%package dir
75Summary: Bacula Director and Catalog services
76Group: Networking/Utilities
77Prereq: bacula-common = %{epoch}:%{version}-%{release}
bb6e7dc5 78
5ce18635
AM
79%description dir
80Bacula - It comes by night and sucks the vital essence from your
81computers.
82
83Bacula Director is the program that supervises all the backup,
84restore, verify and archive operations. The system administrator uses
85the Bacula Director to schedule backups and to recover files. Catalog
86services are comprised of the software programs responsible for
87maintaining the file indexes and volume databases for all files backed
88up. The Catalog services permit the System Administrator or user to
89quickly locate and restore any desired file, since it maintains a
90record of all Volumes used, all Jobs run, and all Files saved. This
91build requires sqlite to be installed separately as the catalog
92database.
93
94%package console
95Summary: Bacula Console
96Group: Networking/Utilities
97Prereq: bacula-common = %{epoch}:%{version}-%{release}
98
99%description console
100Bacula - It comes by night and sucks the vital essence from your
101computers.
102
103Bacula Console is the program that allows the administrator or user to
104communicate with the Bacula Director. This is the text only console
105interface.
106
107%package console-wx
108Summary: Bacula wxWindows Console
109Group: Networking/Utilities
110Prereq: bacula-common = %{epoch}:%{version}-%{release}
111
112%description console-wx
113Bacula - It comes by night and sucks the vital essence from your
114computers.
115
116Bacula Console is the program that allows the administrator or user to
117communicate with the Bacula Director. This is the wxWindows GUI
118interface.
119
120%package fd
121Summary: Bacula File services (Client)
122Group: Networking/Utilities
123Prereq: bacula-common = %{epoch}:%{version}-%{release}
124
125%description fd
126Bacula - It comes by night and sucks the vital essence from your
127computers.
128
129Bacula File services (or Client program) is the software program that
130is installed on the machine to be backed up. It is specific to the
131operating system on which it runs and is responsible for providing the
132file attributes and data when requested by the Director. The File
133services are also responsible for the file system dependent part of
134restoring the file attributes and data during a recovery operation.
135This program runs as a daemon on the machine to be backed up, and in
136some of the documentation, the File daemon is referred to as the
137Client (for example in Bacula configuration file).
138
139%package sd
140Summary: Bacula Storage services
141Group: Networking/Utilities
142Prereq: bacula-common = %{epoch}:%{version}-%{release}
143
144%description sd
145Bacula - It comes by night and sucks the vital essence from your
146computers.
147
148Bacula Storage services consist of the software programs that perform
149the storage and recovery of the file attributes and data to the
150physical backup media or volumes. In other words, the Storage daemon
151is responsible for reading and writing your tapes (or other storage
152media, e.g. files). The Storage services runs as a daemon on the
153machine that has the backup device (usually a tape drive).
bb6e7dc5 154
5ce18635 155%package rescue
bb6e7dc5
AM
156Summary: Bacula - The Network Backup Solution
157Group: Networking/Utilities
158Requires: coreutils
159Requires: util-linux
bb6e7dc5
AM
160Requires: bacula-fd
161
162%description rescue
163Bacula - It comes by night and sucks the vital essence from your
164computers.
165
166Bacula is a set of computer programs that permit you (or the system
167administrator) to manage backup, recovery, and verification of
168computer data across a network of computers of different kinds. In
169technical terms, it is a network client/server based backup program.
170Bacula is relatively easy to use and efficient, while offering many
171advanced storage management features that make it easy to find and
172recover lost or damaged files. Bacula source code has been released
173under the GPL version 2 license.
174
175This package installs scripts for disaster recovery and builds rescue
176floppy disks for bare metal recovery. This package includes tomsrtbt
177(http://www.toms.net/rb/, by Tom Oehser, Tom@Toms.NET) to provide a
178tool to build a boot floppy disk.
179
d907cd57
AM
180To create a boot disk run "./getdiskinfo" from the
181%{_sysconfdir}/rescue directory (this is done when the package is
182first installed), then run "./install.s" from the
183%{_sysconfdir}/rescue/tomsrtbt/ directory. To make the bacula rescue
184disk run "./make_rescue_disk --copy-static-bacula
185- --copy-etc-files" from the %{_sysconfdir}/rescue directory. To
186 recreate the rescue information for this system run ./getdiskinfo
187 again.
bb6e7dc5
AM
188
189%package updatedb
190Summary: Bacula - The Network Backup Solution
191Group: Networking/Utilities
192
193%description updatedb
194Bacula - It comes by night and sucks the vital essence from your
195computers.
196
197Bacula is a set of computer programs that permit you (or the system
198administrator) to manage backup, recovery, and verification of
199computer data across a network of computers of different kinds. In
200technical terms, it is a network client/server based backup program.
201Bacula is relatively easy to use and efficient, while offering many
202advanced storage management features that make it easy to find and
203recover lost or damaged files. Bacula source code has been released
204under the GPL version 2 license.
205
206This package installs scripts for updating older versions of the
207bacula database.
208
bb6e7dc5 209%prep
5ce18635 210%setup -q -a 1 -a 2
bb6e7dc5
AM
211sed -i -e 's#wx-config#wxgtk2-2.4-config#g' configure*
212sed -i -e 's#-lreadline -ltermcap#-lreadline#g' configure*
213
214%build
215# patches for the bundled sqlite scripts
216# patch the make_sqlite_tables script for installation bindir
217patch src/cats/make_sqlite_tables.in src/cats/make_sqlite_tables.in.patch
218# patch the create_sqlite_database script for installation bindir
219patch src/cats/create_sqlite_database.in src/cats/create_sqlite_database.in.patch
220# patch the make_catalog_backup script for installation bindir
221patch src/cats/make_catalog_backup.in src/cats/make_catalog_backup.in.patch
222# patch the update_sqlite_tables script for installation bindir
223patch src/cats/update_sqlite_tables.in src/cats/update_sqlite_tables.in.patch
224
225CPPFLAGS="-I%{_includedir}/ncurses -I%{_includedir}/readline"
226%configure \
5ce18635 227 --with-scriptdir=%{_libexecdir}/%{name} \
bb6e7dc5
AM
228 --disable-gnome \
229 --disable-conio \
5ce18635 230 --enable-smartalloc \
bb6e7dc5
AM
231 --enable-wx-console \
232 --with-readline \
233 --with-tcp-wrappers \
234 --with-working-dir=%{_var}/lib/%{name} \
235 --with-dump-email="root@localhost" \
236 --with-job-email="root@localhost" \
237 --with-smtp-host=localhost \
238 --with-pid-dir=/var/run \
239 --with-subsys-dir=/var/lock/subsys \
d907cd57 240 --with-sqlite \
5ce18635
AM
241 --enable-static-fd \
242 --with-dir-password="#FAKE#DIR#PASSWORD#" \
243 --with-fd-password="#FAKE#FD#PASSWORD#" \
244 --with-sd-password="#FAKE#SD#PASSWORD#"
245
bb6e7dc5
AM
246%{__make}
247
248%install
249rm -rf $RPM_BUILD_ROOT
250
d907cd57
AM
251install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,logrotate.d,pam.d,security/console.apps}
252install -d $RPM_BUILD_ROOT%{_sysconfdir}/{rescue/tomsrtbt,updatedb}
253install -d $RPM_BUILD_ROOT%{_pixmapsdir}
bb6e7dc5
AM
254
255%{__make} install \
256 DESTDIR=$RPM_BUILD_ROOT
257
d907cd57
AM
258# static daemon
259strip src/filed/static-bacula-fd
260install src/filed/static-bacula-fd $RPM_BUILD_ROOT%{_sysconfdir}/rescue/bacula-fd
261
5ce18635
AM
262install %{SOURCE10} $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-dir
263install %{SOURCE11} $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-fd
264install %{SOURCE12} $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-sd
265install %{SOURCE13} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
d907cd57
AM
266
267install scripts/bacula.png $RPM_BUILD_ROOT%{_pixmapsdir}/bacula.png
268
269# install the rescue stuff, these are the rescue scripts
270install rescue/linux/backup.etc.list $RPM_BUILD_ROOT%{_sysconfdir}/rescue/
271install rescue/linux/format_floppy $RPM_BUILD_ROOT%{_sysconfdir}/rescue/
272install rescue/linux/getdiskinfo $RPM_BUILD_ROOT%{_sysconfdir}/rescue/
273install rescue/linux/make_rescue_disk $RPM_BUILD_ROOT%{_sysconfdir}/rescue/
274install rescue/linux/restore_bacula $RPM_BUILD_ROOT%{_sysconfdir}/rescue/
275install rescue/linux/restore_etc $RPM_BUILD_ROOT%{_sysconfdir}/rescue/
276install rescue/linux/run_grub $RPM_BUILD_ROOT%{_sysconfdir}/rescue/
277install rescue/linux/run_lilo $RPM_BUILD_ROOT%{_sysconfdir}/rescue/
278install rescue/linux/sfdisk.bz2 $RPM_BUILD_ROOT%{_sysconfdir}/rescue/
bb6e7dc5
AM
279
280# this is the tom's root boot disk
d907cd57 281install tomsrtbt-*/* $RPM_BUILD_ROOT%{_sysconfdir}/rescue/tomsrtbt/
bb6e7dc5
AM
282
283# install the updatedb scripts
d907cd57
AM
284install updatedb/* $RPM_BUILD_ROOT%{_sysconfdir}/updatedb/
285
286# manual
287install -d html-manual
288cp -a doc/html-manual/*.{html,jpg,gif,css} html-manual/
bb6e7dc5 289
d907cd57
AM
290# drop some files
291rm -f $RPM_BUILD_ROOT%{_sysconfdir}/{gconsole,startmysql,stopmysql}
bb6e7dc5 292
5ce18635
AM
293%pre common
294# FIXME: dodawanie usera bacula /var/lib/bacula /bin/false
295
296%postun common
297# FIXME: del usera bacula
298
299%post dir
300umask 077
301[ -s %{_localstatedir}/%{name}/bacula.db ] && \
302 DB_VER=`echo "select * from Version;" | \
303 sqlite %{_localstatedir}/%{name}/bacula.db | tail -n 1 2>/dev/null`
304if [ -z "$DB_VER" ]; then
305# grant privileges and create tables
306 %{_libexecdir}/%{name}/grant_bacula_privileges > dev/null
307 %{_libexecdir}/%{name}/create_bacula_database > dev/null
308 %{_libexecdir}/%{name}/make_bacula_tables > dev/null
309elif [ "$DB_VER" -lt "7" ]; then
310 echo "Backing up bacula tables"
311 echo ".dump" | sqlite %{_localstatedir}/%{name}/bacula.db | bzip2 > %{_localstatedir}/%{name}/bacula_backup.sql.bz2
312 type=sqlite
313 echo "Upgrading bacula tables"
314 if [ "$DB_VER" -lt "6" ]; then
315 if [ "$DB_VER" -lt "5" ]; then
316 %{_libexecdir}/%{name}/update_${type}_tables_4_to_5
317 fi
318 %{_libexecdir}/%{name}/update_${type}_tables_5_to_6
319 fi
320 %{_libexecdir}/%{name}/update_bacula_tables
321 echo "If bacula works correctly you can remove the backup file %{_localstatedir}/%{name}/bacula_backup.sql.bz2"
bb6e7dc5 322fi
5ce18635
AM
323chown -R bacula:bacula %{_localstatedir}/%{name}
324chmod -R u+rX,go-rwx %{_localstatedir}/%{name}
bb6e7dc5 325
5ce18635 326#%_post_service bacula-dir
bb6e7dc5 327
5ce18635
AM
328%preun dir
329#%_preun_service bacula-dir
bb6e7dc5 330
5ce18635
AM
331%post fd
332#%post_fix_config bacula-fd
333#%_post_service bacula-fd
bb6e7dc5 334
5ce18635
AM
335%preun fd
336#%_preun_service bacula-fd
337
338%post sd
339#%post_fix_config bacula-sd
340#%_post_service bacula-sd
bb6e7dc5 341
5ce18635
AM
342%preun sd
343#%_preun_service bacula-sd
344
345%pre console
346if [ -e %{_sysconfdir}/console.conf -a ! -e %{_sysconfdir}/bconsole.conf ]; then
347 mv %{_sysconfdir}/console.conf %{_sysconfdir}/bconsole.conf
bb6e7dc5
AM
348fi
349
5ce18635
AM
350#%post console
351#%post_fix_config bconsole
352
353
bb6e7dc5 354%post updatedb
d907cd57 355echo "The database update scripts were installed to %{_sysconfdir}/updatedb"
bb6e7dc5
AM
356
357%clean
358rm -rf $RPM_BUILD_ROOT
359
360%post rescue
361# link our current installed conf file to the rescue directory
d907cd57 362ln -s %{_sysconfdir}/bacula-fd.conf %{_sysconfdir}/rescue/bacula-fd.conf
bb6e7dc5
AM
363
364# run getdiskinfo
365echo "Creating rescue files for this system..."
d907cd57 366cd %{_sysconfdir}/rescue
bb6e7dc5
AM
367./getdiskinfo
368
369%preun rescue
370# remove the files created after the initial rpm installation
d907cd57
AM
371rm -f %{_sysconfdir}/rescue/bacula-fd.conf
372rm -f %{_sysconfdir}/rescue/partition.*
373rm -f %{_sysconfdir}/rescue/format.*
374rm -f %{_sysconfdir}/rescue/mount_drives
375rm -f %{_sysconfdir}/rescue/start_network
376rm -f %{_sysconfdir}/rescue/sfdisk
377rm -rf %{_sysconfdir}/rescue/diskinfo/*
bb6e7dc5 378
5ce18635
AM
379%files common
380%defattr(644,root,root,755)
381%dir %{_sysconfdir}/%{name}
382%attr(755, root, root) %{_sbindir}/btraceback
383%attr(755, root, root) %{_sbindir}/bsmtp
384%dir %{_libexecdir}/%{name}
385%{_libexecdir}/%{name}/btraceback.gdb
386%attr(700, bacula, bacula) %dir %{_localstatedir}/%{name}
387
388%files dir
bb6e7dc5 389%defattr(644,root,root,755)
5ce18635
AM
390%doc ChangeLog CheckList ReleaseNotes kernstodo
391%doc doc/*.pdf doc/manual examples
392%attr(600, root, root) %config(noreplace) %{_sysconfdir}/%{name}/bacula-dir.conf
393%ghost %{_sysconfdir}/%{name}/.pw.sed
394%config(noreplace) %{_sysconfdir}/logrotate.d/bacula-dir
395%{_mandir}/man8/bacula-dir.8*
396%{_mandir}/man1/dbcheck.1*
397%defattr (755, root, root)
398%config(noreplace) %{_initrddir}/bacula-dir
5ff0b6a3 399%attr(755,root,root) %{_sbindir}/bacula-dir
5ce18635
AM
400%attr(755,root,root) %{_sbindir}/dbcheck
401%{_libexecdir}/%{name}/create_sqlite_database
402%{_libexecdir}/%{name}/drop_sqlite_database
403%{_libexecdir}/%{name}/drop_sqlite_tables
404%{_libexecdir}/%{name}/grant_sqlite_privileges
405%{_libexecdir}/%{name}/make_sqlite_tables
406%{_libexecdir}/%{name}/update_sqlite_tables*
407%{_libexecdir}/%{name}/create_bacula_database
408%{_libexecdir}/%{name}/drop_bacula_database
409%{_libexecdir}/%{name}/drop_bacula_tables
410%{_libexecdir}/%{name}/grant_bacula_privileges
411%{_libexecdir}/%{name}/make_bacula_tables
412%{_libexecdir}/%{name}/update_bacula_tables
413%{_libexecdir}/%{name}/make_catalog_backup
414%{_libexecdir}/%{name}/delete_catalog_backup
415%attr(644, root, root) %{_libexecdir}/%{name}/query.sql
416
417%files fd
418%defattr(644,root,root,755)
419%attr(600, root, root) %config(noreplace) %{_sysconfdir}/%{name}/bacula-fd.conf
420%config(noreplace) %{_initrddir}/bacula-fd
5ff0b6a3 421%attr(755,root,root) %{_sbindir}/bacula-fd
5ce18635
AM
422%attr(644, root, root) %{_mandir}/man8/bacula-fd.8*
423
424%files sd
425%defattr(644,root,root,755)
426%dir %{_sysconfdir}/%{name}
427%attr(600, root, root) %config(noreplace) %{_sysconfdir}/%{name}/bacula-sd.conf
428%config(noreplace) %{_initrddir}/bacula-sd
5ff0b6a3
AM
429%attr(755,root,root) %{_sbindir}/bacula-sd
430%attr(755,root,root) %{_sbindir}/bcopy
431%attr(755,root,root) %{_sbindir}/bextract
432%attr(755,root,root) %{_sbindir}/bls
433%attr(755,root,root) %{_sbindir}/bscan
434%attr(755,root,root) %{_sbindir}/btape
5ce18635
AM
435%{_libexecdir}/%{name}/mtx-changer
436%defattr(644, root,root, 755)
437%{_mandir}/man8/bacula-sd.8*
438%{_mandir}/man1/bcopy.1*
439%{_mandir}/man1/bextract.1*
440%{_mandir}/man1/bls.1*
441%{_mandir}/man1/bscan.1*
442%{_mandir}/man1/btape.1*
443
444%files console
bb6e7dc5 445%defattr(644,root,root,755)
5ce18635
AM
446%attr(600, root, root) %config(noreplace) %{_sysconfdir}/%{name}/bconsole.conf
447%attr(755, root, root) %{_sbindir}/bconsole
448%config(noreplace) %{_sysconfdir}/security/console.apps/bconsole
449%config(noreplace) %{_sysconfdir}/pam.d/bconsole
450%verify(link) %{_bindir}/bconsole
451%{_mandir}/man1/bconsole.1*
452
453
454%files console-wx
455%defattr(644,root,root,755)
456%{_iconsdir}/%{name}.png
457%{_miconsdir}/%{name}.png
458%{_liconsdir}/%{name}.png
459%{_menudir}/bacula-console-wx
460%attr(600, root, root) %config(noreplace) %{_sysconfdir}/%{name}/wx-console.conf
461%attr(755, root, root) %{_sbindir}/wx-console
462%config(noreplace) %{_sysconfdir}/security/console.apps/wx-console
463%config(noreplace) %{_sysconfdir}/pam.d/wx-console
464%verify(link) %{_bindir}/wx-console
465%{_mandir}/man1/wx-console.1*
bb6e7dc5
AM
466
467%files rescue
468%defattr(644,root,root,755)
d907cd57 469%{_sysconfdir}/rescue
bb6e7dc5
AM
470
471%files updatedb
472%defattr(644,root,root,755)
d907cd57 473%{_sysconfdir}/updatedb
This page took 0.096039 seconds and 4 git commands to generate.