# sitelib for noarch packages, sitearch for others (remove the unneeded one)
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
# Filter the _speedups.so provides that otherwise comes into the provides
%global __provides_exclude_from ^(%{python_sitearch}/.*\\.so)$
# Github commit hash
%global commit 2c10593a7bcec17b8d3dcca9ba40e24868f8ca5c
%global shortcommit %(c=%{commit}; echo ${c:0:7})
Name: python-scss
Version: 1.2.0
Release: 3%{?dist}
Summary: A Scss compiler for Python
License: MIT
URL: https://github.com/Kronuz/pyScss
Source0: https://github.com/Kronuz/pyScss/archive/%{commit}/%{name}-%{version}-%{shortcommit}.tar.gz
# Review request for this is filed: https://github.com/Kronuz/pyScss/pull/241
Patch0: python-scss-remove-shebangs.patch
BuildRequires: python2-devel
BuildRequires: python-six
BuildRequires: python-sphinx
BuildRequires: pcre-devel
Requires: python-six
Requires: python-setuptools
%description
A Scss compiler for Python
%prep
%setup -q -n pyScss-%{commit}
%patch0 -p0
%build
CFLAGS="%{optflags}" %{__python} setup.py build
cd docs
make SPHINXBUILD=sphinx-build man
%install
%{__python} setup.py install -O1 --skip-build --root %{buildroot}
chmod +x %{buildroot}%{python_sitearch}/scss/tool.py
mkdir -p %{buildroot}%{_mandir}/man1/
cp -ar docs/_build/man/pyscss.1 %{buildroot}%{_mandir}/man1/pyscss.1
%files
%doc DESCRIPTION LICENSE README.rst
%{python_sitearch}/*
%{_bindir}/pyscss
%{_mandir}/man1/pyscss.1.gz
%changelog
* Tue Feb 25 2014 Patrick Uiterwijk <puiterwijk@redhat.com> - 1.2.0-3
- Require python-setuptools as thats needed for the binary to work
* Wed Nov 06 2013 Patrick Uiterwijk <puiterwijk@gmail.com> - 1.2.0-2
- Buildrequire set to python2-devel
- Added buildrequire pcre-devel
- Changed URL to Source
- Added -a to cp to retain timestamp
* Thu Oct 17 2013 Patrick Uiterwijk <puiterwijk@gmail.com> - 1.2.0-1
- Initial packaging