Blob Blame History Raw
%{?mingw_package_header}

%global pkgname Cython

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

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


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.


%{?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
* Mon Nov 06 2017 Sandro Mani <manisandro@gmail.com> - 0.27.3-1
- Update to 0.27.3

* Mon Oct 02 2017 Sandro Mani <manisandro@gmail.com> - 0.27.1-1
- Update to 0.27.1

* 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