python-cython/python-cython.spec

89 lines
2.2 KiB
RPMSpec
Raw Normal View History

2012-02-01 14:24:13 +04:00
%define tarname Cython
%define develname %mklibname -d %{name}
2012-02-01 14:24:13 +04:00
Summary: Language for writing C extensions to Python
2012-10-03 23:20:47 +04:00
Name: python-cython
Version: 0.19.2
Release: 1
Source0: https://pypi.python.org/packages/source/C/Cython/Cython-%{version}.tar.gz
2012-02-01 14:24:13 +04:00
License: Apache License
Group: Development/Python
Url: http://www.cython.org
2014-01-05 02:22:19 +04:00
BuildRequires: pkgconfig(python)
2014-01-05 02:13:20 +04:00
BuildRequires: pythonegg(setuptools)
2012-02-01 14:24:13 +04:00
BuildRequires: dos2unix
BuildRequires: emacs
2012-02-01 14:24:13 +04:00
%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.
2013-03-28 16:43:26 +04:00
#-------------
%package -n %{develname}
Summary: Devel files for %{name}
Group: Development/Python
Requires: %{name} = %{version}-%{release}
%description -n %{develname}
Devel files for %{name}.
2013-03-28 16:43:26 +04:00
%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
2013-03-28 16:43:26 +04:00
#-----------------
2012-02-01 14:24:13 +04:00
%prep
%setup -q -n %{tarname}-%{version}
# Fix non-executable scripts
sed -i "s|^#!.*||" Cython/Debugger/{libpython,Cygdb}.py
sed -i "s|^#!.*||" cython.py
2012-02-01 14:24:13 +04:00
# 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
2013-03-28 16:43:26 +04:00
%build
CFLAGS="%{optflags}" python setup.py build
2013-03-28 16:43:26 +04:00
2014-01-05 02:13:20 +04:00
%install
2012-02-01 14:24:13 +04:00
find -name .*DS_Store* | xargs rm -rf
python setup.py install -O1 --skip-build --root %{buildroot}
rm -rf %{buildroot}%{py_platsitedir}/setuptools/tests
2012-02-01 14:24:13 +04:00
pushd Tools
dos2unix cython-mode.el
2014-01-05 02:13:20 +04:00
install -m 755 -d %{buildroot}%{_sysconfdir}/emacs/site-start.d
install -m 644 *.el* %{buildroot}%{_sysconfdir}/emacs/site-start.d
2013-03-28 16:43:26 +04:00
popd
2012-02-01 14:24:13 +04:00
2014-01-05 02:13:20 +04:00
2012-10-03 23:20:47 +04:00
%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
2012-02-01 14:24:13 +04:00