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