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: Sat, 01 Aug 2020 14:14:38
Message-Id: 1596291156.883722218e177b04cc27c56b56531472eec04a01.mschiff@gentoo
1 commit: 883722218e177b04cc27c56b56531472eec04a01
2 Author: Marc Schiffbauer <mschiff <AT> gentoo <DOT> org>
3 AuthorDate: Sat Aug 1 14:04:23 2020 +0000
4 Commit: Marc Schiffbauer <mschiff <AT> gentoo <DOT> org>
5 CommitDate: Sat Aug 1 14:12:36 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=88372221
7
8 app-backup/bareos: bump 17.2 + remove py2 support
9
10 Package-Manager: Portage-2.3.99, Repoman-2.3.23
11 Signed-off-by: Marc Schiffbauer <mschiff <AT> gentoo.org>
12
13 app-backup/bareos/Manifest | 1 +
14 app-backup/bareos/bareos-17.2.10.ebuild | 360 ++++++++++++++++++++++++++++++++
15 2 files changed, 361 insertions(+)
16
17 diff --git a/app-backup/bareos/Manifest b/app-backup/bareos/Manifest
18 index bd2570916a2..6874232e06f 100644
19 --- a/app-backup/bareos/Manifest
20 +++ b/app-backup/bareos/Manifest
21 @@ -1,3 +1,4 @@
22 +DIST bareos-17.2.10.tar.gz 4190783 BLAKE2B d2deb9368438b5281ea36768b80cc15840135a77a19952daa895c4e30ee6ad231d9ecf28a6d860bd372eb08c1c34f9f827843745c87f465d3a59ab048aecc001 SHA512 3e145627a08927790deb8f75e5167e6e69710733eb1866a93adb34617c274c2b51145a6b1253388784f67bc4886fec7fbb423893a36d377bb96334a2dc7768f2
23 DIST bareos-17.2.9.tar.gz 4190637 BLAKE2B 266627ac023695971acc5d730765c08ddde673ba75398547687d5f2ccbfb7c440221b8c0a617bc6a3b0d2089cd22604ebe838decc65ce3c1f7ae5cdb99833118 SHA512 ac40f867d495aa64693a209dbfceb55f22425a2079dc000dabd8c6ffce79b1a2578bc0110970a6aace7c3e039c7110d1d395c31b372c0d3e5f18b43e682a70a9
24 DIST bareos-18.2.8.tar.gz 10552800 BLAKE2B c13aabbb7f450c1c9c02f39b130d34057cfc4cec590c68acde5d3592d0f238c0e52bf3acbb55e697610252b3f6bd528c2e87ea09c83aba02f303d144a62b44b2 SHA512 61c9155a02ec0f3a21e06db4f5701dabb25411219d98940b50912c16ac38ec007584a7ef9728f2f12acf2823339a25eba3c9b34a6fa9e625a1d2d0778653b860
25 DIST bareos-19.2.7.tar.gz 12602338 BLAKE2B 31fa9c9966b22913c2af6eaa6c6f704396d353341878817a574388925f35b437331b057b2a147a8217502f9198b39539d2fa68c4047e191dc918123c0f674a7d SHA512 cb467846a41d42a469704d48c3a1b03ebf5fdc71b9268c1e438e46b86073d55993dfd9bf26242db593db8b1814009c060fd65122d434bad2986c24613f6865c6
26
27 diff --git a/app-backup/bareos/bareos-17.2.10.ebuild b/app-backup/bareos/bareos-17.2.10.ebuild
28 new file mode 100644
29 index 00000000000..f4a2b487a99
30 --- /dev/null
31 +++ b/app-backup/bareos/bareos-17.2.10.ebuild
32 @@ -0,0 +1,360 @@
33 +# Copyright 1999-2020 Gentoo Authors
34 +# Distributed under the terms of the GNU General Public License v2
35 +
36 +EAPI="7"
37 +
38 +inherit desktop systemd
39 +
40 +DESCRIPTION="Featureful client/server network backup suite"
41 +HOMEPAGE="http://www.bareos.org/"
42 +SRC_URI="https://github.com/${PN}/${PN}/archive/Release/${PV}.tar.gz -> ${P}.tar.gz"
43 +RESTRICT="mirror"
44 +
45 +LICENSE="AGPL-3"
46 +SLOT="0"
47 +KEYWORDS="~amd64 ~x86"
48 +IUSE="X acl cephfs clientonly +director fastlz glusterfs gnutls ipv6 jansson lmdb libressl
49 + logwatch mysql ndmp +postgres rados rados-striper readline scsi-crypto
50 + sql-pooling sqlite ssl static +storage-daemon tcpd vim-syntax"
51 +REQUIRED_USE="!clientonly? ( || ( mysql postgres sqlite ) )"
52 +
53 +DEPEND="
54 + !app-backup/bacula
55 + acct-group/${PN}
56 + cephfs? ( sys-cluster/ceph )
57 + rados? ( sys-cluster/ceph )
58 + rados-striper? ( >=sys-cluster/ceph-0.94.2 )
59 + glusterfs? ( sys-cluster/glusterfs )
60 + lmdb? ( dev-db/lmdb )
61 + dev-libs/gmp:0
62 + !clientonly? (
63 + acct-user/${PN}
64 + postgres? ( dev-db/postgresql:*[threads] )
65 + mysql? ( dev-db/mysql-connector-c:0= )
66 + sqlite? ( dev-db/sqlite:3 )
67 + director? (
68 + virtual/mta
69 + jansson? ( dev-libs/jansson )
70 + )
71 + )
72 + fastlz? ( dev-libs/bareos-fastlzlib )
73 + logwatch? ( sys-apps/logwatch )
74 + tcpd? ( sys-apps/tcp-wrappers )
75 + readline? ( sys-libs/readline:0 )
76 + static? (
77 + acl? ( virtual/acl[static-libs] )
78 + sys-libs/zlib[static-libs]
79 + dev-libs/lzo[static-libs]
80 + sys-libs/ncurses:=[static-libs]
81 + ssl? (
82 + !gnutls? (
83 + !libressl? ( dev-libs/openssl:0=[static-libs] )
84 + libressl? ( dev-libs/libressl:0=[static-libs] )
85 + )
86 + gnutls? ( net-libs/gnutls[static-libs] )
87 + )
88 + )
89 + !static? (
90 + acl? ( virtual/acl )
91 + dev-libs/lzo
92 + ssl? (
93 + !gnutls? (
94 + !libressl? ( dev-libs/openssl:0= )
95 + libressl? ( dev-libs/libressl:0= )
96 + )
97 + gnutls? ( net-libs/gnutls )
98 + )
99 + sys-libs/ncurses:=
100 + sys-libs/zlib
101 + )
102 + "
103 +RDEPEND="${DEPEND}
104 + !clientonly? (
105 + storage-daemon? (
106 + sys-block/mtx
107 + app-arch/mt-st
108 + )
109 + )
110 + vim-syntax? ( || ( app-editors/vim app-editors/gvim ) )"
111 +
112 +REQUIRED_USE="static? ( clientonly )"
113 +
114 +S=${WORKDIR}/${PN}-Release-${PV}
115 +
116 +pkg_setup() {
117 + use mysql && export mydbtypes+="mysql"
118 + use postgres && export mydbtypes+=" postgresql"
119 + use sqlite && export mydbtypes+=" sqlite"
120 +}
121 +
122 +src_prepare() {
123 + # adjusts default configuration files for several binaries
124 + # to /etc/bareos/<config> instead of ./<config>
125 + pushd src >&/dev/null || die
126 + for f in console/console.c dird/dird.c filed/filed.c \
127 + stored/bcopy.c stored/bextract.c stored/bls.c \
128 + stored/bscan.c stored/btape.c stored/stored.c; do
129 + sed -i -e 's|^\(#define CONFIG_FILE "\)|\1/etc/bareos/|g' "${f}" \
130 + || die "sed on ${f} failed"
131 + done
132 + popd >&/dev/null || die
133 +
134 + # enables default database driver in catalog
135 + pushd src/defaultconfigs/bareos-dir.d/catalog >&/dev/null || die
136 + sed -i -e 's/#dbdriver/dbdriver/' -e '/XXX_REPLACE/d' MyCatalog.conf.in \
137 + || die "sed on MyCatalog.conf.in failed"
138 + popd >&/dev/null || die
139 +
140 + # bug 466690 Use CXXFLAGS instead of CFLAGS
141 + sed -i -e 's/@CFLAGS@/@CXXFLAGS@/' autoconf/Make.common.in || die
142 +
143 + # do not strip binaries
144 + for d in filed console dird stored; do
145 + sed -i -e "s/strip /# strip /" src/$d/Makefile.in || die
146 + done
147 +
148 + eapply_user
149 +}
150 +
151 +src_configure() {
152 + local myconf=''
153 +
154 + addpredict /var/lib/logrotate.status
155 +
156 + if use clientonly; then
157 + myconf="${myconf} \
158 + $(use_enable clientonly client-only) \
159 + $(use_enable !static libtool) \
160 + $(use_enable static static-cons) \
161 + $(use_enable static static-fd)"
162 + fi
163 +
164 + myconf="${myconf} \
165 + $(use_with X x) \
166 + $(use_enable acl) \
167 + $(use_enable ipv6) \
168 + $(use_enable ndmp) \
169 + $(use_enable readline) \
170 + $(use_enable !readline conio) \
171 + $(use_enable scsi-crypto) \
172 + $(use_enable sql-pooling) \
173 + $(use_with fastlz) \
174 + $(use_with mysql) \
175 + $(use_with postgres postgresql) \
176 + $(use_with readline) \
177 + $(use_with sqlite sqlite3) \
178 + $(use sqlite || echo "--without-sqlite3") \
179 + $(use_with ssl openssl) \
180 + $(use_with tcpd tcp-wrappers) \
181 + $(use_enable lmdb) \
182 + $(use_with glusterfs) \
183 + $(use_with rados) \
184 + $(use_with rados-striper) \
185 + $(use_with cephfs) \
186 + $(use_with jansson) \
187 + "
188 +
189 + econf \
190 + --without-python \
191 + --with-pid-dir=/run/bareos \
192 + --with-subsys-dir=/run/lock/subsys \
193 + --with-working-dir=/var/lib/bareos \
194 + --with-logdir=/var/log/bareos \
195 + --with-scriptdir=/usr/libexec/bareos \
196 + --with-plugindir=/usr/$(get_libdir)/${PN}/plugin \
197 + --with-backenddir=/usr/$(get_libdir)/${PN}/backend \
198 + --with-dir-user=bareos \
199 + --with-dir-group=bareos \
200 + --with-sd-user=root \
201 + --with-sd-group=bareos \
202 + --with-fd-user=root \
203 + --with-fd-group=bareos \
204 + --with-sbin-perm=0755 \
205 + --with-systemd \
206 + --with-db-password=`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1` \
207 + --enable-dynamic-cats-backends \
208 + --enable-dynamic-storage-backends \
209 + --enable-batch-insert \
210 + --disable-afs \
211 + --host=${CHOST} \
212 + ${myconf}
213 +}
214 +
215 +src_compile() {
216 + # Make build log verbose (bug #447806)
217 + emake NO_ECHO=""
218 +}
219 +
220 +src_install() {
221 + emake DESTDIR="${D}" install
222 + newicon src/images/bareos_logo_shadow.png bareos.png
223 +
224 + # remove some scripts we don't need at all
225 + rm -f "${D}"/usr/libexec/bareos/{bareos,bareos-ctl-dir,bareos-ctl-fd,bareos-ctl-sd,startmysql,stopmysql}
226 + rm -f "${D}"/usr/sbin/bareos
227 +
228 + # remove upstream init scripts
229 + rm -f "${D}"/etc/init.d/bareos-*
230 +
231 + # rename statically linked apps
232 + if use clientonly && use static ; then
233 + pushd "${D}"/usr/sbin || die
234 + mv static-bareos-fd bareos-fd || die
235 + mv static-bconsole bconsole || die
236 + popd || die
237 + fi
238 +
239 + # extra files which 'make install' doesn't cover
240 + if ! use clientonly; then
241 + # the logrotate configuration
242 + # (now unconditional wrt bug #258187)
243 + diropts -m0755
244 + insinto /etc/logrotate.d
245 + insopts -m0644
246 + newins "${S}"/scripts/logrotate bareos
247 +
248 + # the logwatch scripts
249 + if use logwatch; then
250 + diropts -m0750
251 + dodir /etc/log.d/scripts/services
252 + dodir /etc/log.d/scripts/shared
253 + dodir /etc/log.d/conf/logfiles
254 + dodir /etc/log.d/conf/services
255 + pushd "${S}"/scripts/logwatch >&/dev/null || die
256 + emake DESTDIR="${D}" install
257 + popd >&/dev/null || die
258 + fi
259 + fi
260 +
261 + rm -vf "${D}"/usr/share/man/man1/bareos-bwxconsole.1*
262 + if use clientonly || ! use director; then
263 + rm -vf "${D}"/usr/share/man/man8/bareos-dir.8*
264 + rm -vf "${D}"/usr/share/man/man8/bareos-dbcheck.8*
265 + rm -vf "${D}"/usr/share/man/man1/bsmtp.1*
266 + rm -vf "${D}"/usr/share/man/man8/bwild.8*
267 + rm -vf "${D}"/usr/share/man/man8/bregex.8*
268 + rm -vf "${D}"/usr/share/man/man8/bpluginfo.8*
269 + rm -vf "${D}"/usr/libexec/bareos/create_*_database
270 + rm -vf "${D}"/usr/libexec/bareos/drop_*_database
271 + rm -vf "${D}"/usr/libexec/bareos/make_*_tables
272 + rm -vf "${D}"/usr/libexec/bareos/update_*_tables
273 + rm -vf "${D}"/usr/libexec/bareos/drop_*_tables
274 + rm -vf "${D}"/usr/libexec/bareos/grant_*_privileges
275 + rm -vf "${D}"/usr/libexec/bareos/*_catalog_backup
276 + fi
277 + if use clientonly || ! use storage-daemon; then
278 + rm -vf "${D}"/usr/share/man/man8/bareos-sd.8*
279 + rm -vf "${D}"/usr/share/man/man8/bcopy.8*
280 + rm -vf "${D}"/usr/share/man/man8/bextract.8*
281 + rm -vf "${D}"/usr/share/man/man8/bls.8*
282 + rm -vf "${D}"/usr/share/man/man8/bscan.8*
283 + rm -vf "${D}"/usr/share/man/man8/btape.8*
284 + rm -vf "${D}"/usr/libexec/bareos/disk-changer
285 + rm -vf "${D}"/usr/libexec/bareos/mtx-changer
286 + rm -vf "${D}"/usr/libexec/bareos/dvd-handler
287 + rm -vf "${D}"/etc/bareos/mtx-changer.conf
288 + fi
289 + if ! use scsi-crypto; then
290 + rm -vf "${D}"/usr/share/man/man8/bscrypto.8*
291 + fi
292 +
293 + # documentation
294 + dodoc README.md
295 + use ndmp && dodoc README.NDMP
296 + use scsi-crypto && dodoc README.scsicrypto
297 +
298 + # vim-files
299 + if use vim-syntax; then
300 + insinto /usr/share/vim/vimfiles/syntax
301 + doins scripts/bareos.vim
302 + insinto /usr/share/vim/vimfiles/ftdetect
303 + newins scripts/filetype.vim bareos_ft.vim
304 + fi
305 +
306 + # setup init scripts
307 + myscripts="bareos-fd"
308 + if ! use clientonly; then
309 + if use director; then
310 + myscripts="${myscripts} bareos-dir"
311 + fi
312 + if use storage-daemon; then
313 + myscripts="${myscripts} bareos-sd"
314 + fi
315 + fi
316 + for script in ${myscripts}; do
317 + # copy over init script and config to a temporary location
318 + # so we can modify them as needed
319 + cp "${FILESDIR}/${script}".confd-16 "${T}/${script}".confd || die "failed to copy ${script}.confd"
320 + cp "${FILESDIR}/${script}".initd "${T}/${script}".initd || die "failed to copy ${script}.initd"
321 +
322 + # now set the database dependency for the director init script
323 + case "${script}" in
324 + bareos-dir)
325 + sed -i -e "s:%databasetypes%:${mydbtypes}:" "${T}/${script}".confd || die
326 + ;;
327 + *)
328 + ;;
329 + esac
330 +
331 + # install init script and config
332 + newinitd "${T}/${script}".initd "${script}"
333 + newconfd "${T}/${script}".confd "${script}"
334 + done
335 +
336 + # install systemd unit files
337 + use director && systemd_dounit "${FILESDIR}"/bareos-dir.service
338 + use storage-daemon && systemd_dounit "${FILESDIR}"/bareos-sd.service
339 + systemd_dounit "${FILESDIR}"/bareos-fd.service
340 +
341 + # make sure the working directory exists
342 + diropts -m0750
343 + keepdir /var/lib/bareos
344 +
345 + # make sure bareos group can execute bareos libexec scripts
346 + fowners -R root:bareos /usr/libexec/bareos
347 +}
348 +
349 +pkg_postinst() {
350 + if use clientonly; then
351 + fowners root:bareos /var/lib/bareos
352 + else
353 + fowners bareos:bareos /var/lib/bareos
354 + fi
355 +
356 + if ! use clientonly && use director; then
357 + einfo
358 + einfo "If this is a new install, you must create the database:"
359 + if use postgres; then
360 + einfo
361 + einfo "For postgresql:"
362 + einfo " su postgres -c '/usr/libexec/bareos/create_bareos_database postgresql'"
363 + einfo " su postgres -c '/usr/libexec/bareos/make_bareos_tables postgresql'"
364 + einfo " su postgres -c '/usr/libexec/bareos/grant_bareos_privileges postgresql'"
365 + fi
366 + if use mysql; then
367 + einfo
368 + einfo "For mysql:"
369 + einfo
370 + einfo " Make sure root has direct access to your mysql server. You may want to"
371 + einfo " create a /root/.my.cnf file with"
372 + einfo " [client]"
373 + einfo " user=root"
374 + einfo " password=YourPasswordForAccessingMysqlAsRoot"
375 + einfo " before running:"
376 + einfo " /usr/libexec/bareos/create_bareos_database mysql"
377 + einfo " /usr/libexec/bareos/make_bareos_tables mysql"
378 + einfo " /usr/libexec/bareos/grant_bareos_privileges mysql"
379 + fi
380 + einfo
381 + fi
382 +
383 + if use sqlite; then
384 + einfo
385 + einfo "Be aware that Bareos does not officially support SQLite database."
386 + einfo "Best use it only for a client-only installation. See Bug #445540."
387 + einfo
388 + einfo "It is strongly recommended to use either postgresql or mysql as"
389 + einfo "catalog database backend."
390 + einfo
391 + fi
392 +}