Gentoo Archives: gentoo-commits

From: Marc Schiffbauer <mschiff@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-backup/bareos/
Date: Thu, 14 May 2020 04:06:11
Message-Id: 1589429137.dcfbfd53f84986c335f6e03270fb013aaed0d129.mschiff@gentoo
1 commit: dcfbfd53f84986c335f6e03270fb013aaed0d129
2 Author: Marc Schiffbauer <mschiff <AT> gentoo <DOT> org>
3 AuthorDate: Thu May 14 03:55:30 2020 +0000
4 Commit: Marc Schiffbauer <mschiff <AT> gentoo <DOT> org>
5 CommitDate: Thu May 14 04:05:37 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dcfbfd53
7
8 app-backup/bareos: bump versions 17.2 and 18.2
9
10 Package-Manager: Portage-2.3.89, Repoman-2.3.20
11 Signed-off-by: Marc Schiffbauer <mschiff <AT> gentoo.org>
12
13 app-backup/bareos/Manifest | 2 +
14 app-backup/bareos/bareos-17.2.9.ebuild | 366 ++++++++++++++++++++++++++++++
15 app-backup/bareos/bareos-18.2.8.ebuild | 397 +++++++++++++++++++++++++++++++++
16 3 files changed, 765 insertions(+)
17
18 diff --git a/app-backup/bareos/Manifest b/app-backup/bareos/Manifest
19 index d8fbb1e4950..3a1954fb9cd 100644
20 --- a/app-backup/bareos/Manifest
21 +++ b/app-backup/bareos/Manifest
22 @@ -1,4 +1,6 @@
23 DIST bareos-17.2.6.tar.gz 4181984 BLAKE2B a1666b38626228ebf00f6a42f1a5b74c78c26a7178fa5333c9c8fb24ccfda146d20c35d35cbe43b6f53ba1b0ce1dd9b8ad30309997689c39493b51a0db9f5c9b SHA512 5f5ac8cfe028c97fa3120e149f1eb029406b74530517bf6e21574bd726e26c6b78740977635b45cbc2232fda0ee28f1b4338d91a8fa0a86ba05209cce82cd0b2
24 DIST bareos-17.2.7.tar.gz 4184028 BLAKE2B dc817ca3b21ea13d9dbd1e3c5691e09bc3adff535e0032e1fbcfff8d07b96b2bf21976f020d778dd16137e51283c2a3dcab78dbe28f7fb6f3a60d43938f6b770 SHA512 254eddacb067ef7e82b7a54bdfcbffd5cfa033fa045f697c7e5b5c28dd064b5e1ce9f6aa946282c60f59972beae0b1b7901882b77c3f71cf16efdd73934135cc
25 +DIST bareos-17.2.9.tar.gz 4190637 BLAKE2B 266627ac023695971acc5d730765c08ddde673ba75398547687d5f2ccbfb7c440221b8c0a617bc6a3b0d2089cd22604ebe838decc65ce3c1f7ae5cdb99833118 SHA512 ac40f867d495aa64693a209dbfceb55f22425a2079dc000dabd8c6ffce79b1a2578bc0110970a6aace7c3e039c7110d1d395c31b372c0d3e5f18b43e682a70a9
26 DIST bareos-18.2.6.tar.gz 9991951 BLAKE2B 9fdaf852e748f0c01d06e2fd72351e7b9bf18e8fea92307fb85437441b4ce504f9c6ddbd42cd2185b6dc08158502a7db581bef662c2bd84c86c885d6b89eebba SHA512 b6618173a803db4cfc3fe7edfe8c9e4e4128195f44383cd7df5b9866da4290686ed7cb42499edec957a5d9ab8bbd92d26258ce58f13fba84fb569167956768c3
27 +DIST bareos-18.2.8.tar.gz 10552800 BLAKE2B c13aabbb7f450c1c9c02f39b130d34057cfc4cec590c68acde5d3592d0f238c0e52bf3acbb55e697610252b3f6bd528c2e87ea09c83aba02f303d144a62b44b2 SHA512 61c9155a02ec0f3a21e06db4f5701dabb25411219d98940b50912c16ac38ec007584a7ef9728f2f12acf2823339a25eba3c9b34a6fa9e625a1d2d0778653b860
28 DIST bareos-19.2.7.tar.gz 12602338 BLAKE2B 31fa9c9966b22913c2af6eaa6c6f704396d353341878817a574388925f35b437331b057b2a147a8217502f9198b39539d2fa68c4047e191dc918123c0f674a7d SHA512 cb467846a41d42a469704d48c3a1b03ebf5fdc71b9268c1e438e46b86073d55993dfd9bf26242db593db8b1814009c060fd65122d434bad2986c24613f6865c6
29
30 diff --git a/app-backup/bareos/bareos-17.2.9.ebuild b/app-backup/bareos/bareos-17.2.9.ebuild
31 new file mode 100644
32 index 00000000000..aa5473acd45
33 --- /dev/null
34 +++ b/app-backup/bareos/bareos-17.2.9.ebuild
35 @@ -0,0 +1,366 @@
36 +# Copyright 1999-2020 Gentoo Authors
37 +# Distributed under the terms of the GNU General Public License v2
38 +
39 +EAPI="7"
40 +
41 +PYTHON_COMPAT=( python2_7 )
42 +PYTHON_REQ_USE="threads"
43 +
44 +inherit python-single-r1 systemd
45 +
46 +DESCRIPTION="Featureful client/server network backup suite"
47 +HOMEPAGE="http://www.bareos.org/"
48 +SRC_URI="https://github.com/${PN}/${PN}/archive/Release/${PV}.tar.gz -> ${P}.tar.gz"
49 +RESTRICT="mirror"
50 +
51 +LICENSE="AGPL-3"
52 +SLOT="0"
53 +KEYWORDS="~amd64 ~x86"
54 +IUSE="X acl cephfs clientonly +director fastlz glusterfs gnutls ipv6 jansson lmdb libressl
55 + logwatch mysql ndmp +postgres python rados rados-striper readline scsi-crypto
56 + sql-pooling sqlite ssl static +storage-daemon tcpd vim-syntax"
57 +REQUIRED_USE="!clientonly? ( || ( mysql postgres sqlite ) )"
58 +
59 +DEPEND="
60 + !app-backup/bacula
61 + acct-group/${PN}
62 + cephfs? ( sys-cluster/ceph )
63 + rados? ( sys-cluster/ceph )
64 + rados-striper? ( >=sys-cluster/ceph-0.94.2 )
65 + glusterfs? ( sys-cluster/glusterfs )
66 + lmdb? ( dev-db/lmdb )
67 + dev-libs/gmp:0
68 + !clientonly? (
69 + acct-user/${PN}
70 + postgres? ( dev-db/postgresql:*[threads] )
71 + mysql? ( dev-db/mysql-connector-c:0= )
72 + sqlite? ( dev-db/sqlite:3 )
73 + director? (
74 + virtual/mta
75 + jansson? ( dev-libs/jansson )
76 + )
77 + )
78 + fastlz? ( dev-libs/bareos-fastlzlib )
79 + logwatch? ( sys-apps/logwatch )
80 + tcpd? ( sys-apps/tcp-wrappers )
81 + readline? ( sys-libs/readline:0 )
82 + static? (
83 + acl? ( virtual/acl[static-libs] )
84 + sys-libs/zlib[static-libs]
85 + dev-libs/lzo[static-libs]
86 + sys-libs/ncurses:=[static-libs]
87 + ssl? (
88 + !gnutls? (
89 + !libressl? ( dev-libs/openssl:0=[static-libs] )
90 + libressl? ( dev-libs/libressl:0=[static-libs] )
91 + )
92 + gnutls? ( net-libs/gnutls[static-libs] )
93 + )
94 + )
95 + !static? (
96 + acl? ( virtual/acl )
97 + dev-libs/lzo
98 + ssl? (
99 + !gnutls? (
100 + !libressl? ( dev-libs/openssl:0= )
101 + libressl? ( dev-libs/libressl:0= )
102 + )
103 + gnutls? ( net-libs/gnutls )
104 + )
105 + sys-libs/ncurses:=
106 + sys-libs/zlib
107 + )
108 + python? ( ${PYTHON_DEPS} )
109 + "
110 +RDEPEND="${DEPEND}
111 + !clientonly? (
112 + storage-daemon? (
113 + sys-block/mtx
114 + app-arch/mt-st
115 + )
116 + )
117 + vim-syntax? ( || ( app-editors/vim app-editors/gvim ) )"
118 +
119 +REQUIRED_USE="static? ( clientonly )
120 + python? ( ${PYTHON_REQUIRED_USE} )"
121 +
122 +S=${WORKDIR}/${PN}-Release-${PV}
123 +
124 +pkg_setup() {
125 + use mysql && export mydbtypes+="mysql"
126 + use postgres && export mydbtypes+=" postgresql"
127 + use sqlite && export mydbtypes+=" sqlite"
128 + use python && python-single-r1_pkg_setup
129 +}
130 +
131 +src_prepare() {
132 + # adjusts default configuration files for several binaries
133 + # to /etc/bareos/<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; do
138 + sed -i -e 's|^\(#define CONFIG_FILE "\)|\1/etc/bareos/|g' "${f}" \
139 + || die "sed on ${f} failed"
140 + done
141 + popd >&/dev/null || die
142 +
143 + # enables default database driver in catalog
144 + pushd src/defaultconfigs/bareos-dir.d/catalog >&/dev/null || die
145 + sed -i -e 's/#dbdriver/dbdriver/' -e '/XXX_REPLACE/d' MyCatalog.conf.in \
146 + || die "sed on MyCatalog.conf.in failed"
147 + popd >&/dev/null || die
148 +
149 + # bug 466690 Use CXXFLAGS instead of CFLAGS
150 + sed -i -e 's/@CFLAGS@/@CXXFLAGS@/' autoconf/Make.common.in || die
151 +
152 + # do not strip binaries
153 + for d in filed console dird stored; do
154 + sed -i -e "s/strip /# strip /" src/$d/Makefile.in || die
155 + done
156 +
157 + eapply_user
158 +}
159 +
160 +src_configure() {
161 + local myconf=''
162 +
163 + addpredict /var/lib/logrotate.status
164 +
165 + if use clientonly; then
166 + myconf="${myconf} \
167 + $(use_enable clientonly client-only) \
168 + $(use_enable !static libtool) \
169 + $(use_enable static static-cons) \
170 + $(use_enable static static-fd)"
171 + fi
172 +
173 + myconf="${myconf} \
174 + $(use_with X x) \
175 + $(use_enable acl) \
176 + $(use_enable ipv6) \
177 + $(use_enable ndmp) \
178 + $(use_enable readline) \
179 + $(use_enable !readline conio) \
180 + $(use_enable scsi-crypto) \
181 + $(use_enable sql-pooling) \
182 + $(use_with fastlz) \
183 + $(use_with mysql) \
184 + $(use_with postgres postgresql) \
185 + $(use_with python) \
186 + $(use_with readline) \
187 + $(use_with sqlite sqlite3) \
188 + $(use sqlite || echo "--without-sqlite3") \
189 + $(use_with ssl openssl) \
190 + $(use_with tcpd tcp-wrappers) \
191 + $(use_enable lmdb) \
192 + $(use_with glusterfs) \
193 + $(use_with rados) \
194 + $(use_with rados-striper) \
195 + $(use_with cephfs) \
196 + $(use_with jansson) \
197 + "
198 +
199 + econf \
200 + --with-pid-dir=/run/bareos \
201 + --with-subsys-dir=/run/lock/subsys \
202 + --with-working-dir=/var/lib/bareos \
203 + --with-logdir=/var/log/bareos \
204 + --with-scriptdir=/usr/libexec/bareos \
205 + --with-plugindir=/usr/$(get_libdir)/${PN}/plugin \
206 + --with-backenddir=/usr/$(get_libdir)/${PN}/backend \
207 + --with-dir-user=bareos \
208 + --with-dir-group=bareos \
209 + --with-sd-user=root \
210 + --with-sd-group=bareos \
211 + --with-fd-user=root \
212 + --with-fd-group=bareos \
213 + --with-sbin-perm=0755 \
214 + --with-systemd \
215 + --with-db-password=`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1` \
216 + --enable-dynamic-cats-backends \
217 + --enable-dynamic-storage-backends \
218 + --enable-batch-insert \
219 + --disable-afs \
220 + --host=${CHOST} \
221 + ${myconf}
222 +}
223 +
224 +src_compile() {
225 + # Make build log verbose (bug #447806)
226 + emake NO_ECHO=""
227 +}
228 +
229 +src_install() {
230 + emake DESTDIR="${D}" install
231 + newicon src/images/bareos_logo_shadow.png bareos.png
232 +
233 + # remove some scripts we don't need at all
234 + rm -f "${D}"/usr/libexec/bareos/{bareos,bareos-ctl-dir,bareos-ctl-fd,bareos-ctl-sd,startmysql,stopmysql}
235 + rm -f "${D}"/usr/sbin/bareos
236 +
237 + # remove upstream init scripts
238 + rm -f "${D}"/etc/init.d/bareos-*
239 +
240 + # rename statically linked apps
241 + if use clientonly && use static ; then
242 + pushd "${D}"/usr/sbin || die
243 + mv static-bareos-fd bareos-fd || die
244 + mv static-bconsole bconsole || die
245 + popd || die
246 + fi
247 +
248 + # extra files which 'make install' doesn't cover
249 + if ! use clientonly; then
250 + # the logrotate configuration
251 + # (now unconditional wrt bug #258187)
252 + diropts -m0755
253 + insinto /etc/logrotate.d
254 + insopts -m0644
255 + newins "${S}"/scripts/logrotate bareos
256 +
257 + # the logwatch scripts
258 + if use logwatch; then
259 + diropts -m0750
260 + dodir /etc/log.d/scripts/services
261 + dodir /etc/log.d/scripts/shared
262 + dodir /etc/log.d/conf/logfiles
263 + dodir /etc/log.d/conf/services
264 + pushd "${S}"/scripts/logwatch >&/dev/null || die
265 + emake DESTDIR="${D}" install
266 + popd >&/dev/null || die
267 + fi
268 + fi
269 +
270 + rm -vf "${D}"/usr/share/man/man1/bareos-bwxconsole.1*
271 + if use clientonly || ! use director; then
272 + rm -vf "${D}"/usr/share/man/man8/bareos-dir.8*
273 + rm -vf "${D}"/usr/share/man/man8/bareos-dbcheck.8*
274 + rm -vf "${D}"/usr/share/man/man1/bsmtp.1*
275 + rm -vf "${D}"/usr/share/man/man8/bwild.8*
276 + rm -vf "${D}"/usr/share/man/man8/bregex.8*
277 + rm -vf "${D}"/usr/share/man/man8/bpluginfo.8*
278 + rm -vf "${D}"/usr/libexec/bareos/create_*_database
279 + rm -vf "${D}"/usr/libexec/bareos/drop_*_database
280 + rm -vf "${D}"/usr/libexec/bareos/make_*_tables
281 + rm -vf "${D}"/usr/libexec/bareos/update_*_tables
282 + rm -vf "${D}"/usr/libexec/bareos/drop_*_tables
283 + rm -vf "${D}"/usr/libexec/bareos/grant_*_privileges
284 + rm -vf "${D}"/usr/libexec/bareos/*_catalog_backup
285 + fi
286 + if use clientonly || ! use storage-daemon; then
287 + rm -vf "${D}"/usr/share/man/man8/bareos-sd.8*
288 + rm -vf "${D}"/usr/share/man/man8/bcopy.8*
289 + rm -vf "${D}"/usr/share/man/man8/bextract.8*
290 + rm -vf "${D}"/usr/share/man/man8/bls.8*
291 + rm -vf "${D}"/usr/share/man/man8/bscan.8*
292 + rm -vf "${D}"/usr/share/man/man8/btape.8*
293 + rm -vf "${D}"/usr/libexec/bareos/disk-changer
294 + rm -vf "${D}"/usr/libexec/bareos/mtx-changer
295 + rm -vf "${D}"/usr/libexec/bareos/dvd-handler
296 + rm -vf "${D}"/etc/bareos/mtx-changer.conf
297 + fi
298 + if ! use scsi-crypto; then
299 + rm -vf "${D}"/usr/share/man/man8/bscrypto.8*
300 + fi
301 +
302 + # documentation
303 + dodoc README.md
304 + use ndmp && dodoc README.NDMP
305 + use scsi-crypto && dodoc README.scsicrypto
306 +
307 + # vim-files
308 + if use vim-syntax; then
309 + insinto /usr/share/vim/vimfiles/syntax
310 + doins scripts/bareos.vim
311 + insinto /usr/share/vim/vimfiles/ftdetect
312 + newins scripts/filetype.vim bareos_ft.vim
313 + fi
314 +
315 + # setup init scripts
316 + myscripts="bareos-fd"
317 + if ! use clientonly; then
318 + if use director; then
319 + myscripts="${myscripts} bareos-dir"
320 + fi
321 + if use storage-daemon; then
322 + myscripts="${myscripts} bareos-sd"
323 + fi
324 + fi
325 + for script in ${myscripts}; do
326 + # copy over init script and config to a temporary location
327 + # so we can modify them as needed
328 + cp "${FILESDIR}/${script}".confd-16 "${T}/${script}".confd || die "failed to copy ${script}.confd"
329 + cp "${FILESDIR}/${script}".initd "${T}/${script}".initd || die "failed to copy ${script}.initd"
330 +
331 + # now set the database dependency for the director init script
332 + case "${script}" in
333 + bareos-dir)
334 + sed -i -e "s:%databasetypes%:${mydbtypes}:" "${T}/${script}".confd || die
335 + ;;
336 + *)
337 + ;;
338 + esac
339 +
340 + # install init script and config
341 + newinitd "${T}/${script}".initd "${script}"
342 + newconfd "${T}/${script}".confd "${script}"
343 + done
344 +
345 + # install systemd unit files
346 + use director && systemd_dounit "${FILESDIR}"/bareos-dir.service
347 + use storage-daemon && systemd_dounit "${FILESDIR}"/bareos-sd.service
348 + systemd_dounit "${FILESDIR}"/bareos-fd.service
349 +
350 + # make sure the working directory exists
351 + diropts -m0750
352 + keepdir /var/lib/bareos
353 +
354 + # make sure bareos group can execute bareos libexec scripts
355 + fowners -R root:bareos /usr/libexec/bareos
356 +}
357 +
358 +pkg_postinst() {
359 + if use clientonly; then
360 + fowners root:bareos /var/lib/bareos
361 + else
362 + fowners bareos:bareos /var/lib/bareos
363 + fi
364 +
365 + if ! use clientonly && use director; then
366 + einfo
367 + einfo "If this is a new install, you must create the database:"
368 + if use postgres; then
369 + einfo
370 + einfo "For postgresql:"
371 + einfo " su postgres -c '/usr/libexec/bareos/create_bareos_database postgresql'"
372 + einfo " su postgres -c '/usr/libexec/bareos/make_bareos_tables postgresql'"
373 + einfo " su postgres -c '/usr/libexec/bareos/grant_bareos_privileges postgresql'"
374 + fi
375 + if use mysql; then
376 + einfo
377 + einfo "For mysql:"
378 + einfo
379 + einfo " Make sure root has direct access to your mysql server. You may want to"
380 + einfo " create a /root/.my.cnf file with"
381 + einfo " [client]"
382 + einfo " user=root"
383 + einfo " password=YourPasswordForAccessingMysqlAsRoot"
384 + einfo " before running:"
385 + einfo " /usr/libexec/bareos/create_bareos_database mysql"
386 + einfo " /usr/libexec/bareos/make_bareos_tables mysql"
387 + einfo " /usr/libexec/bareos/grant_bareos_privileges mysql"
388 + fi
389 + einfo
390 + fi
391 +
392 + if use sqlite; then
393 + einfo
394 + einfo "Be aware that Bareos does not officially support SQLite database."
395 + einfo "Best use it only for a client-only installation. See Bug #445540."
396 + einfo
397 + einfo "It is strongly recommended to use either postgresql or mysql as"
398 + einfo "catalog database backend."
399 + einfo
400 + fi
401 +}
402
403 diff --git a/app-backup/bareos/bareos-18.2.8.ebuild b/app-backup/bareos/bareos-18.2.8.ebuild
404 new file mode 100644
405 index 00000000000..4bf0b6c7c3b
406 --- /dev/null
407 +++ b/app-backup/bareos/bareos-18.2.8.ebuild
408 @@ -0,0 +1,397 @@
409 +# Copyright 1999-2020 Gentoo Authors
410 +# Distributed under the terms of the GNU General Public License v2
411 +
412 +EAPI="7"
413 +
414 +PYTHON_COMPAT=( python2_7 )
415 +PYTHON_REQ_USE="threads"
416 +CMAKE_WARN_UNUSED_CLI=no
417 +#CMAKE_REMOVE_MODULES=yes
418 +
419 +inherit python-single-r1 systemd cmake-utils
420 +
421 +DESCRIPTION="Featureful client/server network backup suite"
422 +HOMEPAGE="http://www.bareos.org/"
423 +SRC_URI="https://github.com/${PN}/${PN}/archive/Release/${PV}.tar.gz -> ${P}.tar.gz"
424 +RESTRICT="mirror"
425 +
426 +LICENSE="AGPL-3"
427 +SLOT="0"
428 +KEYWORDS="~amd64 ~x86"
429 +IUSE="X acl cephfs clientonly +director fastlz glusterfs gnutls ipv6 jansson lmdb libressl
430 + logwatch mysql ndmp +postgres python rados rados-striper readline scsi-crypto
431 + sql-pooling sqlite ssl static +storage-daemon systemd tcpd vim-syntax"
432 +REQUIRED_USE="!clientonly? ( || ( mysql postgres sqlite ) )"
433 +
434 +DEPEND="
435 + !app-backup/bacula
436 + acct-group/${PN}
437 + cephfs? ( sys-cluster/ceph )
438 + rados? ( sys-cluster/ceph )
439 + rados-striper? ( >=sys-cluster/ceph-0.94.2 )
440 + glusterfs? ( sys-cluster/glusterfs )
441 + lmdb? ( dev-db/lmdb )
442 + dev-libs/gmp:0
443 + !clientonly? (
444 + acct-user/${PN}
445 + postgres? ( dev-db/postgresql:*[threads] )
446 + mysql? ( virtual/mysql )
447 + sqlite? ( dev-db/sqlite:3 )
448 + director? (
449 + virtual/mta
450 + jansson? ( dev-libs/jansson )
451 + )
452 + )
453 + fastlz? ( dev-libs/bareos-fastlzlib )
454 + logwatch? ( sys-apps/logwatch )
455 + tcpd? ( sys-apps/tcp-wrappers )
456 + readline? ( sys-libs/readline:0 )
457 + static? (
458 + acl? ( virtual/acl[static-libs] )
459 + sys-libs/zlib[static-libs]
460 + dev-libs/lzo[static-libs]
461 + sys-libs/ncurses:=[static-libs]
462 + ssl? (
463 + !gnutls? (
464 + !libressl? ( dev-libs/openssl:0=[static-libs] )
465 + libressl? ( dev-libs/libressl:0=[static-libs] )
466 + )
467 + gnutls? ( net-libs/gnutls[static-libs] )
468 + )
469 + )
470 + !static? (
471 + acl? ( virtual/acl )
472 + dev-libs/lzo
473 + ssl? (
474 + !gnutls? (
475 + !libressl? ( dev-libs/openssl:0= )
476 + libressl? ( dev-libs/libressl:0= )
477 + )
478 + gnutls? ( net-libs/gnutls )
479 + )
480 + sys-libs/ncurses:=
481 + sys-libs/zlib
482 + )
483 + python? ( ${PYTHON_DEPS} )
484 + "
485 +RDEPEND="${DEPEND}
486 + !clientonly? (
487 + storage-daemon? (
488 + sys-block/mtx
489 + app-arch/mt-st
490 + )
491 + )
492 + vim-syntax? ( || ( app-editors/vim app-editors/gvim ) )"
493 +
494 +REQUIRED_USE="static? ( clientonly )
495 + python? ( ${PYTHON_REQUIRED_USE} )"
496 +
497 +S=${WORKDIR}/${PN}-Release-${PV}
498 +
499 +pkg_setup() {
500 + use python && python-single-r1_pkg_setup
501 +}
502 +
503 +src_prepare() {
504 + use mysql && export mydbtypes+=( mysql )
505 + use postgres && export mydbtypes+=( postgresql )
506 + use sqlite && export mydbtypes+=( sqlite )
507 +
508 + # enables default database driver in catalog
509 + pushd core/src/defaultconfigs >&/dev/null || die
510 + sed -i -e 's/#dbdriver/dbdriver/' -e '/XXX_REPLACE_WITH_DATABASE_DRIVER_XXX/d' $(grep -rl XXX_REPLACE_WITH_DATABASE_DRIVER_XXX) \
511 + || die "sed on MyCatalog.conf.in failed"
512 + popd >&/dev/null || die
513 +
514 + eapply -p0 "${FILESDIR}/bareos-cmake-rados.patch"
515 +
516 + # fix gentoo version detection
517 + eapply -p0 "${FILESDIR}/bareos-cmake-gentoo.patch"
518 +
519 + # fix missing DESTDIR in symlink creation
520 + eapply -p2 "${FILESDIR}/bareos-cmake-symlink-default-db-backend.patch"
521 +
522 + eapply_user
523 +
524 + CMAKE_USE_DIR="$S/core"
525 + cmake-utils_src_prepare
526 +}
527 +
528 +src_configure() {
529 + local mycmakeargs=()
530 +
531 + CMAKE_USE_DIR="$S/core"
532 +
533 + pushd core/platforms >&/dev/null || die
534 + cmake_comment_add_subdirectory '${DISTNAME}'
535 + popd >&/dev/null || die
536 +
537 + if use clientonly; then
538 + mycmakeargs+=(
539 + -Dclient-only=YES
540 + -Dstatic-cons=$(usex static)
541 + -Dstatic-fd=$(usex static)
542 + )
543 + fi
544 +
545 + for useflag in acl ipv6 ndmp readline scsi-crypto sql-pooling \
546 + systemd fastlz mysql python lmdb glusterfs rados \
547 + rados-striper cephfs jansson; do
548 +
549 + mycmakeargs+=( -D$useflag=$(usex $useflag) )
550 + done
551 +
552 + mycmakeargs+=(
553 + -DDEFAULT_DB_TYPE=${mydbtypes[0]}
554 + -Dx=$(usex X)
555 + -Dpostgresql=$(usex postgres)
556 + -Dmysql=$(usex mysql)
557 + -Dsqlite3=$(usex sqlite)
558 + -Dopenssl=$(usex ssl)
559 + -Dtcp-wrapper=$(usex tcpd)
560 + -Dlibdir=/usr/$(get_libdir)
561 + -Dsbindir=/usr/sbin
562 + -Dmandir=/usr/share/man
563 + -Ddocdir=/usr/share/doc/${PF}
564 + -Dhtmldir=/usr/share/doc/${PF}/html
565 + -Darchivedir=/var/lib/bareos/storage
566 + -Dbsrdir=/var/lib/bareos/bsr
567 + -Dpiddir=/run/bareos
568 + -Dsysconfdir=/etc
569 + -Dconfdir=/etc/bareos
570 + -Dsubsys-dir=/run/lock/subsys
571 + -Dworkingdir=/var/lib/bareos
572 + -Dlogdir=/var/log/bareos
573 + -Dscriptdir=/usr/libexec/bareos
574 + -Dplugindir=/usr/$(get_libdir)/${PN}/plugin
575 + -Dbackenddir=/usr/$(get_libdir)/${PN}/backend
576 + -Ddir-user=bareos
577 + -Ddir-group=bareos
578 + -Dsd-user=root
579 + -Dsd-group=bareos
580 + -Dfd-user=root
581 + -Dfd-group=bareos
582 + -Dsbin-perm=0755
583 + -Ddb_password=`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1`
584 + -Ddynamic-cats-backends=yes
585 + -Ddynamic-storage-backends=yes
586 + -Dbatch-insert=yes
587 + -Dhost=${CHOST}
588 + -Dcoverage=yes
589 + -Dpython=yes
590 + -Dsmartalloc=yes
591 + -Ddir-password="`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1`"
592 + -Dfd-password="`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1`"
593 + -Dsd-password="`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1`"
594 + -Dmon-dir-password="`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1`"
595 + -Dmon-fd-password="`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1`"
596 + -Dmon-sd-password="`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1`"
597 + -Dbasename="`hostname -s`"
598 + -Dhostname="`hostname -s`"
599 + )
600 +
601 + cmake-utils_src_configure
602 +}
603 +
604 +src_install() {
605 + #emake DESTDIR="${D}" install
606 + cmake-utils_src_install
607 + newicon core/src/images/bareos_logo_shadow.png bareos.png
608 +
609 + # remove some scripts we don't need at all
610 + rm -f "${D}"/usr/libexec/bareos/{bareos,bareos-ctl-dir,bareos-ctl-fd,bareos-ctl-sd,startmysql,stopmysql}
611 + rm -f "${D}"/usr/sbin/bareos
612 +
613 + # remove upstream init scripts
614 + rm -f "${D}"/etc/init.d/bareos-*
615 +
616 + # rename statically linked apps
617 + if use clientonly && use static ; then
618 + pushd "${D}"/usr/sbin || die
619 + mv static-bareos-fd bareos-fd || die
620 + mv static-bconsole bconsole || die
621 + popd || die
622 + fi
623 +
624 + # extra files which 'make install' doesn't cover
625 + if ! use clientonly; then
626 + # the logrotate configuration
627 + # (now unconditional wrt bug #258187)
628 + diropts -m0755
629 + insinto /etc/logrotate.d
630 + insopts -m0644
631 + newins "${S}"/core/scripts/logrotate bareos
632 +
633 + # the logwatch scripts
634 + if use logwatch; then
635 + diropts -m0750
636 + dodir /etc/log.d/scripts/services
637 + dodir /etc/log.d/scripts/shared
638 + dodir /etc/log.d/conf/logfiles
639 + dodir /etc/log.d/conf/services
640 + pushd "${S}"/core/scripts/logwatch >&/dev/null || die
641 +
642 + into /etc/log.d/scripts/services
643 + dobin bareos
644 +
645 + into /etc/log.d/scripts/shared
646 + dobin applybareosdate
647 +
648 + insinto /etc/log.d/conf/logfiles
649 + newins logfile.bareos.conf bareos.conf
650 +
651 + insinto /etc/log.d/conf/services
652 + newins services.bareos.conf bareos.conf
653 +
654 + popd >&/dev/null || die
655 + fi
656 + fi
657 +
658 + rm -vf "${D}"/usr/share/man/man1/bareos-bwxconsole.1*
659 + if use clientonly || ! use director; then
660 + if use systemd; then
661 + rm -vf "${D}"/lib/systemd/system/bareos-dir.service
662 + fi
663 + rm -vf "${D}"/usr/share/man/man8/bareos-dir.8*
664 + rm -vf "${D}"/usr/share/man/man8/bareos-dbcheck.8*
665 + rm -vf "${D}"/usr/share/man/man1/bsmtp.1*
666 + rm -vf "${D}"/usr/share/man/man8/bwild.8*
667 + rm -vf "${D}"/usr/share/man/man8/bregex.8*
668 + rm -vf "${D}"/usr/share/man/man8/bpluginfo.8*
669 + rm -vf "${D}"/usr/libexec/bareos/create_*_database
670 + rm -vf "${D}"/usr/libexec/bareos/drop_*_database
671 + rm -vf "${D}"/usr/libexec/bareos/make_*_tables
672 + rm -vf "${D}"/usr/libexec/bareos/update_*_tables
673 + rm -vf "${D}"/usr/libexec/bareos/drop_*_tables
674 + rm -vf "${D}"/usr/libexec/bareos/grant_*_privileges
675 + rm -vf "${D}"/usr/libexec/bareos/*_catalog_backup
676 + fi
677 + if use clientonly || ! use storage-daemon; then
678 + if use systemd; then
679 + rm -vf "${D}"/lib/systemd/system/bareos-sd.service
680 + fi
681 + rm -vf "${D}"/usr/share/man/man8/bareos-sd.8*
682 + rm -vf "${D}"/usr/share/man/man8/bcopy.8*
683 + rm -vf "${D}"/usr/share/man/man8/bextract.8*
684 + rm -vf "${D}"/usr/share/man/man8/bls.8*
685 + rm -vf "${D}"/usr/share/man/man8/bscan.8*
686 + rm -vf "${D}"/usr/share/man/man8/btape.8*
687 + rm -vf "${D}"/usr/libexec/bareos/disk-changer
688 + rm -vf "${D}"/usr/libexec/bareos/mtx-changer
689 + rm -vf "${D}"/usr/libexec/bareos/dvd-handler
690 + rm -vf "${D}"/etc/bareos/mtx-changer.conf
691 + fi
692 + if ! use scsi-crypto; then
693 + rm -vf "${D}"/usr/share/man/man8/bscrypto.8*
694 + fi
695 +
696 + # documentation
697 + dodoc README.md
698 + dodoc core/README.configsubdirectories
699 + use glusterfs dodoc core/README.glusterfs
700 + use ndmp && dodoc core/README.NDMP
701 + use scsi-crypto && dodoc core/README.scsicrypto
702 +
703 + # vim-files
704 + if use vim-syntax; then
705 + insinto /usr/share/vim/vimfiles/syntax
706 + doins core/scripts/bareos.vim
707 + insinto /usr/share/vim/vimfiles/ftdetect
708 + newins core/scripts/filetype.vim bareos_ft.vim
709 + fi
710 +
711 + # setup init scripts
712 + myscripts="bareos-fd"
713 + if ! use clientonly; then
714 + if use director; then
715 + myscripts+=" bareos-dir"
716 + fi
717 + if use storage-daemon; then
718 + myscripts+=" bareos-sd"
719 + fi
720 + fi
721 + for script in ${myscripts}; do
722 + # copy over init script and config to a temporary location
723 + # so we can modify them as needed
724 + cp "${FILESDIR}/${script}".confd "${T}/${script}".confd || die "failed to copy ${script}.confd"
725 + cp "${FILESDIR}/${script}".initd "${T}/${script}".initd || die "failed to copy ${script}.initd"
726 +
727 + # now set the database dependency for the director init script
728 + case "${script}" in
729 + bareos-dir)
730 + sed -i -e "s:%databasetypes%:${mydbtypes[*]}:" "${T}/${script}".confd || die
731 + ;;
732 + *)
733 + ;;
734 + esac
735 +
736 + # install init script and config
737 + newinitd "${T}/${script}".initd "${script}"
738 + newconfd "${T}/${script}".confd "${script}"
739 + done
740 +
741 + # install systemd unit files
742 + if use systemd; then
743 + if ! use clientonly; then
744 + use director && systemd_dounit core/platforms/systemd/bareos-dir.service
745 + use storage-daemon && systemd_dounit core/platforms/systemd/bareos-sd.service
746 + fi
747 + systemd_dounit core/platforms/systemd/bareos-fd.service
748 + fi
749 +
750 + # make sure the working directory exists
751 + diropts -m0750
752 + keepdir /var/lib/bareos
753 + keepdir /var/lib/bareos/storage
754 +
755 + diropts -m0755
756 + keepdir /var/log/bareos
757 +
758 + # make sure bareos group can execute bareos libexec scripts
759 + fowners -R root:bareos /usr/libexec/bareos
760 +}
761 +
762 +pkg_postinst() {
763 + if use clientonly; then
764 + fowners root:bareos /var/lib/bareos
765 + else
766 + fowners bareos:bareos /var/lib/bareos
767 + fi
768 +
769 + if ! use clientonly && use director; then
770 + einfo
771 + einfo "If this is a new install, you must create the database:"
772 + if use postgres; then
773 + einfo
774 + einfo "For postgresql:"
775 + einfo " su postgres -c '/usr/libexec/bareos/create_bareos_database postgresql'"
776 + einfo " su postgres -c '/usr/libexec/bareos/make_bareos_tables postgresql'"
777 + einfo " su postgres -c '/usr/libexec/bareos/grant_bareos_privileges postgresql'"
778 + fi
779 + if use mysql; then
780 + einfo
781 + einfo "For mysql:"
782 + einfo
783 + einfo " Make sure root has direct access to your mysql server. You may want to"
784 + einfo " create a /root/.my.cnf file with"
785 + einfo " [client]"
786 + einfo " user=root"
787 + einfo " password=YourPasswordForAccessingMysqlAsRoot"
788 + einfo " before running:"
789 + einfo " /usr/libexec/bareos/create_bareos_database mysql"
790 + einfo " /usr/libexec/bareos/make_bareos_tables mysql"
791 + einfo " /usr/libexec/bareos/grant_bareos_privileges mysql"
792 + fi
793 + einfo
794 + fi
795 +
796 + if use sqlite; then
797 + einfo
798 + einfo "Be aware that Bareos does not officially support SQLite database."
799 + einfo "Best use it only for a client-only installation. See Bug #445540."
800 + einfo
801 + einfo "It is strongly recommended to use either postgresql or mysql as"
802 + einfo "catalog database backend."
803 + einfo
804 + fi
805 +}