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: 1596291163.3200136ffa0bdfa0ce9bbd3a4d03201af6ba75cf.mschiff@gentoo
1 commit: 3200136ffa0bdfa0ce9bbd3a4d03201af6ba75cf
2 Author: Marc Schiffbauer <mschiff <AT> gentoo <DOT> org>
3 AuthorDate: Sat Aug 1 14:08:23 2020 +0000
4 Commit: Marc Schiffbauer <mschiff <AT> gentoo <DOT> org>
5 CommitDate: Sat Aug 1 14:12:43 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3200136f
7
8 app-backup/bareos: bump 18.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-18.2.9.ebuild | 397 +++++++++++++++++++++++++++++++++
15 2 files changed, 398 insertions(+)
16
17 diff --git a/app-backup/bareos/Manifest b/app-backup/bareos/Manifest
18 index 741274fb308..bbce1692c61 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-18.2.8.tar.gz 10552800 BLAKE2B c13aabbb7f450c1c9c02f39b130d34057cfc4cec590c68acde5d3592d0f238c0e52bf3acbb55e697610252b3f6bd528c2e87ea09c83aba02f303d144a62b44b2 SHA512 61c9155a02ec0f3a21e06db4f5701dabb25411219d98940b50912c16ac38ec007584a7ef9728f2f12acf2823339a25eba3c9b34a6fa9e625a1d2d0778653b860
24 +DIST bareos-18.2.9.tar.gz 10554581 BLAKE2B 1277956a87794e707050c119a0e2d6a879f47bd67bde7fa230796b6f9a8c0b6ca1cddf35f12b6e53d0841f6cfbb86c586157b9705d36c515adaf1021bb23edc1 SHA512 f40c0bc696f31ee4eb443cc7a76a5810620a2fbb5fa421afc580e047879ce86b1288de92679695e00074a3bfd5a5ac2a4cb4fb8f8acbb39e615df19ad9cf7934
25 DIST bareos-19.2.7.tar.gz 12602338 BLAKE2B 31fa9c9966b22913c2af6eaa6c6f704396d353341878817a574388925f35b437331b057b2a147a8217502f9198b39539d2fa68c4047e191dc918123c0f674a7d SHA512 cb467846a41d42a469704d48c3a1b03ebf5fdc71b9268c1e438e46b86073d55993dfd9bf26242db593db8b1814009c060fd65122d434bad2986c24613f6865c6
26
27 diff --git a/app-backup/bareos/bareos-18.2.9.ebuild b/app-backup/bareos/bareos-18.2.9.ebuild
28 new file mode 100644
29 index 00000000000..cf1622b6e1a
30 --- /dev/null
31 +++ b/app-backup/bareos/bareos-18.2.9.ebuild
32 @@ -0,0 +1,397 @@
33 +# Copyright 1999-2020 Gentoo Authors
34 +# Distributed under the terms of the GNU General Public License v2
35 +
36 +EAPI="7"
37 +
38 +CMAKE_WARN_UNUSED_CLI=no
39 +#CMAKE_REMOVE_MODULES=yes
40 +
41 +inherit desktop systemd cmake
42 +
43 +DESCRIPTION="Featureful client/server network backup suite"
44 +HOMEPAGE="http://www.bareos.org/"
45 +SRC_URI="https://github.com/${PN}/${PN}/archive/Release/${PV}.tar.gz -> ${P}.tar.gz"
46 +RESTRICT="mirror"
47 +
48 +LICENSE="AGPL-3"
49 +SLOT="0"
50 +KEYWORDS="~amd64 ~x86"
51 +IUSE="X acl cephfs clientonly +director fastlz glusterfs gnutls ipv6 jansson lmdb libressl
52 + logwatch mysql ndmp +postgres rados rados-striper readline scsi-crypto
53 + sql-pooling sqlite ssl static +storage-daemon systemd tcpd vim-syntax"
54 +REQUIRED_USE="!clientonly? ( || ( mysql postgres sqlite ) )"
55 +
56 +DEPEND="
57 + !app-backup/bacula
58 + acct-group/${PN}
59 + cephfs? ( sys-cluster/ceph )
60 + rados? ( sys-cluster/ceph )
61 + rados-striper? ( >=sys-cluster/ceph-0.94.2 )
62 + glusterfs? ( sys-cluster/glusterfs )
63 + lmdb? ( dev-db/lmdb )
64 + dev-libs/gmp:0
65 + !clientonly? (
66 + acct-user/${PN}
67 + postgres? ( dev-db/postgresql:*[threads] )
68 + mysql? ( virtual/mysql )
69 + sqlite? ( dev-db/sqlite:3 )
70 + director? (
71 + virtual/mta
72 + jansson? ( dev-libs/jansson )
73 + )
74 + )
75 + fastlz? ( dev-libs/bareos-fastlzlib )
76 + logwatch? ( sys-apps/logwatch )
77 + tcpd? ( sys-apps/tcp-wrappers )
78 + readline? ( sys-libs/readline:0 )
79 + static? (
80 + acl? ( virtual/acl[static-libs] )
81 + sys-libs/zlib[static-libs]
82 + dev-libs/lzo[static-libs]
83 + sys-libs/ncurses:=[static-libs]
84 + ssl? (
85 + !gnutls? (
86 + !libressl? ( dev-libs/openssl:0=[static-libs] )
87 + libressl? ( dev-libs/libressl:0=[static-libs] )
88 + )
89 + gnutls? ( net-libs/gnutls[static-libs] )
90 + )
91 + )
92 + !static? (
93 + acl? ( virtual/acl )
94 + dev-libs/lzo
95 + ssl? (
96 + !gnutls? (
97 + !libressl? ( dev-libs/openssl:0= )
98 + libressl? ( dev-libs/libressl:0= )
99 + )
100 + gnutls? ( net-libs/gnutls )
101 + )
102 + sys-libs/ncurses:=
103 + sys-libs/zlib
104 + )
105 + "
106 +RDEPEND="${DEPEND}
107 + !clientonly? (
108 + storage-daemon? (
109 + sys-block/mtx
110 + app-arch/mt-st
111 + )
112 + )
113 + vim-syntax? ( || ( app-editors/vim app-editors/gvim ) )"
114 +
115 +REQUIRED_USE="static? ( clientonly )"
116 +
117 +S=${WORKDIR}/${PN}-Release-${PV}
118 +
119 +src_prepare() {
120 + use mysql && export mydbtypes+=( mysql )
121 + use postgres && export mydbtypes+=( postgresql )
122 + use sqlite && export mydbtypes+=( sqlite )
123 +
124 + # enables default database driver in catalog
125 + pushd core/src/defaultconfigs >&/dev/null || die
126 + sed -i -e 's/#dbdriver/dbdriver/' -e '/XXX_REPLACE_WITH_DATABASE_DRIVER_XXX/d' $(grep -rl XXX_REPLACE_WITH_DATABASE_DRIVER_XXX) \
127 + || die "sed on MyCatalog.conf.in failed"
128 + popd >&/dev/null || die
129 +
130 + eapply -p0 "${FILESDIR}/bareos-cmake-rados.patch"
131 +
132 + # fix gentoo version detection
133 + eapply -p0 "${FILESDIR}/bareos-cmake-gentoo.patch"
134 +
135 + # fix missing DESTDIR in symlink creation
136 + eapply -p2 "${FILESDIR}/bareos-cmake-symlink-default-db-backend.patch"
137 +
138 + # disable dird and stored plugins, because of
139 + # py2 dependency
140 + cd "${S}/core/src/plugins"
141 + cmake_comment_add_subdirectory filed
142 + cmake_comment_add_subdirectory dird
143 + cmake_comment_add_subdirectory stored
144 + cd -
145 +
146 + eapply_user
147 +
148 + CMAKE_USE_DIR="$S/core"
149 + cmake_src_prepare
150 +}
151 +
152 +src_configure() {
153 + local mycmakeargs=()
154 +
155 + CMAKE_USE_DIR="$S/core"
156 +
157 + pushd core/platforms >&/dev/null || die
158 + cmake_comment_add_subdirectory '${DISTNAME}'
159 + popd >&/dev/null || die
160 +
161 + if use clientonly; then
162 + mycmakeargs+=(
163 + -Dclient-only=YES
164 + -Dstatic-cons=$(usex static)
165 + -Dstatic-fd=$(usex static)
166 + )
167 + fi
168 +
169 + for useflag in acl ipv6 ndmp readline scsi-crypto sql-pooling \
170 + systemd fastlz mysql lmdb glusterfs rados \
171 + rados-striper cephfs jansson; do
172 +
173 + mycmakeargs+=( -D$useflag=$(usex $useflag) )
174 + done
175 +
176 + mycmakeargs+=(
177 + -DDEFAULT_DB_TYPE=${mydbtypes[0]}
178 + -Dx=$(usex X)
179 + -Dpostgresql=$(usex postgres)
180 + -Dmysql=$(usex mysql)
181 + -Dsqlite3=$(usex sqlite)
182 + -Dopenssl=$(usex ssl)
183 + -Dtcp-wrapper=$(usex tcpd)
184 + -Dlibdir=/usr/$(get_libdir)
185 + -Dsbindir=/usr/sbin
186 + -Dmandir=/usr/share/man
187 + -Ddocdir=/usr/share/doc/${PF}
188 + -Dhtmldir=/usr/share/doc/${PF}/html
189 + -Darchivedir=/var/lib/bareos/storage
190 + -Dbsrdir=/var/lib/bareos/bsr
191 + -Dpiddir=/run/bareos
192 + -Dsysconfdir=/etc
193 + -Dconfdir=/etc/bareos
194 + -Dsubsys-dir=/run/lock/subsys
195 + -Dworkingdir=/var/lib/bareos
196 + -Dlogdir=/var/log/bareos
197 + -Dscriptdir=/usr/libexec/bareos
198 + -Dplugindir=/usr/$(get_libdir)/${PN}/plugin
199 + -Dbackenddir=/usr/$(get_libdir)/${PN}/backend
200 + -Ddir-user=bareos
201 + -Ddir-group=bareos
202 + -Dsd-user=root
203 + -Dsd-group=bareos
204 + -Dfd-user=root
205 + -Dfd-group=bareos
206 + -Dsbin-perm=0755
207 + -Ddb_password=`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1`
208 + -Ddynamic-cats-backends=yes
209 + -Ddynamic-storage-backends=yes
210 + -Dbatch-insert=yes
211 + -Dhost=${CHOST}
212 + -Dcoverage=yes
213 + -Dpython=no
214 + -Dsmartalloc=yes
215 + -Ddir-password="`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1`"
216 + -Dfd-password="`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1`"
217 + -Dsd-password="`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1`"
218 + -Dmon-dir-password="`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1`"
219 + -Dmon-fd-password="`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1`"
220 + -Dmon-sd-password="`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1`"
221 + -Dbasename="`hostname -s`"
222 + -Dhostname="`hostname -s`"
223 + )
224 +
225 + cmake_src_configure
226 +}
227 +
228 +src_install() {
229 + #emake DESTDIR="${D}" install
230 + cmake_src_install
231 + newicon core/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}"/core/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}"/core/scripts/logwatch >&/dev/null || die
265 +
266 + into /etc/log.d/scripts/services
267 + dobin bareos
268 +
269 + into /etc/log.d/scripts/shared
270 + dobin applybareosdate
271 +
272 + insinto /etc/log.d/conf/logfiles
273 + newins logfile.bareos.conf bareos.conf
274 +
275 + insinto /etc/log.d/conf/services
276 + newins services.bareos.conf bareos.conf
277 +
278 + popd >&/dev/null || die
279 + fi
280 + fi
281 +
282 + rm -vf "${D}"/usr/share/man/man1/bareos-bwxconsole.1*
283 + if use clientonly || ! use director; then
284 + if use systemd; then
285 + rm -vf "${D}"/lib/systemd/system/bareos-dir.service
286 + fi
287 + rm -vf "${D}"/usr/share/man/man8/bareos-dir.8*
288 + rm -vf "${D}"/usr/share/man/man8/bareos-dbcheck.8*
289 + rm -vf "${D}"/usr/share/man/man1/bsmtp.1*
290 + rm -vf "${D}"/usr/share/man/man8/bwild.8*
291 + rm -vf "${D}"/usr/share/man/man8/bregex.8*
292 + rm -vf "${D}"/usr/share/man/man8/bpluginfo.8*
293 + rm -vf "${D}"/usr/libexec/bareos/create_*_database
294 + rm -vf "${D}"/usr/libexec/bareos/drop_*_database
295 + rm -vf "${D}"/usr/libexec/bareos/make_*_tables
296 + rm -vf "${D}"/usr/libexec/bareos/update_*_tables
297 + rm -vf "${D}"/usr/libexec/bareos/drop_*_tables
298 + rm -vf "${D}"/usr/libexec/bareos/grant_*_privileges
299 + rm -vf "${D}"/usr/libexec/bareos/*_catalog_backup
300 + fi
301 + if use clientonly || ! use storage-daemon; then
302 + if use systemd; then
303 + rm -vf "${D}"/lib/systemd/system/bareos-sd.service
304 + fi
305 + rm -vf "${D}"/usr/share/man/man8/bareos-sd.8*
306 + rm -vf "${D}"/usr/share/man/man8/bcopy.8*
307 + rm -vf "${D}"/usr/share/man/man8/bextract.8*
308 + rm -vf "${D}"/usr/share/man/man8/bls.8*
309 + rm -vf "${D}"/usr/share/man/man8/bscan.8*
310 + rm -vf "${D}"/usr/share/man/man8/btape.8*
311 + rm -vf "${D}"/usr/libexec/bareos/disk-changer
312 + rm -vf "${D}"/usr/libexec/bareos/mtx-changer
313 + rm -vf "${D}"/usr/libexec/bareos/dvd-handler
314 + rm -vf "${D}"/etc/bareos/mtx-changer.conf
315 + fi
316 + if ! use scsi-crypto; then
317 + rm -vf "${D}"/usr/share/man/man8/bscrypto.8*
318 + fi
319 +
320 + # documentation
321 + dodoc README.md
322 + dodoc core/README.configsubdirectories
323 + use glusterfs dodoc core/README.glusterfs
324 + use ndmp && dodoc core/README.NDMP
325 + use scsi-crypto && dodoc core/README.scsicrypto
326 +
327 + # vim-files
328 + if use vim-syntax; then
329 + insinto /usr/share/vim/vimfiles/syntax
330 + doins core/scripts/bareos.vim
331 + insinto /usr/share/vim/vimfiles/ftdetect
332 + newins core/scripts/filetype.vim bareos_ft.vim
333 + fi
334 +
335 + # setup init scripts
336 + myscripts="bareos-fd"
337 + if ! use clientonly; then
338 + if use director; then
339 + myscripts+=" bareos-dir"
340 + fi
341 + if use storage-daemon; then
342 + myscripts+=" bareos-sd"
343 + fi
344 + fi
345 + for script in ${myscripts}; do
346 + # copy over init script and config to a temporary location
347 + # so we can modify them as needed
348 + cp "${FILESDIR}/${script}".confd "${T}/${script}".confd || die "failed to copy ${script}.confd"
349 + cp "${FILESDIR}/${script}".initd "${T}/${script}".initd || die "failed to copy ${script}.initd"
350 +
351 + # now set the database dependency for the director init script
352 + case "${script}" in
353 + bareos-dir)
354 + sed -i -e "s:%databasetypes%:${mydbtypes[*]}:" "${T}/${script}".confd || die
355 + ;;
356 + *)
357 + ;;
358 + esac
359 +
360 + # install init script and config
361 + newinitd "${T}/${script}".initd "${script}"
362 + newconfd "${T}/${script}".confd "${script}"
363 + done
364 +
365 + # install systemd unit files
366 + if use systemd; then
367 + if ! use clientonly; then
368 + use director && systemd_dounit core/platforms/systemd/bareos-dir.service
369 + use storage-daemon && systemd_dounit core/platforms/systemd/bareos-sd.service
370 + fi
371 + systemd_dounit core/platforms/systemd/bareos-fd.service
372 + fi
373 +
374 + # make sure the working directory exists
375 + diropts -m0750
376 + keepdir /var/lib/bareos
377 + keepdir /var/lib/bareos/storage
378 +
379 + diropts -m0755
380 + keepdir /var/log/bareos
381 +
382 + # make sure bareos group can execute bareos libexec scripts
383 + fowners -R root:bareos /usr/libexec/bareos
384 +}
385 +
386 +pkg_postinst() {
387 + if use clientonly; then
388 + fowners root:bareos /var/lib/bareos
389 + else
390 + fowners bareos:bareos /var/lib/bareos
391 + fi
392 +
393 + if ! use clientonly && use director; then
394 + einfo
395 + einfo "If this is a new install, you must create the database:"
396 + if use postgres; then
397 + einfo
398 + einfo "For postgresql:"
399 + einfo " su postgres -c '/usr/libexec/bareos/create_bareos_database postgresql'"
400 + einfo " su postgres -c '/usr/libexec/bareos/make_bareos_tables postgresql'"
401 + einfo " su postgres -c '/usr/libexec/bareos/grant_bareos_privileges postgresql'"
402 + fi
403 + if use mysql; then
404 + einfo
405 + einfo "For mysql:"
406 + einfo
407 + einfo " Make sure root has direct access to your mysql server. You may want to"
408 + einfo " create a /root/.my.cnf file with"
409 + einfo " [client]"
410 + einfo " user=root"
411 + einfo " password=YourPasswordForAccessingMysqlAsRoot"
412 + einfo " before running:"
413 + einfo " /usr/libexec/bareos/create_bareos_database mysql"
414 + einfo " /usr/libexec/bareos/make_bareos_tables mysql"
415 + einfo " /usr/libexec/bareos/grant_bareos_privileges mysql"
416 + fi
417 + einfo
418 + fi
419 +
420 + if use sqlite; then
421 + einfo
422 + einfo "Be aware that Bareos does not officially support SQLite database."
423 + einfo "Best use it only for a client-only installation. See Bug #445540."
424 + einfo
425 + einfo "It is strongly recommended to use either postgresql or mysql as"
426 + einfo "catalog database backend."
427 + einfo
428 + fi
429 +}