forked from pool/python-Mako
Accepting request 920174 from devel:languages:python
revert OBS-URL: https://build.opensuse.org/request/show/920174 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-Mako?expand=0&rev=79
This commit is contained in:
@@ -16,12 +16,6 @@
|
||||
#
|
||||
|
||||
|
||||
%if 0%{?suse_version} > 1500
|
||||
%bcond_without libalternatives
|
||||
%else
|
||||
%bcond_with libalternatives
|
||||
%endif
|
||||
|
||||
%define oldpython python
|
||||
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
||||
Name: python-Mako
|
||||
@@ -41,12 +35,8 @@ BuildRequires: fdupes
|
||||
BuildRequires: python-rpm-macros
|
||||
Requires: python-MarkupSafe >= 0.9.2
|
||||
Requires: python-setuptools
|
||||
%if %{with libalternatives}
|
||||
Requires: alts
|
||||
%else
|
||||
Requires(post): update-alternatives
|
||||
Requires(postun): update-alternatives
|
||||
%endif
|
||||
BuildArch: noarch
|
||||
%if 0%{?suse_version} >= 1000 || 0%{?fedora_version} >= 24
|
||||
Recommends: python-Beaker >= 1.1
|
||||
@@ -76,46 +66,23 @@ scoping semantics.
|
||||
|
||||
%install
|
||||
%python_install
|
||||
%if ! %{with libalternatives}
|
||||
%python_clone -a %{buildroot}%{_bindir}/mako-render
|
||||
%else
|
||||
%python_clone %{buildroot}%{_bindir}/mako-render
|
||||
ln -sf %{_bindir}/alts %{buildroot}%{_bindir}/mako-render
|
||||
mkdir -p %{buildroot}%{_datadir}/libalternatives/mako-render
|
||||
%python_expand echo "binary=%{_bindir}/mako-render-%{$python_version}" > %{buildroot}%{_datadir}/libalternatives/mako-render/10%{$python_version_nodots}.conf
|
||||
%endif
|
||||
%python_clone -a %{buildroot}%{_bindir}/mako-render
|
||||
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
||||
|
||||
%check
|
||||
%pytest
|
||||
|
||||
%if %{with libalternatives}
|
||||
%pre
|
||||
# removing old update-alternatives entries
|
||||
if [ "$1" -gt 0 ] && [ -f %{_sbindir}/update-alternatives ] ; then
|
||||
%python_uninstall_alternative mako-render
|
||||
fi
|
||||
%else
|
||||
%post
|
||||
%python_install_alternative mako-render
|
||||
|
||||
%postun
|
||||
%python_uninstall_alternative mako-render
|
||||
%endif
|
||||
|
||||
%files %{python_files}
|
||||
%license LICENSE
|
||||
%doc CHANGES README.rst
|
||||
%doc examples
|
||||
%if ! 0%{with libalternatives}
|
||||
%python_alternative %{_bindir}/mako-render
|
||||
%else
|
||||
%dir %{_datadir}/libalternatives
|
||||
%dir %{_datadir}/libalternatives/mako-render
|
||||
%{_datadir}/libalternatives/mako-render/10%python_version_nodots.conf
|
||||
%{_bindir}/mako-render
|
||||
%{_bindir}/mako-render-%python_version
|
||||
%endif
|
||||
%{python_sitelib}/mako/
|
||||
%{python_sitelib}/Mako-%{version}-py*.egg-info
|
||||
|
||||
|
||||
Reference in New Issue
Block a user