Conditionalize the python2 subpackage
This commit is contained in:
parent
275ef13225
commit
bcac51858f
@ -1,11 +1,14 @@
|
|||||||
%if 0%{?fedora} > 12
|
|
||||||
%global with_python3 1
|
%global with_python3 1
|
||||||
%else
|
|
||||||
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib())")}
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%global pypi_name lesscpy
|
%global pypi_name lesscpy
|
||||||
|
|
||||||
|
%if 0%{?rhel} > 7
|
||||||
|
# Disable python2 build by default
|
||||||
|
%bcond_with python2
|
||||||
|
%else
|
||||||
|
%bcond_without python2
|
||||||
|
%endif
|
||||||
|
|
||||||
Name: python-%{pypi_name}
|
Name: python-%{pypi_name}
|
||||||
Version: 0.13.0
|
Version: 0.13.0
|
||||||
Release: 2%{?dist}
|
Release: 2%{?dist}
|
||||||
@ -16,12 +19,14 @@ URL: https://github.com/robotis/lesscpy
|
|||||||
Source0: https://pypi.python.org/packages/source/l/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
|
Source0: https://pypi.python.org/packages/source/l/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
|
|
||||||
|
%if %{with python2}
|
||||||
BuildRequires: python2-devel
|
BuildRequires: python2-devel
|
||||||
BuildRequires: python2-setuptools
|
BuildRequires: python2-setuptools
|
||||||
BuildRequires: python2-ply
|
BuildRequires: python2-ply
|
||||||
BuildRequires: python2-nose
|
BuildRequires: python2-nose
|
||||||
BuildRequires: python2-coverage
|
BuildRequires: python2-coverage
|
||||||
BuildRequires: python2-flake8
|
BuildRequires: python2-flake8
|
||||||
|
%endif # with python2
|
||||||
|
|
||||||
%global _description\
|
%global _description\
|
||||||
A compiler written in python 3 for the lesscss language. For those of us not\
|
A compiler written in python 3 for the lesscss language. For those of us not\
|
||||||
@ -31,12 +36,14 @@ supported (JavaScript evaluation).
|
|||||||
|
|
||||||
%description %_description
|
%description %_description
|
||||||
|
|
||||||
|
%if %{with python2}
|
||||||
%package -n python2-lesscpy
|
%package -n python2-lesscpy
|
||||||
Summary: %summary
|
Summary: %summary
|
||||||
Requires: python2-ply
|
Requires: python2-ply
|
||||||
%{?python_provide:%python_provide python2-lesscpy}
|
%{?python_provide:%python_provide python2-lesscpy}
|
||||||
|
|
||||||
%description -n python2-lesscpy %_description
|
%description -n python2-lesscpy %_description
|
||||||
|
%endif # with python2
|
||||||
|
|
||||||
%if 0%{?with_python3}
|
%if 0%{?with_python3}
|
||||||
%package -n python3-lesscpy
|
%package -n python3-lesscpy
|
||||||
@ -68,24 +75,29 @@ popd
|
|||||||
%endif
|
%endif
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%{__python} setup.py build
|
%if %{with python2}
|
||||||
|
%py2_build
|
||||||
|
%endif # with python2
|
||||||
%if 0%{?with_python3}
|
%if 0%{?with_python3}
|
||||||
pushd %{py3dir}
|
pushd %{py3dir}
|
||||||
export LANG=en_US.utf8
|
export LANG=en_US.utf8
|
||||||
env
|
env
|
||||||
%{__python3} setup.py build
|
%py3_build
|
||||||
popd
|
popd
|
||||||
%endif # with_python3
|
%endif # with_python3
|
||||||
|
|
||||||
|
|
||||||
%install
|
%install
|
||||||
%{__python} setup.py install --skip-build --root %{buildroot}
|
%if %{with python2}
|
||||||
|
%py2_install
|
||||||
%if 0%{?with_python3}
|
%if 0%{?with_python3}
|
||||||
rm %{buildroot}/%{_bindir}/lesscpy
|
rm %{buildroot}/%{_bindir}/lesscpy
|
||||||
pushd %{py3dir}
|
%endif # with python3
|
||||||
%{__python3} setup.py install --skip-build --root %{buildroot}
|
%endif # with python2
|
||||||
|
|
||||||
|
%if 0%{?with_python3}
|
||||||
|
pushd %{py3dir}
|
||||||
|
%py3_install
|
||||||
# link for backwards compatibility. consider removal in Fedora 30+
|
# link for backwards compatibility. consider removal in Fedora 30+
|
||||||
ln -s ./lesscpy %{buildroot}/%{_bindir}/py3-lesscpy
|
ln -s ./lesscpy %{buildroot}/%{_bindir}/py3-lesscpy
|
||||||
popd
|
popd
|
||||||
@ -93,17 +105,22 @@ popd
|
|||||||
|
|
||||||
|
|
||||||
#%check
|
#%check
|
||||||
|
#%%if %{with python2}
|
||||||
#nosetests -v
|
#nosetests -v
|
||||||
#%if 0%{?with_python3}
|
#%%endif # with python2
|
||||||
|
#%%if 0%{?with_python3}
|
||||||
#pushd %{py3dir}
|
#pushd %{py3dir}
|
||||||
#nosetests-3.3 -v
|
#nosetests-3.3 -v
|
||||||
#popd
|
#popd
|
||||||
#%endif # with_python3
|
#%%endif # with_python3
|
||||||
|
|
||||||
|
%if %{with python2}
|
||||||
%files -n python2-lesscpy
|
%files -n python2-lesscpy
|
||||||
%doc LICENSE
|
%doc LICENSE
|
||||||
%{python_sitelib}/%{pypi_name}
|
%{python2_sitelib}/%{pypi_name}
|
||||||
%{python_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info
|
%{python2_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info
|
||||||
|
%endif # with python2
|
||||||
|
|
||||||
%if 0%{?with_python3}
|
%if 0%{?with_python3}
|
||||||
%files -n python3-lesscpy
|
%files -n python3-lesscpy
|
||||||
%doc LICENSE
|
%doc LICENSE
|
||||||
@ -111,6 +128,7 @@ popd
|
|||||||
%{python3_sitelib}/%{pypi_name}
|
%{python3_sitelib}/%{pypi_name}
|
||||||
%{python3_sitelib}/%{pypi_name}*.egg-info
|
%{python3_sitelib}/%{pypi_name}*.egg-info
|
||||||
%endif # with_python3
|
%endif # with_python3
|
||||||
|
|
||||||
%{_bindir}/lesscpy
|
%{_bindir}/lesscpy
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user