Gentoo Archives: gentoo-commits

From: Thomas Beierlein <tomjbe@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-backup/bacula/
Date: Sat, 11 May 2019 10:45:37
Message-Id: 1557571522.8ad1ca82cce905fa64e0179b38a6293d670f51fb.tomjbe@gentoo
1 commit: 8ad1ca82cce905fa64e0179b38a6293d670f51fb
2 Author: Thomas Beierlein <tomjbe <AT> gentoo <DOT> org>
3 AuthorDate: Sat May 11 10:45:22 2019 +0000
4 Commit: Thomas Beierlein <tomjbe <AT> gentoo <DOT> org>
5 CommitDate: Sat May 11 10:45:22 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8ad1ca82
7
8 app-backup/bacula: Bugfix release
9
10 Package-Manager: Portage-2.3.66, Repoman-2.3.12
11 Signed-off-by: Thomas Beierlein <tomjbe <AT> gentoo.org>
12
13 app-backup/bacula/Manifest | 1 +
14 app-backup/bacula/bacula-9.4.3.ebuild | 435 ++++++++++++++++++++++++++++++++++
15 2 files changed, 436 insertions(+)
16
17 diff --git a/app-backup/bacula/Manifest b/app-backup/bacula/Manifest
18 index b8e11e5a2ab..066afa2e8f4 100644
19 --- a/app-backup/bacula/Manifest
20 +++ b/app-backup/bacula/Manifest
21 @@ -3,3 +3,4 @@ DIST bacula-9.0.8.tar.gz 4475511 BLAKE2B be321a2a215cc2b127423cf8d103303957c7064
22 DIST bacula-9.2.2.tar.gz 4115575 BLAKE2B affc6efa3543836690e3d89eb37faa2d5066344308dc29a22c491374f04a2fd00bedb57a869d0bcf8a0f58d806bc9f9b9381330c22984ddb4d5acd97b757d2c8 SHA512 390ac0ad205c3694fe02c6842740b188bde0be469d0a9b89388d3f75746c7cca6a536a2386e06a5069c84863f28dae3449250ff71e63b9ff14e8f7b074df1708
23 DIST bacula-9.4.1.tar.gz 4162956 BLAKE2B f3fdd2ab64dc4fe50210d83a80ce16f36996f6d23bb67326e8bcee97ae9fd83b2dc8a96eabcd86c522c5e1ca5b8923110e97c03be953427a5c5f59140fdea332 SHA512 5e05a939c5f457a121879a6108ce2ac6403dde556b415af4e5013e4f100cf4d878f3d468fd680fa1633a4c8d6ce3d7a6ed351a1600ef780166cd4be9b70191ee
24 DIST bacula-9.4.2.tar.gz 4163642 BLAKE2B 5b12b44749186fbcd0da4eb97fca304cc8a0152cff87dd9dcf7058452a853a8a58208537496978a213067691cecaa5626e21d3a94438981e12f028a6157d3fb8 SHA512 f8c8f4c788ced1ab846e02656a0a1d9d1b65fe57ae0b888780167ac7e9272e8ca624ef5c41bd44a7454cf518c8e451c2201970b3e4862a99b4290a377da40b0d
25 +DIST bacula-9.4.3.tar.gz 4167892 BLAKE2B 058d51fa62f7a37ccb19d91c33589dd2d2a52ee2d17e82c5b5ce7b9f80f36ead81cd6cb4fafcfc269f4202a2a9f989106ade72efd673f89693f155c0f4a0b336 SHA512 042bf1b974ff60b054bd4a16ce93cd1d93b89d0b743f340c00cc4636922e1e25a38d97dc140bf5842859b3694736df2a812801747ced678610f8583e14ea5e81
26
27 diff --git a/app-backup/bacula/bacula-9.4.3.ebuild b/app-backup/bacula/bacula-9.4.3.ebuild
28 new file mode 100644
29 index 00000000000..0ec8c9e2352
30 --- /dev/null
31 +++ b/app-backup/bacula/bacula-9.4.3.ebuild
32 @@ -0,0 +1,435 @@
33 +# Copyright 1999-2019 Gentoo Authors
34 +# Distributed under the terms of the GNU General Public License v2
35 +
36 +EAPI=6
37 +
38 +inherit desktop libtool qmake-utils systemd user
39 +
40 +MY_PV=${PV/_beta/-b}
41 +MY_P=${PN}-${MY_PV}
42 +
43 +DESCRIPTION="Featureful client/server network backup suite"
44 +HOMEPAGE="https://www.bacula.org/"
45 +SRC_URI="mirror://sourceforge/bacula/${MY_P}.tar.gz"
46 +
47 +LICENSE="AGPL-3"
48 +SLOT="0"
49 +KEYWORDS="~amd64 ~ppc ~sparc ~x86"
50 +IUSE="acl bacula-clientonly bacula-nodir bacula-nosd +batch-insert examples ipv6 libressl logwatch mysql postgres qt5 readline +sqlite ssl static tcpd vim-syntax X"
51 +
52 +DEPEND="
53 + !bacula-clientonly? (
54 + !bacula-nodir? ( virtual/mta )
55 + postgres? ( dev-db/postgresql:=[threads] )
56 + mysql? ( || ( dev-db/mysql-connector-c dev-db/mariadb-connector-c ) )
57 + sqlite? ( dev-db/sqlite:3 )
58 + )
59 + dev-libs/gmp:0
60 + qt5? (
61 + dev-qt/qtsvg:5
62 + x11-libs/qwt:6
63 + )
64 + logwatch? ( sys-apps/logwatch )
65 + readline? ( sys-libs/readline:0 )
66 + static? (
67 + dev-libs/lzo[static-libs]
68 + sys-libs/ncurses:=[static-libs]
69 + sys-libs/zlib[static-libs]
70 + acl? ( virtual/acl[static-libs] )
71 + ssl? (
72 + !libressl? ( dev-libs/openssl:0=[static-libs] )
73 + libressl? ( dev-libs/libressl:0=[static-libs] )
74 + )
75 + )
76 + !static? (
77 + dev-libs/lzo
78 + sys-libs/ncurses:=
79 + sys-libs/zlib
80 + acl? ( virtual/acl )
81 + ssl? (
82 + !libressl? ( dev-libs/openssl:0= )
83 + libressl? ( dev-libs/libressl:0= )
84 + )
85 + )
86 + tcpd? ( >=sys-apps/tcp-wrappers-7.6 )
87 +"
88 +RDEPEND="${DEPEND}
89 + !bacula-clientonly? (
90 + !bacula-nosd? (
91 + app-arch/mt-st
92 + sys-block/mtx
93 + )
94 + )
95 + vim-syntax? ( || ( app-editors/vim app-editors/gvim ) )
96 +"
97 +
98 +REQUIRED_USE="
99 + !bacula-clientonly? ( ^^ ( mysql postgres sqlite ) )
100 + static? ( bacula-clientonly )
101 +"
102 +
103 +S=${WORKDIR}/${MY_P}
104 +
105 +pkg_setup() {
106 + #XOR and !bacula-clientonly controlled by REQUIRED_USE
107 + use mysql && export mydbtype="mysql"
108 + use postgres && export mydbtype="postgresql"
109 + use sqlite && export mydbtype="sqlite3"
110 +
111 + # create the daemon group and user
112 + if [ -z "$(egetent group bacula 2>/dev/null)" ]; then
113 + enewgroup bacula
114 + einfo
115 + einfo "The group 'bacula' has been created. Any users you add to this"
116 + einfo "group have access to files created by the daemons."
117 + einfo
118 + fi
119 +
120 + if use bacula-clientonly && use static && use qt5; then
121 + ewarn
122 + ewarn "Building statically linked 'bat' is not supported. Ignorig 'qt5' useflag."
123 + ewarn
124 + fi
125 +
126 + if ! use bacula-clientonly; then
127 + if [ -z "$(egetent passwd bacula 2>/dev/null)" ]; then
128 + enewuser bacula -1 -1 /var/lib/bacula bacula,disk,tape,cdrom,cdrw
129 + einfo
130 + einfo "The user 'bacula' has been created. Please see the bacula manual"
131 + einfo "for information about running bacula as a non-root user."
132 + einfo
133 + fi
134 + fi
135 +}
136 +
137 +src_prepare() {
138 + # adjusts default configuration files for several binaries
139 + # to /etc/bacula/<config> instead of ./<config>
140 + pushd src >&/dev/null || die
141 + for f in console/console.c dird/dird.c filed/filed.c \
142 + stored/bcopy.c stored/bextract.c stored/bls.c \
143 + stored/bscan.c stored/btape.c stored/stored.c \
144 + qt-console/main.cpp; do
145 + sed -i -e 's|^\(#define CONFIG_FILE "\)|\1/etc/bacula/|g' "${f}" \
146 + || die "sed on ${f} failed"
147 + done
148 + popd >&/dev/null || die
149 +
150 + # bug 466688 drop deprecated categories from Desktop file
151 + sed -i -e 's/Application;//' scripts/bat.desktop.in || die
152 +
153 + # bug 466690 Use CXXFLAGS instead of CFLAGS
154 + sed -i -e 's/@CFLAGS@/@CXXFLAGS@/' autoconf/Make.common.in || die
155 +
156 + # drop automatic install of unneeded documentation (for bug 356499)
157 + eapply -p0 "${FILESDIR}"/7.2.0/${PN}-7.2.0-doc.patch
158 +
159 + # bug #310087
160 + eapply "${FILESDIR}"/5.2.3/${PN}-5.2.3-as-needed.patch
161 +
162 + # bug #311161
163 + eapply -p0 "${FILESDIR}"/9.0.2/${PN}-9.0.2-lib-search-path.patch
164 +
165 + # bat needs to respect LDFLAGS and CFLAGS
166 + eapply -p0 "${FILESDIR}"/9.0.6/${PN}-9.0.6-bat-pro.patch
167 +
168 + # bug #328701
169 + eapply -p0 "${FILESDIR}"/5.2.3/${PN}-5.2.3-openssl-1.patch
170 +
171 + eapply -p0 "${FILESDIR}"/9.0.8/${PN}-9.0.8-fix-static.patch
172 +
173 + # fix soname in libbaccat.so bug #602952
174 + eapply -p0 "${FILESDIR}/bacula-fix-sonames.patch"
175 +
176 + # do not strip binaries
177 + sed -i -e "s/strip /# strip /" src/filed/Makefile.in || die
178 + sed -i -e "s/strip /# strip /" src/console/Makefile.in || die
179 +
180 + # fix file not found error during make depend
181 + eapply -p0 "${FILESDIR}"/7.0.2/${PN}-7.0.2-depend.patch
182 +
183 + eapply_user
184 +
185 + # Fix systemd unit files:
186 + # bug 497748
187 + sed -i -e '/Requires/d' platforms/systemd/*.service.in || die
188 + sed -i -e '/StandardOutput/d' platforms/systemd/*.service.in || die
189 + # bug 504370
190 + sed -i -e '/Alias=bacula-dir/d' platforms/systemd/bacula-dir.service.in || die
191 + # bug 584442 and 504368
192 + sed -i -e 's/@dir_user@/root/g' platforms/systemd/bacula-dir.service.in || die
193 +
194 + # build 'bat' for Qt5
195 + export QMAKE="$(qt5_get_bindir)"/qmake
196 +
197 + # adapt to >=Qt-5.9 (see bug #644566)
198 + # qmake needs an existing target file to generate install instructions
199 + sed -i -e 's#bins.files = bat#bins.files = .libs/bat#g' \
200 + src/qt-console/bat.pro.in || die
201 + mkdir src/qt-console/.libs || die
202 + touch src/qt-console/.libs/bat || die
203 + chmod 755 src/qt-console/.libs/bat || die
204 +
205 + # fix handling of libressl version
206 + # needs separate handling for <libressl-2.7 and >=libressl2.7
207 + # (see bug #655520)
208 + if has_version "<dev-libs/libressl-2.7"; then
209 + eapply -p0 "${FILESDIR}"/9.4.0/${PN}-9.4.0-libressl26.patch
210 + else
211 + eapply -p0 "${FILESDIR}"/9.4.0/${PN}-9.4.0-libressl27.patch
212 + fi
213 +
214 + # Don't let program install man pages directly
215 + rm "${S}"/manpages/Makefile.in || die "Unable to remove man pages Makefile.in"
216 + eapply -p1 "${FILESDIR}/bacula-fix-manpages.patch"
217 +
218 + # fix bundled libtool (bug 466696)
219 + # But first move directory with M4 macros out of the way.
220 + # It is only needed by autoconf and gives errors during elibtoolize.
221 + mv autoconf/libtool autoconf/libtool1 || die
222 + elibtoolize
223 +}
224 +
225 +src_configure() {
226 + local myconf=''
227 +
228 + if use bacula-clientonly; then
229 + myconf="${myconf} \
230 + $(use_enable bacula-clientonly client-only) \
231 + $(use_enable !static libtool) \
232 + $(use_enable static static-cons) \
233 + $(use_enable static static-fd)"
234 + else
235 + myconf="${myconf} \
236 + $(use_enable !bacula-nodir build-dird) \
237 + $(use_enable !bacula-nosd build-stored)"
238 + # bug #311099
239 + # database support needed by dir-only *and* sd-only
240 + # build as well (for building bscan, btape, etc.)
241 + myconf="${myconf}
242 + --with-${mydbtype}"
243 + fi
244 +
245 + # do not build bat if 'static' clientonly
246 + if ! use bacula-clientonly || ! use static; then
247 + myconf="${myconf} \
248 + $(use_enable qt5 bat)"
249 + fi
250 +
251 + myconf="${myconf} \
252 + $(use_with X x) \
253 + $(use_enable batch-insert) \
254 + $(use_enable !readline conio) \
255 + $(use_enable readline) \
256 + $(use_with readline readline /usr) \
257 + $(use_with ssl openssl) \
258 + $(use_enable ipv6) \
259 + $(use_enable acl) \
260 + $(use_with tcpd tcp-wrappers)"
261 +
262 + econf \
263 + --libdir=/usr/$(get_libdir) \
264 + --docdir=/usr/share/doc/${PF} \
265 + --htmldir=/usr/share/doc/${PF}/html \
266 + --with-pid-dir=/var/run \
267 + --sysconfdir=/etc/bacula \
268 + --with-archivedir=/var/lib/bacula/tmp \
269 + --with-subsys-dir=/var/lock/subsys \
270 + --with-working-dir=/var/lib/bacula \
271 + --with-logdir=/var/lib/bacula \
272 + --with-scriptdir=/usr/libexec/bacula \
273 + --with-systemd=$(systemd_get_systemunitdir) \
274 + --with-dir-user=bacula \
275 + --with-dir-group=bacula \
276 + --with-sd-user=root \
277 + --with-sd-group=bacula \
278 + --with-fd-user=root \
279 + --with-fd-group=bacula \
280 + --enable-smartalloc \
281 + --disable-afs \
282 + --without-s3 \
283 + --host=${CHOST} \
284 + ${myconf}
285 +}
286 +
287 +src_compile() {
288 + # Make build log verbose (bug #447806)
289 + emake NO_ECHO=""
290 +}
291 +
292 +src_install() {
293 + emake DESTDIR="${D}" install
294 + doicon scripts/bacula.png
295 +
296 + # install bat icon and desktop file when enabled
297 + # (for some reason ./configure doesn't pick this up)
298 + if use qt5 && ! use static ; then
299 + doicon src/qt-console/images/bat_icon.png
300 + domenu scripts/bat.desktop
301 + fi
302 +
303 + # remove some scripts we don't need at all
304 + rm -f "${D}"/usr/libexec/bacula/{bacula,bacula-ctl-dir,bacula-ctl-fd,bacula-ctl-sd,startmysql,stopmysql}
305 +
306 + # rename statically linked apps
307 + if use bacula-clientonly && use static ; then
308 + pushd "${D}"/usr/sbin || die
309 + mv static-bacula-fd bacula-fd || die
310 + mv static-bconsole bconsole || die
311 + popd || die
312 + fi
313 +
314 + # extra files which 'make install' doesn't cover
315 + if ! use bacula-clientonly; then
316 + # the database update scripts
317 + diropts -m0750
318 + insinto /usr/libexec/bacula/updatedb
319 + insopts -m0754
320 + doins "${S}"/updatedb/*
321 + fperms 0640 /usr/libexec/bacula/updatedb/README
322 +
323 + # the logrotate configuration
324 + # (now unconditional wrt bug #258187)
325 + diropts -m0755
326 + insinto /etc/logrotate.d
327 + insopts -m0644
328 + newins "${S}"/scripts/logrotate bacula
329 +
330 + # the logwatch scripts
331 + if use logwatch; then
332 + diropts -m0750
333 + dodir /usr/share/logwatch/scripts/services
334 + dodir /usr/share/logwatch/scripts/shared
335 + dodir /etc/logwatch/conf/logfiles
336 + dodir /etc/logwatch/conf/services
337 + pushd "${S}"/scripts/logwatch >&/dev/null || die
338 + emake DESTDIR="${D}" install
339 + popd >&/dev/null || die
340 + fi
341 + fi
342 +
343 + if ! use qt5; then
344 + rm -vf "${D}"/usr/share/man/man1/bat.1*
345 + fi
346 + rm -vf "${D}"/usr/share/man/man1/bacula-tray-monitor.1*
347 +
348 + if use bacula-clientonly || use bacula-nodir ; then
349 + rm -vf "${D}"/usr/libexec/bacula/create_*_database
350 + rm -vf "${D}"/usr/libexec/bacula/drop_*_database
351 + rm -vf "${D}"/usr/libexec/bacula/make_*_tables
352 + rm -vf "${D}"/usr/libexec/bacula/update_*_tables
353 + rm -vf "${D}"/usr/libexec/bacula/drop_*_tables
354 + rm -vf "${D}"/usr/libexec/bacula/grant_*_privileges
355 + rm -vf "${D}"/usr/libexec/bacula/*_catalog_backup
356 + fi
357 + if use bacula-clientonly || use bacula-nosd; then
358 + rm -vf "${D}"/usr/libexec/bacula/disk-changer
359 + rm -vf "${D}"/usr/libexec/bacula/mtx-changer
360 + rm -vf "${D}"/usr/libexec/bacula/dvd-handler
361 + fi
362 +
363 + # documentation
364 + dodoc ChangeLog ReleaseNotes SUPPORT
365 +
366 + # Install all man pages
367 + doman "${S}"/manpages/*
368 +
369 + # install examples (bug #457504)
370 + if use examples; then
371 + docinto examples/
372 + dodoc -r examples/*
373 + fi
374 +
375 + # vim-files
376 + if use vim-syntax; then
377 + insinto /usr/share/vim/vimfiles/syntax
378 + doins scripts/bacula.vim
379 + insinto /usr/share/vim/vimfiles/ftdetect
380 + newins scripts/filetype.vim bacula_ft.vim
381 + fi
382 +
383 + # setup init scripts
384 + myscripts="bacula-fd"
385 + if ! use bacula-clientonly; then
386 + if ! use bacula-nodir; then
387 + myscripts="${myscripts} bacula-dir"
388 + fi
389 + if ! use bacula-nosd; then
390 + myscripts="${myscripts} bacula-sd"
391 + fi
392 + fi
393 + for script in ${myscripts}; do
394 + # copy over init script and config to a temporary location
395 + # so we can modify them as needed
396 + cp "${FILESDIR}/${script}".confd "${T}/${script}".confd || die "failed to copy ${script}.confd"
397 + cp "${FILESDIR}/newscripts/${script}".initd "${T}/${script}".initd || die "failed to copy ${script}.initd"
398 +
399 + # now set the database dependancy for the director init script
400 + case "${script}" in
401 + bacula-dir)
402 + case "${mydbtype}" in
403 + sqlite3)
404 + # sqlite databases don't have a daemon
405 + sed -i -e 's/need "%database%"/:/g' "${T}/${script}".initd || die
406 + ;;
407 + *)
408 + # all other databases have daemons
409 + sed -i -e "s:%database%:${mydbtype}:" "${T}/${script}".initd || die
410 + ;;
411 + esac
412 + ;;
413 + *)
414 + ;;
415 + esac
416 +
417 + # install init script and config
418 + newinitd "${T}/${script}".initd "${script}"
419 + newconfd "${T}/${script}".confd "${script}"
420 + done
421 +
422 + systemd_dounit "${S}"/platforms/systemd/bacula-{dir,fd,sd}.service
423 +
424 + # make sure the working directory exists
425 + diropts -m0750
426 + keepdir /var/lib/bacula
427 +
428 + # make sure bacula group can execute bacula libexec scripts
429 + fowners -R root:bacula /usr/libexec/bacula
430 +}
431 +
432 +pkg_postinst() {
433 + if use bacula-clientonly; then
434 + fowners root:bacula /var/lib/bacula
435 + else
436 + fowners bacula:bacula /var/lib/bacula
437 + fi
438 +
439 + if ! use bacula-clientonly && ! use bacula-nodir; then
440 + einfo
441 + einfo "If this is a new install, you must create the ${mydbtype} databases with:"
442 + einfo " /usr/libexec/bacula/create_${mydbtype}_database"
443 + einfo " /usr/libexec/bacula/make_${mydbtype}_tables"
444 + einfo " /usr/libexec/bacula/grant_${mydbtype}_privileges"
445 + einfo
446 +
447 + ewarn "ATTENTION!"
448 + ewarn "The format of the database may have changed."
449 + ewarn "If you just upgraded from a version below 9.0.0 you must run"
450 + ewarn "'update_bacula_tables' now."
451 + ewarn "Make sure to have a backup of your catalog before."
452 + ewarn
453 + fi
454 +
455 + if use sqlite; then
456 + einfo
457 + einfo "Be aware that Bacula does not officially support SQLite database anymore."
458 + einfo "Best use it only for a client-only installation. See Bug #445540."
459 + einfo
460 + fi
461 +
462 + einfo "Please note that 'bconsole' will always be installed. To compile 'bat'"
463 + einfo "you have to enable 'USE=qt5'."
464 + einfo
465 + einfo "/var/lib/bacula/tmp was configured for archivedir. This dir will be used during"
466 + einfo "restores, so be sure to set it to an appropriate in dir in the bacula config."
467 +}