Blob Blame History Raw
%{?mingw_package_header}

%global pkgname Cython

Name:          mingw-%{pkgname}
Summary:       MinGW Windows Python %{pkgname} library
Version:       0.25.2
Release:       2%{?dist}
BuildArch:     noarch

License:       ASL 2.0
URL:           http://www.cython.org
Source:        https://github.com/cython/cython/archive/%{version}/cython-%{version}.tar.gz

# https://bugzilla.redhat.com/show_bug.cgi?id=1406533
# https://github.com/cython/cython/pull/1560
Patch1:        0001-fix-typo-in-Compiler-Options.py.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=1406905
# https://github.com/cython/cython/pull/483
Patch2:        0001-Check-sys.path-for-.pxi-files-too.patch


BuildRequires: mingw32-filesystem >= 102
BuildRequires: mingw32-gcc
BuildRequires: mingw32-python2
BuildRequires: mingw32-python2-setuptools

BuildRequires: mingw64-filesystem >= 102
BuildRequires: mingw64-gcc
BuildRequires: mingw64-python2
BuildRequires: mingw64-python2-setuptools


%description
MinGW Windows Python %{pkgname} library.


%package -n mingw32-python2-%{pkgname}
Summary:       MinGW Windows Python2 %{pkgname} library

%description -n mingw32-python2-%{pkgname}
MinGW Windows Python2 %{pkgname} library.


%package -n mingw64-python2-%{pkgname}
Summary:       MinGW Windows Python2 %{pkgname} library

%description -n mingw64-python2-%{pkgname}
MinGW Windows Python2 %{pkgname} library.


# No binaries
%{?mingw_debug_package}


%prep
%autosetup -p1 -n cython-%{version}


%build
%{mingw32_python2} setup.py build -b build_mingw32
%{mingw64_python2} setup.py build -b build_mingw64



%install
ln -s build_mingw32 build
%{mingw32_python2} setup.py install -O1 --skip-build --root=%{buildroot}
rm build

ln -s build_mingw64 build
%{mingw64_python2} setup.py install -O1 --skip-build  --root=%{buildroot}
rm build

# Exclude debug files from the main files (note: the debug files are only created after %%install, so we can't search for them directly)
find %{buildroot}%{mingw32_prefix} | grep -E '.(exe|dll|pyd)$' | sed 's|^%{buildroot}\(.*\)$|%%exclude \1.debug|' > mingw32-python2-%{pkgname}.debugfiles
find %{buildroot}%{mingw64_prefix} | grep -E '.(exe|dll|pyd)$' | sed 's|^%{buildroot}\(.*\)$|%%exclude \1.debug|' > mingw64-python2-%{pkgname}.debugfiles


%files -n mingw32-python2-%{pkgname} -f mingw32-python2-%{pkgname}.debugfiles
%license LICENSE.txt
%{mingw32_bindir}/cygdb
%{mingw32_bindir}/cython
%{mingw32_bindir}/cythonize
%{mingw32_python2_sitearch}/*

%files -n mingw64-python2-%{pkgname} -f mingw64-python2-%{pkgname}.debugfiles
%license LICENSE.txt
%{mingw64_bindir}/cygdb
%{mingw64_bindir}/cython
%{mingw64_bindir}/cythonize
%{mingw64_python2_sitearch}/*


%changelog
* Sat Sep 09 2017 Sandro Mani <manisandro@gmail.com> - 0.25.2-2
- Rebuild for mingw-filesystem

* Thu Aug 31 2017 Sandro Mani <manisandro@gmail.com> - 0.25.2-1
- Initial package