[packages/snapper] - new

baggins baggins at pld-linux.org
Mon Mar 15 22:06:43 CET 2021


commit 6cbe1c6956256d272ee214b029f76121f2a1eff8
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Mon Mar 15 22:06:22 2021 +0100

    - new

 json-c.patch               |  13 ++++
 remove-ext4-info-xml.patch |  24 +++++++
 snapper.spec               | 152 +++++++++++++++++++++++++++++++++++++++++++++
 systemd-install.patch      |  23 +++++++
 4 files changed, 212 insertions(+)
---
diff --git a/snapper.spec b/snapper.spec
new file mode 100644
index 0000000..81b4c11
--- /dev/null
+++ b/snapper.spec
@@ -0,0 +1,152 @@
+Summary:	Tool for filesystem snapshot management
+Name:		snapper
+Version:	0.8.15
+Release:	1
+License:	GPL v2
+Source0:	https://github.com/openSUSE/snapper/archive/v%{version}/%{name}-%{version}.tar.gz
+# Source0-md5:	df0e34b092bde0d8447360adc7bffb3a
+URL:		http://snapper.io
+Patch0:		remove-ext4-info-xml.patch
+Patch1:		json-c.patch
+Patch2:		systemd-install.patch
+BuildRequires:	acl-devel
+BuildRequires:	autoconf
+BuildRequires:	automake
+BuildRequires:	boost-devel
+BuildRequires:	btrfs-progs-devel
+BuildRequires:	dbus-devel
+BuildRequires:	docbook-style-xsl
+BuildRequires:	gettext
+BuildRequires:	json-c-devel
+BuildRequires:	libmount-devel
+BuildRequires:	libselinux-devel
+BuildRequires:	libtool
+BuildRequires:	libxml2-devel
+BuildRequires:	libxslt-progs
+BuildRequires:	pam-devel
+BuildRequires:	systemd-devel
+Requires:	%{name}-libs = %{version}-%{release}
+Requires:	diffutils
+BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+This package contains snapper, a tool for filesystem snapshot
+management.
+
+%package libs
+Summary:	Library for filesystem snapshot management
+Requires:	btrfs-progs
+Requires:	util-linux
+
+%description libs
+This package contains the snapper shared library for filesystem
+snapshot management.
+
+%package devel
+Summary:	Header files and development libraries for %{name}-libs
+Requires:	%{name}-libs = %{version}-%{release}
+Requires:	acl-devel
+Requires:	boost-devel
+Requires:	btrfs-progs-devel
+Requires:	libmount-devel
+Requires:	libstdc++-devel
+Requires:	libxml2-devel
+
+%description devel
+This package contains header files and documentation for developing
+with snapper.
+
+%package -n pam_snapper
+Summary:	PAM module for calling snapper
+Requires:	%{name} = %{version}-%{release}
+
+%description -n pam_snapper
+A PAM module for calling snapper during user login and logout.
+
+%prep
+%setup -q
+%patch0 -p1
+%patch1 -p1
+%patch2 -p1
+
+# use libexecdir
+find -type f -exec sed -i -e "s|/usr/lib/snapper|%{_libexecdir}/%{name}|g" {} ';'
+
+%build
+%{__libtoolize}
+%{__aclocal}
+%{__autoconf}
+%{__autoheader}
+%{__automake}
+%configure \
+	--disable-ext4 \
+	--disable-zypp \
+	--enable-selinux
+
+%{__make} V=1
+
+%install
+rm -rf $RPM_BUILD_ROOT
+install -d $RPM_BUILD_ROOT{%{_sysconfdir}/sysconfig,%{_examplesdir}/%{name}-%{version}}
+
+%{__make} install \
+	DESTDIR=$RPM_BUILD_ROOT
+
+cp -p data/sysconfig.snapper $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/%{name}
+cp -p examples/c/*.c examples/c++-lib/*.cc $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
+
+%{__rm} $RPM_BUILD_ROOT{%{_libdir}/*.la,/%{_lib}/security/*.la}
+%{__rm} -r $RPM_BUILD_ROOT%{_sysconfdir}/cron.*
+%{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name}
+# Testsuite here only
+%{__rm} -r $RPM_BUILD_ROOT%{_libdir}/snapper
+
+%find_lang %{name}
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files -f snapper.lang
+%defattr(644,root,root,755)
+%doc AUTHORS
+%attr(755,root,root) %{_bindir}/snapper
+%attr(755,root,root) %{_sbindir}/mksubvolume
+%attr(755,root,root) %{_sbindir}/snapperd
+%config(noreplace) /etc/logrotate.d/snapper
+%config(noreplace) /etc/dbus-1/system.d/org.opensuse.Snapper.conf
+%{_datadir}/dbus-1/system-services/org.opensuse.Snapper.service
+%dir %{_libexecdir}/%{name}
+%{_libexecdir}/%{name}/installation-helper
+%{_libexecdir}/%{name}/systemd-helper
+%{systemdunitdir}/%{name}-*.timer
+%{systemdunitdir}/%{name}-*.service
+%{systemdunitdir}/snapperd.service
+%{_mandir}/man5/snapper-configs.5*
+%{_mandir}/man8/%{name}.8*
+%{_mandir}/man8/mksubvolume.8*
+%{_mandir}/man8/snapperd.8*
+
+%files libs
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/libsnapper.so.*.*.*
+%ghost %{_libdir}/libsnapper.so.5
+%dir %{_sysconfdir}/%{name}
+%dir %{_sysconfdir}/%{name}/configs
+%dir %{_sysconfdir}/%{name}/config-templates
+%config(noreplace) %{_sysconfdir}/%{name}/config-templates/default
+%dir %{_sysconfdir}/%{name}/filters
+%config(noreplace) %{_sysconfdir}/%{name}/filters/*.txt
+%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
+
+%files devel
+%defattr(644,root,root,755)
+%{_libdir}/libsnapper.so
+%{_includedir}/%{name}
+%{_examplesdir}/%{name}-%{version}
+
+%files -n pam-pam_snapper
+%defattr(644,root,root,755)
+%attr(755,root,root) /%{_lib}/security/pam_snapper.so
+%dir %{_prefix}/lib/pam_snapper
+%attr(755,root,root) %{_prefix}/lib/pam_snapper/*.sh
+%{_mandir}/man8/pam_snapper.8*
diff --git a/json-c.patch b/json-c.patch
new file mode 100644
index 0000000..0b6fefb
--- /dev/null
+++ b/json-c.patch
@@ -0,0 +1,13 @@
+--- snapper-0.8.15/configure.ac~	2021-03-15 21:29:58.000000000 +0100
++++ snapper-0.8.15/configure.ac	2021-03-15 21:33:42.630871897 +0100
+@@ -194,9 +194,7 @@
+ 
+ PKG_CHECK_MODULES(DBUS, dbus-1)
+ PKG_CHECK_MODULES(XML2, libxml-2.0)
+-if test "x$with_zypp" = "xyes"; then
+-   PKG_CHECK_MODULES(JSONC, json-c, [], [AC_MSG_WARN([Cannot find json-c. Please install libjson-c-devel])])
+-fi
++PKG_CHECK_MODULES(JSONC, json-c, [], [AC_MSG_WARN([Cannot find json-c. Please install libjson-c-devel])])
+ 
+ AC_CHECK_HEADER(acl/libacl.h,[],[AC_MSG_ERROR([Cannout find libacl headers. Please install libacl-devel])])
+ 
diff --git a/remove-ext4-info-xml.patch b/remove-ext4-info-xml.patch
new file mode 100644
index 0000000..9587abc
--- /dev/null
+++ b/remove-ext4-info-xml.patch
@@ -0,0 +1,24 @@
+--- snapper-0.8.15/doc/snapper.xml.in~	2020-12-17 13:43:33.000000000 +0100
++++ snapper-0.8.15/doc/snapper.xml.in	2021-03-15 21:22:46.488538426 +0100
+@@ -39,9 +39,7 @@
+ 
+     <para>Snapper never modifies the content of snapshots. Thus snapper creates
+     read-only snapshots if supported by the kernel. Supported filesystems are
+-    btrfs and ext4 (discontinued) as well as snapshots of LVM logical volumes with
+-    thin-provisioning. Some filesystems might not be supported depending on your
+-    installation.</para>
++    btrfs as well as snapshots of LVM logical volumes with thin-provisioning.</para>
+   </refsect1>
+ 
+   <refsect1 id='concepts'>
+@@ -342,8 +340,8 @@
+ 	    <varlistentry>
+ 	      <term><option>-f, --fstype</option> <replaceable>fstype</replaceable></term>
+ 	      <listitem>
+-		<para>Manually set filesystem type. Supported values are btrfs, ext4
+-		(discontinued) and lvm. For lvm, snapper uses LVM thin-provisioned snapshots.
++		<para>Manually set filesystem type. Supported values are btrfs and lvm.
++		For lvm, snapper uses LVM thin-provisioned snapshots.
+ 		The filesystem type on top of LVM must be provided in parentheses,
+ 		e.g. lvm(xfs).</para>
+ 		<para>Without this option snapper tries to detect the filesystem.</para>
diff --git a/systemd-install.patch b/systemd-install.patch
new file mode 100644
index 0000000..b64203c
--- /dev/null
+++ b/systemd-install.patch
@@ -0,0 +1,23 @@
+--- snapper-0.8.15/data/Makefile.am~	2021-03-15 21:35:19.000000000 +0100
++++ snapper-0.8.15/data/Makefile.am	2021-03-15 21:38:52.026915450 +0100
+@@ -22,13 +22,13 @@
+ 	install -D -m 644 org.opensuse.Snapper.service $(DESTDIR)/usr/share/dbus-1/system-services/org.opensuse.Snapper.service
+ 
+ if ENABLE_SYSTEMD
+-	install -D -m 644 timeline.service $(DESTDIR)/usr/lib/systemd/system/snapper-timeline.service
+-	install -D -m 644 timeline.timer $(DESTDIR)/usr/lib/systemd/system/snapper-timeline.timer
+-	install -D -m 644 cleanup.service $(DESTDIR)/usr/lib/systemd/system/snapper-cleanup.service
+-	install -D -m 644 cleanup.timer $(DESTDIR)/usr/lib/systemd/system/snapper-cleanup.timer
+-	install -D -m 644 boot.service $(DESTDIR)/usr/lib/systemd/system/snapper-boot.service
+-	install -D -m 644 boot.timer $(DESTDIR)/usr/lib/systemd/system/snapper-boot.timer
+-	install -D -m 644 snapperd.service $(DESTDIR)/usr/lib/systemd/system/snapperd.service
++	install -D -m 644 timeline.service $(DESTDIR)/lib/systemd/system/snapper-timeline.service
++	install -D -m 644 timeline.timer $(DESTDIR)/lib/systemd/system/snapper-timeline.timer
++	install -D -m 644 cleanup.service $(DESTDIR)/lib/systemd/system/snapper-cleanup.service
++	install -D -m 644 cleanup.timer $(DESTDIR)/lib/systemd/system/snapper-cleanup.timer
++	install -D -m 644 boot.service $(DESTDIR)/lib/systemd/system/snapper-boot.service
++	install -D -m 644 boot.timer $(DESTDIR)/lib/systemd/system/snapper-boot.timer
++	install -D -m 644 snapperd.service $(DESTDIR)/lib/systemd/system/snapperd.service
+ endif
+ 
+ if HAVE_ZYPP
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/snapper.git/commitdiff/6cbe1c6956256d272ee214b029f76121f2a1eff8



More information about the pld-cvs-commit mailing list