Remove unused with_python3 (always true)

This commit is contained in:
Miro Hrončok 2018-06-12 13:05:58 +02:00
parent bcac51858f
commit cff973f66a

View File

@ -1,5 +1,3 @@
%global with_python3 1
%global pypi_name lesscpy %global pypi_name lesscpy
%if 0%{?rhel} > 7 %if 0%{?rhel} > 7
@ -45,7 +43,6 @@ Requires: python2-ply
%description -n python2-lesscpy %_description %description -n python2-lesscpy %_description
%endif # with python2 %endif # with python2
%if 0%{?with_python3}
%package -n python3-lesscpy %package -n python3-lesscpy
Summary: Lesscss compiler Summary: Lesscss compiler
Requires: python3-ply Requires: python3-ply
@ -60,59 +57,49 @@ A compiler written in python 3 for the lesscss language. For those of us not
willing/able to have node.js installed in our environment. Not all features willing/able to have node.js installed in our environment. Not all features
of lesscss are supported (yet). Some features wil probably never be of lesscss are supported (yet). Some features wil probably never be
supported (JavaScript evaluation). supported (JavaScript evaluation).
%endif #with_python3
%prep %prep
%setup -q -n %{pypi_name}-%{version} %setup -q -n %{pypi_name}-%{version}
%if 0%{?with_python3}
rm -rf %{py3dir} rm -rf %{py3dir}
cp -a . %{py3dir} cp -a . %{py3dir}
#fix utf8 encoding issue occurring only under py3 #fix utf8 encoding issue occurring only under py3
pushd %{py3dir} pushd %{py3dir}
find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!/usr/bin/python|#!%{__python3}|' find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!/usr/bin/python|#!%{__python3}|'
popd popd
%endif
%build %build
%if %{with python2} %if %{with python2}
%py2_build %py2_build
%endif # with python2 %endif # with python2
%if 0%{?with_python3}
pushd %{py3dir} pushd %{py3dir}
export LANG=en_US.utf8 export LANG=en_US.utf8
env env
%py3_build %py3_build
popd popd
%endif # with_python3
%install %install
%if %{with python2} %if %{with python2}
%py2_install %py2_install
%if 0%{?with_python3}
rm %{buildroot}/%{_bindir}/lesscpy rm %{buildroot}/%{_bindir}/lesscpy
%endif # with python3
%endif # with python2 %endif # with python2
%if 0%{?with_python3}
pushd %{py3dir} pushd %{py3dir}
%py3_install %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
%endif # with_python3
#%check #%check
#%%if %{with python2} #%%if %{with python2}
#nosetests -v #nosetests -v
#%%endif # with python2 #%%endif # with python2
#%%if 0%{?with_python3}
#pushd %{py3dir} #pushd %{py3dir}
#nosetests-3.3 -v #nosetests-3.3 -v
#popd #popd
#%%endif # with_python3
%if %{with python2} %if %{with python2}
%files -n python2-lesscpy %files -n python2-lesscpy
@ -121,15 +108,12 @@ popd
%{python2_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info %{python2_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info
%endif # with python2 %endif # with python2
%if 0%{?with_python3}
%files -n python3-lesscpy %files -n python3-lesscpy
%doc LICENSE %doc LICENSE
%{_bindir}/lesscpy
%{_bindir}/py3-lesscpy %{_bindir}/py3-lesscpy
%{python3_sitelib}/%{pypi_name} %{python3_sitelib}/%{pypi_name}
%{python3_sitelib}/%{pypi_name}*.egg-info %{python3_sitelib}/%{pypi_name}*.egg-info
%endif # with_python3
%{_bindir}/lesscpy
%changelog %changelog