9c4604b
%global	modname	cysignals
9c4604b
5425116
# Python files are installed into nonstandard locations
5425116
%global _python_bytecompile_extra 0
5425116
9c4604b
Name:		python-%{modname}
105d415
Version:	1.10.2
a207261
Release:	7%{?dist}
9c4604b
Summary:	Interrupt and signal handling for Cython
9c4604b
License:	LGPLv3+
9c4604b
URL:		https://github.com/sagemath/%{modname}
2526b5e
Source0:	https://github.com/sagemath/%{modname}/releases/download/%{version}/%{modname}-%{version}.tar.gz
105d415
BuildRequires:	gcc
105d415
BuildRequires:	gcc-c++
9c4604b
BuildRequires:	pari-devel
9c4604b
# https://bugzilla.redhat.com/show_bug.cgi?id=1445411#c2
2526b5e
Patch0:		%{name}-gdb.patch
2526b5e
# Linux already clears the FPU state
2526b5e
Patch1:		%{name}-emms.patch
2526b5e
# Counteract _FORTIFY_SOURCE
2526b5e
Patch2:		%{name}-fortify.patch
2526b5e
# Fix underlinked signals.so
5425116
Patch3:		%{name}-underlink.patch
972c9aa
# Do not fail if cysignals_crash_logs cannot be created
972c9aa
Patch4:		%{name}-crash-logs.patch
972c9aa
# Remove workaround for Cython bug that is already fixed in Fedora
972c9aa
Patch5:		%{name}-sigismember.patch
9c4604b
972c9aa
%global _description %{expand:
972c9aa
When writing Cython code, special care must be taken to ensure that the
972c9aa
code can be interrupted with CTRL-C. Since Cython optimizes for speed,
972c9aa
Cython normally does not check for interrupts. For example, code like
972c9aa
the following cannot be interrupted in Cython:
972c9aa
972c9aa
while True:
972c9aa
    pass
972c9aa
972c9aa
The cysignals package provides mechanisms to handle interrupts
972c9aa
(and other signals and errors) in Cython code.
972c9aa
972c9aa
See http://cysignals.readthedocs.org/ for the full documentation.}
9c4604b
9c4604b
%description	%{_description}
9c4604b
9c4604b
%package	-n python3-%{modname}
9c4604b
Summary:	%{summary}
9c4604b
BuildRequires:	python3-devel
972c9aa
BuildRequires:	python3-docs
585c6ac
BuildRequires:	python3dist(cython)
585c6ac
BuildRequires:	python3dist(setuptools)
585c6ac
9c4604b
%description	-n python3-%{modname} %{_description}
9c4604b
9c4604b
%package	-n python3-%{modname}-devel
9c4604b
Summary:	%{summary} headers files
9c4604b
Requires:	python3-%{modname}
585c6ac
9c4604b
%description	-n python3-%{modname}-devel %{_description}
9c4604b
9c4604b
%package	doc
9c4604b
Summary:	Documentation for %{name}
585c6ac
BuildRequires:	python3dist(sphinx)
585c6ac
Requires:	python3-%{modname}
9c4604b
BuildArch:	noarch
9c4604b
%description	doc
9c4604b
Documentation and examples for %{name}.
9c4604b
9c4604b
%prep
585c6ac
%autosetup -p0 -n %{modname}-%{version}
9c4604b
972c9aa
# Use local objects.inv for intersphinx
972c9aa
sed -i "s|'https://docs\.python\.org/2\.7', None|'https://docs.python.org/3', '%{_docdir}/python3-docs/html/objects.inv'|" docs/source/conf.py
972c9aa
972c9aa
# Build for python 3
972c9aa
sed -i 's/language_level=2/language_level=3/' setup.py
972c9aa
9c4604b
%build
2526b5e
%configure
9c4604b
%py3_build
2526b5e
2526b5e
# Build the documentation
585c6ac
export PYTHONPATH=$PWD/$(ls -1d build/lib.linux*%{python3_version})
972c9aa
%__make -C docs html
972c9aa
rst2html --no-datestamp README.rst README.html
9c4604b
9c4604b
%install
9c4604b
%py3_install
9c4604b
mkdir -p %{buildroot}%{_docdir}/%{name}
9c4604b
cp -farp docs/build/html %{buildroot}%{_docdir}/%{name}
9c4604b
rm %{buildroot}%{_docdir}/%{name}/html/.buildinfo
9c4604b
9c4604b
%check
9c4604b
PATH=%{buildroot}%{_bindir}:$PATH
9c4604b
PYTHONPATH=%{buildroot}%{python3_sitearch}
585c6ac
export PATH PYTHONPATH
585c6ac
%{__python3} rundoctests.py src/cysignals/*.pyx
9c4604b
9c4604b
%files		-n python3-%{modname}
9c4604b
%license LICENSE
972c9aa
%doc README.html
585c6ac
%{_bindir}/%{modname}-CSI
5425116
%{_datadir}/%{modname}/
9c4604b
%{python3_sitearch}/%{modname}
9c4604b
%{python3_sitearch}/%{modname}-*.egg-info
9c4604b
%exclude %{python3_sitearch}/%{modname}/*.h
9c4604b
%exclude %{python3_sitearch}/%{modname}/*.pxd
9c4604b
%exclude %{python3_sitearch}/%{modname}/*.pxi
9c4604b
9c4604b
%files		-n python3-%{modname}-devel
9c4604b
%{python3_sitearch}/%{modname}/*.h
9c4604b
%{python3_sitearch}/%{modname}/*.pxd
9c4604b
%{python3_sitearch}/%{modname}/*.pxi
9c4604b
9c4604b
%files		doc
9c4604b
%dir %{_docdir}/%{name}
9c4604b
%{_docdir}/%{name}/html
9c4604b
9c4604b
%changelog
a207261
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 1.10.2-7
a207261
- Rebuilt for Python 3.9
a207261
fd29e3c
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.10.2-6
fd29e3c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
fd29e3c
972c9aa
* Sat Jan 25 2020 Jerry James <loganjerry@gmail.com> - 1.10.2-5
972c9aa
- Do not try to write to an unwritable directory (bz 1751021)
972c9aa
- Fix cross-references in the documentation
972c9aa
06d125b
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 1.10.2-4
06d125b
- Rebuilt for Python 3.8.0rc1 (#1748018)
06d125b
d7a49bd
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 1.10.2-3
d7a49bd
- Rebuilt for Python 3.8
d7a49bd
b778027
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.10.2-2
b778027
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
b778027
105d415
* Tue Apr 23 2019 Jerry James <loganjerry@gmail.com> - 1.10.2-1
105d415
- New upstream release
105d415
c02bdf4
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.8.1-2
c02bdf4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
c02bdf4
585c6ac
* Thu Jan 17 2019 Jerry James <loganjerry@gmail.com> - 1.8.1-1
585c6ac
- New upstream release
585c6ac
- Drop python2 subpackages (bz 1663842)
585c6ac
5425116
* Fri Aug 10 2018 Jerry James <loganjerry@gmail.com> - 1.7.2-1
5425116
- New upstream release (bz 1601237)
5425116
- Drop upstreamed -import patch
5425116
- The Cython libraries are used at runtime, so add Requires
5425116
439efd2
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.7.1-3
439efd2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
439efd2
005231b
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 1.7.1-2
005231b
- Rebuilt for Python 3.7
005231b
2526b5e
* Sat Jun  2 2018 Jerry James <loganjerry@gmail.com> - 1.7.1-1
2526b5e
- New upstream version for sagemath 8.2 (bz 1473458)
2526b5e
- Add -fortify, -import, and -underlink patches
2526b5e
c5a72f6
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.6.4-3
c5a72f6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
c5a72f6
7f8f60e
* Thu Jan 18 2018 Iryna Shcherbina <ishcherb@redhat.com> - 1.6.4-2
7f8f60e
- Update Python 2 dependency declarations to new packaging standards
7f8f60e
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
7f8f60e
f6bfc8b
* Wed Nov 08 2017 pcpa <paulo.cesar.pereira.de.andrade@gmail.com> - 1.6.2-1
f6bfc8b
- Update to version required by sagemath 8.0
f6bfc8b
6cceb36
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.2-5
6cceb36
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
6cceb36
65acd2d
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.2-4
65acd2d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
65acd2d
9c4604b
* Thu Apr 27 2017 pcpa <paulo.cesar.pereira.de.andrade@gmail.com> - 1.3.2-3
9c4604b
- Correct mixed tabs and spaces in the spec (#1445411#c5)
9c4604b
9c4604b
* Wed Apr 26 2017 pcpa <paulo.cesar.pereira.de.andrade@gmail.com> - 1.3.2-2
9c4604b
- Remove python preloading (#1445411#c2)
9c4604b
- Add python provides to python3 subpackage (#1445411#c3)
9c4604b
- Add changelog section (#1445411#c3)
9c4604b
- Add URL tag (#1445411#c3)
9c4604b
- Correct license to LGPLv3+ (#1445411#c3)
9c4604b
- Change doc subpackage to noarch
9c4604b
- Correct owner of documentation directory (#1445411#c3)
9c4604b
- Do not call the emms instruction on x86 (#1445411#c3)
9c4604b
- Do not install .buildinfo file in doc subpackage (#1445411#c3)
9c4604b
- Correct problems in python3 tests in %%check due to Popen python
9c4604b
- Install a python 2 or 3 specific cysignals-CSI
9c4604b
- Add requires to the LICENSE file in the doc subpackage (#1445411#c3)
9c4604b
9c4604b
* Wed Apr 26 2017 pcpa <paulo.cesar.pereira.de.andrade@gmail.com> - 1.3.2-1
9c4604b
- Initial python-cysignals spec.