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
|
%bcond_without tests
|
||||||
|
|
||||||
Name: %{pypi_name}
|
Name: borgmatic
|
||||||
Version: %{pypi_version}
|
Version: 1.5.24
|
||||||
Release: 1%{?dist}
|
Release: 2%{?dist}
|
||||||
Summary: Simple, configuration-driven backup software for servers and workstations
|
Summary: Simple, configuration-driven backup software for servers and workstations
|
||||||
|
|
||||||
License: None
|
License: None
|
||||||
URL: https://torsion.org/borgmatic
|
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
|
BuildArch: noarch
|
||||||
|
|
||||||
|
BuildRequires: systemd-rpm-macros
|
||||||
BuildRequires: python(abi) >= 3.7
|
BuildRequires: python(abi) >= 3.7
|
||||||
BuildRequires: python%{python3_pkgversion}-devel
|
BuildRequires: python%{python3_pkgversion}-devel
|
||||||
BuildRequires: python%{python3_version}dist(setuptools)
|
BuildRequires: python%{python3_version}dist(setuptools)
|
||||||
@@ -60,8 +58,8 @@ according to a retention policy, and validates backups for consistency.
|
|||||||
|
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%autosetup -n %{pypi_name}-%{pypi_version}
|
%autosetup -n %{name}
|
||||||
rm -rf %{pypi_name}.egg-info
|
rm -rf %{name}.egg-info
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%py3_build
|
%py3_build
|
||||||
@@ -69,6 +67,12 @@ rm -rf %{pypi_name}.egg-info
|
|||||||
%install
|
%install
|
||||||
%py3_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
|
%check
|
||||||
%if %{with tests}
|
%if %{with tests}
|
||||||
%{__python3} setup.py test
|
%{__python3} setup.py test
|
||||||
@@ -77,13 +81,29 @@ rm -rf %{pypi_name}.egg-info
|
|||||||
%files
|
%files
|
||||||
%license LICENSE
|
%license LICENSE
|
||||||
%doc README.md
|
%doc README.md
|
||||||
|
%attr(0750, root, root) %{_sysconfdir}/borgmatic
|
||||||
|
%attr(0750, root, root) %{_sysconfdir}/borgmatic.d
|
||||||
%{_bindir}/borgmatic
|
%{_bindir}/borgmatic
|
||||||
%{_bindir}/generate-borgmatic-config
|
%{_bindir}/generate-borgmatic-config
|
||||||
%{_bindir}/upgrade-borgmatic-config
|
%{_bindir}/upgrade-borgmatic-config
|
||||||
%{_bindir}/validate-borgmatic-config
|
%{_bindir}/validate-borgmatic-config
|
||||||
%{python3_sitelib}/%{pypi_name}
|
%{python3_sitelib}/%{name}
|
||||||
%{python3_sitelib}/%{pypi_name}-%{pypi_version}-py%{python3_version}.egg-info
|
%{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
|
%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
|
* Wed Apr 20 2022 Daniel Uvehag <ufven+pkgs@protonmail.com> - 1.5.24-1
|
||||||
- Initial package.
|
- Initial package.
|
||||||
|
|||||||
Reference in New Issue
Block a user