Add systemd support
This commit is contained in:
+31
-11
@@ -1,18 +1,16 @@
|
||||
%global pypi_name borgmatic
|
||||
%global pypi_version 1.5.24
|
||||
|
||||
%bcond_without tests
|
||||
|
||||
Name: %{pypi_name}
|
||||
Version: %{pypi_version}
|
||||
Release: 1%{?dist}
|
||||
Name: borgmatic
|
||||
Version: 1.5.24
|
||||
Release: 2%{?dist}
|
||||
Summary: Simple, configuration-driven backup software for servers and workstations
|
||||
|
||||
License: None
|
||||
URL: https://torsion.org/borgmatic
|
||||
Source0: %{pypi_source}
|
||||
Source0: https://projects.torsion.org/witten/borgmatic/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz
|
||||
BuildArch: noarch
|
||||
|
||||
BuildRequires: systemd-rpm-macros
|
||||
BuildRequires: python(abi) >= 3.7
|
||||
BuildRequires: python%{python3_pkgversion}-devel
|
||||
BuildRequires: python%{python3_version}dist(setuptools)
|
||||
@@ -60,8 +58,8 @@ according to a retention policy, and validates backups for consistency.
|
||||
|
||||
|
||||
%prep
|
||||
%autosetup -n %{pypi_name}-%{pypi_version}
|
||||
rm -rf %{pypi_name}.egg-info
|
||||
%autosetup -n %{name}
|
||||
rm -rf %{name}.egg-info
|
||||
|
||||
%build
|
||||
%py3_build
|
||||
@@ -69,6 +67,12 @@ rm -rf %{pypi_name}.egg-info
|
||||
%install
|
||||
%py3_install
|
||||
|
||||
install -dm 0750 %{buildroot}%{_sysconfdir}/borgmatic
|
||||
install -dm 0750 %{buildroot}%{_sysconfdir}/borgmatic.d
|
||||
|
||||
install -Dpm 0644 sample/systemd/%{name}.service %{buildroot}%{_unitdir}/%{name}.service
|
||||
install -Dpm 0644 sample/systemd/%{name}.timer %{buildroot}%{_unitdir}/%{name}.timer
|
||||
|
||||
%check
|
||||
%if %{with tests}
|
||||
%{__python3} setup.py test
|
||||
@@ -77,13 +81,29 @@ rm -rf %{pypi_name}.egg-info
|
||||
%files
|
||||
%license LICENSE
|
||||
%doc README.md
|
||||
%attr(0750, root, root) %{_sysconfdir}/borgmatic
|
||||
%attr(0750, root, root) %{_sysconfdir}/borgmatic.d
|
||||
%{_bindir}/borgmatic
|
||||
%{_bindir}/generate-borgmatic-config
|
||||
%{_bindir}/upgrade-borgmatic-config
|
||||
%{_bindir}/validate-borgmatic-config
|
||||
%{python3_sitelib}/%{pypi_name}
|
||||
%{python3_sitelib}/%{pypi_name}-%{pypi_version}-py%{python3_version}.egg-info
|
||||
%{python3_sitelib}/%{name}
|
||||
%{python3_sitelib}/%{name}-%{version}-py%{python3_version}.egg-info
|
||||
%{_unitdir}/borgmatic.service
|
||||
%{_unitdir}/borgmatic.timer
|
||||
|
||||
%post
|
||||
%systemd_post borgmatic.timer
|
||||
|
||||
%preun
|
||||
%systemd_preun borgmatic.timer
|
||||
|
||||
%postun
|
||||
%systemd_postun borgmatic.timer
|
||||
|
||||
%changelog
|
||||
* Wed Apr 20 2022 Daniel Uvehag <ufven+pkgs@protonmail.com> - 1.5.24-2
|
||||
- Add systemd support
|
||||
|
||||
* Wed Apr 20 2022 Daniel Uvehag <ufven+pkgs@protonmail.com> - 1.5.24-1
|
||||
- Initial package.
|
||||
|
||||
Reference in New Issue
Block a user