Gentoo Archives: gentoo-commits

From: Yixun Lan <dlan@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-backup/snapper/, app-backup/snapper/files/
Date: Tue, 26 Apr 2022 08:46:33
Message-Id: 1650962500.7f5469d0475d8a655cc380d78731a59fa4d5e1e2.dlan@gentoo
1 commit: 7f5469d0475d8a655cc380d78731a59fa4d5e1e2
2 Author: Yixun Lan <dlan <AT> gentoo <DOT> org>
3 AuthorDate: Tue Apr 26 08:34:53 2022 +0000
4 Commit: Yixun Lan <dlan <AT> gentoo <DOT> org>
5 CommitDate: Tue Apr 26 08:41:40 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7f5469d0
7
8 app-backup/snapper: add 0.10.1
9
10 Signed-off-by: Yixun Lan <dlan <AT> gentoo.org>
11
12 app-backup/snapper/Manifest | 1 +
13 .../snapper/files/snapper-0.10.1-testsuite.patch | 84 +++++++++++++++++++++
14 app-backup/snapper/snapper-0.10.1.ebuild | 88 ++++++++++++++++++++++
15 3 files changed, 173 insertions(+)
16
17 diff --git a/app-backup/snapper/Manifest b/app-backup/snapper/Manifest
18 index 5ba939cd025f..901f27a4c64b 100644
19 --- a/app-backup/snapper/Manifest
20 +++ b/app-backup/snapper/Manifest
21 @@ -1,2 +1,3 @@
22 DIST snapper-0.10.0.tar.gz 404564 BLAKE2B 2dd3f889cf445e06975b5a6f1088d07445510c6905dacecd5b75c0b92c155d399b9b6ed07e466303e4ea3e4b3e6aa72f57b9a34fc2b3aa97c328d886732a375c SHA512 eb0b8568f90907a84dd6f6e135f26cddbafbb8a420f2e4c3ad657d4d782ff35517da93c375d9796dbac1a03983e8b88084280347b51eadf869294dcc080dbfeb
23 +DIST snapper-0.10.1.tar.gz 407628 BLAKE2B 84b4c027762a11cbf5f49af3e94bc0e494e83e61aa35c3873d0ab98b0c232897b6d002ef28181ad3b2567cc88b84424f570e7b24278c546fb39452e399ad7333 SHA512 39f4d95e98b736510b6bea56eebc8275618a0ad3221d7fae9cd0f46f8a4af574700a6123a438918d522d65758ad50020f80c925395ae3ab84b7ad3eb924592c0
24 DIST snapper-0.9.1.tar.gz 400387 BLAKE2B fe9d25f573dc99e0eb6c876fa2ebb34140ea8177c72a65af65bd4b6621b81bcab71ee03948696d311444cad4c69d21db70161f67ef3917aea93e39ad54b10444 SHA512 447a024570bbb834adfc789aa5b12b037838fcf50f8d26f87a9a10b250541a589be3b24b01f990625021b8ff5b2eade0f2eda5e992f76113c62bd5e8a27c1293
25
26 diff --git a/app-backup/snapper/files/snapper-0.10.1-testsuite.patch b/app-backup/snapper/files/snapper-0.10.1-testsuite.patch
27 new file mode 100644
28 index 000000000000..84ff2ce1978a
29 --- /dev/null
30 +++ b/app-backup/snapper/files/snapper-0.10.1-testsuite.patch
31 @@ -0,0 +1,84 @@
32 +diff --git a/configure.ac b/configure.ac
33 +index 39def82..9b96a32 100644
34 +--- a/configure.ac
35 ++++ b/configure.ac
36 +@@ -174,6 +174,13 @@ if test "x$enable_coverage" = "xyes"; then
37 + LDFLAGS="${LDFLAGS} --coverage"
38 + fi
39 +
40 ++AC_ARG_ENABLE([tests], AC_HELP_STRING([--disable-tests],[Disable internal tests support]),
41 ++ [with_tests=$enableval],[with_tests=yes])
42 ++AM_CONDITIONAL(ENABLE_TESTS, [test "x$with_tests" = "xyes"])
43 ++if test "x$with_tests" = "xyes"; then
44 ++ AC_DEFINE(ENABLE_TESTS, 1, [Enable internal tests support])
45 ++fi
46 ++
47 + PKG_CHECK_MODULES(DBUS, dbus-1)
48 + PKG_CHECK_MODULES(XML2, libxml-2.0)
49 + PKG_CHECK_MODULES(JSONC, json-c, [], [AC_MSG_WARN([Cannot find json-c. Please install libjson-c-devel])])
50 +diff --git a/testsuite-cmp/Makefile.am b/testsuite-cmp/Makefile.am
51 +index 81104bf..9c29477 100644
52 +--- a/testsuite-cmp/Makefile.am
53 ++++ b/testsuite-cmp/Makefile.am
54 +@@ -2,6 +2,7 @@
55 + # Makefile.am for snapper/testsuite-cmp
56 + #
57 +
58 ++if ENABLE_TESTS
59 + AM_CPPFLAGS = -I$(top_srcdir)
60 + AM_LDFLAGS = -lboost_system
61 +
62 +@@ -15,3 +16,4 @@ cmp_SOURCES = cmp.cc
63 +
64 + EXTRA_DIST = $(noinst_SCRIPTS)
65 +
66 ++endif
67 +diff --git a/testsuite-real/Makefile.am b/testsuite-real/Makefile.am
68 +index a3bb2e3..c4e88f4 100644
69 +--- a/testsuite-real/Makefile.am
70 ++++ b/testsuite-real/Makefile.am
71 +@@ -2,6 +2,7 @@
72 + # Makefile.am for snapper/testsuite-real
73 + #
74 +
75 ++if ENABLE_TESTS
76 + CXXFLAGS += -std=gnu++11
77 +
78 + AM_CPPFLAGS = -I$(top_srcdir)
79 +@@ -56,3 +57,4 @@ ascii_file_SOURCES = ascii-file.cc
80 +
81 + EXTRA_DIST = $(test_DATA) $(test_SCRIPTS)
82 +
83 ++endif
84 +diff --git a/testsuite/Makefile.am b/testsuite/Makefile.am
85 +index ccb84d3..409e265 100644
86 +--- a/testsuite/Makefile.am
87 ++++ b/testsuite/Makefile.am
88 +@@ -2,6 +2,7 @@
89 + # Makefile.am for snapper/testsuite
90 + #
91 +
92 ++if ENABLE_TESTS
93 + AM_CPPFLAGS = -I$(top_srcdir) $(DBUS_CFLAGS)
94 +
95 + LDADD = ../snapper/libsnapper.la ../dbus/libdbus.la -lboost_unit_test_framework
96 +@@ -48,3 +49,4 @@ lvm_utils_test_LDADD = -lboost_unit_test_framework ../snapper/libsnapper.la
97 + range_test_LDADD = -lboost_unit_test_framework ../client/utils/libutils.la
98 +
99 + limit_test_LDADD = -lboost_unit_test_framework ../client/utils/libutils.la
100 ++endif
101 +diff --git a/zypp-plugin/testsuite/Makefile.am b/zypp-plugin/testsuite/Makefile.am
102 +index 7b52e13..71cb545 100644
103 +--- a/zypp-plugin/testsuite/Makefile.am
104 ++++ b/zypp-plugin/testsuite/Makefile.am
105 +@@ -1,3 +1,5 @@
106 ++
107 ++if ENABLE_TESTS
108 + if HAVE_ZYPP
109 + TEST_LOG_DRIVER = $(SHELL) tap-driver.sh
110 +
111 +@@ -12,3 +14,4 @@ TESTS = $(check_SCRIPTS)
112 +
113 + EXTRA_DIST = $(check_SCRIPTS) $(noinst_SCRIPTS) $(noinst_DATA) tap-driver.sh
114 + endif
115 ++endif
116
117 diff --git a/app-backup/snapper/snapper-0.10.1.ebuild b/app-backup/snapper/snapper-0.10.1.ebuild
118 new file mode 100644
119 index 000000000000..11fe4ff862dd
120 --- /dev/null
121 +++ b/app-backup/snapper/snapper-0.10.1.ebuild
122 @@ -0,0 +1,88 @@
123 +# Copyright 1999-2022 Gentoo Authors
124 +# Distributed under the terms of the GNU General Public License v2
125 +
126 +EAPI=8
127 +
128 +inherit autotools systemd
129 +
130 +DESCRIPTION="Command-line program for btrfs and lvm snapshot management"
131 +HOMEPAGE="http://snapper.io/"
132 +SRC_URI="https://github.com/openSUSE/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
133 +
134 +LICENSE="GPL-2"
135 +SLOT="0"
136 +KEYWORDS="~amd64 ~arm64 ~riscv ~x86"
137 +IUSE="doc lvm pam test systemd xattr"
138 +RESTRICT="test"
139 +
140 +RDEPEND="dev-libs/boost:=[threads(+)]
141 + dev-libs/json-c:=
142 + dev-libs/libxml2
143 + dev-libs/icu:=
144 + sys-apps/acl
145 + sys-apps/dbus
146 + sys-apps/util-linux
147 + >=sys-fs/btrfs-progs-3.17.1
148 + sys-libs/zlib
149 + virtual/libintl
150 + lvm? ( sys-fs/lvm2 )
151 + pam? ( sys-libs/pam )
152 + xattr? ( sys-apps/attr )"
153 +
154 +DEPEND="${RDEPEND}
155 + app-text/docbook-xsl-stylesheets
156 + dev-libs/libxslt
157 + sys-devel/gettext
158 + virtual/pkgconfig"
159 +
160 +PATCHES=(
161 + "${FILESDIR}"/cron-confd.patch
162 + "${FILESDIR}"/${P}-testsuite.patch
163 +)
164 +
165 +src_prepare() {
166 + default
167 +
168 + sed -e "s,/usr/lib/systemd/system,$(systemd_get_systemunitdir),g" \
169 + -i data/Makefile.* \
170 + || die "Failed to fix systemd services and timers installation path"
171 + eautoreconf
172 +}
173 +
174 +src_configure() {
175 + # ext4 code does not work anymore
176 + # snapper does not build without btrfs
177 + local myeconfargs=(
178 + --disable-silent-rules
179 + --with-conf="/etc/conf.d"
180 + --enable-zypp
181 + --enable-rollback
182 + --enable-btrfs-quota
183 + --disable-ext4
184 + --enable-btrfs
185 + $(use_enable doc)
186 + $(use_enable lvm)
187 + $(use_enable pam)
188 + $(use_enable test tests)
189 + $(use_enable systemd)
190 + $(use_enable xattr xattrs)
191 + )
192 +
193 + econf "${myeconfargs[@]}"
194 +}
195 +
196 +src_install() {
197 + default
198 + # Existing configuration file required to function
199 + keepdir /etc/snapper/configs
200 + newconfd data/sysconfig.snapper snapper
201 + find "${D}" -name '*.la' -delete || die
202 +}
203 +
204 +pkg_postinst() {
205 + elog "In order to use Snapper, you need to set up"
206 + elog "at least one config first. To do this, run:"
207 + elog "snapper create-config <subvolume>"
208 + elog "For more information, see man (8) snapper or"
209 + elog "http://snapper.io/documentation.html"
210 +}