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, 28 Oct 2018 10:14:29
Message-Id: 1540721612.01193cbf016e898ab1b07fb17333c1d2d4c37bb4.tomjbe@gentoo
1 commit: 01193cbf016e898ab1b07fb17333c1d2d4c37bb4
2 Author: Thomas Beierlein <tomjbe <AT> gentoo <DOT> org>
3 AuthorDate: Sun Oct 28 10:05:16 2018 +0000
4 Commit: Thomas Beierlein <tomjbe <AT> gentoo <DOT> org>
5 CommitDate: Sun Oct 28 10:13:32 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=01193cbf
7
8 app-backup/bacula: Revbumps to replace virtual/mysql
9
10 Closes: https://bugs.gentoo.org/665818
11
12 Signed-off-by: Thomas Beierlein <tomjbe <AT> gentoo.org>
13 Package-Manager: Portage-2.3.51, Repoman-2.3.11
14
15 app-backup/bacula/bacula-5.2.13-r7.ebuild | 397 +++++++++++++++++++++++++++
16 app-backup/bacula/bacula-9.0.6-r4.ebuild | 436 ++++++++++++++++++++++++++++++
17 app-backup/bacula/bacula-9.0.8-r1.ebuild | 434 +++++++++++++++++++++++++++++
18 3 files changed, 1267 insertions(+)
19
20 diff --git a/app-backup/bacula/bacula-5.2.13-r7.ebuild b/app-backup/bacula/bacula-5.2.13-r7.ebuild
21 new file mode 100644
22 index 00000000000..5c90175fbb9
23 --- /dev/null
24 +++ b/app-backup/bacula/bacula-5.2.13-r7.ebuild
25 @@ -0,0 +1,397 @@
26 +# Copyright 1999-2018 Gentoo Authors
27 +# Distributed under the terms of the GNU General Public License v2
28 +
29 +EAPI="5"
30 +
31 +PYTHON_COMPAT=( python2_7 )
32 +PYTHON_REQ_USE="threads"
33 +
34 +inherit eutils multilib python-single-r1 systemd user libtool
35 +
36 +MY_PV=${PV/_beta/-b}
37 +MY_P=${PN}-${MY_PV}
38 +
39 +DESCRIPTION="Featureful client/server network backup suite"
40 +HOMEPAGE="http://www.bacula.org/"
41 +SRC_URI="mirror://sourceforge/bacula/${MY_P}.tar.gz"
42 +
43 +LICENSE="AGPL-3"
44 +SLOT="0"
45 +KEYWORDS="~amd64 ~ppc ~sparc ~x86"
46 +IUSE="acl bacula-clientonly bacula-nodir bacula-nosd examples ipv6 libressl logwatch mysql postgres python readline +sqlite ssl static tcpd vim-syntax X"
47 +
48 +DEPEND="
49 + dev-libs/gmp:0
50 + !bacula-clientonly? (
51 + postgres? ( dev-db/postgresql:=[threads] )
52 + mysql? ( dev-db/mysql-connector-c:= )
53 + sqlite? ( dev-db/sqlite:3 )
54 + !bacula-nodir? ( virtual/mta )
55 + )
56 + logwatch? ( sys-apps/logwatch )
57 + tcpd? ( >=sys-apps/tcp-wrappers-7.6 )
58 + readline? ( sys-libs/readline:0 )
59 + static? (
60 + acl? ( virtual/acl[static-libs] )
61 + sys-libs/zlib[static-libs]
62 + dev-libs/lzo[static-libs]
63 + sys-libs/ncurses:=[static-libs]
64 + ssl? (
65 + !libressl? ( dev-libs/openssl:0=[static-libs] )
66 + libressl? ( dev-libs/libressl:0=[static-libs] )
67 + )
68 + )
69 + !static? (
70 + acl? ( virtual/acl )
71 + sys-libs/zlib
72 + dev-libs/lzo
73 + sys-libs/ncurses:=
74 + ssl? (
75 + !libressl? ( dev-libs/openssl:0= )
76 + libressl? ( dev-libs/libressl:0= )
77 + )
78 + )
79 + python? ( ${PYTHON_DEPS} )
80 + "
81 +RDEPEND="${DEPEND}
82 + !bacula-clientonly? (
83 + !bacula-nosd? (
84 + sys-block/mtx
85 + app-arch/mt-st
86 + )
87 + )
88 + vim-syntax? ( || ( app-editors/vim app-editors/gvim ) )"
89 +
90 +REQUIRED_USE="!bacula-clientonly? ( ^^ ( mysql postgres sqlite ) )
91 + static? ( bacula-clientonly )
92 + python? ( ${PYTHON_REQUIRED_USE} )"
93 +
94 +S=${WORKDIR}/${MY_P}
95 +
96 +pkg_setup() {
97 + #XOR and !bacula-clientonly controlled by REQUIRED_USE
98 + use mysql && export mydbtype="mysql"
99 + use postgres && export mydbtype="postgresql"
100 + use sqlite && export mydbtype="sqlite3"
101 +
102 + # create the daemon group and user
103 + if [ -z "$(egetent group bacula 2>/dev/null)" ]; then
104 + enewgroup bacula
105 + einfo
106 + einfo "The group 'bacula' has been created. Any users you add to this"
107 + einfo "group have access to files created by the daemons."
108 + einfo
109 + fi
110 +
111 + if ! use bacula-clientonly; then
112 + if [ -z "$(egetent passwd bacula 2>/dev/null)" ]; then
113 + enewuser bacula -1 -1 /var/lib/bacula bacula,disk,tape,cdrom,cdrw
114 + einfo
115 + einfo "The user 'bacula' has been created. Please see the bacula manual"
116 + einfo "for information about running bacula as a non-root user."
117 + einfo
118 + fi
119 + fi
120 +
121 + use python && python-single-r1_pkg_setup
122 +}
123 +
124 +src_prepare() {
125 + # adjusts default configuration files for several binaries
126 + # to /etc/bacula/<config> instead of ./<config>
127 + pushd src >&/dev/null || die
128 + for f in console/console.c dird/dird.c filed/filed.c \
129 + stored/bcopy.c stored/bextract.c stored/bls.c \
130 + stored/bscan.c stored/btape.c stored/stored.c \
131 + qt-console/main.cpp; do
132 + sed -i -e 's|^\(#define CONFIG_FILE "\)|\1/etc/bacula/|g' "${f}" \
133 + || die "sed on ${f} failed"
134 + done
135 + popd >&/dev/null || die
136 +
137 + # bug 466688 drop deprecated categories from Desktop file
138 + sed -i -e 's/Application;//' scripts/bat.desktop.in || die
139 +
140 + # bug 466690 Use CXXFLAGS instead of CFLAGS
141 + sed -i -e 's/@CFLAGS@/@CXXFLAGS@/' autoconf/Make.common.in || die
142 +
143 + # drop automatic install of unneeded documentation (for bug 356499)
144 + epatch "${FILESDIR}"/5.2.3/${PN}-5.2.3-doc.patch
145 +
146 + # bug #310087
147 + epatch "${FILESDIR}"/5.2.3/${PN}-5.2.3-as-needed.patch
148 +
149 + # bug #311161
150 + epatch "${FILESDIR}"/5.2.3/${PN}-5.2.3-lib-search-path.patch
151 +
152 + # stop build for errors in subdirs
153 + epatch "${FILESDIR}"/5.2.3/${PN}-5.2.3-Makefile.patch
154 +
155 + # bat needs to respect LDFLAGS
156 + epatch "${FILESDIR}"/5.2.3/${PN}-5.2.3-ldflags.patch
157 +
158 + # bug #328701
159 + epatch "${FILESDIR}"/5.2.3/${PN}-5.2.3-openssl-1.patch
160 +
161 + epatch "${FILESDIR}"/5.2.10/${PN}-5.2.10-fix-static.patch
162 +
163 + # do not strip binaries
164 + sed -i -e "s/strip /# strip /" src/filed/Makefile.in || die
165 + sed -i -e "s/strip /# strip /" src/console/Makefile.in || die
166 +
167 + # fix file not found error during make depend
168 + epatch "${FILESDIR}"/5.2.12/${PN}-5.2.12-depend.patch
169 +
170 + # Fix systemd unit files:
171 + # bug 497748
172 + sed -i -e '/Requires/d' platforms/systemd/*.service.in || die
173 + sed -i -e '/StandardOutput/d' platforms/systemd/*.service.in || die
174 + # bug 504370
175 + sed -i -e '/Alias=bacula-dir/d' platforms/systemd/bacula-dir.service.in || die
176 + # bug 584442 and 504368
177 + sed -i -e 's/@dir_user@/root/g' platforms/systemd/bacula-dir.service.in || die
178 +
179 + # Fix tmpfiles config for client-only (no bacula user) install
180 + # NOTE: Change only first occurance (user) not second (group)
181 + # bug 528398 and 577486
182 + if use bacula-clientonly; then
183 + sed -i -e 's/bacula/root/' platforms/systemd/bacula.conf.in || die
184 + fi
185 +
186 + # fix bundled libtool (bug 466696)
187 + # But first move directory with M4 macros out of the way.
188 + # It is only needed by autoconf and gives errors during elibtoolize.
189 + mv autoconf/libtool autoconf/libtool1 || die
190 + elibtoolize
191 +}
192 +
193 +src_configure() {
194 + local myconf=''
195 +
196 + if use bacula-clientonly; then
197 + myconf="${myconf} \
198 + $(use_enable bacula-clientonly client-only) \
199 + $(use_enable !static libtool) \
200 + $(use_enable static static-cons) \
201 + $(use_enable static static-fd)"
202 + else
203 + myconf="${myconf} \
204 + $(use_enable !bacula-nodir build-dird) \
205 + $(use_enable !bacula-nosd build-stored)"
206 + # bug #311099
207 + # database support needed by dir-only *and* sd-only
208 + # build as well (for building bscan, btape, etc.)
209 + myconf="${myconf} \
210 + --with-${mydbtype} \
211 + --enable-batch-insert"
212 + fi
213 +
214 + myconf="${myconf} \
215 + --disable-tray-monitor \
216 + $(use_with X x) \
217 + $(use_with python) \
218 + $(use_enable !readline conio) \
219 + $(use_enable readline) \
220 + $(use_with readline readline /usr) \
221 + $(use_with ssl openssl) \
222 + $(use_enable ipv6) \
223 + $(use_enable acl) \
224 + $(use_with tcpd tcp-wrappers)"
225 +
226 + econf \
227 + --libdir=/usr/$(get_libdir) \
228 + --docdir=/usr/share/doc/${PF} \
229 + --htmldir=/usr/share/doc/${PF}/html \
230 + --with-pid-dir=/var/run \
231 + --sysconfdir=/etc/bacula \
232 + --with-subsys-dir=/var/lock/subsys \
233 + --with-working-dir=/var/lib/bacula \
234 + --with-logdir=/var/lib/bacula \
235 + --with-scriptdir=/usr/libexec/bacula \
236 + --with-systemd=$(systemd_get_unitdir) \
237 + --with-dir-user=bacula \
238 + --with-dir-group=bacula \
239 + --with-sd-user=root \
240 + --with-sd-group=bacula \
241 + --with-fd-user=root \
242 + --with-fd-group=bacula \
243 + --enable-smartalloc \
244 + --disable-afs \
245 + --host=${CHOST} \
246 + ${myconf}
247 +}
248 +
249 +src_compile() {
250 + # Make build log verbose (bug #447806)
251 + emake NO_ECHO=""
252 +}
253 +
254 +src_install() {
255 + emake DESTDIR="${D}" install
256 + doicon scripts/bacula.png
257 +
258 + # remove some scripts we don't need at all
259 + rm -f "${D}"/usr/libexec/bacula/{bacula,bacula-ctl-dir,bacula-ctl-fd,bacula-ctl-sd,startmysql,stopmysql}
260 +
261 + # rename statically linked apps
262 + if use bacula-clientonly && use static ; then
263 + pushd "${D}"/usr/sbin || die
264 + mv static-bacula-fd bacula-fd || die
265 + mv static-bconsole bconsole || die
266 + popd || die
267 + fi
268 +
269 + # extra files which 'make install' doesn't cover
270 + if ! use bacula-clientonly; then
271 + # the database update scripts
272 + diropts -m0750
273 + insinto /usr/libexec/bacula/updatedb
274 + insopts -m0754
275 + doins "${S}"/updatedb/*
276 + fperms 0640 /usr/libexec/bacula/updatedb/README
277 +
278 + # the logrotate configuration
279 + # (now unconditional wrt bug #258187)
280 + diropts -m0755
281 + insinto /etc/logrotate.d
282 + insopts -m0644
283 + newins "${S}"/scripts/logrotate bacula
284 +
285 + # the logwatch scripts
286 + if use logwatch; then
287 + diropts -m0750
288 + dodir /etc/log.d/scripts/services
289 + dodir /etc/log.d/scripts/shared
290 + dodir /etc/log.d/conf/logfiles
291 + dodir /etc/log.d/conf/services
292 + pushd "${S}"/scripts/logwatch >&/dev/null || die
293 + emake DESTDIR="${D}" install
294 + popd >&/dev/null || die
295 + fi
296 + fi
297 +
298 + rm -vf "${D}"/usr/share/man/man1/bacula-bwxconsole.1*
299 + rm -vf "${D}"/usr/share/man/man1/bat.1*
300 + rm -vf "${D}"/usr/share/man/man1/bacula-tray-monitor.1*
301 + if use bacula-clientonly || use bacula-nodir; then
302 + rm -vf "${D}"/usr/share/man/man8/bacula-dir.8*
303 + rm -vf "${D}"/usr/share/man/man8/dbcheck.8*
304 + rm -vf "${D}"/usr/share/man/man1/bsmtp.1*
305 + rm -vf "${D}"/usr/libexec/bacula/create_*_database
306 + rm -vf "${D}"/usr/libexec/bacula/drop_*_database
307 + rm -vf "${D}"/usr/libexec/bacula/make_*_tables
308 + rm -vf "${D}"/usr/libexec/bacula/update_*_tables
309 + rm -vf "${D}"/usr/libexec/bacula/drop_*_tables
310 + rm -vf "${D}"/usr/libexec/bacula/grant_*_privileges
311 + rm -vf "${D}"/usr/libexec/bacula/*_catalog_backup
312 + fi
313 + if use bacula-clientonly || use bacula-nosd; then
314 + rm -vf "${D}"/usr/share/man/man8/bacula-sd.8*
315 + rm -vf "${D}"/usr/share/man/man8/bcopy.8*
316 + rm -vf "${D}"/usr/share/man/man8/bextract.8*
317 + rm -vf "${D}"/usr/share/man/man8/bls.8*
318 + rm -vf "${D}"/usr/share/man/man8/bscan.8*
319 + rm -vf "${D}"/usr/share/man/man8/btape.8*
320 + rm -vf "${D}"/usr/libexec/bacula/disk-changer
321 + rm -vf "${D}"/usr/libexec/bacula/mtx-changer
322 + rm -vf "${D}"/usr/libexec/bacula/dvd-handler
323 + fi
324 +
325 + # documentation
326 + dodoc ChangeLog ReleaseNotes SUPPORT technotes
327 +
328 + # install examples (bug #457504)
329 + if use examples; then
330 + docinto examples/
331 + dodoc -r examples/*
332 + fi
333 +
334 + # vim-files
335 + if use vim-syntax; then
336 + insinto /usr/share/vim/vimfiles/syntax
337 + doins scripts/bacula.vim
338 + insinto /usr/share/vim/vimfiles/ftdetect
339 + newins scripts/filetype.vim bacula_ft.vim
340 + fi
341 +
342 + # setup init scripts
343 + myscripts="bacula-fd"
344 + if ! use bacula-clientonly; then
345 + if ! use bacula-nodir; then
346 + myscripts="${myscripts} bacula-dir"
347 + fi
348 + if ! use bacula-nosd; then
349 + myscripts="${myscripts} bacula-sd"
350 + fi
351 + fi
352 + for script in ${myscripts}; do
353 + # copy over init script and config to a temporary location
354 + # so we can modify them as needed
355 + cp "${FILESDIR}/${script}".confd "${T}/${script}".confd || die "failed to copy ${script}.confd"
356 + cp "${FILESDIR}/${script}".initd "${T}/${script}".initd || die "failed to copy ${script}.initd"
357 +
358 + # now set the database dependancy for the director init script
359 + case "${script}" in
360 + bacula-dir)
361 + case "${mydbtype}" in
362 + sqlite3)
363 + # sqlite databases don't have a daemon
364 + sed -i -e 's/need "%database%"/:/g' "${T}/${script}".initd || die
365 + ;;
366 + *)
367 + # all other databases have daemons
368 + sed -i -e "s:%database%:${mydbtype}:" "${T}/${script}".initd || die
369 + ;;
370 + esac
371 + ;;
372 + *)
373 + ;;
374 + esac
375 +
376 + # install init script and config
377 + newinitd "${T}/${script}".initd "${script}"
378 + newconfd "${T}/${script}".confd "${script}"
379 + done
380 +
381 + systemd_dounit "${S}"/platforms/systemd/bacula-{dir,fd,sd}.service
382 + systemd_dotmpfilesd "${S}"/platforms/systemd/bacula.conf
383 +
384 + # make sure the working directory exists
385 + diropts -m0750
386 + keepdir /var/lib/bacula
387 +
388 + # make sure bacula group can execute bacula libexec scripts
389 + fowners -R root:bacula /usr/libexec/bacula
390 +}
391 +
392 +pkg_postinst() {
393 + if use bacula-clientonly; then
394 + fowners root:bacula /var/lib/bacula
395 + else
396 + fowners bacula:bacula /var/lib/bacula
397 + fi
398 +
399 + einfo
400 + einfo "This Revision 6 of bacula-5.2.13 dropped support for building 'bat' as"
401 + einfo "Qt4 is not longer supported by Gentoo. Please use it only for installations"
402 + einfo "requiring an old file demon."
403 + einfo
404 + if ! use bacula-clientonly && ! use bacula-nodir; then
405 + einfo
406 + einfo "If this is a new install, you must create the ${mydbtype} databases with:"
407 + einfo " /usr/libexec/bacula/create_${mydbtype}_database"
408 + einfo " /usr/libexec/bacula/make_${mydbtype}_tables"
409 + einfo " /usr/libexec/bacula/grant_${mydbtype}_privileges"
410 + einfo
411 + fi
412 +
413 + if use sqlite; then
414 + einfo
415 + einfo "Be aware that Bacula does not officially support SQLite database anymore."
416 + einfo "Best use it only for a client-only installation. See Bug #445540."
417 + einfo
418 + fi
419 +
420 + einfo "Please note that 'bconsole' will always be installed."
421 + einfo
422 +}
423
424 diff --git a/app-backup/bacula/bacula-9.0.6-r4.ebuild b/app-backup/bacula/bacula-9.0.6-r4.ebuild
425 new file mode 100644
426 index 00000000000..bda740bbcd9
427 --- /dev/null
428 +++ b/app-backup/bacula/bacula-9.0.6-r4.ebuild
429 @@ -0,0 +1,436 @@
430 +# Copyright 1999-2018 Gentoo Authors
431 +# Distributed under the terms of the GNU General Public License v2
432 +
433 +EAPI="6"
434 +
435 +inherit qmake-utils desktop systemd user libtool
436 +
437 +MY_PV=${PV/_beta/-b}
438 +MY_P=${PN}-${MY_PV}
439 +
440 +DESCRIPTION="Featureful client/server network backup suite"
441 +HOMEPAGE="http://www.bacula.org/"
442 +SRC_URI="mirror://sourceforge/bacula/${MY_P}.tar.gz"
443 +
444 +LICENSE="AGPL-3"
445 +SLOT="0"
446 +KEYWORDS="~amd64 ~ppc ~sparc ~x86"
447 +IUSE="acl bacula-clientonly bacula-nodir bacula-nosd examples ipv6 libressl logwatch mysql postgres qt5 readline +sqlite ssl static tcpd vim-syntax X"
448 +
449 +DEPEND="
450 + dev-libs/gmp:0
451 + !bacula-clientonly? (
452 + postgres? ( dev-db/postgresql:=[threads] )
453 + mysql? ( dev-db/mysql-connector-c:= )
454 + sqlite? ( dev-db/sqlite:3 )
455 + !bacula-nodir? ( virtual/mta )
456 + )
457 + qt5? (
458 + dev-qt/qtsvg:5
459 + x11-libs/qwt:6
460 + )
461 + logwatch? ( sys-apps/logwatch )
462 + tcpd? ( >=sys-apps/tcp-wrappers-7.6 )
463 + readline? ( sys-libs/readline:0 )
464 + static? (
465 + acl? ( virtual/acl[static-libs] )
466 + sys-libs/zlib[static-libs]
467 + dev-libs/lzo[static-libs]
468 + sys-libs/ncurses:=[static-libs]
469 + ssl? (
470 + !libressl? ( dev-libs/openssl:0=[static-libs] )
471 + libressl? ( dev-libs/libressl:0=[static-libs] )
472 + )
473 + )
474 + !static? (
475 + acl? ( virtual/acl )
476 + sys-libs/zlib
477 + dev-libs/lzo
478 + sys-libs/ncurses:=
479 + ssl? (
480 + !libressl? ( dev-libs/openssl:0= )
481 + libressl? ( dev-libs/libressl:0= )
482 + )
483 + )"
484 +RDEPEND="${DEPEND}
485 + !bacula-clientonly? (
486 + !bacula-nosd? (
487 + sys-block/mtx
488 + app-arch/mt-st
489 + )
490 + )
491 + vim-syntax? ( || ( app-editors/vim app-editors/gvim ) )"
492 +
493 +REQUIRED_USE="!bacula-clientonly? ( ^^ ( mysql postgres sqlite ) )
494 + static? ( bacula-clientonly )"
495 +
496 +S=${WORKDIR}/${MY_P}
497 +
498 +pkg_setup() {
499 + #XOR and !bacula-clientonly controlled by REQUIRED_USE
500 + use mysql && export mydbtype="mysql"
501 + use postgres && export mydbtype="postgresql"
502 + use sqlite && export mydbtype="sqlite3"
503 +
504 + # create the daemon group and user
505 + if [ -z "$(egetent group bacula 2>/dev/null)" ]; then
506 + enewgroup bacula
507 + einfo
508 + einfo "The group 'bacula' has been created. Any users you add to this"
509 + einfo "group have access to files created by the daemons."
510 + einfo
511 + fi
512 +
513 + if use bacula-clientonly && use static && use qt5; then
514 + ewarn
515 + ewarn "Building statically linked 'bat' is not supported. Ignorig 'qt5' useflag."
516 + ewarn
517 + fi
518 +
519 + if ! use bacula-clientonly; then
520 + if [ -z "$(egetent passwd bacula 2>/dev/null)" ]; then
521 + enewuser bacula -1 -1 /var/lib/bacula bacula,disk,tape,cdrom,cdrw
522 + einfo
523 + einfo "The user 'bacula' has been created. Please see the bacula manual"
524 + einfo "for information about running bacula as a non-root user."
525 + einfo
526 + fi
527 + fi
528 +}
529 +
530 +src_prepare() {
531 + # adjusts default configuration files for several binaries
532 + # to /etc/bacula/<config> instead of ./<config>
533 + pushd src >&/dev/null || die
534 + for f in console/console.c dird/dird.c filed/filed.c \
535 + stored/bcopy.c stored/bextract.c stored/bls.c \
536 + stored/bscan.c stored/btape.c stored/stored.c \
537 + qt-console/main.cpp; do
538 + sed -i -e 's|^\(#define CONFIG_FILE "\)|\1/etc/bacula/|g' "${f}" \
539 + || die "sed on ${f} failed"
540 + done
541 + popd >&/dev/null || die
542 +
543 + # bug 466688 drop deprecated categories from Desktop file
544 + sed -i -e 's/Application;//' scripts/bat.desktop.in || die
545 +
546 + # bug 466690 Use CXXFLAGS instead of CFLAGS
547 + sed -i -e 's/@CFLAGS@/@CXXFLAGS@/' autoconf/Make.common.in || die
548 +
549 + # drop automatic install of unneeded documentation (for bug 356499)
550 + eapply -p0 "${FILESDIR}"/7.2.0/${PN}-7.2.0-doc.patch
551 +
552 + # bug #310087
553 + eapply "${FILESDIR}"/5.2.3/${PN}-5.2.3-as-needed.patch
554 +
555 + # bug #311161
556 + eapply -p0 "${FILESDIR}"/9.0.2/${PN}-9.0.2-lib-search-path.patch
557 +
558 + # bat needs to respect LDFLAGS and CFLAGS
559 + eapply -p0 "${FILESDIR}"/9.0.6/${PN}-9.0.6-bat-pro.patch
560 +
561 + # bug #328701
562 + eapply -p0 "${FILESDIR}"/5.2.3/${PN}-5.2.3-openssl-1.patch
563 +
564 + eapply -p0 "${FILESDIR}"/9.0.2/${PN}-9.0.2-fix-static.patch
565 +
566 + # fix soname in libbaccat.so bug #602952
567 + eapply -p0 "${FILESDIR}/bacula-fix-sonames.patch"
568 +
569 + # do not strip binaries
570 + sed -i -e "s/strip /# strip /" src/filed/Makefile.in || die
571 + sed -i -e "s/strip /# strip /" src/console/Makefile.in || die
572 +
573 + # fix file not found error during make depend
574 + eapply -p0 "${FILESDIR}"/7.0.2/${PN}-7.0.2-depend.patch
575 +
576 + # fix missing QtGlobal include in src/qt-console/pages.h for Qt5
577 + eapply -p0 "${FILESDIR}"/9.0.6/${PN}-9.0.6-fix-pages-h-qt-includes.patch
578 + eapply_user
579 +
580 + # Fix systemd unit files:
581 + # bug 497748
582 + sed -i -e '/Requires/d' platforms/systemd/*.service.in || die
583 + sed -i -e '/StandardOutput/d' platforms/systemd/*.service.in || die
584 + # bug 504370
585 + sed -i -e '/Alias=bacula-dir/d' platforms/systemd/bacula-dir.service.in || die
586 + # bug 584442 and 504368
587 + sed -i -e 's/@dir_user@/root/g' platforms/systemd/bacula-dir.service.in || die
588 +
589 + # build 'bat' for Qt5
590 + export QMAKE="$(qt5_get_bindir)"/qmake
591 +
592 + # adapt to >=Qt-5.9 (see bug #644566)
593 + # qmake needs an existing target file to generate install instructions
594 + sed -i -e 's#bins.files = bat#bins.files = .libs/bat#g' \
595 + src/qt-console/bat.pro.in || die
596 + mkdir src/qt-console/.libs || die
597 + touch src/qt-console/.libs/bat || die
598 + chmod 755 src/qt-console/.libs/bat || die
599 +
600 + # fix wrong handling of libressl version
601 + # needs separate handling for <libressl-2.7 and >=libressl2.7
602 + # (see bug #655520)
603 + if has_version "<dev-libs/libressl-2.7"; then
604 + eapply -p0 "${FILESDIR}"/9.0.6/${PN}-9.0.6-libressl26.patch
605 + else
606 + eapply -p0 "${FILESDIR}"/9.0.6/${PN}-9.0.6-libressl27.patch
607 + fi
608 +
609 + # fix bundled libtool (bug 466696)
610 + # But first move directory with M4 macros out of the way.
611 + # It is only needed by autoconf and gives errors during elibtoolize.
612 + mv autoconf/libtool autoconf/libtool1 || die
613 + elibtoolize
614 +}
615 +
616 +src_configure() {
617 + local myconf=''
618 +
619 + if use bacula-clientonly; then
620 + myconf="${myconf} \
621 + $(use_enable bacula-clientonly client-only) \
622 + $(use_enable !static libtool) \
623 + $(use_enable static static-cons) \
624 + $(use_enable static static-fd)"
625 + else
626 + myconf="${myconf} \
627 + $(use_enable !bacula-nodir build-dird) \
628 + $(use_enable !bacula-nosd build-stored)"
629 + # bug #311099
630 + # database support needed by dir-only *and* sd-only
631 + # build as well (for building bscan, btape, etc.)
632 + myconf="${myconf}
633 + --with-${mydbtype}"
634 + if use mysql; then
635 + myconf="${myconf} \
636 + --disable-batch-insert"
637 + else
638 + myconf="${myconf} \
639 + --enable-batch-insert"
640 + fi
641 + fi
642 +
643 + # do not build bat if 'static' clientonly
644 + if ! use bacula-clientonly || ! use static; then
645 + myconf="${myconf} \
646 + $(use_enable qt5 bat)"
647 + fi
648 +
649 + myconf="${myconf} \
650 + $(use_with X x) \
651 + $(use_enable !readline conio) \
652 + $(use_enable readline) \
653 + $(use_with readline readline /usr) \
654 + $(use_with ssl openssl) \
655 + $(use_enable ipv6) \
656 + $(use_enable acl) \
657 + $(use_with tcpd tcp-wrappers)"
658 +
659 + econf \
660 + --libdir=/usr/$(get_libdir) \
661 + --docdir=/usr/share/doc/${PF} \
662 + --htmldir=/usr/share/doc/${PF}/html \
663 + --with-pid-dir=/var/run \
664 + --sysconfdir=/etc/bacula \
665 + --with-subsys-dir=/var/lock/subsys \
666 + --with-working-dir=/var/lib/bacula \
667 + --with-logdir=/var/lib/bacula \
668 + --with-scriptdir=/usr/libexec/bacula \
669 + --with-systemd=$(systemd_get_systemunitdir) \
670 + --with-dir-user=bacula \
671 + --with-dir-group=bacula \
672 + --with-sd-user=root \
673 + --with-sd-group=bacula \
674 + --with-fd-user=root \
675 + --with-fd-group=bacula \
676 + --enable-smartalloc \
677 + --disable-afs \
678 + --host=${CHOST} \
679 + ${myconf}
680 +}
681 +
682 +src_compile() {
683 + # Make build log verbose (bug #447806)
684 + emake NO_ECHO=""
685 +}
686 +
687 +src_install() {
688 + emake DESTDIR="${D}" install
689 + doicon scripts/bacula.png
690 +
691 + # install bat icon and desktop file when enabled
692 + # (for some reason ./configure doesn't pick this up)
693 + if use qt5 && ! use static ; then
694 + doicon src/qt-console/images/bat_icon.png
695 + domenu scripts/bat.desktop
696 + fi
697 +
698 + # remove some scripts we don't need at all
699 + rm -f "${D}"/usr/libexec/bacula/{bacula,bacula-ctl-dir,bacula-ctl-fd,bacula-ctl-sd,startmysql,stopmysql}
700 +
701 + # rename statically linked apps
702 + if use bacula-clientonly && use static ; then
703 + pushd "${D}"/usr/sbin || die
704 + mv static-bacula-fd bacula-fd || die
705 + mv static-bconsole bconsole || die
706 + popd || die
707 + fi
708 +
709 + # extra files which 'make install' doesn't cover
710 + if ! use bacula-clientonly; then
711 + # the database update scripts
712 + diropts -m0750
713 + insinto /usr/libexec/bacula/updatedb
714 + insopts -m0754
715 + doins "${S}"/updatedb/*
716 + fperms 0640 /usr/libexec/bacula/updatedb/README
717 +
718 + # the logrotate configuration
719 + # (now unconditional wrt bug #258187)
720 + diropts -m0755
721 + insinto /etc/logrotate.d
722 + insopts -m0644
723 + newins "${S}"/scripts/logrotate bacula
724 +
725 + # the logwatch scripts
726 + if use logwatch; then
727 + diropts -m0750
728 + dodir /usr/share/logwatch/scripts/services
729 + dodir /usr/share/logwatch/scripts/shared
730 + dodir /etc/logwatch/conf/logfiles
731 + dodir /etc/logwatch/conf/services
732 + pushd "${S}"/scripts/logwatch >&/dev/null || die
733 + emake DESTDIR="${D}" install
734 + popd >&/dev/null || die
735 + fi
736 + fi
737 +
738 + if ! use qt5; then
739 + rm -vf "${D}"/usr/share/man/man1/bat.1*
740 + fi
741 + rm -vf "${D}"/usr/share/man/man1/bacula-tray-monitor.1*
742 + if use bacula-clientonly || use bacula-nodir; then
743 + rm -vf "${D}"/usr/share/man/man8/bacula-dir.8*
744 + rm -vf "${D}"/usr/share/man/man8/dbcheck.8*
745 + rm -vf "${D}"/usr/share/man/man1/bsmtp.1*
746 + rm -vf "${D}"/usr/libexec/bacula/create_*_database
747 + rm -vf "${D}"/usr/libexec/bacula/drop_*_database
748 + rm -vf "${D}"/usr/libexec/bacula/make_*_tables
749 + rm -vf "${D}"/usr/libexec/bacula/update_*_tables
750 + rm -vf "${D}"/usr/libexec/bacula/drop_*_tables
751 + rm -vf "${D}"/usr/libexec/bacula/grant_*_privileges
752 + rm -vf "${D}"/usr/libexec/bacula/*_catalog_backup
753 + fi
754 + if use bacula-clientonly || use bacula-nosd; then
755 + rm -vf "${D}"/usr/share/man/man8/bacula-sd.8*
756 + rm -vf "${D}"/usr/share/man/man8/bcopy.8*
757 + rm -vf "${D}"/usr/share/man/man8/bextract.8*
758 + rm -vf "${D}"/usr/share/man/man8/bls.8*
759 + rm -vf "${D}"/usr/share/man/man8/bscan.8*
760 + rm -vf "${D}"/usr/share/man/man8/btape.8*
761 + rm -vf "${D}"/usr/libexec/bacula/disk-changer
762 + rm -vf "${D}"/usr/libexec/bacula/mtx-changer
763 + rm -vf "${D}"/usr/libexec/bacula/dvd-handler
764 + fi
765 +
766 + # documentation
767 + dodoc ChangeLog ReleaseNotes SUPPORT
768 +
769 + # install examples (bug #457504)
770 + if use examples; then
771 + docinto examples/
772 + dodoc -r examples/*
773 + fi
774 +
775 + # vim-files
776 + if use vim-syntax; then
777 + insinto /usr/share/vim/vimfiles/syntax
778 + doins scripts/bacula.vim
779 + insinto /usr/share/vim/vimfiles/ftdetect
780 + newins scripts/filetype.vim bacula_ft.vim
781 + fi
782 +
783 + # setup init scripts
784 + myscripts="bacula-fd"
785 + if ! use bacula-clientonly; then
786 + if ! use bacula-nodir; then
787 + myscripts="${myscripts} bacula-dir"
788 + fi
789 + if ! use bacula-nosd; then
790 + myscripts="${myscripts} bacula-sd"
791 + fi
792 + fi
793 + for script in ${myscripts}; do
794 + # copy over init script and config to a temporary location
795 + # so we can modify them as needed
796 + cp "${FILESDIR}/${script}".confd "${T}/${script}".confd || die "failed to copy ${script}.confd"
797 + cp "${FILESDIR}/newscripts/${script}".initd "${T}/${script}".initd || die "failed to copy ${script}.initd"
798 +
799 + # now set the database dependancy for the director init script
800 + case "${script}" in
801 + bacula-dir)
802 + case "${mydbtype}" in
803 + sqlite3)
804 + # sqlite databases don't have a daemon
805 + sed -i -e 's/need "%database%"/:/g' "${T}/${script}".initd || die
806 + ;;
807 + *)
808 + # all other databases have daemons
809 + sed -i -e "s:%database%:${mydbtype}:" "${T}/${script}".initd || die
810 + ;;
811 + esac
812 + ;;
813 + *)
814 + ;;
815 + esac
816 +
817 + # install init script and config
818 + newinitd "${T}/${script}".initd "${script}"
819 + newconfd "${T}/${script}".confd "${script}"
820 + done
821 +
822 + systemd_dounit "${S}"/platforms/systemd/bacula-{dir,fd,sd}.service
823 +
824 + # make sure the working directory exists
825 + diropts -m0750
826 + keepdir /var/lib/bacula
827 +
828 + # make sure bacula group can execute bacula libexec scripts
829 + fowners -R root:bacula /usr/libexec/bacula
830 +}
831 +
832 +pkg_postinst() {
833 + if use bacula-clientonly; then
834 + fowners root:bacula /var/lib/bacula
835 + else
836 + fowners bacula:bacula /var/lib/bacula
837 + fi
838 +
839 + if ! use bacula-clientonly && ! use bacula-nodir; then
840 + einfo
841 + einfo "If this is a new install, you must create the ${mydbtype} databases with:"
842 + einfo " /usr/libexec/bacula/create_${mydbtype}_database"
843 + einfo " /usr/libexec/bacula/make_${mydbtype}_tables"
844 + einfo " /usr/libexec/bacula/grant_${mydbtype}_privileges"
845 + einfo
846 +
847 + ewarn "ATTENTION!"
848 + ewarn "The format of the database may have changed."
849 + ewarn "If you just upgraded from a version below 9.0.0 you must run"
850 + ewarn "'update_bacula_tables' now."
851 + ewarn "Make sure to have a backup of your catalog before."
852 + ewarn
853 + fi
854 +
855 + if use sqlite; then
856 + einfo
857 + einfo "Be aware that Bacula does not officially support SQLite database anymore."
858 + einfo "Best use it only for a client-only installation. See Bug #445540."
859 + einfo
860 + fi
861 +
862 + einfo "Please note that 'bconsole' will always be installed. To compile 'bat'"
863 + einfo "you have to enable 'USE=qt5'."
864 + einfo
865 +}
866
867 diff --git a/app-backup/bacula/bacula-9.0.8-r1.ebuild b/app-backup/bacula/bacula-9.0.8-r1.ebuild
868 new file mode 100644
869 index 00000000000..f3069cfd596
870 --- /dev/null
871 +++ b/app-backup/bacula/bacula-9.0.8-r1.ebuild
872 @@ -0,0 +1,434 @@
873 +# Copyright 1999-2018 Gentoo Authors
874 +# Distributed under the terms of the GNU General Public License v2
875 +
876 +EAPI="6"
877 +
878 +inherit qmake-utils desktop systemd user libtool
879 +
880 +MY_PV=${PV/_beta/-b}
881 +MY_P=${PN}-${MY_PV}
882 +
883 +DESCRIPTION="Featureful client/server network backup suite"
884 +HOMEPAGE="http://www.bacula.org/"
885 +SRC_URI="mirror://sourceforge/bacula/${MY_P}.tar.gz"
886 +
887 +LICENSE="AGPL-3"
888 +SLOT="0"
889 +KEYWORDS="~amd64 ~ppc ~sparc ~x86"
890 +IUSE="acl bacula-clientonly bacula-nodir bacula-nosd examples ipv6 libressl logwatch mysql postgres qt5 readline +sqlite ssl static tcpd vim-syntax X"
891 +
892 +DEPEND="
893 + dev-libs/gmp:0
894 + !bacula-clientonly? (
895 + postgres? ( dev-db/postgresql:=[threads] )
896 + mysql? ( dev-db/mysql-connector-c:= )
897 + sqlite? ( dev-db/sqlite:3 )
898 + !bacula-nodir? ( virtual/mta )
899 + )
900 + qt5? (
901 + dev-qt/qtsvg:5
902 + x11-libs/qwt:6
903 + )
904 + logwatch? ( sys-apps/logwatch )
905 + tcpd? ( >=sys-apps/tcp-wrappers-7.6 )
906 + readline? ( sys-libs/readline:0 )
907 + static? (
908 + acl? ( virtual/acl[static-libs] )
909 + sys-libs/zlib[static-libs]
910 + dev-libs/lzo[static-libs]
911 + sys-libs/ncurses:=[static-libs]
912 + ssl? (
913 + !libressl? ( dev-libs/openssl:0=[static-libs] )
914 + libressl? ( dev-libs/libressl:0=[static-libs] )
915 + )
916 + )
917 + !static? (
918 + acl? ( virtual/acl )
919 + sys-libs/zlib
920 + dev-libs/lzo
921 + sys-libs/ncurses:=
922 + ssl? (
923 + !libressl? ( dev-libs/openssl:0= )
924 + libressl? ( dev-libs/libressl:0= )
925 + )
926 + )"
927 +RDEPEND="${DEPEND}
928 + !bacula-clientonly? (
929 + !bacula-nosd? (
930 + sys-block/mtx
931 + app-arch/mt-st
932 + )
933 + )
934 + vim-syntax? ( || ( app-editors/vim app-editors/gvim ) )"
935 +
936 +REQUIRED_USE="!bacula-clientonly? ( ^^ ( mysql postgres sqlite ) )
937 + static? ( bacula-clientonly )"
938 +
939 +S=${WORKDIR}/${MY_P}
940 +
941 +pkg_setup() {
942 + #XOR and !bacula-clientonly controlled by REQUIRED_USE
943 + use mysql && export mydbtype="mysql"
944 + use postgres && export mydbtype="postgresql"
945 + use sqlite && export mydbtype="sqlite3"
946 +
947 + # create the daemon group and user
948 + if [ -z "$(egetent group bacula 2>/dev/null)" ]; then
949 + enewgroup bacula
950 + einfo
951 + einfo "The group 'bacula' has been created. Any users you add to this"
952 + einfo "group have access to files created by the daemons."
953 + einfo
954 + fi
955 +
956 + if use bacula-clientonly && use static && use qt5; then
957 + ewarn
958 + ewarn "Building statically linked 'bat' is not supported. Ignorig 'qt5' useflag."
959 + ewarn
960 + fi
961 +
962 + if ! use bacula-clientonly; then
963 + if [ -z "$(egetent passwd bacula 2>/dev/null)" ]; then
964 + enewuser bacula -1 -1 /var/lib/bacula bacula,disk,tape,cdrom,cdrw
965 + einfo
966 + einfo "The user 'bacula' has been created. Please see the bacula manual"
967 + einfo "for information about running bacula as a non-root user."
968 + einfo
969 + fi
970 + fi
971 +}
972 +
973 +src_prepare() {
974 + # adjusts default configuration files for several binaries
975 + # to /etc/bacula/<config> instead of ./<config>
976 + pushd src >&/dev/null || die
977 + for f in console/console.c dird/dird.c filed/filed.c \
978 + stored/bcopy.c stored/bextract.c stored/bls.c \
979 + stored/bscan.c stored/btape.c stored/stored.c \
980 + qt-console/main.cpp; do
981 + sed -i -e 's|^\(#define CONFIG_FILE "\)|\1/etc/bacula/|g' "${f}" \
982 + || die "sed on ${f} failed"
983 + done
984 + popd >&/dev/null || die
985 +
986 + # bug 466688 drop deprecated categories from Desktop file
987 + sed -i -e 's/Application;//' scripts/bat.desktop.in || die
988 +
989 + # bug 466690 Use CXXFLAGS instead of CFLAGS
990 + sed -i -e 's/@CFLAGS@/@CXXFLAGS@/' autoconf/Make.common.in || die
991 +
992 + # drop automatic install of unneeded documentation (for bug 356499)
993 + eapply -p0 "${FILESDIR}"/7.2.0/${PN}-7.2.0-doc.patch
994 +
995 + # bug #310087
996 + eapply "${FILESDIR}"/5.2.3/${PN}-5.2.3-as-needed.patch
997 +
998 + # bug #311161
999 + eapply -p0 "${FILESDIR}"/9.0.2/${PN}-9.0.2-lib-search-path.patch
1000 +
1001 + # bat needs to respect LDFLAGS and CFLAGS
1002 + eapply -p0 "${FILESDIR}"/9.0.6/${PN}-9.0.6-bat-pro.patch
1003 +
1004 + # bug #328701
1005 + eapply -p0 "${FILESDIR}"/5.2.3/${PN}-5.2.3-openssl-1.patch
1006 +
1007 + eapply -p0 "${FILESDIR}"/9.0.8/${PN}-9.0.8-fix-static.patch
1008 +
1009 + # fix soname in libbaccat.so bug #602952
1010 + eapply -p0 "${FILESDIR}/bacula-fix-sonames.patch"
1011 +
1012 + # do not strip binaries
1013 + sed -i -e "s/strip /# strip /" src/filed/Makefile.in || die
1014 + sed -i -e "s/strip /# strip /" src/console/Makefile.in || die
1015 +
1016 + # fix file not found error during make depend
1017 + eapply -p0 "${FILESDIR}"/7.0.2/${PN}-7.0.2-depend.patch
1018 +
1019 + eapply_user
1020 +
1021 + # Fix systemd unit files:
1022 + # bug 497748
1023 + sed -i -e '/Requires/d' platforms/systemd/*.service.in || die
1024 + sed -i -e '/StandardOutput/d' platforms/systemd/*.service.in || die
1025 + # bug 504370
1026 + sed -i -e '/Alias=bacula-dir/d' platforms/systemd/bacula-dir.service.in || die
1027 + # bug 584442 and 504368
1028 + sed -i -e 's/@dir_user@/root/g' platforms/systemd/bacula-dir.service.in || die
1029 +
1030 + # build 'bat' for Qt5
1031 + export QMAKE="$(qt5_get_bindir)"/qmake
1032 +
1033 + # adapt to >=Qt-5.9 (see bug #644566)
1034 + # qmake needs an existing target file to generate install instructions
1035 + sed -i -e 's#bins.files = bat#bins.files = .libs/bat#g' \
1036 + src/qt-console/bat.pro.in || die
1037 + mkdir src/qt-console/.libs || die
1038 + touch src/qt-console/.libs/bat || die
1039 + chmod 755 src/qt-console/.libs/bat || die
1040 +
1041 + # fix wrong handling of libressl version
1042 + # needs separate handling for <libressl-2.7 and >=libressl2.7
1043 + # (see bug #655520)
1044 + if has_version "<dev-libs/libressl-2.7"; then
1045 + eapply -p0 "${FILESDIR}"/9.0.6/${PN}-9.0.6-libressl26.patch
1046 + else
1047 + eapply -p0 "${FILESDIR}"/9.0.6/${PN}-9.0.6-libressl27.patch
1048 + fi
1049 +
1050 + # fix bundled libtool (bug 466696)
1051 + # But first move directory with M4 macros out of the way.
1052 + # It is only needed by autoconf and gives errors during elibtoolize.
1053 + mv autoconf/libtool autoconf/libtool1 || die
1054 + elibtoolize
1055 +}
1056 +
1057 +src_configure() {
1058 + local myconf=''
1059 +
1060 + if use bacula-clientonly; then
1061 + myconf="${myconf} \
1062 + $(use_enable bacula-clientonly client-only) \
1063 + $(use_enable !static libtool) \
1064 + $(use_enable static static-cons) \
1065 + $(use_enable static static-fd)"
1066 + else
1067 + myconf="${myconf} \
1068 + $(use_enable !bacula-nodir build-dird) \
1069 + $(use_enable !bacula-nosd build-stored)"
1070 + # bug #311099
1071 + # database support needed by dir-only *and* sd-only
1072 + # build as well (for building bscan, btape, etc.)
1073 + myconf="${myconf}
1074 + --with-${mydbtype}"
1075 + if use mysql; then
1076 + myconf="${myconf} \
1077 + --disable-batch-insert"
1078 + else
1079 + myconf="${myconf} \
1080 + --enable-batch-insert"
1081 + fi
1082 + fi
1083 +
1084 + # do not build bat if 'static' clientonly
1085 + if ! use bacula-clientonly || ! use static; then
1086 + myconf="${myconf} \
1087 + $(use_enable qt5 bat)"
1088 + fi
1089 +
1090 + myconf="${myconf} \
1091 + $(use_with X x) \
1092 + $(use_enable !readline conio) \
1093 + $(use_enable readline) \
1094 + $(use_with readline readline /usr) \
1095 + $(use_with ssl openssl) \
1096 + $(use_enable ipv6) \
1097 + $(use_enable acl) \
1098 + $(use_with tcpd tcp-wrappers)"
1099 +
1100 + econf \
1101 + --libdir=/usr/$(get_libdir) \
1102 + --docdir=/usr/share/doc/${PF} \
1103 + --htmldir=/usr/share/doc/${PF}/html \
1104 + --with-pid-dir=/var/run \
1105 + --sysconfdir=/etc/bacula \
1106 + --with-subsys-dir=/var/lock/subsys \
1107 + --with-working-dir=/var/lib/bacula \
1108 + --with-logdir=/var/lib/bacula \
1109 + --with-scriptdir=/usr/libexec/bacula \
1110 + --with-systemd=$(systemd_get_systemunitdir) \
1111 + --with-dir-user=bacula \
1112 + --with-dir-group=bacula \
1113 + --with-sd-user=root \
1114 + --with-sd-group=bacula \
1115 + --with-fd-user=root \
1116 + --with-fd-group=bacula \
1117 + --enable-smartalloc \
1118 + --disable-afs \
1119 + --host=${CHOST} \
1120 + ${myconf}
1121 +}
1122 +
1123 +src_compile() {
1124 + # Make build log verbose (bug #447806)
1125 + emake NO_ECHO=""
1126 +}
1127 +
1128 +src_install() {
1129 + emake DESTDIR="${D}" install
1130 + doicon scripts/bacula.png
1131 +
1132 + # install bat icon and desktop file when enabled
1133 + # (for some reason ./configure doesn't pick this up)
1134 + if use qt5 && ! use static ; then
1135 + doicon src/qt-console/images/bat_icon.png
1136 + domenu scripts/bat.desktop
1137 + fi
1138 +
1139 + # remove some scripts we don't need at all
1140 + rm -f "${D}"/usr/libexec/bacula/{bacula,bacula-ctl-dir,bacula-ctl-fd,bacula-ctl-sd,startmysql,stopmysql}
1141 +
1142 + # rename statically linked apps
1143 + if use bacula-clientonly && use static ; then
1144 + pushd "${D}"/usr/sbin || die
1145 + mv static-bacula-fd bacula-fd || die
1146 + mv static-bconsole bconsole || die
1147 + popd || die
1148 + fi
1149 +
1150 + # extra files which 'make install' doesn't cover
1151 + if ! use bacula-clientonly; then
1152 + # the database update scripts
1153 + diropts -m0750
1154 + insinto /usr/libexec/bacula/updatedb
1155 + insopts -m0754
1156 + doins "${S}"/updatedb/*
1157 + fperms 0640 /usr/libexec/bacula/updatedb/README
1158 +
1159 + # the logrotate configuration
1160 + # (now unconditional wrt bug #258187)
1161 + diropts -m0755
1162 + insinto /etc/logrotate.d
1163 + insopts -m0644
1164 + newins "${S}"/scripts/logrotate bacula
1165 +
1166 + # the logwatch scripts
1167 + if use logwatch; then
1168 + diropts -m0750
1169 + dodir /usr/share/logwatch/scripts/services
1170 + dodir /usr/share/logwatch/scripts/shared
1171 + dodir /etc/logwatch/conf/logfiles
1172 + dodir /etc/logwatch/conf/services
1173 + pushd "${S}"/scripts/logwatch >&/dev/null || die
1174 + emake DESTDIR="${D}" install
1175 + popd >&/dev/null || die
1176 + fi
1177 + fi
1178 +
1179 + if ! use qt5; then
1180 + rm -vf "${D}"/usr/share/man/man1/bat.1*
1181 + fi
1182 + rm -vf "${D}"/usr/share/man/man1/bacula-tray-monitor.1*
1183 + if use bacula-clientonly || use bacula-nodir; then
1184 + rm -vf "${D}"/usr/share/man/man8/bacula-dir.8*
1185 + rm -vf "${D}"/usr/share/man/man8/dbcheck.8*
1186 + rm -vf "${D}"/usr/share/man/man1/bsmtp.1*
1187 + rm -vf "${D}"/usr/libexec/bacula/create_*_database
1188 + rm -vf "${D}"/usr/libexec/bacula/drop_*_database
1189 + rm -vf "${D}"/usr/libexec/bacula/make_*_tables
1190 + rm -vf "${D}"/usr/libexec/bacula/update_*_tables
1191 + rm -vf "${D}"/usr/libexec/bacula/drop_*_tables
1192 + rm -vf "${D}"/usr/libexec/bacula/grant_*_privileges
1193 + rm -vf "${D}"/usr/libexec/bacula/*_catalog_backup
1194 + fi
1195 + if use bacula-clientonly || use bacula-nosd; then
1196 + rm -vf "${D}"/usr/share/man/man8/bacula-sd.8*
1197 + rm -vf "${D}"/usr/share/man/man8/bcopy.8*
1198 + rm -vf "${D}"/usr/share/man/man8/bextract.8*
1199 + rm -vf "${D}"/usr/share/man/man8/bls.8*
1200 + rm -vf "${D}"/usr/share/man/man8/bscan.8*
1201 + rm -vf "${D}"/usr/share/man/man8/btape.8*
1202 + rm -vf "${D}"/usr/libexec/bacula/disk-changer
1203 + rm -vf "${D}"/usr/libexec/bacula/mtx-changer
1204 + rm -vf "${D}"/usr/libexec/bacula/dvd-handler
1205 + fi
1206 +
1207 + # documentation
1208 + dodoc ChangeLog ReleaseNotes SUPPORT
1209 +
1210 + # install examples (bug #457504)
1211 + if use examples; then
1212 + docinto examples/
1213 + dodoc -r examples/*
1214 + fi
1215 +
1216 + # vim-files
1217 + if use vim-syntax; then
1218 + insinto /usr/share/vim/vimfiles/syntax
1219 + doins scripts/bacula.vim
1220 + insinto /usr/share/vim/vimfiles/ftdetect
1221 + newins scripts/filetype.vim bacula_ft.vim
1222 + fi
1223 +
1224 + # setup init scripts
1225 + myscripts="bacula-fd"
1226 + if ! use bacula-clientonly; then
1227 + if ! use bacula-nodir; then
1228 + myscripts="${myscripts} bacula-dir"
1229 + fi
1230 + if ! use bacula-nosd; then
1231 + myscripts="${myscripts} bacula-sd"
1232 + fi
1233 + fi
1234 + for script in ${myscripts}; do
1235 + # copy over init script and config to a temporary location
1236 + # so we can modify them as needed
1237 + cp "${FILESDIR}/${script}".confd "${T}/${script}".confd || die "failed to copy ${script}.confd"
1238 + cp "${FILESDIR}/newscripts/${script}".initd "${T}/${script}".initd || die "failed to copy ${script}.initd"
1239 +
1240 + # now set the database dependancy for the director init script
1241 + case "${script}" in
1242 + bacula-dir)
1243 + case "${mydbtype}" in
1244 + sqlite3)
1245 + # sqlite databases don't have a daemon
1246 + sed -i -e 's/need "%database%"/:/g' "${T}/${script}".initd || die
1247 + ;;
1248 + *)
1249 + # all other databases have daemons
1250 + sed -i -e "s:%database%:${mydbtype}:" "${T}/${script}".initd || die
1251 + ;;
1252 + esac
1253 + ;;
1254 + *)
1255 + ;;
1256 + esac
1257 +
1258 + # install init script and config
1259 + newinitd "${T}/${script}".initd "${script}"
1260 + newconfd "${T}/${script}".confd "${script}"
1261 + done
1262 +
1263 + systemd_dounit "${S}"/platforms/systemd/bacula-{dir,fd,sd}.service
1264 +
1265 + # make sure the working directory exists
1266 + diropts -m0750
1267 + keepdir /var/lib/bacula
1268 +
1269 + # make sure bacula group can execute bacula libexec scripts
1270 + fowners -R root:bacula /usr/libexec/bacula
1271 +}
1272 +
1273 +pkg_postinst() {
1274 + if use bacula-clientonly; then
1275 + fowners root:bacula /var/lib/bacula
1276 + else
1277 + fowners bacula:bacula /var/lib/bacula
1278 + fi
1279 +
1280 + if ! use bacula-clientonly && ! use bacula-nodir; then
1281 + einfo
1282 + einfo "If this is a new install, you must create the ${mydbtype} databases with:"
1283 + einfo " /usr/libexec/bacula/create_${mydbtype}_database"
1284 + einfo " /usr/libexec/bacula/make_${mydbtype}_tables"
1285 + einfo " /usr/libexec/bacula/grant_${mydbtype}_privileges"
1286 + einfo
1287 +
1288 + ewarn "ATTENTION!"
1289 + ewarn "The format of the database may have changed."
1290 + ewarn "If you just upgraded from a version below 9.0.0 you must run"
1291 + ewarn "'update_bacula_tables' now."
1292 + ewarn "Make sure to have a backup of your catalog before."
1293 + ewarn
1294 + fi
1295 +
1296 + if use sqlite; then
1297 + einfo
1298 + einfo "Be aware that Bacula does not officially support SQLite database anymore."
1299 + einfo "Best use it only for a client-only installation. See Bug #445540."
1300 + einfo
1301 + fi
1302 +
1303 + einfo "Please note that 'bconsole' will always be installed. To compile 'bat'"
1304 + einfo "you have to enable 'USE=qt5'."
1305 + einfo
1306 +}