]>
Commit | Line | Data |
---|---|---|
bb6e7dc5 | 1 | # TODO: |
bb6e7dc5 | 2 | # - files section |
d907cd57 | 3 | # - rpm scripts |
bb6e7dc5 AM |
4 | # |
5 | Summary: Bacula - The Network Backup Solution | |
6 | Name: bacula | |
7 | Version: 1.34.6 | |
8 | Release: 0.1 | |
9 | Group: Networking/Utilities | |
10 | License: GPL v2 | |
11 | Source0: http://dl.sourceforge.net/bacula/%{name}-%{version}.tar.gz | |
12 | # Source0-md5: c8aaef1429f9b37efce381f49f7bccb8 | |
13 | Source1: http://www.tux.org/pub/distributions/tinylinux/tomsrtbt/tomsrtbt-2.0.103.tar.gz | |
14 | # Source1-md5: d5ee50efb28986d564547d5da5de2483 | |
d907cd57 AM |
15 | Source2: %{name}-dir.init |
16 | Source3: %{name}-fd.init | |
17 | Source4: %{name}-sd.init | |
18 | Source5: %{name}.logrotate | |
bb6e7dc5 | 19 | URL: http://www.bacula.org/ |
d907cd57 | 20 | BuildRequires: mtx |
bb6e7dc5 AM |
21 | BuildRequires: wxGTK2-devel |
22 | BuildRequires: openssl-devel | |
23 | BuildRequires: pkgconfig | |
24 | BuildRequires: ncurses-devel | |
25 | BuildRequires: readline-devel | |
26 | BuildRequires: sqlite2-devel | |
27 | BuildRequires: libwrap-devel | |
28 | BuildRequires: zlib-devel | |
29 | BuildRequires: acl-devel | |
30 | BuildRequires: libstdc++-devel | |
d907cd57 AM |
31 | BuildRequires: glibc-static |
32 | BuildRequires: acl-static | |
33 | BuildRequires: libwrap-static | |
34 | BuildRequires: libstdc++-static | |
bb6e7dc5 AM |
35 | Provides: bacula-dir |
36 | Provides: bacula-sd | |
37 | Provides: bacula-fd | |
38 | Provides: bacula-server | |
39 | Conflicts: bacula-client | |
40 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
41 | ||
42 | %define _sysconfdir /etc/%{name} | |
43 | ||
44 | %description | |
45 | Bacula - It comes by night and sucks the vital essence from your | |
46 | computers. | |
47 | ||
48 | Bacula is a set of computer programs that permit you (or the system | |
49 | administrator) to manage backup, recovery, and verification of | |
50 | computer data across a network of computers of different kinds. In | |
51 | technical terms, it is a network client/server based backup program. | |
52 | Bacula is relatively easy to use and efficient, while offering many | |
53 | advanced storage management features that make it easy to find and | |
54 | recover lost or damaged files. Bacula source code has been released | |
55 | under the GPL version 2 license. | |
56 | ||
57 | %package client | |
58 | Summary: Bacula - The Network Backup Solution | |
59 | Group: Networking/Utilities | |
60 | Provides: bacula-fd | |
61 | ||
62 | %description client | |
63 | Bacula - It comes by night and sucks the vital essence from your | |
64 | computers. | |
65 | ||
66 | Bacula is a set of computer programs that permit you (or the system | |
67 | administrator) to manage backup, recovery, and verification of | |
68 | computer data across a network of computers of different kinds. In | |
69 | technical terms, it is a network client/server based backup program. | |
70 | Bacula is relatively easy to use and efficient, while offering many | |
71 | advanced storage management features that make it easy to find and | |
72 | recover lost or damaged files. Bacula source code has been released | |
73 | under the GPL version 2 license. | |
74 | ||
75 | This is the File daemon (Client) only package. It includes the command | |
76 | line console program. | |
77 | ||
78 | %package rescue | |
79 | ||
80 | Summary: Bacula - The Network Backup Solution | |
81 | Group: Networking/Utilities | |
82 | Requires: coreutils | |
83 | Requires: util-linux | |
84 | Requires: libc5 | |
85 | Requires: bacula-fd | |
86 | ||
87 | %description rescue | |
88 | Bacula - It comes by night and sucks the vital essence from your | |
89 | computers. | |
90 | ||
91 | Bacula is a set of computer programs that permit you (or the system | |
92 | administrator) to manage backup, recovery, and verification of | |
93 | computer data across a network of computers of different kinds. In | |
94 | technical terms, it is a network client/server based backup program. | |
95 | Bacula is relatively easy to use and efficient, while offering many | |
96 | advanced storage management features that make it easy to find and | |
97 | recover lost or damaged files. Bacula source code has been released | |
98 | under the GPL version 2 license. | |
99 | ||
100 | This package installs scripts for disaster recovery and builds rescue | |
101 | floppy disks for bare metal recovery. This package includes tomsrtbt | |
102 | (http://www.toms.net/rb/, by Tom Oehser, Tom@Toms.NET) to provide a | |
103 | tool to build a boot floppy disk. | |
104 | ||
d907cd57 AM |
105 | To create a boot disk run "./getdiskinfo" from the |
106 | %{_sysconfdir}/rescue directory (this is done when the package is | |
107 | first installed), then run "./install.s" from the | |
108 | %{_sysconfdir}/rescue/tomsrtbt/ directory. To make the bacula rescue | |
109 | disk 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 | |
115 | Summary: Bacula - The Network Backup Solution | |
116 | Group: Networking/Utilities | |
117 | ||
118 | %description updatedb | |
119 | Bacula - It comes by night and sucks the vital essence from your | |
120 | computers. | |
121 | ||
122 | Bacula is a set of computer programs that permit you (or the system | |
123 | administrator) to manage backup, recovery, and verification of | |
124 | computer data across a network of computers of different kinds. In | |
125 | technical terms, it is a network client/server based backup program. | |
126 | Bacula is relatively easy to use and efficient, while offering many | |
127 | advanced storage management features that make it easy to find and | |
128 | recover lost or damaged files. Bacula source code has been released | |
129 | under the GPL version 2 license. | |
130 | ||
131 | This package installs scripts for updating older versions of the | |
132 | bacula database. | |
133 | ||
134 | %package wxconsole | |
135 | Summary: Bacula - The Network Backup Solution | |
136 | Group: Networking/Utilities | |
137 | Requires: bacula-fd | |
138 | ||
139 | %description wxconsole | |
140 | Bacula - It comes by night and sucks the vital essence from your | |
141 | computers. | |
142 | ||
143 | Bacula is a set of computer programs that permit you (or the system | |
144 | administrator) to manage backup, recovery, and verification of | |
145 | computer data across a network of computers of different kinds. In | |
146 | technical terms, it is a network client/server based backup program. | |
147 | Bacula is relatively easy to use and efficient, while offering many | |
148 | advanced storage management features that make it easy to find and | |
149 | recover lost or damaged files. Bacula source code has been released | |
150 | under the GPL version 2 license. | |
151 | ||
152 | This is the WX Console package. It is an add-on to the client or | |
153 | server packages. | |
154 | ||
155 | %prep | |
d907cd57 | 156 | %setup -q -a 1 |
bb6e7dc5 AM |
157 | sed -i -e 's#wx-config#wxgtk2-2.4-config#g' configure* |
158 | sed -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 | |
163 | patch src/cats/make_sqlite_tables.in src/cats/make_sqlite_tables.in.patch | |
164 | # patch the create_sqlite_database script for installation bindir | |
165 | patch src/cats/create_sqlite_database.in src/cats/create_sqlite_database.in.patch | |
166 | # patch the make_catalog_backup script for installation bindir | |
167 | patch src/cats/make_catalog_backup.in src/cats/make_catalog_backup.in.patch | |
168 | # patch the update_sqlite_tables script for installation bindir | |
169 | patch src/cats/update_sqlite_tables.in src/cats/update_sqlite_tables.in.patch | |
170 | ||
171 | CPPFLAGS="-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 | |
189 | rm -rf $RPM_BUILD_ROOT | |
190 | ||
d907cd57 AM |
191 | install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,logrotate.d,pam.d,security/console.apps} |
192 | install -d $RPM_BUILD_ROOT%{_sysconfdir}/{rescue/tomsrtbt,updatedb} | |
193 | install -d $RPM_BUILD_ROOT%{_pixmapsdir} | |
bb6e7dc5 AM |
194 | |
195 | %{__make} install \ | |
196 | DESTDIR=$RPM_BUILD_ROOT | |
197 | ||
d907cd57 AM |
198 | # static daemon |
199 | strip src/filed/static-bacula-fd | |
200 | install src/filed/static-bacula-fd $RPM_BUILD_ROOT%{_sysconfdir}/rescue/bacula-fd | |
201 | ||
202 | install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-dir | |
203 | install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-fd | |
204 | install %{SOURCE4} $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-sd | |
205 | install %{SOURCE5} $RPM_BUILD_ROOT/etc/logrotate.d/%{name} | |
206 | ||
207 | install scripts/bacula.png $RPM_BUILD_ROOT%{_pixmapsdir}/bacula.png | |
208 | ||
209 | # install the rescue stuff, these are the rescue scripts | |
210 | install rescue/linux/backup.etc.list $RPM_BUILD_ROOT%{_sysconfdir}/rescue/ | |
211 | install rescue/linux/format_floppy $RPM_BUILD_ROOT%{_sysconfdir}/rescue/ | |
212 | install rescue/linux/getdiskinfo $RPM_BUILD_ROOT%{_sysconfdir}/rescue/ | |
213 | install rescue/linux/make_rescue_disk $RPM_BUILD_ROOT%{_sysconfdir}/rescue/ | |
214 | install rescue/linux/restore_bacula $RPM_BUILD_ROOT%{_sysconfdir}/rescue/ | |
215 | install rescue/linux/restore_etc $RPM_BUILD_ROOT%{_sysconfdir}/rescue/ | |
216 | install rescue/linux/run_grub $RPM_BUILD_ROOT%{_sysconfdir}/rescue/ | |
217 | install rescue/linux/run_lilo $RPM_BUILD_ROOT%{_sysconfdir}/rescue/ | |
218 | install rescue/linux/sfdisk.bz2 $RPM_BUILD_ROOT%{_sysconfdir}/rescue/ | |
bb6e7dc5 AM |
219 | |
220 | # this is the tom's root boot disk | |
d907cd57 | 221 | install tomsrtbt-*/* $RPM_BUILD_ROOT%{_sysconfdir}/rescue/tomsrtbt/ |
bb6e7dc5 AM |
222 | |
223 | # install the updatedb scripts | |
d907cd57 AM |
224 | install updatedb/* $RPM_BUILD_ROOT%{_sysconfdir}/updatedb/ |
225 | ||
226 | # manual | |
227 | install -d html-manual | |
228 | cp -a doc/html-manual/*.{html,jpg,gif,css} html-manual/ | |
bb6e7dc5 | 229 | |
d907cd57 AM |
230 | # drop some files |
231 | rm -f $RPM_BUILD_ROOT%{_sysconfdir}/{gconsole,startmysql,stopmysql} | |
bb6e7dc5 | 232 | |
d907cd57 | 233 | %pre |
bb6e7dc5 AM |
234 | # test for bacula database older than version 6 |
235 | if [ -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 | |
246 | fi | |
d907cd57 AM |
247 | # check for and copy %{_sysconfdir}/console.conf to bconsole.conf |
248 | if [ -s %{_sysconfdir}/console.conf ];then | |
249 | cp -a %{_sysconfdir}/console.conf %{_sysconfdir}/bconsole.conf | |
bb6e7dc5 AM |
250 | fi |
251 | ||
d907cd57 | 252 | %post |
bb6e7dc5 AM |
253 | # add our links |
254 | if [ "$1" -ge 1 ] ; then | |
255 | /sbin/chkconfig --add bacula-dir | |
256 | /sbin/chkconfig --add bacula-fd | |
257 | /sbin/chkconfig --add bacula-sd | |
258 | fi | |
259 | ||
260 | # test for an existing database | |
261 | if [ -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 | |
272 | else | |
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 |
279 | fi |
280 | ||
d907cd57 | 281 | %preun |
bb6e7dc5 AM |
282 | # delete our links |
283 | if [ $1 = 0 ]; then | |
284 | /sbin/chkconfig --del bacula-dir | |
285 | /sbin/chkconfig --del bacula-fd | |
286 | /sbin/chkconfig --del bacula-sd | |
287 | fi | |
288 | ||
289 | %post client | |
290 | # add our link | |
291 | if [ "$1" -ge 1 ] ; then | |
292 | /sbin/chkconfig --add bacula-fd | |
293 | fi | |
294 | ||
295 | %preun client | |
296 | # delete our link | |
297 | if [ $1 = 0 ]; then | |
298 | /sbin/chkconfig --del bacula-fd | |
299 | fi | |
300 | ||
301 | %post updatedb | |
d907cd57 | 302 | echo "The database update scripts were installed to %{_sysconfdir}/updatedb" |
bb6e7dc5 AM |
303 | |
304 | %clean | |
305 | rm -rf $RPM_BUILD_ROOT | |
306 | ||
307 | %post rescue | |
308 | # link our current installed conf file to the rescue directory | |
d907cd57 | 309 | ln -s %{_sysconfdir}/bacula-fd.conf %{_sysconfdir}/rescue/bacula-fd.conf |
bb6e7dc5 AM |
310 | |
311 | # run getdiskinfo | |
312 | echo "Creating rescue files for this system..." | |
d907cd57 | 313 | cd %{_sysconfdir}/rescue |
bb6e7dc5 AM |
314 | ./getdiskinfo |
315 | ||
316 | %preun rescue | |
317 | # remove the files created after the initial rpm installation | |
d907cd57 AM |
318 | rm -f %{_sysconfdir}/rescue/bacula-fd.conf |
319 | rm -f %{_sysconfdir}/rescue/partition.* | |
320 | rm -f %{_sysconfdir}/rescue/format.* | |
321 | rm -f %{_sysconfdir}/rescue/mount_drives | |
322 | rm -f %{_sysconfdir}/rescue/start_network | |
323 | rm -f %{_sysconfdir}/rescue/sfdisk | |
324 | rm -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 |
bb6e7dc5 | 329 | |
d907cd57 AM |
330 | %{_sysconfdir}/bacula |
331 | %{_sysconfdir}/bconsole | |
332 | %{_sysconfdir}/fd | |
333 | %{_sysconfdir}/create_bacula_database | |
334 | %{_sysconfdir}/drop_bacula_database | |
335 | %{_sysconfdir}/grant_bacula_privileges | |
336 | %{_sysconfdir}/make_bacula_tables | |
337 | %{_sysconfdir}/drop_bacula_tables | |
338 | %{_sysconfdir}/update_bacula_tables | |
339 | %{_sysconfdir}/create_sqlite_database | |
340 | %{_sysconfdir}/drop_sqlite_database | |
341 | %{_sysconfdir}/grant_sqlite_privileges | |
342 | %{_sysconfdir}/make_sqlite_tables | |
343 | %{_sysconfdir}/drop_sqlite_tables | |
344 | %{_sysconfdir}/update_sqlite_tables | |
345 | %{_sysconfdir}/make_catalog_backup | |
346 | %{_sysconfdir}/delete_catalog_backup | |
347 | %{_sysconfdir}/mtx-changer | |
348 | /etc/rc.d/init.d/bacula-dir | |
349 | /etc/rc.d/init.d/bacula-fd | |
350 | /etc/rc.d/init.d/bacula-sd | |
bb6e7dc5 AM |
351 | /etc/logrotate.d/bacula |
352 | ||
d907cd57 AM |
353 | %config(noreplace) %{_sysconfdir}/bacula-dir.conf |
354 | %config(noreplace) %{_sysconfdir}/bacula-fd.conf | |
355 | %config(noreplace) %{_sysconfdir}/bacula-sd.conf | |
356 | %config(noreplace) %{_sysconfdir}/bconsole.conf | |
357 | %{_sysconfdir}/query.sql | |
bb6e7dc5 AM |
358 | %dir %{_var}/lib/%{name} |
359 | ||
360 | %attr(755,root,root) %{_sbindir}/bacula-dir | |
361 | %attr(755,root,root) %{_sbindir}/bacula-fd | |
362 | %attr(755,root,root) %{_sbindir}/bacula-sd | |
363 | %attr(755,root,root) %{_sbindir}/bcopy | |
364 | %attr(755,root,root) %{_sbindir}/bextract | |
365 | %attr(755,root,root) %{_sbindir}/bls | |
366 | %attr(755,root,root) %{_sbindir}/bscan | |
367 | %attr(755,root,root) %{_sbindir}/btape | |
368 | %attr(755,root,root) %{_sbindir}/btraceback | |
369 | %attr(755,root,root) %{_sbindir}/bconsole | |
370 | %attr(755,root,root) %{_sbindir}/dbcheck | |
bb6e7dc5 | 371 | %attr(755,root,root) %{_sbindir}/bsmtp |
bb6e7dc5 | 372 | %attr(755,root,root) %{_sbindir}/static-bacula-fd |
d907cd57 | 373 | %{_sysconfdir}/btraceback.gdb |
bb6e7dc5 AM |
374 | |
375 | %files client | |
376 | %defattr(644,root,root,755) | |
377 | ||
d907cd57 AM |
378 | %{_sysconfdir}/fd |
379 | %{_sysconfdir}/bconsole | |
380 | /etc/rc.d/init.d/bacula-fd | |
bb6e7dc5 | 381 | |
bb6e7dc5 AM |
382 | /etc/logrotate.d/bacula |
383 | ||
d907cd57 AM |
384 | %config(noreplace) %{_sysconfdir}/bacula-fd.conf |
385 | %config(noreplace) %{_sysconfdir}/bconsole.conf | |
bb6e7dc5 AM |
386 | %dir %{_var}/lib/%{name} |
387 | ||
388 | %attr(755,root,root) %{_sbindir}/bacula-fd | |
389 | %attr(755,root,root) %{_sbindir}/btraceback | |
d907cd57 | 390 | %{_sysconfdir}/btraceback.gdb |
bb6e7dc5 AM |
391 | %attr(755,root,root) %{_sbindir}/bsmtp |
392 | %attr(755,root,root) %{_sbindir}/bconsole | |
393 | ||
394 | %files rescue | |
395 | %defattr(644,root,root,755) | |
d907cd57 | 396 | %{_sysconfdir}/rescue |
bb6e7dc5 AM |
397 | |
398 | %files updatedb | |
399 | %defattr(644,root,root,755) | |
d907cd57 | 400 | %{_sysconfdir}/updatedb |
bb6e7dc5 AM |
401 | |
402 | %files wxconsole | |
403 | %defattr(644,root,root,755) | |
404 | %attr(755,root,root) %{_sbindir}/wx-console | |
d907cd57 AM |
405 | %config(noreplace) %{_sysconfdir}/wx-console.conf |
406 | %{_pixmapsdir}/bacula.png |