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