This commit is contained in:
imax-ua
2024-06-26 22:12:16 +00:00
parent 037e23eb86
commit 051433c7af
5 changed files with 248 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
AUX cron-confd.patch 916 BLAKE2B 52672e59ebbfde9dd120516d9c0fb80443b8bfe38d08ec943956005a3d07aa1ed3e9273c572730722a02d3b841859dbc8d3fa81e89e87d6958251abec016716c SHA512 7f0872b14f1fa6b3c7990a9b219a0b2c0b941b1376fb89eda6e4fdf4b3b37818d0114febdb21d2432f5b1c08f1ba4354936d556c1c26953a0fe0f3196d699aa7
AUX snapper-0.10.1-testsuite.patch 2525 BLAKE2B 0ece146356113d456ef0a56e46e76eae1f9509e3b454459499fa457119c75a9e5fecb85d5530caaab340cea7f4deba0f155ac9e31706ab3899372c45e381cf77 SHA512 e0e1a4ed7c9ef069bc0bc5449f784c2deda1ce6851e98ca6d04c03988361f00e06b6a4f347671ee905f496dba19f8dffa64e5bdcba89f547292fc9c8d276ecd7
DIST snapper-0.10.6.tar.gz 423867 BLAKE2B a7d0f8c62c60c0d03bf108a8c0692dd209f170cf8227512cbc3b80eb9f58ecca845aa585859032bc6582d67e4c6ff15b75443a9ee9291d1b970efec15513571f SHA512 6eedfb9408260331f042f0a429a1104136cb88dac450f320641b0941cd06faf52f67cad2397cf4122f919876bb994455da0cfd3bb099f82217050e07b4c77d2e
EBUILD snapper-0.10.6.ebuild 2069 BLAKE2B 315a3e32d1ea1289588180d9f2955a6d2e11f136e4344ee4a5af9e6e5f1739b08dac52fc1a715370e08c6dd7069a43e694060b4e6bcace2cc5c40960025903af SHA512 ec2d6e295ab28c1964c30e958dae8ec726175196c99c867d19439d970772a04cdbcfc3dbbc815331f641bb698d9899c3e8d9b435d49f3504390b6cf38dbc044b
MISC metadata.xml 1331 BLAKE2B 891a27fbae2ed364a26952def66b3e9e62be7025580d7b89f559f284888efed53476f4a8f5bcd7209c3c4de8494913a05354059004ef6c3aa6c1829a3e093efb SHA512 add8dffdf453f079d09f06608cae732ce61e04a5fac1988afb0733c8d60a943efe054a4973e54ca1cf304ad3d3778fd8aa6b01fc16815a1f42f83048d58adb63

View File

@@ -0,0 +1,32 @@
diff -u old/scripts/snapper-daily new/scripts/snapper-daily
--- old/scripts/snapper-daily 2014-01-29 17:48:30.000000000 +0200
+++ new/scripts/snapper-daily 2014-02-19 13:32:22.702734875 +0200
@@ -9,10 +9,10 @@
#
-# get information from /etc/sysconfig/snapper
+# get information from /etc/conf.d/snapper
#
-if [ -f /etc/sysconfig/snapper ] ; then
- . /etc/sysconfig/snapper
+if [ -f /etc/conf.d/snapper ] ; then
+ . /etc/conf.d/snapper
fi
diff -u old/scripts/snapper-hourly new/scripts/snapper-hourly
--- old/scripts/snapper-hourly 2014-01-29 17:48:30.000000000 +0200
+++ new/scripts/snapper-hourly 2014-02-19 13:32:43.609166927 +0200
@@ -9,10 +9,10 @@
#
-# get information from /etc/sysconfig/snapper
+# get information from /etc/conf.d/snapper
#
-if [ -f /etc/sysconfig/snapper ] ; then
- . /etc/sysconfig/snapper
+if [ -f /etc/conf.d/snapper ] ; then
+ . /etc/conf.d/snapper
fi

