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