diff --git a/httpie.changes b/httpie.changes index 96a3298..cc51e75 100644 --- a/httpie.changes +++ b/httpie.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Mar 31 16:59:11 UTC 2020 - Matej Cepl + +- Don't use %python3_only command, but properly use alternatives. + ------------------------------------------------------------------- Sun Jan 12 10:25:17 UTC 2020 - Martin Hauke diff --git a/httpie.spec b/httpie.spec index bdfa3c5..8269d5f 100644 --- a/httpie.spec +++ b/httpie.spec @@ -1,7 +1,7 @@ # # spec file for package httpie # -# Copyright (c) 2020 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -29,7 +29,6 @@ Source: https://github.com/jakubroztocil/httpie/archive/%{version}.tar.g Source1: http.1 Patch0: httpie-adjust-requirements.patch BuildRequires: %{python_module Pygments >= 2.1.3} -BuildRequires: %{python_module devel} BuildRequires: %{python_module mock} BuildRequires: %{python_module pytest-httpbin} BuildRequires: %{python_module pytest} @@ -43,6 +42,8 @@ Suggests: python-argparse >= 1.2.1 Suggests: python-colorama >= 0.2.4 Provides: httpie BuildArch: noarch +Requires(post): update-alternatives +Requires(postun): update-alternatives %python_subpackages %description @@ -66,19 +67,27 @@ export LC_CTYPE=en_US.UTF-8 %install export LC_CTYPE=en_US.UTF-8 %python_install +%python_clone -a %{buildroot}%{_bindir}/http +%python_clone -a %{buildroot}%{_bindir}/https %python_expand %fdupes %{buildroot}%{$python_sitelib} install -D -m 0644 %{SOURCE1} %{buildroot}%{_mandir}/man1/http.1 %check export LC_CTYPE=en_US.UTF-8 -%python_expand PYTHONPATH=%{buildroot}%{$python_sitelib} py.test-%{$python_version} +%pytest + +%post +%python_install_alternative http https + +%postun +%python_uninstall_alternative http https %files %{python_files} %doc AUTHORS.rst CHANGELOG.rst README.rst %license LICENSE -%python3_only %{_bindir}/http -%python3_only %{_bindir}/https +%python_alternative %{_bindir}/http +%python_alternative %{_bindir}/https %{python_sitelib}/* -%{_mandir}/man1/http.1%{ext_man} +%{_mandir}/man1/http.1%{?ext_man} %changelog