diff --git a/python-geomet.changes b/python-geomet.changes index f471b27..125ba8f 100644 --- a/python-geomet.changes +++ b/python-geomet.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue May 26 06:34:21 UTC 2020 - Petr Gajdos + +- %python3_only -> %python_alternative + ------------------------------------------------------------------- Mon Jan 20 08:14:34 UTC 2020 - Tomáš Chvátal diff --git a/python-geomet.spec b/python-geomet.spec index 8bcf409..40d8999 100644 --- a/python-geomet.spec +++ b/python-geomet.spec @@ -30,6 +30,8 @@ BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: python-click Requires: python-six +Requires(post): update-alternatives +Requires(postun): update-alternatives BuildArch: noarch # SECTION test requirements BuildRequires: %{python_module click} @@ -49,17 +51,29 @@ GeoJSON <-> WKT/WKB conversion utilities %install %python_install +%python_clone -a %{buildroot}%{_bindir}/geomet rm %{buildroot}%{_prefix}/LICENSE %python_expand %fdupes %{buildroot}%{$python_sitelib} %check export PATH=$PATH:%{buildroot}%{_bindir} -%pytest +export PYTHONDONTWRITEBYTECODE=1 +%{python_expand \ +sed -i 's:geomet:geomet-%{$python_version}:' geomet/tests/test_cli.py +export PYTHONPATH=:%{buildroot}%{$python_sitelib} +$python -m pytest +} + +%post +%python_install_alternative geomet + +%postun +%python_uninstall_alternative geomet %files %{python_files} %doc AUTHORS.txt README.md %license LICENSE -%python3_only %{_bindir}/geomet +%python_alternative %{_bindir}/geomet %{python_sitelib}/geomet %{python_sitelib}/geomet-%{version}-py*.egg-info