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