diff --git a/python-vdirsyncer.changes b/python-vdirsyncer.changes index cf0df99..0913ea6 100644 --- a/python-vdirsyncer.changes +++ b/python-vdirsyncer.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri Mar 12 19:57:06 UTC 2021 - Matej Cepl + +- Set up update-alternatives for systemd unit files. + ------------------------------------------------------------------- Sun Feb 28 22:24:56 UTC 2021 - Hans-Peter Jansen diff --git a/python-vdirsyncer.spec b/python-vdirsyncer.spec index 7371400..1c19020 100644 --- a/python-vdirsyncer.spec +++ b/python-vdirsyncer.spec @@ -46,7 +46,7 @@ Requires: python-click-threading >= 0.2 Requires: python-requests >= 2.20.0 Requires: python-requests-toolbelt >= 0.4.0 Requires(post): update-alternatives -Requires(postun): update-alternatives +Requires(postun):update-alternatives Recommends: python-requests-oauthlib BuildArch: noarch # SECTION test requirements @@ -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