File snapper.spec of Package snapper

# spec file for package snapper
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
# 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

Name:           snapper
Version:        0.0.11
Release:        0
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Source:         snapper-%{version}.tar.bz2
Patch1:         no-readonly.diff
Prefix:         /usr
BuildRequires:  boost-devel
BuildRequires:  doxygen
BuildRequires:  gcc-c++
BuildRequires:  libtool
BuildRequires:  libxml2-devel
BuildRequires:  python-devel
BuildRequires:  swig
%if (0%{?suse_version} && 0%{?suse_version} >= 1210)
BuildRequires:  libzypp(plugin:commit)
Requires:       libsnapper1 = %version
%if 0%{?suse_version}
Recommends:     cron logrotate snapper-zypp-plugin
Supplements:    btrfsprogs
Summary:        Tool for filesystem snapshot management
License:        GPL-2.0
Group:          System/Packages

This package contains snapper, a tool for filesystem snapshot management.

    Arvin Schnell <>

%setup -n snapper-%{version}
%if (0%{?suse_version} && 0%{?suse_version} < 1210) || (0%{?fedora} && 0%{?fedora} < 17) || (0%{?rhel_version} && 0%{?rhel_version} < 700) || (0%{?centos_version} && 0%{?centos_version} < 700) || (0%{?mdkversion} && 0%{?mdkversion} < 201200)


libtoolize --force --automake --copy
automake --add-missing --copy

./configure --libdir=%{_libdir} --prefix=%{prefix} --mandir=%{_mandir} --disable-silent-rules
make %{?jobs:-j%jobs}

make install DESTDIR="$RPM_BUILD_ROOT"

%if 0%{?suse_version}
install -D data/sysconfig.snapper $RPM_BUILD_ROOT/var/adm/fillup-templates/sysconfig.snapper
install -D data/sysconfig.snapper $RPM_BUILD_ROOT/etc/sysconfig/snapper

%{find_lang} snapper

rm -f $RPM_BUILD_ROOT/%{python_sitearch}/_libsnapper.a
rm -f $RPM_BUILD_ROOT/%{python_sitearch}/

rm -rf "$RPM_BUILD_ROOT"

%files -f snapper.lang
%doc %{_mandir}/*/*
%config(noreplace) %{_sysconfdir}/logrotate.d/snapper

%package -n libsnapper1
Summary:        Library for filesystem snapshot management
Group:          System/Libraries
Requires:       diffutils
Requires:       util-linux
%if 0%{?suse_version}
PreReq:         %fillup_prereq

%description -n libsnapper1
This package contains libsnapper, a library for filesystem snapshot management.

    Arvin Schnell <>

%files -n libsnapper1
%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
%doc %dir %{prefix}/share/doc/packages/snapper
%doc %{prefix}/share/doc/packages/snapper/AUTHORS
%doc %{prefix}/share/doc/packages/snapper/COPYING
%if 0%{?suse_version}
%config(noreplace) %{_sysconfdir}/sysconfig/snapper
%dir %{prefix}/lib/snapper
%dir %{prefix}/lib/snapper/bin

%post -n libsnapper1
%if 0%{?suse_version}
%{fillup_only -n snapper}

%postun -n libsnapper1

%package -n libsnapper-devel
Requires:       boost-devel
Requires:       gcc-c++
Requires:       libsnapper1 = %version
Requires:       libstdc++-devel
Requires:       libxml2-devel
Summary:        Header files and documentation for libsnapper
Group:          Development/Languages/C and C++

%description -n libsnapper-devel
This package contains header files and documentation for developing with

    Arvin Schnell <>

%files -n libsnapper-devel

%package -n libsnapper-python
Summary:        Python bindings for libsnapper
Group:          System/Libraries

%description -n libsnapper-python
This package contains Python bindings for libsnapper.

    Thomas Fehr <>

%files -n libsnapper-python
%attr(755,root,root) %{python_sitearch}/

%package -n snapper-zypp-plugin
Requires:       snapper
Requires:       zypp-plugin-python
Requires:       libzypp(plugin:commit)
Summary:        A zypp commit plugin for calling snapper
Group:          System/Packages

%description -n snapper-zypp-plugin
This package contains a plugin for zypp that makes filesystem snapshots with
snapper during commits.

    Arvin Schnell <>

%files -n snapper-zypp-plugin
%if 0%{?suse_version} < 1210
%dir /usr/lib/zypp
%dir /usr/lib/zypp/plugins
%dir /usr/lib/zypp/plugins/commit