File rsnapshot.spec of Package rsnapshot
#
# spec file for package rsnapshot
#
# Copyright (c) 2016 SUSE LINUX 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 http://bugs.opensuse.org/
#
Name: rsnapshot
Version: 1.4.2
Release: 0
Summary: Backup program using hardlinks
License: GPL-2.0+
Group: Productivity/Archiving/Backup
Url: http://www.rsnapshot.org/
Source0: https://github.com/rsnapshot/rsnapshot/releases/download/%{version}/%{name}-%{version}.tar.gz
Source1: rsnapshot.logrotate
Patch1: rsnapshot-config.patch
BuildRequires: logrotate
BuildRequires: openssh
BuildRequires: perl
BuildRequires: rsync
Requires: logrotate
Requires: openssh
Requires: perl
Requires: rsync
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch
%if 0%{?suse_version} >= 1320
BuildRequires: util-linux-systemd
Requires: util-linux-systemd
%endif
%description
rsnapshot is a filesystem snapshot utility for making backups of local
and remote systems. Using rsync and hard links, it is possible to keep
multiple, full backups instantly available. The disk space required is
just a little more than the space of one full backup, plus
incrementals. Depending on your configuration, it is quite possible to
set up in just a few minutes. Files can be restored by the users who
own them, without the root user getting involved. There are no tapes to
change, so once it's set up, you may never need to think about it
again.
%prep
%setup -q
%patch1
%build
# replace hardcoded /usr/local
find . -type f -exec sed -i "s|usr/local|usr|g" {} +
%configure
make %{?_smp_mflags}
%check
make %{?_smp_mflags} test
%install
make DESTDIR=%{buildroot} install %{?_smp_mflags}
install -d "%{buildroot}/%{_sysconfdir}"
install -m 644 rsnapshot.conf.default "%{buildroot}/%{_sysconfdir}/rsnapshot.conf.default"
install -m 600 rsnapshot.conf.default "%{buildroot}/%{_sysconfdir}/rsnapshot.conf"
install -m 644 -D %{S:1} "%{buildroot}/%{_sysconfdir}/logrotate.d/rsnapshot"
%files
%defattr(-,root,root)
%doc AUTHORS COPYING ChangeLog README.md docs
%{_bindir}/rsnapshot
%{_bindir}/rsnapshot-diff
%config(noreplace) %{_sysconfdir}/rsnapshot.conf
%config %{_sysconfdir}/rsnapshot.conf.default
%config(noreplace) %{_sysconfdir}/logrotate.d/rsnapshot
%{_mandir}/man1/rsnapshot.1.gz
%{_mandir}/man1/rsnapshot-diff.1.gz
%changelog