xenithorb / rpms / borgmatic

Forked from rpms/borgmatic 3 years ago
Blob Blame History Raw
%global srcname borgmatic
%global debug_package %{nil}

Name:           %{srcname}
Version:        1.2.0
Release:        2%{?dist}
Summary:        Simple Python wrapper script for borgbackup

License:        GPLv3
URL:            https://torsion.org/borgmatic
Source0:        https://files.pythonhosted.org/packages/source/b/%{srcname}/%{srcname}-%{version}.tar.gz
Source1:        https://projects.torsion.org/witten/borgmatic/raw/branch/master/LICENSE
Source2:        borgmatic.service
Source3:        borgmatic.timer

# build
BuildRequires:  python%{python3_pkgversion}-devel
BuildRequires:  python%{python3_pkgversion}-setuptools

BuildRequires:  systemd

# test
%if 0%{?fedora}
BuildRequires:  python%{python3_pkgversion}-pytest
BuildRequires:  python%{python3_pkgversion}-pykwalify
BuildRequires:  python%{python3_pkgversion}-ruamel-yaml
BuildRequires:  python%{python3_pkgversion}-flexmock

Requires:       borgbackup
Requires:       python%{python3_pkgversion}-ruamel-yaml
Requires:       python%{python3_pkgversion}-pykwalify

borgmatic (formerly atticmatic) is a simple Python wrapper script for
the Borg backup software that initiates a backup, prunes any old backups
according to a retention policy, and validates backups for consistency.

%setup -n %{srcname}-%{version}
rm -rf %{srcname}.egg-info


find . -name *.so -type f -exec chmod 0755 {} \;


install -d %{buildroot}%{_unitdir}
install -d %{buildroot}%{_docdir}
install -d %{buildroot}%{_sysconfdir}/borgmatic
install -d %{buildroot}%{_sysconfdir}/borgmatic.d

install -D -m 644 %{SOURCE1} %{buildroot}%{_docdir}
install -D -m 644 %{SOURCE2} %{buildroot}%{_unitdir}
install -D -m 644 %{SOURCE3} %{buildroot}%{_unitdir}

# epel lacks of required packages for testing
%if 0%{?fedora}
py.test-3 borgmatic/tests/unit


%attr(0750, root, root) %{_sysconfdir}/borgmatic
%attr(0750, root, root) %{_sysconfdir}/borgmatic.d

%systemd_post borgmatic.timer

%systemd_preun borgmatic.timer

%systemd_postun borgmatic.timer

* Thu Jul 12 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

* Fri Jun 29 2018 Benjamin Pereto <benjamin@sandchaschte.ch> - 1.2.0-1
- upstream release 1.2.0
- added missing deps ruamel.yaml and pykwalify

* Tue Jun 19 2018 Miro HronĨok <mhroncok@redhat.com> - 1.1.15-3
- Rebuilt for Python 3.7

* Thu Apr 12 2018 Benjamin Pereto <benjamin@sandchaschte.ch> - 1.1.15-2
- add empty /etc/borgmatic.d as described in documentation
- add empty /etc/borgmatic as described in documentation

* Thu Apr 12 2018 Benjamin Pereto <benjamin@sandchaschte.ch> - 1.1.15-1
- Initial packaging for the borgmatic project