]> git.pld-linux.org Git - packages/bacula.git/blame - bacula.spec
- initial pld release; nfy
[packages/bacula.git] / bacula.spec
CommitLineData
bb6e7dc5
AM
1# TODO:
2# - install section
3# - build section
4# - files section
5# - pld configs and init scripts
6#
7Summary: Bacula - The Network Backup Solution
8Name: bacula
9Version: 1.34.6
10Release: 0.1
11Group: Networking/Utilities
12License: GPL v2
13Source0: http://dl.sourceforge.net/bacula/%{name}-%{version}.tar.gz
14# Source0-md5: c8aaef1429f9b37efce381f49f7bccb8
15Source1: http://www.tux.org/pub/distributions/tinylinux/tomsrtbt/tomsrtbt-2.0.103.tar.gz
16# Source1-md5: d5ee50efb28986d564547d5da5de2483
17URL: http://www.bacula.org/
18BuildRequires: wxGTK2-devel
19BuildRequires: openssl-devel
20BuildRequires: pkgconfig
21BuildRequires: ncurses-devel
22BuildRequires: readline-devel
23BuildRequires: sqlite2-devel
24BuildRequires: libwrap-devel
25BuildRequires: zlib-devel
26BuildRequires: acl-devel
27BuildRequires: libstdc++-devel
28Provides: bacula-dir
29Provides: bacula-sd
30Provides: bacula-fd
31Provides: bacula-server
32Conflicts: bacula-client
33BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
34
35%define _sysconfdir /etc/%{name}
36
37%description
38Bacula - It comes by night and sucks the vital essence from your
39computers.
40
41Bacula is a set of computer programs that permit you (or the system
42administrator) to manage backup, recovery, and verification of
43computer data across a network of computers of different kinds. In
44technical terms, it is a network client/server based backup program.
45Bacula is relatively easy to use and efficient, while offering many
46advanced storage management features that make it easy to find and
47recover lost or damaged files. Bacula source code has been released
48under the GPL version 2 license.
49
50%package client
51Summary: Bacula - The Network Backup Solution
52Group: Networking/Utilities
53Provides: bacula-fd
54
55%description client
56Bacula - It comes by night and sucks the vital essence from your
57computers.
58
59Bacula is a set of computer programs that permit you (or the system
60administrator) to manage backup, recovery, and verification of
61computer data across a network of computers of different kinds. In
62technical terms, it is a network client/server based backup program.
63Bacula is relatively easy to use and efficient, while offering many
64advanced storage management features that make it easy to find and
65recover lost or damaged files. Bacula source code has been released
66under the GPL version 2 license.
67
68This is the File daemon (Client) only package. It includes the command
69line console program.
70
71%package rescue
72
73Summary: Bacula - The Network Backup Solution
74Group: Networking/Utilities
75Requires: coreutils
76Requires: util-linux
77Requires: libc5
78Requires: bacula-fd
79
80%description rescue
81Bacula - It comes by night and sucks the vital essence from your
82computers.
83
84Bacula is a set of computer programs that permit you (or the system
85administrator) to manage backup, recovery, and verification of
86computer data across a network of computers of different kinds. In
87technical terms, it is a network client/server based backup program.
88Bacula is relatively easy to use and efficient, while offering many
89advanced storage management features that make it easy to find and
90recover lost or damaged files. Bacula source code has been released
91under the GPL version 2 license.
92
93This package installs scripts for disaster recovery and builds rescue
94floppy disks for bare metal recovery. This package includes tomsrtbt
95(http://www.toms.net/rb/, by Tom Oehser, Tom@Toms.NET) to provide a
96tool to build a boot floppy disk.
97
98You need to have the bacula-sqlite, bacula-mysql, bacula-postgresql or
99bacula-client package for your platform installed and configured
100before installing this package.
101
102To create a boot disk run "./getdiskinfo" from the /etc/bacula/rescue
103directory (this is done when the package is first installed), then run
104"./install.s" from the /etc/bacula/rescue/tomsrtbt/ directory. To make
105the bacula rescue disk run "./make_rescue_disk --copy-static-bacula
106- --copy-etc-files" from the /etc/bacula/rescue directory. To recreate
107 the rescue information for this system run ./getdiskinfo again.
108
109%package updatedb
110Summary: Bacula - The Network Backup Solution
111Group: Networking/Utilities
112
113%description updatedb
114Bacula - It comes by night and sucks the vital essence from your
115computers.
116
117Bacula is a set of computer programs that permit you (or the system
118administrator) to manage backup, recovery, and verification of
119computer data across a network of computers of different kinds. In
120technical terms, it is a network client/server based backup program.
121Bacula is relatively easy to use and efficient, while offering many
122advanced storage management features that make it easy to find and
123recover lost or damaged files. Bacula source code has been released
124under the GPL version 2 license.
125
126This package installs scripts for updating older versions of the
127bacula database.
128
129%package wxconsole
130Summary: Bacula - The Network Backup Solution
131Group: Networking/Utilities
132Requires: bacula-fd
133
134%description wxconsole
135Bacula - It comes by night and sucks the vital essence from your
136computers.
137
138Bacula is a set of computer programs that permit you (or the system
139administrator) to manage backup, recovery, and verification of
140computer data across a network of computers of different kinds. In
141technical terms, it is a network client/server based backup program.
142Bacula is relatively easy to use and efficient, while offering many
143advanced storage management features that make it easy to find and
144recover lost or damaged files. Bacula source code has been released
145under the GPL version 2 license.
146
147This is the WX Console package. It is an add-on to the client or
148server packages.
149
150%prep
151%setup -q -b 1
152sed -i -e 's#wx-config#wxgtk2-2.4-config#g' configure*
153sed -i -e 's#-lreadline -ltermcap#-lreadline#g' configure*
154
155%build
156# patches for the bundled sqlite scripts
157# patch the make_sqlite_tables script for installation bindir
158patch src/cats/make_sqlite_tables.in src/cats/make_sqlite_tables.in.patch
159# patch the create_sqlite_database script for installation bindir
160patch src/cats/create_sqlite_database.in src/cats/create_sqlite_database.in.patch
161# patch the make_catalog_backup script for installation bindir
162patch src/cats/make_catalog_backup.in src/cats/make_catalog_backup.in.patch
163# patch the update_sqlite_tables script for installation bindir
164patch src/cats/update_sqlite_tables.in src/cats/update_sqlite_tables.in.patch
165
166CPPFLAGS="-I%{_includedir}/ncurses -I%{_includedir}/readline"
167%configure \
168 --disable-gnome \
169 --disable-conio \
170 --enable-wx-console \
171 --with-readline \
172 --with-tcp-wrappers \
173 --with-working-dir=%{_var}/lib/%{name} \
174 --with-dump-email="root@localhost" \
175 --with-job-email="root@localhost" \
176 --with-smtp-host=localhost \
177 --with-pid-dir=/var/run \
178 --with-subsys-dir=/var/lock/subsys \
179 --with-sqlite
180%{__make}
181
182%install
183rm -rf $RPM_BUILD_ROOT
184
185install -d $RPM_BUILD_ROOT%{_sysconfdir}/init.d
186install -d $RPM_BUILD_ROOT/etc/logrotate.d
187install -d $RPM_BUILD_ROOT%{_datadir}/pixmaps
188install -d $RPM_BUILD_ROOT%{_datadir}/applications
189install -d $RPM_BUILD_ROOT%{_sysconfdir}/bacula/rescue
190install -d $RPM_BUILD_ROOT%{_sysconfdir}/bacula/rescue/tomsrtbt
191install -d $RPM_BUILD_ROOT%{_sysconfdir}/bacula/updatedb
192install -d $RPM_BUILD_ROOT/etc/pam.d
193install -d $RPM_BUILD_ROOT/etc/security/console.apps
194install -d $RPM_BUILD_ROOT%{_bindir}
195
196%{__make} install \
197 DESTDIR=$RPM_BUILD_ROOT
198
199# setup the manual for the doc dir and correct some broken CVS permissions
200mkdir html-manual
201cp -p doc/html-manual/*.html html-manual/
202cp -p doc/html-manual/*.jpg html-manual/
203cp -p doc/html-manual/*.gif html-manual/
204cp -p doc/html-manual/*.css html-manual/
205
206cp -p platforms/redhat/bacula-dir $RPM_BUILD_ROOT%{_sysconfdir}/init.d/bacula-dir
207cp -p platforms/redhat/bacula-fd $RPM_BUILD_ROOT%{_sysconfdir}/init.d/bacula-fd
208cp -p platforms/redhat/bacula-sd $RPM_BUILD_ROOT%{_sysconfdir}/init.d/bacula-sd
209chmod 0754 $RPM_BUILD_ROOT%{_sysconfdir}/init.d/*
210
211cp -p scripts/bacula.png $RPM_BUILD_ROOT%{_datadir}/pixmaps/bacula.png
212cp -p scripts/bacula.desktop.gnome2.consolehelper $RPM_BUILD_ROOT%{_datadir}/applications/bacula.desktop
213cp -p scripts/gnome-console.console_apps $RPM_BUILD_ROOT/etc/security/console.apps/gnome-console
214cp -p scripts/gnome-console.pamd $RPM_BUILD_ROOT/etc/pam.d/gnome-console
215ln -sf consolehelper $RPM_BUILD_ROOT%{_bindir}/gnome-console
216
217cp -p ../depkgs/sqlite/sqlite $RPM_BUILD_ROOT%{sqlite_bindir}/sqlite
218cp -p ../depkgs/sqlite/sqlite.h $RPM_BUILD_ROOT%{sqlite_bindir}/sqlite.h
219cp -p ../depkgs/sqlite/libsqlite.a $RPM_BUILD_ROOT%{sqlite_bindir}/libsqlite.a
220
221# install the logrotate file
222cp -p scripts/logrotate $RPM_BUILD_ROOT/etc/logrotate.d/bacula
223
224# install the rescue stuff
225# these are the rescue scripts
226cp -p rescue/linux/backup.etc.list $RPM_BUILD_ROOT%{_sysconfdir}/bacula/rescue/
227cp -p rescue/linux/format_floppy $RPM_BUILD_ROOT%{_sysconfdir}/bacula/rescue/
228cp -p rescue/linux/getdiskinfo $RPM_BUILD_ROOT%{_sysconfdir}/bacula/rescue/
229cp -p rescue/linux/make_rescue_disk $RPM_BUILD_ROOT%{_sysconfdir}/bacula/rescue/
230cp -p rescue/linux/restore_bacula $RPM_BUILD_ROOT%{_sysconfdir}/bacula/rescue/
231cp -p rescue/linux/restore_etc $RPM_BUILD_ROOT%{_sysconfdir}/bacula/rescue/
232cp -p rescue/linux/run_grub $RPM_BUILD_ROOT%{_sysconfdir}/bacula/rescue/
233cp -p rescue/linux/run_lilo $RPM_BUILD_ROOT%{_sysconfdir}/bacula/rescue/
234cp -p rescue/linux/sfdisk.bz2 $RPM_BUILD_ROOT%{_sysconfdir}/bacula/rescue/
235
236# this is the static file daemon
237cp -p src/filed/static-bacula-fd $RPM_BUILD_ROOT%{_sysconfdir}/bacula/rescue/bacula-fd
238
239# this is the tom's root boot disk
240cp -p ../%{tomsrtbt}/* $RPM_BUILD_ROOT%{_sysconfdir}/bacula/rescue/tomsrtbt/
241
242# install the updatedb scripts
243cp -p updatedb/* $RPM_BUILD_ROOT%{_sysconfdir}/bacula/updatedb/
244
245# now clean up permissions that are left broken by the install
246chmod o-r $RPM_BUILD_ROOT%{_sysconfdir}/bacula/query.sql
247chmod o-rwx $RPM_BUILD_ROOT/var/bacula
248
249%pre sqlite
250# test for bacula database older than version 6
251if [ -s %{_var}/lib/%{name}/bacula.db ];then
252 DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite %{_var}/lib/%{name}/bacula.db | tail -n 1 2>/dev/null`
253 if [ -n "$DB_VER" ] && [ "$DB_VER" -lt "6" ]; then
254 echo "This bacula upgrade will update a bacula database from version 6 to 7."
255 echo "You appear to be running database version $DB_VER. You must first update"
256 echo "your database to version 6 and then install this upgrade. The alternative"
257 echo "is to use /etc/bacula/drop_sqlite_tables to delete all your your current"
258 echo "catalog information, then do the upgrade. Information on updating a"
259 echo "database older than version 6 can be found in the release notes."
260 exit 1
261 fi
262fi
263# check for and copy /etc/bacula/console.conf to bconsole.conf
264if [ -s /etc/bacula/console.conf ];then
265 cp -p /etc/bacula/console.conf /etc/bacula/bconsole.conf
266fi
267
268%post sqlite
269# add our links
270if [ "$1" -ge 1 ] ; then
271 /sbin/chkconfig --add bacula-dir
272 /sbin/chkconfig --add bacula-fd
273 /sbin/chkconfig --add bacula-sd
274fi
275
276# test for an existing database
277if [ -s %{_var}/lib/%{name}/bacula.db ]; then
278 DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite %{_var}/lib/%{name}/bacula.db | tail -n 1 2>/dev/null`
279 # check to see if we need to upgrade a 1.32 or lower database
280 if [ "$DB_VER" -lt "7" ]; then
281 echo "This release requires an upgrade to your bacula database."
282 echo "Backing up your current database..."
283 echo ".dump" | %{sqlite_bindir}/sqlite %{_var}/lib/%{name}/bacula.db | bzip2 > %{_var}/lib/%{name}/bacula_backup.sql.bz2
284 echo "Upgrading bacula database ..."
285 /etc/bacula/update_sqlite_tables
286 echo "If bacula works correctly you can remove the backup file %{_var}/lib/%{name}/bacula_backup.sql.bz2"
287 fi
288else
289 # create the database and tables
290 echo "Hmm, doesn't look like you have an existing database."
291 echo "Creating SQLite database..."
292 /etc/bacula/create_sqlite_database
293 echo "Creating the SQLite tables..."
294 /etc/bacula/make_sqlite_tables
295fi
296
297%preun sqlite
298# delete our links
299if [ $1 = 0 ]; then
300 /sbin/chkconfig --del bacula-dir
301 /sbin/chkconfig --del bacula-fd
302 /sbin/chkconfig --del bacula-sd
303fi
304
305%post client
306# add our link
307if [ "$1" -ge 1 ] ; then
308 /sbin/chkconfig --add bacula-fd
309fi
310
311%preun client
312# delete our link
313if [ $1 = 0 ]; then
314 /sbin/chkconfig --del bacula-fd
315fi
316
317%post updatedb
318echo "The database update scripts were installed to /etc/bacula/updatedb"
319
320%clean
321rm -rf $RPM_BUILD_ROOT
322
323%post rescue
324# link our current installed conf file to the rescue directory
325ln -s /etc/bacula-fd.conf /etc/bacula/rescue/bacula-fd.conf
326
327# run getdiskinfo
328echo "Creating rescue files for this system..."
329cd /etc/bacula/rescue
330./getdiskinfo
331
332%preun rescue
333# remove the files created after the initial rpm installation
334rm -f /etc/bacula/rescue/bacula-fd.conf
335rm -f /etc/bacula/rescue/partition.*
336rm -f /etc/bacula/rescue/format.*
337rm -f /etc/bacula/rescue/mount_drives
338rm -f /etc/bacula/rescue/start_network
339rm -f /etc/bacula/rescue/sfdisk
340rm -rf /etc/bacula/rescue/diskinfo/*
341
342%files
343%defattr(644,root,root,755)
344%{_sysconfdir}/bacula/bacula
345%{_sysconfdir}/bacula/bconsole
346%{_sysconfdir}/bacula/fd
347%{_sysconfdir}/bacula/create_bacula_database
348%{_sysconfdir}/bacula/drop_bacula_database
349%{_sysconfdir}/bacula/grant_bacula_privileges
350%{_sysconfdir}/bacula/make_bacula_tables
351%{_sysconfdir}/bacula/drop_bacula_tables
352%{_sysconfdir}/bacula/update_bacula_tables
353%{_sysconfdir}/bacula/create_sqlite_database
354%{_sysconfdir}/bacula/drop_sqlite_database
355%{_sysconfdir}/bacula/grant_sqlite_privileges
356%{_sysconfdir}/bacula/make_sqlite_tables
357%{_sysconfdir}/bacula/drop_sqlite_tables
358%{_sysconfdir}/bacula/update_sqlite_tables
359%{_sysconfdir}/bacula/make_catalog_backup
360%{_sysconfdir}/bacula/delete_catalog_backup
361%{_sysconfdir}/bacula/mtx-changer
362%{_sysconfdir}/init.d/bacula-dir
363%{_sysconfdir}/init.d/bacula-fd
364%{_sysconfdir}/init.d/bacula-sd
365
366%doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo doc/bacula.pdf html-manual
367%{_mandir}/man1/*
368
369/etc/logrotate.d/bacula
370
371%config(noreplace) %{_sysconfdir}/bacula/bacula-dir.conf
372%config(noreplace) %{_sysconfdir}/bacula/bacula-fd.conf
373%config(noreplace) %{_sysconfdir}/bacula/bacula-sd.conf
374%config(noreplace) %{_sysconfdir}/bacula/bconsole.conf
375%{_sysconfdir}/bacula/query.sql
376%{sqlite_bindir}/libsqlite.a
377%{sqlite_bindir}/sqlite.h
378%dir %{_var}/lib/%{name}
379
380%attr(755,root,root) %{_sbindir}/bacula-dir
381%attr(755,root,root) %{_sbindir}/bacula-fd
382%attr(755,root,root) %{_sbindir}/bacula-sd
383%attr(755,root,root) %{_sbindir}/bcopy
384%attr(755,root,root) %{_sbindir}/bextract
385%attr(755,root,root) %{_sbindir}/bls
386%attr(755,root,root) %{_sbindir}/bscan
387%attr(755,root,root) %{_sbindir}/btape
388%attr(755,root,root) %{_sbindir}/btraceback
389%attr(755,root,root) %{_sbindir}/bconsole
390%attr(755,root,root) %{_sbindir}/dbcheck
391%attr(755,root,root) %{_sbindir}/loaderinfo
392%attr(755,root,root) %{_sbindir}/mtx
393%attr(755,root,root) %{_sbindir}/scsitape
394%attr(755,root,root) %{_sbindir}/bsmtp
395%attr(755,root,root) %{_sbindir}/tapeinfo
396%attr(755,root,root) %{_sbindir}/static-bacula-fd
397%{sqlite_bindir}/sqlite
398%{_sysconfdir}/bacula/btraceback.gdb
399
400%files client
401%defattr(644,root,root,755)
402
403%{_sysconfdir}/bacula/fd
404%{_sysconfdir}/bacula/bconsole
405%{_sysconfdir}/init.d/bacula-fd
406
407%doc COPYING ChangeLog ReleaseNotes VERIFYING kernstodo doc/bacula.pdf html-manual ../Release_Notes-%{version}-%{release}.txt
408/etc/logrotate.d/bacula
409
410%config(noreplace) %{_sysconfdir}/bacula/bacula-fd.conf
411%config(noreplace) %{_sysconfdir}/bacula/bconsole.conf
412%dir %{_var}/lib/%{name}
413
414%attr(755,root,root) %{_sbindir}/bacula-fd
415%attr(755,root,root) %{_sbindir}/btraceback
416%{_sysconfdir}/bacula/btraceback.gdb
417%attr(755,root,root) %{_sbindir}/bsmtp
418%attr(755,root,root) %{_sbindir}/bconsole
419
420%files rescue
421%defattr(644,root,root,755)
422%{_sysconfdir}/bacula/rescue/backup.etc.list
423%{_sysconfdir}/bacula/rescue/format_floppy
424%{_sysconfdir}/bacula/rescue/getdiskinfo
425%{_sysconfdir}/bacula/rescue/make_rescue_disk
426%{_sysconfdir}/bacula/rescue/restore_bacula
427%{_sysconfdir}/bacula/rescue/restore_etc
428%{_sysconfdir}/bacula/rescue/run_grub
429%{_sysconfdir}/bacula/rescue/run_lilo
430%{_sysconfdir}/bacula/rescue/sfdisk.bz2
431%{_sysconfdir}/bacula/rescue/bacula-fd
432%{_sysconfdir}/bacula/rescue/tomsrtbt/*
433
434%files updatedb
435%defattr(644,root,root,755)
436%{_sysconfdir}/bacula/updatedb/*
437
438%files wxconsole
439%defattr(644,root,root,755)
440%attr(755,root,root) %{_sbindir}/wx-console
441%{_sysconfdir}/bacula/wxconsole
442%config(noreplace) %{_sysconfdir}/bacula/gnome-console.conf
443%{_datadir}/pixmaps/bacula.png
444%{_datadir}/applications/bacula.desktop
445
446# add the console helper files
447%config(noreplace,missingok) /etc/pam.d/gnome-console
448%config(noreplace,missingok) /etc/security/console.apps/gnome-console
This page took 0.086613 seconds and 4 git commands to generate.