2011-05-12 11:10:13 +02:00
|
|
|
#
|
2011-09-05 17:15:50 +02:00
|
|
|
# spec file for package snapper
|
2011-05-12 11:10:13 +02:00
|
|
|
#
|
2020-01-03 17:01:41 +01:00
|
|
|
# Copyright (c) 2020 SUSE LINUX GmbH, Nuernberg, Germany.
|
2011-09-05 17:15:50 +02:00
|
|
|
#
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
|
|
|
#
|
|
|
|
|
2018-12-04 15:53:46 +01:00
|
|
|
|
2017-12-07 13:50:03 +01:00
|
|
|
#Compat macro for new _fillupdir macro introduced in Nov 2017
|
|
|
|
%if ! %{defined _fillupdir}
|
|
|
|
%define _fillupdir /var/adm/fillup-templates
|
|
|
|
%endif
|
|
|
|
|
2020-01-28 10:31:35 +01:00
|
|
|
# optionally build with test coverage reporting
|
|
|
|
%bcond_with coverage
|
|
|
|
|
2011-09-05 17:15:50 +02:00
|
|
|
Name: snapper
|
2020-06-18 12:07:57 +02:00
|
|
|
Version: 0.8.10
|
2011-09-19 18:04:43 +02:00
|
|
|
Release: 0
|
2011-09-05 17:15:50 +02:00
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
|
|
|
Source: snapper-%{version}.tar.bz2
|
2017-02-28 11:03:23 +01:00
|
|
|
%if 0%{?suse_version} > 1325
|
|
|
|
BuildRequires: libboost_system-devel
|
2018-11-22 12:17:41 +01:00
|
|
|
BuildRequires: libboost_test-devel
|
2018-12-04 15:53:46 +01:00
|
|
|
BuildRequires: libboost_thread-devel
|
2017-02-28 11:03:23 +01:00
|
|
|
%else
|
2012-06-13 22:46:23 +02:00
|
|
|
BuildRequires: boost-devel
|
2017-02-28 11:03:23 +01:00
|
|
|
%endif
|
2018-12-04 15:53:46 +01:00
|
|
|
BuildRequires: e2fsprogs-devel
|
2012-06-13 22:46:23 +02:00
|
|
|
BuildRequires: gcc-c++
|
2014-01-30 09:02:21 +01:00
|
|
|
BuildRequires: libacl-devel
|
2012-06-13 22:46:23 +02:00
|
|
|
BuildRequires: libtool
|
|
|
|
BuildRequires: libxml2-devel
|
2014-04-26 11:45:01 +02:00
|
|
|
%if 0%{?suse_version} > 1230
|
|
|
|
BuildRequires: libbtrfs-devel
|
|
|
|
%endif
|
|
|
|
%if 0%{?suse_version} > 1310
|
|
|
|
BuildRequires: libmount-devel >= 2.24
|
|
|
|
%endif
|
2017-01-18 21:31:08 +01:00
|
|
|
%if 0%{?fedora_version} >= 23
|
|
|
|
BuildRequires: pkgconfig
|
|
|
|
%else
|
2012-12-07 14:51:34 +01:00
|
|
|
BuildRequires: pkg-config
|
2017-01-18 21:31:08 +01:00
|
|
|
%endif
|
|
|
|
%if 0%{?fedora_version} >= 24
|
2018-12-04 15:53:46 +01:00
|
|
|
BuildRequires: glibc-langpack-de
|
|
|
|
BuildRequires: glibc-langpack-en
|
2017-01-18 21:31:08 +01:00
|
|
|
%endif
|
2012-11-13 09:44:02 +01:00
|
|
|
%if ! 0%{?mandriva_version}
|
2017-01-18 21:31:08 +01:00
|
|
|
%if 0%{?fedora_version} >= 23
|
|
|
|
BuildRequires: dbus-devel
|
|
|
|
BuildRequires: docbook-style-xsl
|
|
|
|
%else
|
2012-11-13 09:44:02 +01:00
|
|
|
BuildRequires: dbus-1-devel
|
2013-07-01 16:00:20 +02:00
|
|
|
BuildRequires: docbook-xsl-stylesheets
|
2017-01-18 21:31:08 +01:00
|
|
|
%endif
|
2013-07-01 16:00:20 +02:00
|
|
|
BuildRequires: libxslt
|
2012-11-13 09:44:02 +01:00
|
|
|
%else
|
2013-07-01 16:00:20 +02:00
|
|
|
BuildRequires: docbook-dtd45-xml
|
|
|
|
BuildRequires: docbook-xsl
|
2012-11-13 09:44:02 +01:00
|
|
|
BuildRequires: libdbus-1-devel
|
2013-07-01 16:00:20 +02:00
|
|
|
BuildRequires: xsltproc
|
2012-11-13 09:44:02 +01:00
|
|
|
%endif
|
2012-06-13 22:46:23 +02:00
|
|
|
%if (0%{?suse_version} && 0%{?suse_version} >= 1210)
|
2011-09-05 17:15:50 +02:00
|
|
|
BuildRequires: libzypp(plugin:commit)
|
2012-03-17 13:23:18 +01:00
|
|
|
%endif
|
2013-05-13 15:34:01 +02:00
|
|
|
BuildRequires: pam-devel
|
2019-12-17 16:00:13 +01:00
|
|
|
%if 0%{?fedora_version}
|
|
|
|
BuildRequires: json-c-devel
|
|
|
|
%else
|
|
|
|
BuildRequires: libjson-c-devel
|
|
|
|
%endif
|
2020-01-28 10:31:35 +01:00
|
|
|
%if %{with coverage}
|
|
|
|
BuildRequires: lcov
|
|
|
|
%endif
|
2013-02-08 14:45:00 +01:00
|
|
|
Requires: diffutils
|
2019-12-17 16:00:13 +01:00
|
|
|
Requires: libsnapper5 = %version
|
2012-03-17 13:23:18 +01:00
|
|
|
%if 0%{?suse_version}
|
2018-01-12 16:19:28 +01:00
|
|
|
Recommends: logrotate snapper-zypp-plugin
|
2012-01-04 07:31:45 +01:00
|
|
|
Supplements: btrfsprogs
|
2012-03-17 13:23:18 +01:00
|
|
|
%endif
|
2011-09-05 17:15:50 +02:00
|
|
|
Summary: Tool for filesystem snapshot management
|
2018-11-28 11:00:28 +01:00
|
|
|
License: GPL-2.0-only
|
2012-06-13 22:46:23 +02:00
|
|
|
Group: System/Packages
|
2013-09-11 17:15:44 +02:00
|
|
|
Url: http://snapper.io/
|
2011-05-12 11:10:13 +02:00
|
|
|
|
|
|
|
%description
|
|
|
|
This package contains snapper, a tool for filesystem snapshot management.
|
|
|
|
|
|
|
|
%prep
|
2017-08-17 12:38:29 +02:00
|
|
|
%setup
|
2011-05-12 11:10:13 +02:00
|
|
|
|
|
|
|
%build
|
2020-01-28 10:31:35 +01:00
|
|
|
%if %{with coverage}
|
|
|
|
# optimized code may confuse the coverage measurement, turn it off
|
|
|
|
# -fPIC is mysteriously needed on Fedora.
|
|
|
|
export CFLAGS="-g3 -fPIC"
|
|
|
|
export CXXFLAGS="-g3 -fPIC"
|
|
|
|
%else
|
2017-08-17 12:38:29 +02:00
|
|
|
export CFLAGS="%{optflags} -DNDEBUG"
|
|
|
|
export CXXFLAGS="%{optflags} -DNDEBUG"
|
2020-01-28 10:31:35 +01:00
|
|
|
%endif
|
2011-05-12 11:10:13 +02:00
|
|
|
|
2017-08-17 12:38:29 +02:00
|
|
|
autoreconf -fi
|
|
|
|
%configure \
|
|
|
|
--docdir="%{_defaultdocdir}/snapper" \
|
2020-01-28 10:31:35 +01:00
|
|
|
%if %{with coverage}
|
|
|
|
--enable-coverage \
|
|
|
|
%endif
|
2014-04-26 11:45:01 +02:00
|
|
|
%if 0%{?suse_version} <= 1310
|
2014-07-28 06:31:07 +02:00
|
|
|
--disable-rollback \
|
2017-01-18 21:31:08 +01:00
|
|
|
%endif
|
2017-02-02 15:12:47 +01:00
|
|
|
%if 0%{?suse_version} <= 1310
|
2017-01-18 21:31:08 +01:00
|
|
|
--disable-btrfs-quota \
|
2014-04-26 11:45:01 +02:00
|
|
|
%endif
|
2016-04-12 18:58:19 +02:00
|
|
|
--disable-silent-rules --disable-ext4
|
2017-08-17 12:38:29 +02:00
|
|
|
make %{?_smp_mflags}
|
2011-05-12 11:10:13 +02:00
|
|
|
|
|
|
|
%install
|
2017-08-17 12:38:29 +02:00
|
|
|
%make_install
|
|
|
|
rm -f "%{buildroot}/%{_libdir}"/*.la "%{buildroot}/%{_lib}/security/pam_snapper.la"
|
2018-01-12 16:19:28 +01:00
|
|
|
rm -f %{buildroot}/etc/cron.hourly/suse.de-snapper
|
|
|
|
rm -f %{buildroot}/etc/cron.daily/suse.de-snapper
|
2011-05-12 11:10:13 +02:00
|
|
|
|
2012-03-17 13:23:18 +01:00
|
|
|
%if 0%{?suse_version}
|
2017-12-07 13:50:03 +01:00
|
|
|
install -D -m 644 data/sysconfig.snapper "%{buildroot}%{_fillupdir}/sysconfig.snapper"
|
2012-03-17 13:23:18 +01:00
|
|
|
%else
|
2017-08-17 12:38:29 +02:00
|
|
|
install -D -m 644 data/sysconfig.snapper "%{buildroot}/etc/sysconfig/snapper"
|
2012-03-17 13:23:18 +01:00
|
|
|
%endif
|
|
|
|
|
2011-05-12 11:10:13 +02:00
|
|
|
%{find_lang} snapper
|
|
|
|
|
2013-07-01 16:00:20 +02:00
|
|
|
%check
|
2019-10-16 12:18:45 +02:00
|
|
|
make check VERBOSE=1
|
2013-07-01 16:00:20 +02:00
|
|
|
|
2018-01-12 16:19:28 +01:00
|
|
|
%pre
|
|
|
|
%if 0%{?suse_version}
|
|
|
|
%service_add_pre snapper-boot.service snapper-boot.timer snapper-cleanup.service snapper-cleanup.timer snapper-timeline.service snapper-timeline.timer
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%post
|
|
|
|
%if 0%{?suse_version}
|
|
|
|
# special hack, since the macros were added much later than
|
|
|
|
# the systemd timer
|
|
|
|
if [ -f /etc/cron.hourly/suse.de-snapper ]; then
|
|
|
|
systemctl preset snapper-timeline.timer || :
|
|
|
|
systemctl is-enabled -q snapper-timeline.timer && systemctl start snapper-timeline.timer || :
|
|
|
|
fi
|
|
|
|
if [ -f /etc/cron.daily/suse.de-snapper ]; then
|
|
|
|
systemctl preset snapper-cleanup.timer || :
|
|
|
|
systemctl is-enabled -q snapper-cleanup.timer && systemctl start snapper-cleanup.timer || :
|
|
|
|
fi
|
|
|
|
%service_add_post snapper-boot.service snapper-boot.timer snapper-cleanup.service snapper-cleanup.timer snapper-timeline.service snapper-timeline.timer
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%preun
|
|
|
|
%if 0%{?suse_version}
|
|
|
|
%service_del_preun snapper-boot.service snapper-boot.timer snapper-cleanup.service snapper-cleanup.timer snapper-timeline.service snapper-timeline.timer
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%postun
|
|
|
|
%if 0%{?suse_version}
|
|
|
|
%service_del_postun snapper-boot.service snapper-boot.timer snapper-cleanup.service snapper-cleanup.timer snapper-timeline.service snapper-timeline.timer
|
|
|
|
%endif
|
|
|
|
|
2011-05-12 11:10:13 +02:00
|
|
|
%files -f snapper.lang
|
|
|
|
%defattr(-,root,root)
|
2017-08-17 12:38:29 +02:00
|
|
|
%{_bindir}/snapper
|
|
|
|
%{_sbindir}/snapperd
|
2017-01-18 21:31:08 +01:00
|
|
|
%if 0%{?suse_version} > 1310
|
2017-08-17 12:38:29 +02:00
|
|
|
%{_sbindir}/mksubvolume
|
2017-01-18 21:31:08 +01:00
|
|
|
%endif
|
2020-01-08 16:40:53 +01:00
|
|
|
%dir %{_prefix}/lib/snapper
|
|
|
|
%{_prefix}/lib/snapper/*-helper
|
2013-11-29 07:05:09 +01:00
|
|
|
%doc %{_mandir}/*/snapper.8*
|
|
|
|
%doc %{_mandir}/*/snapperd.8*
|
|
|
|
%doc %{_mandir}/*/snapper-configs.5*
|
2017-01-18 21:31:08 +01:00
|
|
|
%if 0%{?suse_version} > 1310
|
2015-10-01 12:20:51 +02:00
|
|
|
%doc %{_mandir}/*/mksubvolume.8*
|
2017-01-18 21:31:08 +01:00
|
|
|
%endif
|
2011-05-12 11:10:13 +02:00
|
|
|
%config(noreplace) %{_sysconfdir}/logrotate.d/snapper
|
2018-01-12 16:19:28 +01:00
|
|
|
%{_unitdir}/snapper-*.*
|
2012-11-13 09:44:02 +01:00
|
|
|
%config /etc/dbus-1/system.d/org.opensuse.Snapper.conf
|
2017-08-17 12:38:29 +02:00
|
|
|
%{_datadir}/dbus-1/system-services/org.opensuse.Snapper.service
|
2011-05-12 11:10:13 +02:00
|
|
|
|
2019-12-17 16:00:13 +01:00
|
|
|
%package -n libsnapper5
|
2011-09-05 17:15:50 +02:00
|
|
|
Summary: Library for filesystem snapshot management
|
|
|
|
Group: System/Libraries
|
2012-06-13 22:46:23 +02:00
|
|
|
Requires: util-linux
|
2012-03-17 13:23:18 +01:00
|
|
|
%if 0%{?suse_version}
|
2011-09-05 17:15:50 +02:00
|
|
|
PreReq: %fillup_prereq
|
2012-03-17 13:23:18 +01:00
|
|
|
%endif
|
2014-02-07 16:44:31 +01:00
|
|
|
# expands to Obsoletes: libsnapper1 libsnapper2 libsnapper3...
|
2019-12-17 16:00:13 +01:00
|
|
|
Obsoletes: %(echo `seq -s " " -f "libsnapper%.f" $((5 - 1))`)
|
2011-05-12 11:10:13 +02:00
|
|
|
|
2019-12-17 16:00:13 +01:00
|
|
|
%description -n libsnapper5
|
2011-05-12 11:10:13 +02:00
|
|
|
This package contains libsnapper, a library for filesystem snapshot management.
|
|
|
|
|
2019-12-17 16:00:13 +01:00
|
|
|
%files -n libsnapper5
|
2011-05-12 11:10:13 +02:00
|
|
|
%defattr(-,root,root)
|
|
|
|
%{_libdir}/libsnapper.so.*
|
|
|
|
%dir %{_sysconfdir}/snapper
|
|
|
|
%dir %{_sysconfdir}/snapper/configs
|
|
|
|
%dir %{_sysconfdir}/snapper/config-templates
|
|
|
|
%config(noreplace) %{_sysconfdir}/snapper/config-templates/default
|
|
|
|
%dir %{_sysconfdir}/snapper/filters
|
|
|
|
%config(noreplace) %{_sysconfdir}/snapper/filters/*.txt
|
2017-08-17 12:38:29 +02:00
|
|
|
%doc %dir %{_defaultdocdir}/snapper
|
|
|
|
%doc %{_defaultdocdir}/snapper/AUTHORS
|
|
|
|
%doc %{_defaultdocdir}/snapper/COPYING
|
2012-03-17 13:23:18 +01:00
|
|
|
%if 0%{?suse_version}
|
2017-12-07 13:50:03 +01:00
|
|
|
%{_fillupdir}/sysconfig.snapper
|
2012-03-17 13:23:18 +01:00
|
|
|
%else
|
|
|
|
%config(noreplace) %{_sysconfdir}/sysconfig/snapper
|
|
|
|
%endif
|
2011-05-12 11:10:13 +02:00
|
|
|
|
2019-12-17 16:00:13 +01:00
|
|
|
%post -n libsnapper5
|
2011-05-12 11:10:13 +02:00
|
|
|
/sbin/ldconfig
|
2012-03-17 13:23:18 +01:00
|
|
|
%if 0%{?suse_version}
|
2011-05-12 11:10:13 +02:00
|
|
|
%{fillup_only -n snapper}
|
2012-03-17 13:23:18 +01:00
|
|
|
%endif
|
2011-05-12 11:10:13 +02:00
|
|
|
|
2019-12-17 16:00:13 +01:00
|
|
|
%postun -n libsnapper5 -p /sbin/ldconfig
|
2011-05-12 11:10:13 +02:00
|
|
|
|
|
|
|
%package -n libsnapper-devel
|
2017-02-28 11:03:23 +01:00
|
|
|
%if 0%{?suse_version} > 1325
|
|
|
|
Requires: libboost_headers-devel
|
|
|
|
%else
|
2012-06-13 22:46:23 +02:00
|
|
|
Requires: boost-devel
|
2017-02-28 11:03:23 +01:00
|
|
|
%endif
|
2012-06-13 22:46:23 +02:00
|
|
|
Requires: gcc-c++
|
2018-12-04 15:53:46 +01:00
|
|
|
Requires: libacl-devel
|
2019-12-17 16:00:13 +01:00
|
|
|
Requires: libsnapper5 = %version
|
2012-06-13 22:46:23 +02:00
|
|
|
Requires: libstdc++-devel
|
|
|
|
Requires: libxml2-devel
|
2014-04-26 11:45:01 +02:00
|
|
|
%if 0%{?suse_version} > 1230
|
|
|
|
Requires: libbtrfs-devel
|
|
|
|
%endif
|
|
|
|
%if 0%{?suse_version} > 1310
|
|
|
|
Requires: libmount-devel >= 2.24
|
|
|
|
%endif
|
2011-09-05 17:15:50 +02:00
|
|
|
Summary: Header files and documentation for libsnapper
|
|
|
|
Group: Development/Languages/C and C++
|
2011-05-12 11:10:13 +02:00
|
|
|
|
|
|
|
%description -n libsnapper-devel
|
|
|
|
This package contains header files and documentation for developing with
|
|
|
|
libsnapper.
|
|
|
|
|
|
|
|
%files -n libsnapper-devel
|
|
|
|
%defattr(-,root,root)
|
|
|
|
%{_libdir}/libsnapper.so
|
2017-08-17 12:38:29 +02:00
|
|
|
%{_includedir}/snapper
|
2011-07-08 15:50:58 +02:00
|
|
|
|
|
|
|
%package -n snapper-zypp-plugin
|
2018-11-22 12:17:41 +01:00
|
|
|
Requires: snapper = %version
|
2018-12-04 15:53:46 +01:00
|
|
|
Requires: libzypp(plugin:commit) = 1
|
2011-09-05 17:15:50 +02:00
|
|
|
Summary: A zypp commit plugin for calling snapper
|
|
|
|
Group: System/Packages
|
2011-07-08 15:50:58 +02:00
|
|
|
|
|
|
|
%description -n snapper-zypp-plugin
|
|
|
|
This package contains a plugin for zypp that makes filesystem snapshots with
|
|
|
|
snapper during commits.
|
|
|
|
|
|
|
|
%files -n snapper-zypp-plugin
|
|
|
|
%defattr(-,root,root)
|
2013-11-29 07:05:09 +01:00
|
|
|
%config(noreplace) %{_sysconfdir}/snapper/zypp-plugin.conf
|
2012-03-17 13:23:18 +01:00
|
|
|
%if 0%{?suse_version} < 1210
|
|
|
|
%dir /usr/lib/zypp
|
|
|
|
%dir /usr/lib/zypp/plugins
|
|
|
|
%dir /usr/lib/zypp/plugins/commit
|
|
|
|
%endif
|
2019-12-17 16:00:13 +01:00
|
|
|
/usr/lib/zypp/plugins/commit/snapper-zypp-plugin
|
2013-11-29 07:05:09 +01:00
|
|
|
%doc %{_mandir}/*/snapper-zypp-plugin.8*
|
|
|
|
%doc %{_mandir}/*/snapper-zypp-plugin.conf.5*
|
2011-09-19 18:04:43 +02:00
|
|
|
|
2013-05-13 15:34:01 +02:00
|
|
|
%package -n pam_snapper
|
|
|
|
Requires: pam
|
|
|
|
Requires: snapper = %version
|
|
|
|
Summary: PAM module for calling snapper
|
|
|
|
Group: System/Packages
|
|
|
|
|
|
|
|
%description -n pam_snapper
|
|
|
|
A PAM module for calling snapper during user login and logout.
|
|
|
|
|
|
|
|
%files -n pam_snapper
|
|
|
|
%defattr(-,root,root)
|
|
|
|
/%{_lib}/security/pam_snapper.so
|
|
|
|
%dir /usr/lib/pam_snapper
|
|
|
|
/usr/lib/pam_snapper/*.sh
|
2013-11-29 07:05:09 +01:00
|
|
|
%doc %{_mandir}/*/pam_snapper.8*
|
2013-05-13 15:34:01 +02:00
|
|
|
|
2019-11-29 10:11:50 +01:00
|
|
|
%package testsuite
|
|
|
|
Summary: Integration tests for snapper
|
|
|
|
Group: System/Packages
|
|
|
|
|
|
|
|
%description testsuite
|
|
|
|
Tests to be run in a scratch machine to test that snapper operates as expected.
|
|
|
|
|
|
|
|
%files testsuite
|
|
|
|
%defattr(-,root,root)
|
|
|
|
%dir %{_libdir}/snapper
|
|
|
|
%dir %{_libdir}/snapper/testsuite
|
|
|
|
%{_libdir}/snapper/testsuite/*
|
|
|
|
|
2011-09-05 17:15:50 +02:00
|
|
|
%changelog
|