Gentoo Archives: gentoo-commits

From: "Thomas Beierlein (tomjbe)" <tomjbe@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in app-backup/bacula: bacula-5.0.3-r2.ebuild ChangeLog
Date: Wed, 29 Dec 2010 10:35:18
Message-Id: 20101229103507.BF78B20054@flycatcher.gentoo.org
1 tomjbe 10/12/29 10:35:07
2
3 Modified: ChangeLog
4 Added: bacula-5.0.3-r2.ebuild
5 Log:
6 Fix USE=static - only supported for bacula-clientonly now. bug #341983. Thanks dabbott@g.o for reporting
7
8 (Portage version: 2.1.9.26/cvs/Linux x86_64)
9
10 Revision Changes Path
11 1.107 app-backup/bacula/ChangeLog
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-backup/bacula/ChangeLog?rev=1.107&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-backup/bacula/ChangeLog?rev=1.107&content-type=text/plain
15 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-backup/bacula/ChangeLog?r1=1.106&r2=1.107
16
17 Index: ChangeLog
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/app-backup/bacula/ChangeLog,v
20 retrieving revision 1.106
21 retrieving revision 1.107
22 diff -u -r1.106 -r1.107
23 --- ChangeLog 27 Dec 2010 20:45:53 -0000 1.106
24 +++ ChangeLog 29 Dec 2010 10:35:07 -0000 1.107
25 @@ -1,6 +1,13 @@
26 # ChangeLog for app-backup/bacula
27 # Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
28 -# $Header: /var/cvsroot/gentoo-x86/app-backup/bacula/ChangeLog,v 1.106 2010/12/27 20:45:53 arfrever Exp $
29 +# $Header: /var/cvsroot/gentoo-x86/app-backup/bacula/ChangeLog,v 1.107 2010/12/29 10:35:07 tomjbe Exp $
30 +
31 +*bacula-5.0.3-r2 (29 Dec 2010)
32 +
33 + 29 Dec 2010; Thomas Beierlein <tomjbe@g.o> +bacula-5.0.3-r2.ebuild,
34 + +files/5.0.3/bacula-5.0.3-fix-static.patch:
35 + Fix USE=static - only supported for bacula-clientonly now. bug #341983.
36 + Thanks dabbott@g.o for reporting
37
38 27 Dec 2010; Arfrever Frehtes Taifersar Arahesis <arfrever@g.o>
39 bacula-5.0.3-r1.ebuild:
40
41
42
43 1.1 app-backup/bacula/bacula-5.0.3-r2.ebuild
44
45 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-backup/bacula/bacula-5.0.3-r2.ebuild?rev=1.1&view=markup
46 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-backup/bacula/bacula-5.0.3-r2.ebuild?rev=1.1&content-type=text/plain
47
48 Index: bacula-5.0.3-r2.ebuild
49 ===================================================================
50 # Copyright 1999-2010 Gentoo Foundation
51 # Distributed under the terms of the GNU General Public License v2
52 # $Header: /var/cvsroot/gentoo-x86/app-backup/bacula/bacula-5.0.3-r2.ebuild,v 1.1 2010/12/29 10:35:07 tomjbe Exp $
53
54 EAPI="2"
55 PYTHON_DEPEND="python? 2"
56 PYTHON_USE_WITH="threads"
57 PYTHON_USE_WITH_OPT="python"
58
59 inherit eutils multilib python
60
61 MY_PV=${PV/_beta/-b}
62 MY_P=${PN}-${MY_PV}
63 #DOC_VER="${MY_PV}"
64
65 DESCRIPTION="Featureful client/server network backup suite"
66 HOMEPAGE="http://www.bacula.org/"
67
68 #DOC_SRC_URI="mirror://sourceforge/bacula/${PN}-docs-${DOC_VER}.tar.bz2"
69 SRC_URI="mirror://sourceforge/bacula/${MY_P}.tar.gz"
70 # doc? ( ${DOC_SRC_URI} )
71
72 LICENSE="AGPL-3"
73 SLOT="0"
74 KEYWORDS="~amd64 ~hppa ~ppc ~sparc ~x86"
75 IUSE="bacula-clientonly bacula-nodir bacula-nosd ipv6 logwatch mysql postgres python qt4 readline +sqlite3 ssl static tcpd vim-syntax X"
76
77 # maintainer comment:
78 # postgresql-base should have USE=threads (see bug 326333) but fails to build
79 # atm with it (see bug #300964)
80 DEPEND="
81 >=sys-libs/zlib-1.1.4
82 dev-libs/gmp
83 !bacula-clientonly? (
84 postgres? ( dev-db/postgresql-base[threads] )
85 mysql? ( virtual/mysql )
86 sqlite3? ( dev-db/sqlite:3 )
87 !bacula-nodir? ( virtual/mta )
88 )
89 qt4? (
90 x11-libs/qt-svg:4
91 >=x11-libs/qwt-5
92 )
93 ssl? ( dev-libs/openssl )
94 logwatch? ( sys-apps/logwatch )
95 tcpd? ( >=sys-apps/tcp-wrappers-7.6 )
96 readline? ( >=sys-libs/readline-4.1 )
97 sys-libs/ncurses"
98 # doc? (
99 # app-text/ghostscript-gpl
100 # dev-tex/latex2html[png]
101 # app-text/dvipdfm
102 # )
103 RDEPEND="${DEPEND}
104 !bacula-clientonly? (
105 !bacula-nosd? (
106 sys-block/mtx
107 app-arch/mt-st
108 )
109 )
110 vim-syntax? ( || ( app-editors/vim app-editors/gvim ) )"
111
112 S=${WORKDIR}/${MY_P}
113
114 pkg_setup() {
115 local -i dbnum=0
116 if ! use bacula-clientonly; then
117 if use mysql; then
118 export mydbtype=mysql
119 let dbnum++
120 fi
121 if use postgres; then
122 export mydbtype=postgresql
123 let dbnum++
124 fi
125 if use sqlite3; then
126 export mydbtype=sqlite3
127 let dbnum++
128 fi
129 if [[ "${dbnum}" -lt 1 ]]; then
130 ewarn
131 ewarn "No database backend selected, defaulting to sqlite3."
132 ewarn "Supported databases are mysql, postgresql, sqlite3"
133 ewarn
134 export mydbtype=sqlite3
135 elif [[ "${dbnum}" -gt 1 ]]; then
136 ewarn
137 ewarn "Too many database backends selected, defaulting to sqlite3."
138 ewarn "Supported databases are mysql, postgresql, sqlite3"
139 ewarn
140 export mydbtype=sqlite3
141 fi
142 fi
143
144 # create the daemon group and user
145 if [ -z "$(egetent group bacula 2>/dev/null)" ]; then
146 enewgroup bacula || die
147 einfo
148 einfo "The group 'bacula' has been created. Any users you add to this"
149 einfo "group have access to files created by the daemons."
150 einfo
151 fi
152
153 if use bacula-clientonly && use static && use qt4; then
154 ewarn
155 ewarn "Building statical linked 'bat' is not supported. Ignorig it."
156 ewarn
157 fi
158
159 if ! use bacula-clientonly; then
160 # USE=static only supported for bacula-clientonly
161 if use static; then
162 ewarn
163 ewarn "USE=static only supported together with USE=bacula-clientonly."
164 ewarn "Ignoring it."
165 ewarn
166 fi
167 if [ -z "$(egetent passwd bacula 2>/dev/null)" ]; then
168 enewuser bacula -1 -1 /var/lib/bacula bacula,disk,tape,cdrom,cdrw || die
169 einfo
170 einfo "The user 'bacula' has been created. Please see the bacula manual"
171 einfo "for information about running bacula as a non-root user."
172 einfo
173 fi
174 fi
175
176 if use python; then
177 python_set_active_version 2
178 python_pkg_setup
179 fi
180 }
181
182 src_prepare() {
183 # adjusts default configuration files for several binaries
184 # to /etc/bacula/<config> instead of ./<config>
185 pushd src >&/dev/null || die
186 for f in console/console.c dird/dird.c filed/filed.c \
187 stored/bcopy.c stored/bextract.c stored/bls.c \
188 stored/bscan.c stored/btape.c stored/stored.c \
189 qt-console/main.cpp; do
190 sed -i -e 's|^\(#define CONFIG_FILE "\)|\1/etc/bacula/|g' "${f}" \
191 || die "sed on ${f} failed"
192 done
193 popd >&/dev/null || die
194
195 # bug #310087
196 epatch "${FILESDIR}"/${PV}/${P}-as-needed.patch
197
198 # bug #311161
199 epatch "${FILESDIR}"/${PV}/${P}-lib-search-path.patch
200
201 # stop build for errors in subdirs
202 epatch "${FILESDIR}"/${PV}/${P}-Makefile.patch
203
204 # bat needs to respect LDFLAGS
205 epatch "${FILESDIR}"/${PV}/${P}-ldflags.patch
206
207 # bug #328701
208 epatch "${FILESDIR}"/${PV}/${P}-openssl-1.patch
209
210 epatch "${FILESDIR}"/${PV}/${P}-fix-static.patch
211 }
212
213 src_configure() {
214 local myconf=''
215
216 if use bacula-clientonly; then
217 myconf="${myconf} \
218 $(use_enable bacula-clientonly client-only) \
219 $(use_enable !static libtool) \
220 $(use_enable static static-cons) \
221 $(use_enable static static-fd)"
222 else
223 myconf="${myconf} \
224 $(use_enable !bacula-nodir build-dird) \
225 $(use_enable !bacula-nosd build-stored) \
226 $(use_enable qt4 bat)"
227 # bug #311099
228 # database support needed by dir-only *and* sd-only
229 # build as well (for building bscan, btape, etc.)
230 myconf="${myconf} \
231 --with-${mydbtype} \
232 --enable-batch-insert"
233 fi
234
235 myconf="${myconf} \
236 --disable-tray-monitor \
237 $(use_with X x) \
238 $(use_with python) \
239 $(use_enable !readline conio) \
240 $(use_enable readline) \
241 $(use_with readline readline /usr) \
242 $(use_with ssl openssl) \
243 $(use_enable ipv6) \
244 $(use_with tcpd tcp-wrappers)"
245
246 econf \
247 --libdir=/usr/$(get_libdir) \
248 --docdir=/usr/share/doc/${PF} \
249 --htmldir=/usr/share/doc/${PF}/html \
250 --with-pid-dir=/var/run \
251 --sysconfdir=/etc/bacula \
252 --with-subsys-dir=/var/lock/subsys \
253 --with-working-dir=/var/lib/bacula \
254 --with-scriptdir=/usr/libexec/bacula \
255 --with-dir-user=bacula \
256 --with-dir-group=bacula \
257 --with-sd-user=root \
258 --with-sd-group=bacula \
259 --with-fd-user=root \
260 --with-fd-group=bacula \
261 --enable-smartalloc \
262 --host=${CHOST} \
263 ${myconf} \
264 || die "econf failed"
265 }
266
267 src_compile() {
268 emake || die "emake failed"
269
270 # build docs from bacula-docs tarball
271 # if use doc; then
272 # pushd "${WORKDIR}/${PN}-docs-${DOC_VER}"
273 # ./configure \
274 # --with-bacula="${S}" \
275 # || die "configure for bacula-docs failed"
276 # emake -j1 || die "emake for bacula-docs failed"
277 # popd
278 # fi
279 }
280
281 src_install() {
282 emake DESTDIR="${D}" install || die "emake install failed"
283 insinto /usr/share/pixmaps
284 doins scripts/bacula.png || die
285
286 # install bat when enabled (for some reason ./configure doesn't pick this up)
287 if use qt4 && ! use static ; then
288 dosbin "${S}"/src/qt-console/.libs/bat || die
289 insinto /usr/share/pixmaps
290 doins src/qt-console/images/bat_icon.png || die
291 insinto /usr/share/applications
292 doins scripts/bat.desktop || die
293 fi
294
295 # remove some scripts we don't need at all
296 rm -f "${D}"/usr/libexec/bacula/{bacula,bacula-ctl-dir,bacula-ctl-fd,bacula-ctl-sd,startmysql,stopmysql}
297
298 # rename statically linked apps
299 if use bacula-clientonly && use static ; then
300 pushd "${D}"/usr/sbin || die
301 mv static-bacula-fd bacula-fd || die
302 mv static-bconsole bconsole || die
303 popd || die
304 fi
305
306 # extra files which 'make install' doesn't cover
307 if ! use bacula-clientonly; then
308 # the database update scripts
309 diropts -m0750
310 insinto /usr/libexec/bacula/updatedb
311 insopts -m0754
312 doins "${S}"/updatedb/* || die
313 fperms 0640 /usr/libexec/bacula/updatedb/README || die
314
315 # the logrotate configuration
316 # (now unconditional wrt bug #258187)
317 diropts -m0755
318 insinto /etc/logrotate.d
319 insopts -m0644
320 newins "${S}"/scripts/logrotate bacula || die
321
322 # the logwatch scripts
323 if use logwatch; then
324 diropts -m0750
325 dodir /etc/log.d/scripts/services
326 dodir /etc/log.d/scripts/shared
327 dodir /etc/log.d/conf/logfiles
328 dodir /etc/log.d/conf/services
329 pushd "${S}"/scripts/logwatch >&/dev/null || die
330 emake DESTDIR="${D}" install || die "Failed to install logwatch scripts"
331 popd >&/dev/null || die
332 fi
333 fi
334
335 rm -vf "${D}"/usr/share/man/man1/bacula-bwxconsole.1*
336 if ! use qt4; then
337 rm -vf "${D}"/usr/share/man/man1/bat.1*
338 fi
339 rm -vf "${D}"/usr/share/man/man1/bacula-tray-monitor.1*
340 if use bacula-clientonly || use bacula-nodir; then
341 rm -vf "${D}"/usr/share/man/man8/bacula-dir.8*
342 rm -vf "${D}"/usr/share/man/man8/dbcheck.8*
343 rm -vf "${D}"/usr/share/man/man1/bsmtp.1*
344 rm -vf "${D}"/usr/libexec/bacula/create_*_database
345 rm -vf "${D}"/usr/libexec/bacula/drop_*_database
346 rm -vf "${D}"/usr/libexec/bacula/make_*_tables
347 rm -vf "${D}"/usr/libexec/bacula/update_*_tables
348 rm -vf "${D}"/usr/libexec/bacula/drop_*_tables
349 rm -vf "${D}"/usr/libexec/bacula/grant_*_privileges
350 rm -vf "${D}"/usr/libexec/bacula/*_catalog_backup
351 fi
352 if use bacula-clientonly || use bacula-nosd; then
353 rm -vf "${D}"/usr/share/man/man8/bacula-sd.8*
354 rm -vf "${D}"/usr/share/man/man8/bcopy.8*
355 rm -vf "${D}"/usr/share/man/man8/bextract.8*
356 rm -vf "${D}"/usr/share/man/man8/bls.8*
357 rm -vf "${D}"/usr/share/man/man8/bscan.8*
358 rm -vf "${D}"/usr/share/man/man8/btape.8*
359 rm -vf "${D}"/usr/libexec/bacula/disk-changer
360 rm -vf "${D}"/usr/libexec/bacula/mtx-changer
361 rm -vf "${D}"/usr/libexec/bacula/dvd-handler
362 fi
363
364 # documentation
365 ecompress "${D}"/usr/share/doc/${PF}/*
366 # if use doc; then
367 # for i in catalog concepts console developers install problems utility; do
368 # dodoc "${WORKDIR}/${PN}-docs-${DOC_VER}"/manuals/en/${i}/${i}.pdf || die
369 # done
370 # fi
371
372 # vim-files
373 if use vim-syntax; then
374 insinto /usr/share/vim/vimfiles/syntax
375 doins scripts/bacula.vim || die
376 insinto /usr/share/vim/vimfiles/ftdetect
377 newins scripts/filetype.vim bacula_ft.vim || die
378 fi
379
380 # setup init scripts
381 myscripts="bacula-fd"
382 if ! use bacula-clientonly; then
383 if ! use bacula-nodir; then
384 myscripts="${myscripts} bacula-dir"
385 fi
386 if ! use bacula-nosd; then
387 myscripts="${myscripts} bacula-sd"
388 fi
389 fi
390 for script in ${myscripts}; do
391 # copy over init script and config to a temporary location
392 # so we can modify them as needed
393 cp "${FILESDIR}/${PV}/${script}".confd "${T}/${script}".confd || die "failed to copy ${script}.confd"
394 cp "${FILESDIR}/${PV}/${script}".initd "${T}/${script}".initd || die "failed to copy ${script}.initd"
395 # set database dependancy for the director init script
396 case "${script}" in
397 bacula-dir)
398 case "${mydbtype}" in
399 sqlite3)
400 # sqlite3 databases don't have a daemon
401 sed -i -e 's/need "%database%"/:/g' "${T}/${script}".initd || die
402 ;;
403 *)
404 # all other databases have daemons
405 sed -i -e "s:%database%:${mydbtype}:" "${T}/${script}".initd || die
406 ;;
407 esac
408 ;;
409 *)
410 ;;
411 esac
412 # install init script and config
413 newinitd "${T}/${script}".initd "${script}" || die
414 newconfd "${T}/${script}".confd "${script}" || die
415 done
416
417 # make sure the working directory exists
418 diropts -m0750
419 keepdir /var/lib/bacula
420
421 # make sure bacula group can execute bacula libexec scripts
422 fowners -R root:bacula /usr/libexec/bacula
423 }
424
425 pkg_postinst() {
426 if use bacula-clientonly; then
427 fowners root:bacula /var/lib/bacula
428 else
429 fowners bacula:bacula /var/lib/bacula
430 fi
431
432 if ! use bacula-clientonly && ! use bacula-nodir; then
433 einfo
434 einfo "If this is a new install, you must create the ${mydbtype} databases with:"
435 einfo " /usr/libexec/bacula/create_${mydbtype}_database"
436 einfo " /usr/libexec/bacula/make_${mydbtype}_tables"
437 einfo " /usr/libexec/bacula/grant_${mydbtype}_privileges"
438 einfo
439
440 ewarn
441 ewarn "*** ATTENTION! IMPORTANT! ATTENTION! IMPORTANT! ATTENTION! IMPORTANT! ***"
442 ewarn
443 ewarn "If you're upgrading from a major release, you must upgrade your bacula catalog database."
444 ewarn "Please read the manual chapter for how to upgrade your database."
445 ewarn "You can find database upgrade scripts in /usr/libexec/bacula/updatedb/."
446 ewarn
447 ewarn "*** ATTENTION! IMPORTANT! ATTENTION! IMPORTANT! ATTENTION! IMPORTANT! ***"
448 ewarn
449 ebeep 5
450 epause 10
451 echo
452
453 ewarn
454 ewarn "*** ATTENTION! IMPORTANT! ATTENTION! IMPORTANT! ATTENTION! IMPORTANT! ***"
455 ewarn
456 ewarn "The bundled catalog backup script (/usr/libexec/bacula/make_catalog_backup)"
457 ewarn "is INSECURE. The script needs to be called with the database access password"
458 ewarn "as a command line parameter, thus, the password can be seen from any other"
459 ewarn "user on the system"
460 ewarn
461 ewarn "NOTICE:"
462 ewarn "Since version 5.0.0 Bacula bundles an alternative catalog backup script"
463 ewarn "installed as /usr/libexec/bacula/make_catalog_backup.pl that is not"
464 ewarn "subject to this issue as it parses the director daemon config to extract"
465 ewarn "the configured database connection parameters (including the password)."
466 ewarn
467 ewarn "See also:"
468 ewarn "http://www.bacula.org/5.0.x-manuals/en/main/main/Bacula_Security_Issues.html"
469 ewarn "http://www.bacula.org/5.0.x-manuals/en/main/main/Catalog_Maintenance.html#SECTION0043140000000000000000"
470 ewarn
471 ewarn "*** ATTENTION! IMPORTANT! ATTENTION! IMPORTANT! ATTENTION! IMPORTANT! ***"
472 ewarn
473 ebeep 5
474 epause 10
475 echo
476
477 einfo
478 einfo "Please note that SQLite v2 support as well as wxwindows (bwx-console)"
479 einfo "and gnome (gnome-console) support have been dropped."
480 einfo
481 fi
482
483 einfo "Please note that 'bconsole' will always be installed. To compile 'bat'"
484 einfo "you have to enable 'USE=qt4'."
485 einfo
486 }