View File

@@ -0,0 +1,84 @@
diff --git a/configure.ac b/configure.ac
index 39def82..9b96a32 100644
--- a/configure.ac
+++ b/configure.ac
@@ -174,6 +174,13 @@ if test "x$enable_coverage" = "xyes"; then
LDFLAGS="${LDFLAGS} --coverage"
fi
+AC_ARG_ENABLE([tests], AC_HELP_STRING([--disable-tests],[Disable internal tests support]),
+ [with_tests=$enableval],[with_tests=yes])
+AM_CONDITIONAL(ENABLE_TESTS, [test "x$with_tests" = "xyes"])
+if test "x$with_tests" = "xyes"; then
+ AC_DEFINE(ENABLE_TESTS, 1, [Enable internal tests support])
+fi
+
PKG_CHECK_MODULES(DBUS, dbus-1)
PKG_CHECK_MODULES(XML2, libxml-2.0)
PKG_CHECK_MODULES(JSONC, json-c, [], [AC_MSG_WARN([Cannot find json-c. Please install libjson-c-devel])])
diff --git a/testsuite-cmp/Makefile.am b/testsuite-cmp/Makefile.am
index 81104bf..9c29477 100644
--- a/testsuite-cmp/Makefile.am
+++ b/testsuite-cmp/Makefile.am
@@ -2,6 +2,7 @@
# Makefile.am for snapper/testsuite-cmp
#
+if ENABLE_TESTS
AM_CPPFLAGS = -I$(top_srcdir)
AM_LDFLAGS = -lboost_system
@@ -15,3 +16,4 @@ cmp_SOURCES = cmp.cc
EXTRA_DIST = $(noinst_SCRIPTS)
+endif
diff --git a/testsuite-real/Makefile.am b/testsuite-real/Makefile.am
index a3bb2e3..c4e88f4 100644
--- a/testsuite-real/Makefile.am
+++ b/testsuite-real/Makefile.am
@@ -2,6 +2,7 @@
# Makefile.am for snapper/testsuite-real
#
+if ENABLE_TESTS
CXXFLAGS += -std=gnu++11
AM_CPPFLAGS = -I$(top_srcdir)
@@ -56,3 +57,4 @@ ascii_file_SOURCES = ascii-file.cc
EXTRA_DIST = $(test_DATA) $(test_SCRIPTS)
+endif
diff --git a/testsuite/Makefile.am b/testsuite/Makefile.am
index ccb84d3..409e265 100644
--- a/testsuite/Makefile.am
+++ b/testsuite/Makefile.am
@@ -2,6 +2,7 @@
# Makefile.am for snapper/testsuite
#
+if ENABLE_TESTS
AM_CPPFLAGS = -I$(top_srcdir) $(DBUS_CFLAGS)
LDADD = ../snapper/libsnapper.la ../dbus/libdbus.la -lboost_unit_test_framework
@@ -48,3 +49,4 @@ lvm_utils_test_LDADD = -lboost_unit_test_framework ../snapper/libsnapper.la
range_test_LDADD = -lboost_unit_test_framework ../client/utils/libutils.la
limit_test_LDADD = -lboost_unit_test_framework ../client/utils/libutils.la
+endif
diff --git a/zypp-plugin/testsuite/Makefile.am b/zypp-plugin/testsuite/Makefile.am
index 7b52e13..71cb545 100644
--- a/zypp-plugin/testsuite/Makefile.am
+++ b/zypp-plugin/testsuite/Makefile.am
@@ -1,3 +1,5 @@
+
+if ENABLE_TESTS
if HAVE_ZYPP
TEST_LOG_DRIVER = $(SHELL) tap-driver.sh
@@ -12,3 +14,4 @@ TESTS = $(check_SCRIPTS)
EXTRA_DIST = $(check_SCRIPTS) $(noinst_SCRIPTS) $(noinst_DATA) tap-driver.sh
endif
+endif

