python-cython/python-cython.spec
2014-01-05 00:58:49 +01:00

88 lines
2.2 KiB
RPMSpec

%define tarname Cython
%define develname %mklibname -d %{name}
Summary: Language for writing C extensions to Python
Name: python-cython
Version: 0.19.2
Release: 1
Source0: https://pypi.python.org/packages/source/C/Cython/Cython-%{version}.tar.gz
License: Apache License
Group: Development/Python
Url: http://www.cython.org
BuildRequires: pkgconfig(python)
BuildRequires: pythonegg(setuptools)
BuildRequires: dos2unix
BuildRequires: emacs
%description
Cython is a language that facilitates the writing of C extensions for
the Python language. It is based on Pyrex, but provides more cutting
edge functionality and optimizations.
#-------------
%package -n %{develname}
Summary: Devel files for %{name}
Group: Development/Python
Requires: %{name} = %{version}-%{release}
%description -n %{develname}
Devel files for %{name}.
%files -n %{develname}
%doc *.txt
%{py_platsitedir}/Cython/Utility/*.c
%{py_platsitedir}/Cython/Utility/*.h
%{py_platsitedir}/Cython/Utility/*.cpp
%{py_platsitedir}/Cython/Debugger/Tests/*.c
#-----------------
%prep
%setup -q -n %{tarname}-%{version}
# Fix non-executable scripts
sed -i "s|^#!.*||" Cython/Debugger/{libpython,Cygdb}.py
sed -i "s|^#!.*||" cython.py
# Fix EOL encoding
sed -i "s|\r||" Demos/callback/{README.txt,cheesefinder.h}
sed -i "s|\r||" Demos/embed/Makefile.{unix,msc.static}
sed -i "s|\r||" Doc/primes.c
%build
CFLAGS="%{optflags}" python setup.py build
%install
find -name .*DS_Store* | xargs rm -rf
python setup.py install -O1 --skip-build --root %{buildroot}
rm -rf %{buildroot}%{py_platsitedir}/setuptools/tests
pushd Tools
dos2unix cython-mode.el
install -m 755 -d %{buildroot}%{_sysconfdir}/emacs/site-start.d
install -m 644 *.el* %{buildroot}%{_sysconfdir}/emacs/site-start.d
popd
%files
%doc *.txt Demos Doc Tools
%{_bindir}/cython
%{_bindir}/cygdb
%{py_platsitedir}/Cython
%{py_platsitedir}/cython.py*
%{py_platsitedir}/pyximport
%{py_platsitedir}/Cython*egg-info
%config(noreplace) %{_sysconfdir}/emacs/site-start.d/*.el*
# in devel
%exclude %{py_platsitedir}/Cython/Utility/*.c
%exclude %{py_platsitedir}/Cython/Utility/*.cpp
%exclude %{py_platsitedir}/Cython/Utility/*.h
%exclude %{py_platsitedir}/Cython/Debugger/Tests/cfuncs.c