forked from pool/python-vdirsyncer
- Set up update-alternatives for systemd unit files.
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-vdirsyncer?expand=0&rev=30
This commit is contained in:
@@ -1,3 +1,8 @@
|
||||
-------------------------------------------------------------------
|
||||
Fri Mar 12 19:57:06 UTC 2021 - Matej Cepl <mcepl@suse.com>
|
||||
|
||||
- Set up update-alternatives for systemd unit files.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sun Feb 28 22:24:56 UTC 2021 - Hans-Peter Jansen <hpj@urpla.net>
|
||||
|
||||
|
@@ -84,11 +84,15 @@ rm -rf vdirsyncer.egg-info
|
||||
%install
|
||||
%python_install
|
||||
%python_clone -a %{buildroot}%{_bindir}/vdirsyncer
|
||||
%python_expand %fdupes %{buildroot}/%{$python_sitelib}
|
||||
|
||||
mkdir -p %{buildroot}%{_userunitdir}
|
||||
install -Dpm 0644 %{SOURCE1} %{buildroot}%{_userunitdir}/vdirsyncer.service
|
||||
install -Dpm 0644 %{SOURCE2} %{buildroot}%{_userunitdir}/vdirsyncer.timer
|
||||
%{python_expand \
|
||||
install -Dpm 0644 %{SOURCE1} %{buildroot}%{_userunitdir}/vdirsyncer-%{$python_bin_suffix}.service
|
||||
install -Dpm 0644 %{SOURCE2} %{buildroot}%{_userunitdir}/vdirsyncer-%{$python_bin_suffix}.timer
|
||||
%fdupes %{buildroot}/%{$python_sitelib}
|
||||
}
|
||||
%prepare_alternative -t %{_userunitdir}/vdirsyncer.service vdirsyncer.service
|
||||
%prepare_alternative -t %{_userunitdir}/vdirsyncer.timer vdirsyncer.timer
|
||||
|
||||
%check
|
||||
export DETERMINISTIC_TESTS=true
|
||||
@@ -96,7 +100,10 @@ export DETERMINISTIC_TESTS=true
|
||||
%pytest -k 'not test_legacy_status and not test_open_graphical_browser and not test_verbosity'
|
||||
|
||||
%post
|
||||
%python_install_alternative vdirsyncer
|
||||
update-alternatives --install %{_bindir}/vdirsyncer vdirsyncer %{_bindir}/vdirsyncer-%{python_bin_suffix} %{python_version_nodots} \
|
||||
--slave %{_userunitdir}/vdirsyncer.service vdirsyncer.service %{_userunitdir}/vdirsyncer-%{python_bin_suffix}.service \
|
||||
--slave %{_userunitdir}/vdirsyncer.timer vdirsyncer.timer %{_userunitdir}/vdirsyncer-%{python_bin_suffix}.timer
|
||||
update-alternatives --auto vdirsyncer
|
||||
|
||||
%postun
|
||||
%python_uninstall_alternative vdirsyncer
|
||||
@@ -105,8 +112,11 @@ export DETERMINISTIC_TESTS=true
|
||||
%doc README.rst
|
||||
%license LICENSE
|
||||
%python_alternative %{_bindir}/vdirsyncer
|
||||
%{python_sitelib}/*
|
||||
%{python_sitelib}/vdirsyncer*
|
||||
%{_userunitdir}/vdirsyncer-%{python_bin_suffix}.service
|
||||
%{_userunitdir}/vdirsyncer-%{python_bin_suffix}.timer
|
||||
%{_userunitdir}/vdirsyncer.service
|
||||
%{_userunitdir}/vdirsyncer.timer
|
||||
%ghost %{_sysconfdir}/alternatives/vdirsyncer*
|
||||
|
||||
%changelog
|
||||
|
Reference in New Issue
Block a user