Blame SPECS/python-lesscpy.spec

28007d
%if 0%{?fedora} > 12
28007d
%global with_python3 1
28007d
%else
28007d
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib())")}
28007d
%endif
28007d
28007d
%global pypi_name lesscpy
28007d
28007d
Name:           python-%{pypi_name}
28007d
Version:        0.9j
28007d
Release:        1%{?dist}
28007d
Summary:        Lesscss compiler
28007d
28007d
License:        MIT
28007d
URL:            https://github.com/robotis/lesscpy
28007d
Source0:        https://pypi.python.org/packages/source/l/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
28007d
BuildArch:      noarch
28007d
28007d
BuildRequires:  python2-devel
28007d
BuildRequires:  python-setuptools
28007d
BuildRequires:  python-ply
28007d
28007d
Requires:       python-ply
28007d
Patch0:         python-lesscpy-fix-setup-encoding-issue.patch
28007d
%description
28007d
A compiler written in python 3 for the lesscss language.  For those of us not
28007d
willing/able to have node.js installed in our environment.  Not all features
28007d
of lesscss are supported (yet).  Some features wil probably never be
28007d
supported (JavaScript evaluation).
28007d
28007d
%if 0%{?with_python3}
28007d
%package -n python3-lesscpy
28007d
Summary:    Lesscss compiler
28007d
Requires:   python3-ply
28007d
BuildRequires: python3-devel
28007d
BuildRequires: python3-setuptools
28007d
BuildRequires: python3-ply
28007d
%description -n python3-lesscpy
28007d
A compiler written in python 3 for the lesscss language.  For those of us not
28007d
willing/able to have node.js installed in our environment.  Not all features
28007d
of lesscss are supported (yet).  Some features wil probably never be
28007d
supported (JavaScript evaluation).
28007d
%endif #with_python3
28007d
28007d
%prep
28007d
%setup -q -n %{pypi_name}-%{version}
28007d
28007d
%if 0%{?with_python3}
28007d
rm -rf %{py3dir}
28007d
cp -a . %{py3dir}
28007d
#fix utf8 encoding issue occurring only under py3
28007d
pushd %{py3dir}
28007d
%patch0 -p1
28007d
find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!/usr/bin/python|#!%{__python3}|'
28007d
popd
28007d
%endif
28007d
28007d
%build
28007d
%{__python} setup.py build
28007d
%if 0%{?with_python3}
28007d
pushd %{py3dir}
28007d
export LANG=en_US.utf8
28007d
env
28007d
%{__python3} setup.py build
28007d
popd
28007d
%endif # with_python3
28007d
28007d
28007d
%install
28007d
%if 0%{?with_python3}
28007d
pushd %{py3dir}
28007d
%{__python3} setup.py install --skip-build --root %{buildroot}
28007d
mv %{buildroot}/%{_bindir}/lesscpy %{buildroot}/%{_bindir}/py3-lesscpy
28007d
popd
28007d
%endif # with_python3
28007d
28007d
%{__python} setup.py install --skip-build --root %{buildroot}
28007d
28007d
28007d
%check
28007d
28007d
%{__python} lesscpy/test/__main__.py
28007d
%if 0%{?with_python3}
28007d
pushd %{py3dir}
28007d
%{__python3} lesscpy/test/__main__.py
28007d
popd
28007d
%endif # with_python3
28007d
28007d
%files
28007d
%doc LICENSE
28007d
%{python_sitelib}/%{pypi_name}
28007d
%{python_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info
28007d
%{_bindir}/lesscpy
28007d
%if 0%{?with_python3}
28007d
%files -n python3-lesscpy
28007d
%doc LICENSE
28007d
%{_bindir}/py3-lesscpy
28007d
%{python3_sitelib}/%{pypi_name}
28007d
%{python3_sitelib}/%{pypi_name}*.egg-info
28007d
%endif # with_python3
28007d
28007d
28007d
%changelog
28007d
* Mon Sep 8 2014 Petr Vobornik <mpvoborni@redhat.com> - 0.9j-1
28007d
- Initial package for RHEL 7.