View File

@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<longdescription>
Snapper is a command-line program for filesystem snapshot management.
It can create, delete and compare snapshots and undo changes done
between snapshots. It supports both btrfs and ext4.
</longdescription>
<maintainer type="person" proxied="yes">
<email>pastas4@gmail.com</email>
<name>Dainius Masiliūnas (GreatEmerald)</name>
</maintainer>
<maintainer type="person">
<email>dlan@gentoo.org</email>
<name>Yixun Lan</name>
</maintainer>
<maintainer type="project" proxied="proxy">
<email>proxy-maint@gentoo.org</email>
<name>Proxy Maintainers</name>
</maintainer>
<upstream>
<maintainer status="active">
<email>aschnell@suse.de</email>
<name>Arvin Schnell</name>
</maintainer>
<changelog>https://raw.github.com/openSUSE/snapper/master/package/snapper.changes</changelog>
<bugs-to>https://bugzilla.novell.com/</bugs-to>
<remote-id type="github">openSUSE/snapper</remote-id>
</upstream>
<use>
<flag name="xattr">
Add support for getting and setting POSIX extended attributes, through
<pkg>sys-apps/attr</pkg>.
</flag>
<flag name="lvm">Enable LVM thinprovisioned snapshots support <pkg>sys-fs/lvm2</pkg></flag>
</use>
</pkgmetadata>

View File

@@ -0,0 +1,90 @@
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit autotools systemd
DESCRIPTION="Command-line program for btrfs and lvm snapshot management"
HOMEPAGE="http://snapper.io/"
SRC_URI="https://github.com/openSUSE/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="amd64 ~arm64 ~riscv x86"
IUSE="lvm btrfs pam test systemd xattr"
RESTRICT="test"
BDEPEND="app-text/docbook-xsl-stylesheets
dev-libs/libxslt
sys-devel/gettext
virtual/pkgconfig"
RDEPEND="dev-libs/boost:=
dev-libs/json-c:=
dev-libs/libxml2
dev-libs/icu:=
sys-apps/acl
sys-apps/dbus
sys-apps/util-linux
btrfs? ( >=sys-fs/btrfs-progs-3.17.1 )
sys-libs/zlib
virtual/libintl
lvm? ( sys-fs/lvm2 )
pam? ( sys-libs/pam )
xattr? ( sys-apps/attr )"
DEPEND="${RDEPEND}"
PATCHES=(
"${FILESDIR}"/cron-confd.patch
"${FILESDIR}"/${PN}-0.10.1-testsuite.patch
)
src_prepare() {
default
sed -e "s,/usr/lib/systemd/system,$(systemd_get_systemunitdir),g" \
-i data/Makefile.* \
|| die "Failed to fix systemd services and timers installation path"
eautoreconf
}
src_configure() {
# ext4 code does not work anymore
# snapper does not build without btrfs
local myeconfargs=(
--disable-silent-rules
--with-conf="/etc/conf.d"
--enable-zypp
--enable-rollback
--enable-btrfs-quota
--disable-ext4
$(use_enable btrfs)
--enable-doc
$(use_enable lvm)
$(use_enable pam)
$(use_enable test tests)
$(use_enable systemd)
$(use_enable xattr xattrs)
)
econf "${myeconfargs[@]}"
}
src_install() {
default
# Existing configuration file required to function
keepdir /etc/snapper/configs
newconfd data/sysconfig.snapper snapper
find "${D}" -name '*.la' -delete || die
}
pkg_postinst() {
elog "In order to use Snapper, you need to set up"
elog "at least one config first. To do this, run:"
elog "snapper create-config <subvolume>"
elog "For more information, see man (8) snapper or"
elog "http://snapper.io/documentation.html and"
elog "https://wiki.gentoo.org/wiki/Snapper"
}