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: Sun, 27 Nov 2022 10:04:36
Message-Id: 1669543437.66f92a9db8fbb60983ad7483721c754b3b50acb3.mschiff@gentoo
1 commit: 66f92a9db8fbb60983ad7483721c754b3b50acb3
2 Author: Marc Schiffbauer <mschiff <AT> gentoo <DOT> org>
3 AuthorDate: Sun Nov 27 09:06:27 2022 +0000
4 Commit: Marc Schiffbauer <mschiff <AT> gentoo <DOT> org>
5 CommitDate: Sun Nov 27 10:03:57 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=66f92a9d
7
8 app-backup/bareos: add 21.1.5
9
10 Signed-off-by: Marc Schiffbauer <mschiff <AT> gentoo.org>
11
12 app-backup/bareos/Manifest | 1 +
13 app-backup/bareos/bareos-21.1.5.ebuild | 390 +++++++++++++++++++++++++++++++++
14 2 files changed, 391 insertions(+)
15
16 diff --git a/app-backup/bareos/Manifest b/app-backup/bareos/Manifest
17 index 5b6c99245325..0325b45696fd 100644
18 --- a/app-backup/bareos/Manifest
19 +++ b/app-backup/bareos/Manifest
20 @@ -1 +1,2 @@
21 DIST bareos-21.1.2.tar.gz 11582588 BLAKE2B e7e02b3897d7e377cc79d9d0880da821f1b81d1f54891d89e704e78f51471cdf94b5a02ffe2f4ed54dec38bf37ccc757bf1641c3b678a04e401f48484ed3c941 SHA512 acdc787ff828add93c81b2b7d293dec90f2aa22aa3aee3002662bd30e88dc0dc58b753bb63ca7c111fac6c7eeea888938236c1169f92ed6cec27941036c7b6b1
22 +DIST bareos-21.1.5.tar.gz 11655244 BLAKE2B 18ef42669cfdd7a663910fa1ce9b46f12eab0aa3a2106e9877dc3d341e9a7b309c21bc1768d4873d626938fcbb2084884a85d6dcef0aa2834b117aef1034d28f SHA512 637c6c0500ff31bb2c87f27d87f908d49836191afb880de4b636432b9c20433ec6f32f5805aaa7fb57f2f99a0201c51802c8d213ee5573642698f74da4cb06b7
23
24 diff --git a/app-backup/bareos/bareos-21.1.5.ebuild b/app-backup/bareos/bareos-21.1.5.ebuild
25 new file mode 100644
26 index 000000000000..19bc1b11ce54
27 --- /dev/null
28 +++ b/app-backup/bareos/bareos-21.1.5.ebuild
29 @@ -0,0 +1,390 @@
30 +# Copyright 1999-2022 Gentoo Authors
31 +# Distributed under the terms of the GNU General Public License v2
32 +
33 +EAPI=7
34 +
35 +PYTHON_COMPAT=( python3_{8..11} )
36 +CMAKE_WARN_UNUSED_CLI=no
37 +#CMAKE_REMOVE_MODULES=yes
38 +
39 +inherit python-any-r1 systemd cmake tmpfiles
40 +
41 +DESCRIPTION="Featureful client/server network backup suite"
42 +HOMEPAGE="https://www.bareos.org/"
43 +SRC_URI="https://github.com/${PN}/${PN}/archive/Release/${PV}.tar.gz -> ${P}.tar.gz"
44 +
45 +# some tests still fail propably due to missing bits in src_test -> TODO
46 +RESTRICT="mirror test"
47 +#RESTRICT="
48 +# mirror
49 +# !test? ( test )
50 +#"
51 +
52 +LICENSE="AGPL-3"
53 +SLOT="0"
54 +KEYWORDS="~amd64 ~x86"
55 +IUSE="X acl ceph clientonly +director glusterfs ipv6 lmdb
56 + logwatch ndmp readline scsi-crypto
57 + static +storage-daemon systemd tcpd test vim-syntax vmware xattr"
58 +
59 +# get cmake variables from core/cmake/BareosSetVariableDefaults.cmake
60 +DEPEND="
61 + !app-backup/bacula
62 + acct-group/${PN}
63 + !x86? (
64 + ceph? ( sys-cluster/ceph )
65 + )
66 + glusterfs? ( sys-cluster/glusterfs )
67 + lmdb? ( dev-db/lmdb )
68 + dev-libs/gmp:0
69 + !clientonly? (
70 + acct-user/${PN}
71 + dev-db/postgresql:*[threads]
72 + director? (
73 + virtual/mta
74 + )
75 + )
76 + logwatch? ( sys-apps/logwatch )
77 + ndmp? ( net-libs/rpcsvc-proto )
78 + tcpd? ( sys-apps/tcp-wrappers )
79 + readline? ( sys-libs/readline:0 )
80 + static? (
81 + acl? ( virtual/acl[static-libs] )
82 + dev-libs/jansson:=[static-libs]
83 + dev-libs/lzo[static-libs]
84 + dev-libs/openssl:0=[static-libs]
85 + sys-libs/ncurses:=[static-libs]
86 + sys-libs/zlib[static-libs]
87 + )
88 + !static? (
89 + acl? ( virtual/acl )
90 + dev-libs/jansson:=
91 + dev-libs/lzo
92 + dev-libs/openssl:0=
93 + sys-libs/ncurses:=
94 + sys-libs/zlib
95 + )
96 + "
97 +RDEPEND="${DEPEND}
98 + !clientonly? (
99 + storage-daemon? (
100 + sys-block/mtx
101 + app-arch/mt-st
102 + )
103 + )
104 + vim-syntax? ( || ( app-editors/vim app-editors/gvim ) )
105 + "
106 +
107 +BDEPEND="
108 + ${PYTHON_DEPS}
109 + test? (
110 + dev-cpp/gtest
111 + dev-db/postgresql:*[server,threads]
112 + dev-db/mariadb:*[server]
113 + )
114 +"
115 +
116 +REQUIRED_USE="
117 + static? ( clientonly )
118 + x86? ( !ceph )
119 +"
120 +
121 +S=${WORKDIR}/${PN}-Release-${PV}
122 +
123 +pkg_pretend() {
124 + local active_removed_backend=""
125 + if has_version "<app-backup/bareos-21[director,mysql]"; then
126 + if grep -qhriE "dbdriver.*=.*mysql" /etc/bareos/; then
127 + active_removed_backend=MySQL
128 + fi
129 + elif has_version "<app-backup/bareos-21[director,sqlite]"; then
130 + if grep -qhriE "dbdriver.*=.*sqlite" /etc/bareos/; then
131 + active_removed_backend=SQLite
132 + fi
133 + fi
134 + if [[ -n $active_removed_backend ]]; then
135 + ewarn
136 + ewarn "You are currently using bareos with the $active_removed_backend"
137 + ewarn "catalog backend."
138 + ewarn
139 + ewarn "THIS IS NOT SUPPORTED ANYMORE"
140 + ewarn
141 + ewarn "Beginning with version 21.0.0 bareos has dropped support for"
142 + ewarn "MySQL and SQLite catalog backends."
143 + ewarn
144 + ewarn "To upgrade to bareos >=21.0.0 you need to migrate to PostgreSQL"
145 + ewarn "catalog backend using the 'bareos-dbcopy' tool of your current"
146 + ewarn "installation first."
147 + ewarn
148 + die "current catalog backend not supported anymore"
149 + fi
150 +}
151 +
152 +src_test() {
153 + # initialze catalog test database
154 + initdb -D "${T}"/pgsql || die
155 + pg_ctl -w -D "${T}"/pgsql start \
156 + -o "-h '' -k '${T}'" || die
157 + createuser -h "${T}" bareos || die
158 + createdb -h "${T}" --owner bareos bareos || die
159 + export PGHOST="${T}"
160 +
161 + # initiale mariadb database for backup tests
162 + # $USER must be set and != root
163 + export USER=portage
164 +
165 + default
166 + cmake_src_test
167 +
168 + pg_ctl -w -D "${T}"/pgsql stop || die
169 + rm -rvf "${T}"/pgsql
170 +}
171 +
172 +src_prepare() {
173 + # fix gentoo platform support
174 + eapply -p1 "${FILESDIR}/${PN}-21-cmake-gentoo.patch"
175 + eapply "${FILESDIR}/${PN}-21.1.2-werror.patch"
176 + eapply "${FILESDIR}/${PN}-21.1.2-no-automagic-ccache.patch"
177 +
178 + # fix missing DESTDIR in symlink creation
179 + sed -i '/bareos-symlink-default-db-backend.cmake/d' "${S}/core/src/cats/CMakeLists.txt"
180 +
181 + cmake_src_prepare
182 +}
183 +
184 +src_configure() {
185 + local mycmakeargs=()
186 +
187 + cmake_comment_add_subdirectory webui
188 +
189 + if use clientonly; then
190 + mycmakeargs+=(
191 + -Dclient-only=ON
192 + -Dstatic-cons=$(usex static)
193 + -Dstatic-fd=$(usex static)
194 + )
195 + fi
196 +
197 + for useflag in acl ipv6 ndmp scsi-crypto \
198 + systemd lmdb; do
199 + mycmakeargs+=( -D$useflag=$(usex $useflag) )
200 + done
201 +
202 + mycmakeargs+=(
203 + -DHAVE_PYTHON=0
204 + -Darchivedir=/var/lib/bareos/storage
205 + -Dbackenddir=/usr/$(get_libdir)/${PN}/backend
206 + -Dbasename="`hostname -s`"
207 + -Dbatch-insert=yes
208 + -Dbsrdir=/var/lib/bareos/bsr
209 + -Dconfdir=/etc/bareos
210 + -Dcoverage=no
211 + -Ddb_password=`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1`
212 + -Ddir-group=bareos
213 + -Ddir-password="`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1`"
214 + -Ddir-user=bareos
215 + -Ddocdir=/usr/share/doc/${PF}
216 + -Ddynamic-cats-backends=yes
217 + -Ddynamic-storage-backends=yes
218 + -Dfd-group=bareos
219 + -Dfd-password="`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1`"
220 + -Dfd-user=root
221 + -Dhost=${CHOST}
222 + -Dhostname="`hostname -s`"
223 + -Dhtmldir=/usr/share/doc/${PF}/html
224 + -Dlibdir=/usr/$(get_libdir)
225 + -Dlogdir=/var/log/bareos
226 + -Dmandir=/usr/share/man
227 + -Dmon-dir-password="`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1`"
228 + -Dmon-fd-password="`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1`"
229 + -Dmon-sd-password="`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1`"
230 + -Dopenssl=yes
231 + -Dpiddir=/run/bareos
232 + -Dplugindir=/usr/$(get_libdir)/${PN}/plugin
233 + -Dsbin-perm=0755
234 + -Dsbindir=/usr/sbin
235 + -Dscriptdir=/usr/libexec/bareos
236 + -Dsd-group=bareos
237 + -Dsd-password="`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1`"
238 + -Dsd-user=root
239 + -Dsubsysdir=/run/lock/subsys
240 + -Dsysconfdir=/etc
241 + -Dworkingdir=/var/lib/bareos
242 + -Dx=$(usex X)
243 + )
244 +
245 + # disable droplet support for now as it does not build with gcc 10
246 + # ... and this is a bundled lib, which should have its own package
247 + cd core && cmake_comment_add_subdirectory "src/droplet"
248 +
249 + cmake_src_configure
250 +}
251 +
252 +src_install() {
253 + cmake_src_install
254 +
255 + # remove some scripts we don't need at all
256 + rm -f "${D}"/usr/libexec/bareos/{bareos,bareos-ctl-dir,bareos-ctl-fd,bareos-ctl-sd}
257 + rm -f "${D}"/usr/sbin/bareos
258 +
259 + # remove upstream init scripts and systemd units
260 + rm -f "${D}"/etc/init.d/bareos-* "${D}"/lib/systemd/system/bareos-*.service
261 +
262 + # remove misc stuff we do not need in production
263 + rm -f "${D}"/etc/bareos/bareos-regress.conf
264 + rm -f "${D}"/etc/logrotate.d/bareos-dir
265 +
266 + # get rid of py2 stuff
267 + rm -rf "$D"/usr/lib64/python2.7 || die
268 + rm -f "$D"/usr/lib64/bareos/plugin/python-fd.so || die
269 + if ! use vmware; then
270 + rm -f "$D"/usr/lib64/bareos/plugin/{BareosFdPluginVMware.py,bareos-fd-vmware.py}
271 + fi
272 +
273 + # rename statically linked apps
274 + if use clientonly && use static ; then
275 + pushd "${D}"/usr/sbin || die
276 + mv static-bareos-fd bareos-fd || die
277 + mv static-bconsole bconsole || die
278 + popd || die
279 + fi
280 +
281 + # extra files which 'make install' doesn't cover
282 + if ! use clientonly; then
283 + # the logrotate configuration
284 + # (now unconditional wrt bug #258187)
285 + diropts -m0755
286 + insinto /etc/logrotate.d
287 + insopts -m0644
288 + newins "${S}"/core/scripts/logrotate bareos
289 +
290 + # the logwatch scripts
291 + if use logwatch; then
292 + diropts -m0750
293 + dodir /etc/log.d/scripts/services
294 + dodir /etc/log.d/scripts/shared
295 + dodir /etc/log.d/conf/logfiles
296 + dodir /etc/log.d/conf/services
297 + pushd "${S}"/core/scripts/logwatch >&/dev/null || die
298 +
299 + into /etc/log.d/scripts/services
300 + dobin bareos
301 +
302 + into /etc/log.d/scripts/shared
303 + dobin applybareosdate
304 +
305 + insinto /etc/log.d/conf/logfiles
306 + newins logfile.bareos.conf bareos.conf
307 +
308 + insinto /etc/log.d/conf/services
309 + newins services.bareos.conf bareos.conf
310 +
311 + popd >&/dev/null || die
312 + fi
313 + fi
314 +
315 + rm -vf "${D}"/usr/share/man/man1/bareos-bwxconsole.1*
316 + if use clientonly || ! use director; then
317 + rm -vf "${D}"/usr/share/man/man8/bareos-dir.8*
318 + rm -vf "${D}"/usr/share/man/man8/bareos-dbcheck.8*
319 + rm -vf "${D}"/usr/share/man/man1/bsmtp.1*
320 + rm -vf "${D}"/usr/share/man/man8/bwild.8*
321 + rm -vf "${D}"/usr/share/man/man8/bregex.8*
322 + rm -vf "${D}"/usr/share/man/man8/bpluginfo.8*
323 + rm -vf "${D}"/usr/libexec/bareos/create_*_database
324 + rm -vf "${D}"/usr/libexec/bareos/drop_*_database
325 + rm -vf "${D}"/usr/libexec/bareos/make_*_tables
326 + rm -vf "${D}"/usr/libexec/bareos/update_*_tables
327 + rm -vf "${D}"/usr/libexec/bareos/drop_*_tables
328 + rm -vf "${D}"/usr/libexec/bareos/grant_*_privileges
329 + rm -vf "${D}"/usr/libexec/bareos/*_catalog_backup
330 + fi
331 + if use clientonly || ! use storage-daemon; then
332 + rm -vf "${D}"/usr/share/man/man8/bareos-sd.8*
333 + rm -vf "${D}"/usr/share/man/man8/bcopy.8*
334 + rm -vf "${D}"/usr/share/man/man8/bextract.8*
335 + rm -vf "${D}"/usr/share/man/man8/bls.8*
336 + rm -vf "${D}"/usr/share/man/man8/bscan.8*
337 + rm -vf "${D}"/usr/share/man/man8/btape.8*
338 + rm -vf "${D}"/usr/libexec/bareos/disk-changer
339 + rm -vf "${D}"/usr/libexec/bareos/mtx-changer
340 + rm -vf "${D}"/usr/libexec/bareos/dvd-handler
341 + rm -vf "${D}"/etc/bareos/mtx-changer.conf
342 + fi
343 + if ! use scsi-crypto; then
344 + rm -vf "${D}"/usr/share/man/man8/bscrypto.8*
345 + fi
346 +
347 + # documentation
348 + dodoc README.md
349 + dodoc core/README.configsubdirectories
350 + use glusterfs dodoc core/README.glusterfs
351 + use ndmp && dodoc core/README.NDMP
352 + use scsi-crypto && dodoc core/README.scsicrypto
353 +
354 + # vim-files
355 + if use vim-syntax; then
356 + insinto /usr/share/vim/vimfiles/syntax
357 + doins core/scripts/bareos.vim
358 + insinto /usr/share/vim/vimfiles/ftdetect
359 + newins core/scripts/filetype.vim bareos_ft.vim
360 + fi
361 +
362 + # setup init scripts
363 + myscripts="bareos-fd"
364 + if ! use clientonly; then
365 + if use director; then
366 + myscripts+=" bareos-dir"
367 + fi
368 + if use storage-daemon; then
369 + myscripts+=" bareos-sd"
370 + fi
371 + fi
372 + for script in ${myscripts}; do
373 + # install init script and config
374 + newinitd "${FILESDIR}/${script}-21".initd "${script}"
375 + newconfd "${FILESDIR}/${script}-21".confd "${script}"
376 + done
377 +
378 + # install systemd unit files
379 + if use systemd; then
380 + if ! use clientonly; then
381 + use director && systemd_newunit "${FILESDIR}"/bareos-dir-21.service bareos-dir.service
382 + use storage-daemon && systemd_dounit "${FILESDIR}"/bareos-sd.service
383 + fi
384 + systemd_dounit "${FILESDIR}"/bareos-fd.service
385 + fi
386 +
387 + # make sure the working directory exists
388 + diropts -m0750
389 + keepdir /var/lib/bareos
390 + keepdir /var/lib/bareos/storage
391 +
392 + diropts -m0755
393 + keepdir /var/log/bareos
394 +
395 + newtmpfiles "${FILESDIR}"/tmpfiles.d-bareos.conf bareos.conf
396 +
397 + # make sure bareos group can execute bareos libexec scripts
398 + fowners -R root:bareos /usr/libexec/bareos
399 +}
400 +
401 +pkg_postinst() {
402 + tmpfiles_process bareos.conf
403 +
404 + if use clientonly; then
405 + fowners root:bareos /var/lib/bareos
406 + else
407 + fowners bareos:bareos /var/lib/bareos
408 + fi
409 +
410 + if ! use clientonly && use director; then
411 + einfo
412 + einfo "If this is a new install, you must create the database:"
413 + einfo
414 + einfo " su postgres -c '/usr/libexec/bareos/create_bareos_database postgresql'"
415 + einfo " su postgres -c '/usr/libexec/bareos/make_bareos_tables postgresql'"
416 + einfo " su postgres -c '/usr/libexec/bareos/grant_bareos_privileges postgresql'"
417 + einfo
418 + fi
419 +}