14
0

- 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:
2021-03-12 19:57:16 +00:00
committed by Git OBS Bridge
parent b274f2cb63
commit 36dd96afd8
2 changed files with 21 additions and 6 deletions

View File

@@ -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>

View File

@@ -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