Accepting request 920164 from devel:languages:python

revert

OBS-URL: https://build.opensuse.org/request/show/920164
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pecan?expand=0&rev=57
This commit is contained in:
2021-09-19 17:10:21 +00:00
committed by Git OBS Bridge
parent 9363efb529
commit 26e629fdea
2 changed files with 2 additions and 49 deletions

View File

@@ -1,8 +1,3 @@
-------------------------------------------------------------------
Sun Aug 22 19:58:35 UTC 2021 - Stefan Schubert <schubi@suse.de>
- Use libalternatives instead of update-alternatives.
-------------------------------------------------------------------
Thu May 27 06:49:51 UTC 2021 - pgajdos@suse.com

View File

@@ -16,12 +16,6 @@
#
%if 0%{?suse_version} > 1500
%bcond_without libalternatives
%else
%bcond_with libalternatives
%endif
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define skip_python2 1
Name: python-pecan
@@ -57,12 +51,8 @@ Requires: python-WebTest >= 1.3.1
Requires: python-logutils >= 0.3
Requires: python-setuptools
Requires: python-six
%if %{with libalternatives}
Requires: alts
%else
Requires(post): update-alternatives
Requires(postun):update-alternatives
%endif
BuildArch: noarch
%if 0%{?suse_version}
Suggests: python-Genshi
@@ -88,31 +78,12 @@ sed -ie "/^pep8$/d" test-requirements.txt
%install
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%if ! %{with libalternatives}
%python_clone -a %{buildroot}%{_bindir}/pecan
%python_clone -a %{buildroot}%{_bindir}/gunicorn_pecan
%else
%python_clone %{buildroot}%{_bindir}/pecan
%python_clone %{buildroot}%{_bindir}/gunicorn_pecan
ln -sf %{_bindir}/alts %{buildroot}%{_bindir}/pecan
mkdir -p %{buildroot}%{_datadir}/libalternatives/pecan
%python_expand echo "binary=%{_bindir}/pecan-%{$python_version}" > %{buildroot}%{_datadir}/libalternatives/pecan/10%{$python_version_nodots}.conf
ln -sf %{_bindir}/alts %{buildroot}%{_bindir}/gunicorn_pecan
mkdir -p %{buildroot}%{_datadir}/libalternatives/gunicorn_pecan
%python_expand echo "binary=%{_bindir}/gunicorn_pecan-%{$python_version}" > %{buildroot}%{_datadir}/libalternatives/gunicorn_pecan/10%{$python_version_nodots}.conf
%endif
%python_clone -a %{buildroot}%{_bindir}/pecan
%python_clone -a %{buildroot}%{_bindir}/gunicorn_pecan
%check
%pyunittest discover -v
%if %{with libalternatives}
%pre
# removing old update-alternatives entries
if [ "$1" -gt 0 ] && [ -f %{_sbindir}/update-alternatives ] ; then
%python_uninstall_alternative pecan
%python_uninstall_alternative gunicorn_pecan
fi
%else
%post
%python_install_alternative pecan
%python_install_alternative gunicorn_pecan
@@ -120,25 +91,12 @@ fi
%postun
%python_uninstall_alternative pecan
%python_uninstall_alternative gunicorn_pecan
%endif
%files %{python_files}
%license LICENSE
%doc README.rst
%if ! 0%{with libalternatives}
%python_alternative %{_bindir}/pecan
%python_alternative %{_bindir}/gunicorn_pecan
%else
%dir %{_datadir}/libalternatives
%dir %{_datadir}/libalternatives/pecan
%{_datadir}/libalternatives/pecan/10%python_version_nodots.conf
%{_bindir}/pecan
%{_bindir}/pecan-%python_version
%dir %{_datadir}/libalternatives/gunicorn_pecan
%{_datadir}/libalternatives/gunicorn_pecan/10%python_version_nodots.conf
%{_bindir}/gunicorn_pecan
%{_bindir}/gunicorn_pecan-%python_version
%endif
%{python_sitelib}/*
%changelog