Gentoo Archives: gentoo-commits

From: Marek Szuba <marecki@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-backup/borgmatic/files/, app-backup/borgmatic/
Date: Sun, 29 Mar 2020 21:46:02
Message-Id: 1585517954.4961db15c6560f10fa685ccd9e19d83b3ed883c1.marecki@gentoo
1 commit: 4961db15c6560f10fa685ccd9e19d83b3ed883c1
2 Author: Marek Szuba <marecki <AT> gentoo <DOT> org>
3 AuthorDate: Sun Mar 29 20:46:53 2020 +0000
4 Commit: Marek Szuba <marecki <AT> gentoo <DOT> org>
5 CommitDate: Sun Mar 29 21:39:14 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4961db15
7
8 app-backup/borgmatic: install systemd units
9
10 Signed-off-by: Marek Szuba <marecki <AT> gentoo.org>
11
12 app-backup/borgmatic/borgmatic-1.5.1-r1.ebuild | 65 ++++++++++++++++++++++
13 .../borgmatic-1.5.1-systemd_service_bin_path.patch | 8 +++
14 2 files changed, 73 insertions(+)
15
16 diff --git a/app-backup/borgmatic/borgmatic-1.5.1-r1.ebuild b/app-backup/borgmatic/borgmatic-1.5.1-r1.ebuild
17 new file mode 100644
18 index 00000000000..d5b11aab9bb
19 --- /dev/null
20 +++ b/app-backup/borgmatic/borgmatic-1.5.1-r1.ebuild
21 @@ -0,0 +1,65 @@
22 +# Copyright 1999-2020 Gentoo Authors
23 +# Distributed under the terms of the GNU General Public License v2
24 +
25 +EAPI=7
26 +
27 +PYTHON_COMPAT=( python3_{6,7} )
28 +
29 +DISTUTILS_USE_SETUPTOOLS="rdepend"
30 +inherit distutils-r1 systemd
31 +
32 +DESCRIPTION="Automatically create, prune and verify backups with borgbackup"
33 +HOMEPAGE="https://torsion.org/borgmatic/"
34 +SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
35 +
36 +LICENSE="GPL-3"
37 +SLOT="0"
38 +KEYWORDS="~amd64"
39 +
40 +DEPEND="${PYTHON_DEPS}
41 + dev-python/colorama[${PYTHON_USEDEP}]
42 + >=dev-python/pykwalify-1.6.0[${PYTHON_USEDEP}]
43 + dev-python/requests[${PYTHON_USEDEP}]
44 + <dev-python/ruamel-yaml-0.17.0"[${PYTHON_USEDEP}]
45 +RDEPEND="${DEPEND}
46 + app-backup/borgbackup"
47 +BDEPEND="test? (
48 + ${DEPEND}
49 + dev-python/flexmock[${PYTHON_USEDEP}]
50 + )"
51 +
52 +PATCHES=(
53 + "${FILESDIR}"/${PN}-1.5.1-systemd_service_bin_path.patch
54 + "${FILESDIR}"/${PN}-1.5.1-no_test_coverage.patch
55 +)
56 +
57 +distutils_enable_tests pytest
58 +
59 +src_prepare() {
60 + distutils-r1_src_prepare
61 +
62 + # Unlike the other two test files in integration/commands, which use the
63 + # relevant modules' respective APIs, test_borgmatic.py tries to call the
64 + # 'borgmatic' executable - which has not even been created by now.
65 + # Seeing as the only test run from this file as of 2020-03-25 is the
66 + # parsing of contents of 'borgmatic --version', just skip it for now.
67 + rm -f "${S}"/tests/integration/commands/test_borgmatic.py
68 +}
69 +
70 +src_install() {
71 + distutils-r1_src_install
72 + systemd_dounit sample/systemd/borgmatic.{service,timer}
73 + keepdir /etc/borgmatic
74 +}
75 +
76 +pkg_postinst() {
77 + if [[ -z "${REPLACING_VERSIONS}" ]]; then
78 + elog "To generate a sample configuration file, run:"
79 + elog " generate-borgmatic-config"
80 + else
81 + elog "To upgrade your configuration file to the current version, run:"
82 + elog " upgrade-borgmatic-config"
83 + fi
84 + elog
85 + elog "Systemd users wishing to periodically run borgmatic can use the provided timer and service units."
86 +}
87
88 diff --git a/app-backup/borgmatic/files/borgmatic-1.5.1-systemd_service_bin_path.patch b/app-backup/borgmatic/files/borgmatic-1.5.1-systemd_service_bin_path.patch
89 new file mode 100644
90 index 00000000000..90e94ac1f55
91 --- /dev/null
92 +++ b/app-backup/borgmatic/files/borgmatic-1.5.1-systemd_service_bin_path.patch
93 @@ -0,0 +1,8 @@
94 +--- a/sample/systemd/borgmatic.service
95 ++++ b/sample/systemd/borgmatic.service
96 +@@ -21,4 +21,4 @@
97 +
98 + # Delay start to prevent backups running during boot.
99 + ExecStartPre=sleep 1m
100 +-ExecStart=systemd-inhibit --who="borgmatic" --why="Prevent interrupting scheduled backup" /root/.local/bin/borgmatic --syslog-verbosity 1
101 ++ExecStart=systemd-inhibit --who="borgmatic" --why="Prevent interrupting scheduled backup" /usr/bin/borgmatic --syslog-verbosity 1