| |
@@ -1,28 +1,25 @@
|
| |
- %if 0%{?fedora} > 12
|
| |
- %global with_python3 1
|
| |
+ %global pypi_name lesscpy
|
| |
+
|
| |
+ %if 0%{?rhel} > 7
|
| |
+ # Disable python2 build by default
|
| |
+ %bcond_with python2
|
| |
%else
|
| |
- %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib())")}
|
| |
+ %bcond_without python2
|
| |
%endif
|
| |
|
| |
- %global pypi_name lesscpy
|
| |
-
|
| |
Name: python-%{pypi_name}
|
| |
Version: 0.13.0
|
| |
- Release: 2%{?dist}
|
| |
+ Release: 3%{?dist}
|
| |
Summary: Lesscss compiler
|
| |
|
| |
License: MIT
|
| |
URL: https://github.com/robotis/lesscpy
|
| |
Source0: https://pypi.python.org/packages/source/l/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
|
| |
+
|
| |
+ Patch0: https://github.com/lesscpy/lesscpy/pull/99.patch#/%{pypi_name}-fix-test.patch
|
| |
+
|
| |
BuildArch: noarch
|
| |
|
| |
- BuildRequires: python2-devel
|
| |
- BuildRequires: python2-setuptools
|
| |
- BuildRequires: python2-ply
|
| |
- BuildRequires: python2-nose
|
| |
- BuildRequires: python2-coverage
|
| |
- BuildRequires: python2-flake8
|
| |
-
|
| |
%global _description\
|
| |
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\
|
| |
@@ -31,90 +28,91 @@
|
| |
|
| |
%description %_description
|
| |
|
| |
+ %if %{with python2}
|
| |
%package -n python2-lesscpy
|
| |
- Summary: %summary
|
| |
+ Summary: %summary
|
| |
Requires: python2-ply
|
| |
+ Requires: python2-six
|
| |
+ BuildRequires: python2-devel
|
| |
+ BuildRequires: python2-setuptools
|
| |
+ BuildRequires: python2-ply
|
| |
+ BuildRequires: python2-nose
|
| |
+ BuildRequires: python2-coverage
|
| |
+ BuildRequires: python2-flake8
|
| |
+ BuildRequires: python2-six
|
| |
%{?python_provide:%python_provide python2-lesscpy}
|
| |
|
| |
%description -n python2-lesscpy %_description
|
| |
+ %endif # with python2
|
| |
|
| |
- %if 0%{?with_python3}
|
| |
%package -n python3-lesscpy
|
| |
- Summary: Lesscss compiler
|
| |
+ Summary: %summary
|
| |
Requires: python3-ply
|
| |
+ Requires: python3-six
|
| |
BuildRequires: python3-devel
|
| |
BuildRequires: python3-setuptools
|
| |
BuildRequires: python3-ply
|
| |
BuildRequires: python3-nose
|
| |
BuildRequires: python3-flake8
|
| |
BuildRequires: python3-coverage
|
| |
+ BuildRequires: python3-six
|
| |
+ %{?python_provide:%python_provide python3-lesscpy}
|
| |
+
|
| |
%description -n python3-lesscpy
|
| |
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
|
| |
of lesscss are supported (yet). Some features wil probably never be
|
| |
supported (JavaScript evaluation).
|
| |
- %endif #with_python3
|
| |
|
| |
%prep
|
| |
- %setup -q -n %{pypi_name}-%{version}
|
| |
-
|
| |
- %if 0%{?with_python3}
|
| |
- rm -rf %{py3dir}
|
| |
- cp -a . %{py3dir}
|
| |
- #fix utf8 encoding issue occurring only under py3
|
| |
- pushd %{py3dir}
|
| |
- find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!/usr/bin/python|#!%{__python3}|'
|
| |
- popd
|
| |
- %endif
|
| |
+ %autosetup -p1 -n %{pypi_name}-%{version}
|
| |
|
| |
%build
|
| |
- %{__python} setup.py build
|
| |
- %if 0%{?with_python3}
|
| |
- pushd %{py3dir}
|
| |
- export LANG=en_US.utf8
|
| |
- env
|
| |
- %{__python3} setup.py build
|
| |
- popd
|
| |
- %endif # with_python3
|
| |
+ %if %{with python2}
|
| |
+ %py2_build
|
| |
+ %endif # with python2
|
| |
|
| |
+ %py3_build
|
| |
|
| |
- %install
|
| |
- %{__python} setup.py install --skip-build --root %{buildroot}
|
| |
|
| |
- %if 0%{?with_python3}
|
| |
+ %install
|
| |
+ %if %{with python2}
|
| |
+ %py2_install
|
| |
rm %{buildroot}/%{_bindir}/lesscpy
|
| |
- pushd %{py3dir}
|
| |
- %{__python3} setup.py install --skip-build --root %{buildroot}
|
| |
+ %endif # with python2
|
| |
|
| |
+ %py3_install
|
| |
# link for backwards compatibility. consider removal in Fedora 30+
|
| |
ln -s ./lesscpy %{buildroot}/%{_bindir}/py3-lesscpy
|
| |
- popd
|
| |
- %endif # with_python3
|
| |
|
| |
|
| |
- #%check
|
| |
- #nosetests -v
|
| |
- #%if 0%{?with_python3}
|
| |
- #pushd %{py3dir}
|
| |
- #nosetests-3.3 -v
|
| |
- #popd
|
| |
- #%endif # with_python3
|
| |
+ %check
|
| |
+ %if %{with python2}
|
| |
+ %{__python2} -m nose -v
|
| |
+ %endif # with python2
|
| |
+ %{__python3} -m nose -v
|
| |
|
| |
+ %if %{with python2}
|
| |
%files -n python2-lesscpy
|
| |
%doc LICENSE
|
| |
- %{python_sitelib}/%{pypi_name}
|
| |
- %{python_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info
|
| |
- %if 0%{?with_python3}
|
| |
+ %{python2_sitelib}/%{pypi_name}
|
| |
+ %{python2_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info
|
| |
+ %endif # with python2
|
| |
+
|
| |
%files -n python3-lesscpy
|
| |
%doc LICENSE
|
| |
+ %{_bindir}/lesscpy
|
| |
%{_bindir}/py3-lesscpy
|
| |
%{python3_sitelib}/%{pypi_name}
|
| |
%{python3_sitelib}/%{pypi_name}*.egg-info
|
| |
- %endif # with_python3
|
| |
- %{_bindir}/lesscpy
|
| |
|
| |
|
| |
%changelog
|
| |
+ * Tue Jun 12 2018 Miro Hrončok <mhroncok@redhat.com> - 0.13.0-3
|
| |
+ - General spec cleanup
|
| |
+ - Add missing dependency on six
|
| |
+ - Run the tests
|
| |
+
|
| |
* Tue Jun 12 2018 Miro Hrončok <mhroncok@redhat.com> - 0.13.0-2
|
| |
- /usr/bin/lesscpy is Python 3
|
| |
|
| |