f08d742
Name:           borgmatic
86ecb36
Version:        1.7.11
650d0b9
Release:        %autorelease
c922650
Summary:        Simple Python wrapper script for borgbackup
c922650
c922650
License:        GPLv3
c922650
URL:            https://torsion.org/borgmatic
6b87158
Source0:        https://projects.torsion.org/borgmatic-collective/borgmatic/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz
f08d742
f08d742
BuildArch:      noarch
f08d742
e15f00d
BuildRequires:  python3-devel
f08d742
BuildRequires:  systemd-rpm-macros
c922650
6f23d9a
Requires:       borgbackup
f63d5a0
# These hints are for commands run as part of the database backup and restore
f63d5a0
# hooks. It is assumed that users who configure these hooks will already have
f63d5a0
# the respective DBMS installed, otherwise there'd be nothing to back up.
f63d5a0
# Leaving this here for posterity.
f63d5a0
Suggests:       mysql
f63d5a0
Suggests:       postgresql
f63d5a0
Suggests:       sqlite
6f23d9a
c922650
%description
c922650
borgmatic (formerly atticmatic) is a simple Python wrapper script for
c922650
the Borg backup software that initiates a backup, prunes any old backups
c922650
according to a retention policy, and validates backups for consistency.
c922650
e15f00d
%generate_buildrequires
e15f00d
%pyproject_buildrequires
f08d742
c922650
%prep
f08d742
%autosetup -n %{name}
f08d742
c922650
%build
e15f00d
%pyproject_wheel
c922650
e15f00d
%{__python3} -c 'from borgmatic.commands.completion import bash_completion; print(bash_completion())' > %{name}-bash-completion
140363d
c922650
f08d742
%install
e15f00d
%pyproject_install
bb6ad79
%pyproject_save_files %{name}
c922650
f08d742
install -dm 0750 %{buildroot}%{_sysconfdir}/borgmatic
f08d742
install -dm 0750 %{buildroot}%{_sysconfdir}/borgmatic.d
c922650
09670e4
sed -i 's#/root/.local/bin/borgmatic#%{_bindir}/%{name}#' sample/systemd/%{name}.service
f08d742
install -Dpm 0644 sample/systemd/%{name}.service %{buildroot}%{_unitdir}/%{name}.service
f08d742
install -Dpm 0644 sample/systemd/%{name}.timer %{buildroot}%{_unitdir}/%{name}.timer
c922650
140363d
install -Dpm 0644 %{name}-bash-completion %{buildroot}%{_datadir}/bash-completion/completions/%{name}
140363d
c922650
bb6ad79
%files -f %{pyproject_files}
f08d742
%doc AUTHORS NEWS README.md
f08d742
%license LICENSE
795f581
%attr(0750, root, root) %{_sysconfdir}/borgmatic
795f581
%attr(0750, root, root) %{_sysconfdir}/borgmatic.d
c922650
%{_bindir}/borgmatic
c922650
%{_bindir}/generate-borgmatic-config
c922650
%{_bindir}/upgrade-borgmatic-config
f08d742
%{_bindir}/validate-borgmatic-config
140363d
%{_datadir}/bash-completion/completions/%{name}
c922650
%{_unitdir}/borgmatic.service
c922650
%{_unitdir}/borgmatic.timer
f08d742
c922650
c922650
%post
c922650
%systemd_post borgmatic.timer
c922650
f08d742
c922650
%preun
c922650
%systemd_preun borgmatic.timer
c922650
f08d742
c922650
%postun
c922650
%systemd_postun borgmatic.timer
c922650
f08d742
c922650
%changelog
650d0b9
%autochangelog