Gentoo Archives: gentoo-commits

From: "Wolfram Schlich (wschlich)" <wschlich@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in app-backup/bacula: ChangeLog bacula-2.4.2.ebuild
Date: Tue, 29 Jul 2008 12:00:49
Message-Id: E1KNnsk-0003mO-SW@stork.gentoo.org
1 wschlich 08/07/29 12:00:46
2
3 Modified: ChangeLog
4 Added: bacula-2.4.2.ebuild
5 Log:
6 version bump
7 (Portage version: 2.1.5.6)
8
9 Revision Changes Path
10 1.67 app-backup/bacula/ChangeLog
11
12 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-backup/bacula/ChangeLog?rev=1.67&view=markup
13 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-backup/bacula/ChangeLog?rev=1.67&content-type=text/plain
14 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-backup/bacula/ChangeLog?r1=1.66&r2=1.67
15
16 Index: ChangeLog
17 ===================================================================
18 RCS file: /var/cvsroot/gentoo-x86/app-backup/bacula/ChangeLog,v
19 retrieving revision 1.66
20 retrieving revision 1.67
21 diff -u -r1.66 -r1.67
22 --- ChangeLog 24 Jul 2008 19:04:57 -0000 1.66
23 +++ ChangeLog 29 Jul 2008 12:00:46 -0000 1.67
24 @@ -1,6 +1,16 @@
25 # ChangeLog for app-backup/bacula
26 # Copyright 2002-2008 Gentoo Foundation; Distributed under the GPL v2
27 -# $Header: /var/cvsroot/gentoo-x86/app-backup/bacula/ChangeLog,v 1.66 2008/07/24 19:04:57 armin76 Exp $
28 +# $Header: /var/cvsroot/gentoo-x86/app-backup/bacula/ChangeLog,v 1.67 2008/07/29 12:00:46 wschlich Exp $
29 +
30 +*bacula-2.4.2 (29 Jul 2008)
31 +
32 + 29 Jul 2008; Wolfram Schlich <wschlich@g.o>
33 + +files/2.4.2/bacula-default-configs.patch, +files/2.4.2/bacula-dir-conf,
34 + +files/2.4.2/bacula-dir-init, +files/2.4.2/bacula-fd-conf,
35 + +files/2.4.2/bacula-fd-init, +files/2.4.2/bacula-gnomesu2gksu.diff,
36 + +files/2.4.2/bacula-sd-conf, +files/2.4.2/bacula-sd-init,
37 + +bacula-2.4.2.ebuild:
38 + version bump
39
40 24 Jul 2008; Raúl Porcel <armin76@g.o> bacula-2.4.1-r1.ebuild:
41 x86 stable wrt #232828
42
43
44
45 1.1 app-backup/bacula/bacula-2.4.2.ebuild
46
47 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-backup/bacula/bacula-2.4.2.ebuild?rev=1.1&view=markup
48 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-backup/bacula/bacula-2.4.2.ebuild?rev=1.1&content-type=text/plain
49
50 Index: bacula-2.4.2.ebuild
51 ===================================================================
52 # Copyright 1999-2008 Gentoo Foundation
53 # Distributed under the terms of the GNU General Public License v2
54 # $Header: /var/cvsroot/gentoo-x86/app-backup/bacula/bacula-2.4.2.ebuild,v 1.1 2008/07/29 12:00:46 wschlich Exp $
55
56 #
57 # TODO:
58 # - install stuff from examples/:
59 # - examples/nagios/ + add nagios USE flag etc.
60 # (see also example/reports/check_bacula_pools.sh which is newer
61 # than examples/nagios/check_bacula_pools.sh)
62 # - examples/autochangers/
63 # - examples/devices/
64 # - examples/python/
65 # - examples/reports/baculareport.pl
66 # - install stuff from bacula-gui package:
67 # - bweb
68 # - bacula-web
69 # - bimagemgr
70 # - brestore
71 # - bacula >=2.4.0 supports --without-qwt -- reflect with USE=qwt?
72 #
73
74 inherit eutils
75
76 IUSE="bacula-clientonly bacula-console bacula-nodir bacula-nosd doc gnome ipv6 logrotate logwatch mysql postgres python qt4 readline sqlite sqlite3 ssl static tcpd wxwindows X"
77 # bacula-web bimagemgr brestore bweb
78 KEYWORDS="~amd64 ~hppa ~ppc ~sparc ~x86"
79
80 DESCRIPTION="Featureful client/server network backup suite"
81 HOMEPAGE="http://www.bacula.org/"
82
83 DOC_VER="${PV}"
84 DOC_SRC_URI="mirror://sourceforge/bacula/${PN}-docs-${DOC_VER}.tar.bz2"
85 #GUI_VER="${PV}"
86 #GUI_SRC_URI="mirror://sourceforge/bacula/${PN}-gui-${GUI_VER}.tar.gz"
87 SRC_URI="mirror://sourceforge/bacula/${P}.tar.gz
88 doc? ( ${DOC_SRC_URI} )"
89 # bacula-web? ( ${GUI_SRC_URI} )
90 # bimagemgr? ( ${GUI_SRC_URI} )
91 # brestore? ( ${GUI_SRC_URI} )
92 # bweb? ( ${GUI_SRC_URI} )
93
94 LICENSE="GPL-2"
95 SLOT="0"
96
97 DEPEND="
98 >=sys-libs/zlib-1.1.4
99 dev-libs/gmp
100 !bacula-clientonly? (
101 postgres? ( >=virtual/postgresql-server-7.4 )
102 mysql? ( virtual/mysql )
103 sqlite? ( =dev-db/sqlite-2* )
104 sqlite3? ( >=dev-db/sqlite-3.0.0 )
105 virtual/mta
106 )
107 bacula-console? (
108 wxwindows? ( =x11-libs/wxGTK-2.6* )
109 qt4? (
110 =x11-libs/qt-4*
111 >=x11-libs/qwt-5
112 )
113 gnome? (
114 >=gnome-base/libgnome-2
115 x11-libs/gksu
116 )
117 )
118 ssl? ( dev-libs/openssl )
119 logrotate? ( app-admin/logrotate )
120 logwatch? ( sys-apps/logwatch )
121 tcpd? ( >=sys-apps/tcp-wrappers-7.6 )
122 readline? ( >=sys-libs/readline-4.1 )
123 doc? (
124 virtual/ghostscript
125 dev-tex/latex2html
126 )"
127 RDEPEND="${DEPEND}
128 !bacula-clientonly? (
129 sys-block/mtx
130 app-arch/mt-st
131 )"
132
133 pkg_setup() {
134 local dbnum
135 declare -i dbnum=0
136 if ! useq bacula-clientonly; then
137 if useq mysql; then
138 export mydbtype='mysql'
139 let dbnum++
140 fi
141 if useq postgres; then
142 export mydbtype='postgresql'
143 let dbnum++
144 fi
145 if useq sqlite; then
146 export mydbtype='sqlite'
147 let dbnum++
148 fi
149 if useq sqlite3; then
150 export mydbtype='sqlite3'
151 let dbnum++
152 fi
153 if [[ "${dbnum}" -lt 1 ]]; then
154 eerror
155 eerror "To use ${P} it is required to set a database in the USE flags."
156 eerror "Supported databases are mysql, postgresql, sqlite, sqlite3"
157 eerror
158 die "No database type selected."
159 elif [[ "${dbnum}" -gt 1 ]]; then
160 eerror
161 eerror "You have set ${P} to use multiple database types."
162 eerror "I don't know which to set as the default!"
163 eerror "You can use /etc/portage/package.use to set per-package USE flags"
164 eerror "Set it so only one database type, mysql, postgres, sqlite, sqlite3"
165 eerror
166 die "Multiple database types selected."
167 fi
168 fi
169
170 # create the daemon group and user
171 if [ -z "$(egetent group bacula)" ]; then
172 enewgroup bacula
173 einfo
174 einfo "The group 'bacula' has been created. Any users you add to this"
175 einfo "group have access to files created by the daemons."
176 einfo
177 fi
178 if ! useq bacula-clientonly; then
179 if [ -z "$(egetent passwd bacula)" ]; then
180 enewuser bacula -1 -1 /var/lib/bacula bacula,disk,tape,cdrom,cdrw
181 einfo
182 einfo "The user 'bacula' has been created. Please see the bacula manual"
183 einfo "for information about running bacula as a non-root user."
184 einfo
185 fi
186 fi
187 }
188
189 src_unpack() {
190 unpack ${A}
191 cd "${S}"
192
193 # adjusts default configuration files for several binaries
194 # to /etc/bacula/<config> instead of ./<config>
195 pushd src && epatch "${FILESDIR}/${PV}/${PN}"-default-configs.patch && popd
196
197 # replaces (deprecated) gnomesu with gksu in the gnome menu files
198 useq bacula-console && useq gnome && epatch "${FILESDIR}/${PV}/${PN}"-gnomesu2gksu.diff
199
200 # apply upstream patches
201 #epatch "${FILESDIR}"/${PV}/${PV}-foo.patch
202 }
203
204 src_compile() {
205 if useq doc && has_version dev-tex/latex2html && ! built_with_use dev-tex/latex2html png; then
206 eerror "${PN} needs the PNG support of latex2html"
207 eerror "Please re-emerge dev-tex/latex2html with USE=png"
208 die "need dev-tex/latex2html built with png USE flag"
209 fi
210
211 local myconf=''
212
213 if useq bacula-clientonly; then
214 myconf="${myconf} \
215 $(use_enable bacula-clientonly client-only) \
216 $(use_enable static static-fd)"
217 else
218 myconf="${myconf} \
219 --with-${mydbtype} \
220 $(use_enable static static-tools) \
221 $(use_enable static static-fd) \
222 $(use_enable !bacula-nodir build-dird) \
223 $(use_enable !bacula-nosd build-stored)"
224 if ! useq bacula-nodir; then
225 myconf="${myconf} $(use_enable static static-dir)"
226 fi
227 if ! useq bacula-nosd; then
228 myconf="${myconf} $(use_enable static static-sd)"
229 fi
230
231 fi
232
233 if useq bacula-console; then
234 if useq qt4 && has_version '<x11-libs/qwt-5'; then
235 eerror "x11-libs/qwt found in a version < 5, thus the"
236 eerror "compilation of 'bat' would fail (see"
237 eerror "http://bugs.gentoo.org/188477#c11 for details)."
238 eerror "please either unmerge <x11-libs/qwt-5 or disable"
239 eerror "the qt4 USE flag to disable building 'bat'."
240 die "incompatible slotted qwt version found"
241 fi
242 myconf="${myconf} \
243 $(use_with X x) \
244 $(use_enable gnome) \
245 $(use_enable gnome tray-monitor) \
246 $(use_enable wxwindows bwx-console) \
247 $(use_enable qt4 bat) \
248 $(use_enable static static-cons)"
249 fi
250
251 myconf="${myconf} \
252 $(use_with python) \
253 $(use_enable readline) \
254 $(use_with readline readline /usr) \
255 $(use_with ssl openssl) \
256 $(use_enable ipv6) \
257 $(use_with tcpd tcp-wrappers)"
258
259 ./configure \
260 --prefix=/usr \
261 --mandir=/usr/share/man \
262 --with-pid-dir=/var/run \
263 --sysconfdir=/etc/bacula \
264 --infodir=/usr/share/info \
265 --with-subsys-dir=/var/lock/subsys \
266 --with-working-dir=/var/lib/bacula \
267 --with-scriptdir=/usr/libexec/bacula \
268 --with-dir-user=bacula \
269 --with-dir-group=bacula \
270 --with-sd-user=root \
271 --with-sd-group=bacula \
272 --with-fd-user=root \
273 --with-fd-group=bacula \
274 --enable-smartalloc \
275 --host=${CHOST} \
276 ${myconf} \
277 || die "configure failed"
278
279 emake || die "emake failed"
280
281 # build various GUIs from bacula-gui tarball
282 # if useq bacula-web || useq bimagemgr || useq brestore || useq bweb; then
283 # pushd "${WORKDIR}/${PN}-gui-${GUI_VER}"
284 # local myconf_gui=''
285 # if useq bimagemgr; then
286 # ## TODO FIXME: webapp-config? !apache?
287 # myconf_gui="${myconf_gui} \
288 # --with-bimagemgr-cgidir=/var/www/localhost/cgi-bin \
289 # --with-bimagemgr-docdir=/var/www/localhost/htdocs \
290 # --with-bimagemgr-binowner=root \
291 # --with-bimagemgr-bingroup=root \
292 # --with-bimagemgr-dataowner=apache \
293 # --with-bimagemgr-datagroup=apache \
294 # "
295 # fi
296 # ./configure \
297 # --with-bacula="${S}" \
298 # ${myconf} \
299 # || die "configure for bacula-gui failed"
300 # ## TODO FIXME: install files (see bacula-gui.spec)
301 # if useq bacula-web; then
302 # : install
303 # fi
304 # if useq bimagemgr; then
305 # : install
306 # fi
307 # if useq brestore; then
308 # : install
309 # fi
310 # if useq bweb; then
311 # : install
312 # fi
313 # popd
314 # fi
315
316 # build docs from bacula-docs tarball
317 if useq doc; then
318 pushd "${WORKDIR}/${PN}-docs-${DOC_VER}"
319 ./configure \
320 --with-bacula="${S}" \
321 || die "configure for bacula-docs failed"
322 emake -j1 || die "emake for bacula-docs failed"
323 popd
324 fi
325 }
326
327 src_install() {
328 emake DESTDIR="${D}" install || die "emake install failed"
329
330 # install bat when enabled (for some reason ./configure doesn't pick this up)
331 if useq bacula-console && useq qt4; then
332 dosbin "${S}"/src/qt-console/bat
333 fi
334
335 # remove some scripts we don't need at all
336 rm -f "${D}"/usr/libexec/bacula/{bacula,bacula-ctl-dir,bacula-ctl-fd,bacula-ctl-sd,startmysql,stopmysql}
337
338 # rename statically linked apps
339 if useq static; then
340 pushd "${D}"/usr/sbin
341 mv static-bacula-fd bacula-fd
342 mv static-bconsole bconsole
343 if ! useq bacula-clientonly; then
344 mv static-bacula-dir bacula-dir
345 mv static-bacula-sd bacula-sd
346 fi
347 if useq bacula-console && useq gnome; then
348 mv static-gnome-console gnome-console
349 fi
350 if useq bacula-console && useq qt4; then
351 mv static-bat bat
352 fi
353 popd
354 fi
355
356 # gnome-console menu entries using gksu
357 if useq bacula-console && useq gnome; then
358 emake DESTDIR="${D}" install-menu-xsu \
359 || die "Failed to install gnome menu files"
360 fi
361
362 # extra files which 'make install' doesn't cover
363 if ! useq bacula-clientonly; then
364 # the database update scripts
365 diropts -m0750
366 insinto /usr/libexec/bacula/updatedb
367 insopts -m0754
368 doins "${S}"/updatedb/*
369 fperms 0640 /usr/libexec/bacula/updatedb/README
370
371 # the logrotate configuration
372 if useq logrotate; then
373 diropts -m0755
374 insinto /etc/logrotate.d
375 insopts -m0644
376 newins "${S}"/scripts/logrotate bacula
377 fi
378
379 # the logwatch scripts
380 if useq logwatch; then
381 diropts -m0750
382 dodir /etc/log.d/scripts/services
383 dodir /etc/log.d/conf/logfiles
384 dodir /etc/log.d/conf/services
385 cd "${S}"/scripts/logwatch
386 emake DESTDIR="${D}" install || die "Failed to install logwatch scripts"
387 cd "${S}"
388 fi
389 fi
390
391 # remove unwanted files
392 if ! use bacula-console; then
393 rm -vf "${D}"/etc/bacula/bconsole.conf
394 rm -vf "${D}"/usr/sbin/bconsole
395 rm -vf "${D}"/usr/libexec/bacula/bconsole
396 fi
397 if ! ( use bacula-console && use gnome ); then
398 rm -vf "${D}"/usr/share/man/man1/bacula-bgnome-console.1*
399 rm -vf "${D}"/usr/libexec/bacula/gconsole
400 fi
401 if ! ( use bacula-console && use wxwindows ); then
402 rm -vf "${D}"/usr/share/man/man1/bacula-bwxconsole.1*
403 fi
404 if use bacula-clientonly; then
405 rm -vf "${D}"/usr/share/man/man1/bat.1*
406 rm -vf "${D}"/usr/share/man/man1/bacula-tray-monitor.1*
407 fi
408 if use bacula-clientonly || use bacula-nodir; then
409 rm -vf "${D}"/usr/share/man/man8/bacula-dir.8*
410 rm -vf "${D}"/usr/share/man/man8/dbcheck.8*
411 rm -vf "${D}"/usr/share/man/man1/bsmtp.1*
412 rm -vf "${D}"/usr/libexec/bacula/create_*_database
413 rm -vf "${D}"/usr/libexec/bacula/drop_*_database
414 rm -vf "${D}"/usr/libexec/bacula/make_*_tables
415 rm -vf "${D}"/usr/libexec/bacula/update_*_tables
416 rm -vf "${D}"/usr/libexec/bacula/drop_*_tables
417 rm -vf "${D}"/usr/libexec/bacula/grant_*_privileges
418 rm -vf "${D}"/usr/libexec/bacula/*_catalog_backup
419 fi
420 if use bacula-clientonly || use bacula-nosd; then
421 rm -vf "${D}"/usr/share/man/man8/bacula-sd.8*
422 rm -vf "${D}"/usr/share/man/man8/bcopy.8*
423 rm -vf "${D}"/usr/share/man/man8/bextract.8*
424 rm -vf "${D}"/usr/share/man/man8/bls.8*
425 rm -vf "${D}"/usr/share/man/man8/bscan.8*
426 rm -vf "${D}"/usr/share/man/man8/btape.8*
427 rm -vf "${D}"/usr/libexec/bacula/disk-changer
428 rm -vf "${D}"/usr/libexec/bacula/mtx-changer
429 rm -vf "${D}"/usr/libexec/bacula/dvd-handler
430 fi
431
432 # documentation
433 for d in "${S}"/{ChangeLog,LICENSE,README,ReleaseNotes,SUPPORT,kernstodo,projects}; do
434 dodoc "${d}"
435 done
436 if useq doc; then
437 dodoc "${WORKDIR}/${PN}-docs-${DOC_VER}"/manual/bacula.pdf
438 dodoc "${WORKDIR}/${PN}-docs-${DOC_VER}"/developers/developers.pdf
439 #dodoc "${WORKDIR}/${PN}-docs-${DOC_VER}"/bacula-web/bacula-web.pdf
440 fi
441
442 # setup init scripts
443 myscripts="bacula-fd"
444 if ! useq bacula-clientonly; then
445 if ! useq bacula-nodir; then
446 myscripts="${myscripts} bacula-dir"
447 fi
448 if ! useq bacula-nosd; then
449 myscripts="${myscripts} bacula-sd"
450 fi
451 fi
452 for script in ${myscripts}; do
453 # copy over init script and config to a temporary location
454 # so we can modify them as needed
455 cp "${FILESDIR}/${PV}/${script}"-conf "${T}/${script}".conf || die "failed to copy ${script}-conf"
456 cp "${FILESDIR}/${PV}/${script}"-init "${T}/${script}".init || die "failed to copy ${script}-init"
457 # set database dependancy for the director init scripts
458 case "${script}" in
459 bacula-dir)
460 case "${mydbtype}" in
461 sqlite*)
462 # sqlite + sqlite3 databases don't have daemons
463 sed -i -e 's/need "%database%"/:/g' "${T}/${script}".init
464 ;;
465 *)
466 # all other databases have daemons
467 sed -i -e "s:%database%:${mydbtype}:" "${T}/${script}".init
468 ;;
469 esac
470 ;;
471 *)
472 ;;
473 esac
474 # install init script and config
475 newinitd "${T}/${script}".init "${script}"
476 newconfd "${T}/${script}".conf "${script}"
477 done
478
479 # make sure the working directory exists
480 diropts -m0750
481 keepdir /var/lib/bacula
482
483 # make sure bacula group can execute bacula libexec scripts
484 fowners root:bacula /usr/libexec/bacula/*
485 }
486
487 pkg_postinst() {
488 if useq bacula-clientonly; then
489 fowners root:bacula /var/lib/bacula
490 else
491 fowners bacula:bacula /var/lib/bacula
492 fi
493
494 if ! useq bacula-clientonly && ! useq bacula-nodir; then
495 einfo
496 einfo "If this is a new install, you must create the ${mydbtype} databases with:"
497 einfo " /usr/libexec/bacula/create_${mydbtype}_database"
498 einfo " /usr/libexec/bacula/make_${mydbtype}_tables"
499 einfo " /usr/libexec/bacula/grant_${mydbtype}_privileges"
500 einfo
501 einfo "If you're upgrading from a major release, you must upgrade your bacula catalog database."
502 einfo "Please read the manual chapter for how to upgrade your database."
503 einfo "You can find database upgrade scripts in /usr/libexec/bacula/updatedb."
504 einfo
505 fi
506
507 ewarn
508 ewarn "*** ATTENTION! IMPORTANT! ATTENTION! IMPORTANT! ATTENTION! IMPORTANT! ***"
509 ewarn
510 ewarn "The bundled catalog backup script (/usr/libexec/bacula/make_catalog_backup)"
511 ewarn "is INSECURE. The script needs to be called with the database access password"
512 ewarn "as a command line parameter, thus, the password can be seen from any other"
513 ewarn "user on the system (if not using some non-default hardened/patched kernel"
514 ewarn "with /proc restrictions)!"
515 ewarn
516 ewarn "Our advice is to NOT USE the bundled script at all, but instead use something"
517 ewarn "like this in your catalog backup job definition (example using MySQL as the"
518 ewarn "catalog database):"
519 ewarn
520 ewarn "RunBeforeJob = \"mysqldump --defaults-file=/etc/bacula/my.cnf --opt -f -r /var/lib/bacula/bacula.sql bacula\""
521 ewarn "RunAfterJob = \"rm -f /var/lib/bacula/bacula.sql\""
522 ewarn
523 ewarn "This requires you to put all database access parameters (like user, host and"
524 ewarn "password) into a dedicated file (/etc/bacula/my.cnf in this example) which"
525 ewarn "can (and should!) be secured by simple filesystem access permissions."
526 ewarn
527 ewarn "See also:"
528 ewarn "http://www.bacula.org/en/rel-manual/Bacula_Security_Issues.html"
529 ewarn "http://www.bacula.org/en/rel-manual/Catalog_Maintenance.html#BackingUpBaculaSecurityConsiderations"
530 ewarn
531 ewarn "*** ATTENTION! IMPORTANT! ATTENTION! IMPORTANT! ATTENTION! IMPORTANT! ***"
532 ewarn
533 ebeep 10
534 epause 20
535
536 ewarn
537 ewarn "*** NOTICE! NOTICE! NOTICE! NOTICE! NOTICE! NOTICE! NOTICE! NOTICE! ***"
538 ewarn
539 ewarn "Support for the bacula all-in-one init script has been removed from"
540 ewarn "this release -- if you were previously using the all-in-one init"
541 ewarn "script, please switch to using the individual init scripts now:"
542 ewarn
543 ewarn "- bacula-dir: bacula director (for the central bacula server)"
544 ewarn "- bacula-fd: bacula file daemon (for hosts to be backed up)"
545 ewarn "- bacula-sd: bacula storage daemon (for hosts storing the backup data)"
546 ewarn
547 ewarn "*** NOTICE! NOTICE! NOTICE! NOTICE! NOTICE! NOTICE! NOTICE! NOTICE! ***"
548 ewarn
549 ebeep 5
550 epause 10
551 }