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