Blob Blame History Raw
%global giacver 1.4.9.1
%global module  giacpy

%global with_check  1

# Architectures currently not supported
# http://xcas.e.ujf-grenoble.fr/XCAS/viewtopic.php?f=19&t=1723
ExcludeArch: aarch64 %{power64} s390x

Name:           python-%{module}
Version:        0.6.5
Release:        3%{?dist}
Summary:        Python binding for Giac
License:        GPLv2+
URL:            http://webusers.imj-prg.fr/~frederic.han/xcas/giacpy/
Source0:        https://files.pythonhosted.org/packages/source/g/%{module}/%{module}-%{version}.tar.gz
BuildRequires:  giac-devel >= %{giacver}
BuildRequires:  giac-doc   >= %{giacver}
BuildRequires:  gmp-devel, qt5-qtsvg-devel

%description
A Cython frontend to the c++ library Giac (Computer Algebra System).

# Python2
%package -n     python2-%{module}
Summary:        Python2 binding for Giac
%{?python_provide:%python_provide python2-%{module}}

BuildRequires:  python2-devel
BuildRequires:  python2-Cython
BuildRequires:  libqcas-devel
Requires:       python2-Cython
Requires:       giac-doc

%description -n python2-%{module}
A Cython frontend to the c++ library Giac (Computer Algebra System).

%package -n     python2-%{module}-devel
Summary:        Development libraries of python2-%{module}
Requires:       python2-%{module}%{?_isa}

%description -n python2-%{module}-devel
Development libraries of Python2 %{module}.
#

# Python3
%package -n     python3-%{module}
Summary:        Python3 binding for Giac
%{?python_provide:%python_provide python3-%{module}}

BuildRequires:  python3-devel
BuildRequires:  python3-Cython
BuildRequires:  libqcas-devel
Requires:       python3-Cython
Requires:       giac-doc

%description -n python3-%{module}
A Cython frontend to the c++ library Giac (Computer Algebra System).

%package -n     python3-%{module}-devel
Summary:        Development libraries of python3-%{module}
Requires:       python3-%{module}%{?_isa}

%description -n python3-%{module}-devel
Development libraries of Python3 %{module}.
#

%prep
%setup -q -n %{module}-%{version}

rm -rf *.egg-info

%build
CFLAGS="%{optflags}" %{__python2} setup.py  build --enable-qcas --executable="%{__python2} -s"
CFLAGS="%{optflags}" %{__python3} setup.py  build --enable-qcas --executable="%{__python3} -s"

%install
%py2_install
rm -f $RPM_BUILD_ROOT%{python2_sitearch}/%{module}/giacpy.cpp
rm -f $RPM_BUILD_ROOT%{python2_sitearch}/%{module}/GPL-2

%py3_install
rm -f $RPM_BUILD_ROOT%{python3_sitearch}/%{module}/giacpy.cpp
rm -f $RPM_BUILD_ROOT%{python3_sitearch}/%{module}/GPL-2

%if 0%{?with_check}
%check
pushd build/lib.linux-*-%{python2_version}
export PYTHONPATH=$RPM_BUILD_ROOT%{python2_sitearch}
%{__python2} -m doctest ../../%{module}/%{module}.pyx -v
popd

pushd build/lib.linux-*-%{python3_version}
export PYTHONPATH=$RPM_BUILD_ROOT%{python3_sitearch}
%{__python3} -m doctest ../../%{module}/%{module}.pyx -v
popd
%endif

%files -n python2-%{module}
%doc README.txt
%license %{module}/GPL-2
%{python2_sitearch}/%{module}/
%exclude %{python2_sitearch}/%{module}/*.h
%exclude %{python2_sitearch}/%{module}/*.pyx
%exclude %{python2_sitearch}/%{module}/*.pxi
%{python2_sitearch}/%{module}*.egg-info/

%files -n python2-%{module}-devel
%{python2_sitearch}/%{module}/*.h
%{python2_sitearch}/%{module}/*.pyx
%{python2_sitearch}/%{module}/*.pxi

%files -n python3-%{module}
%doc README.txt
%license %{module}/GPL-2
%{python3_sitearch}/%{module}/
%exclude %{python3_sitearch}/%{module}/*.h
%exclude %{python3_sitearch}/%{module}/*.pyx
%exclude %{python3_sitearch}/%{module}/*.pxi
%{python3_sitearch}/%{module}*.egg-info/

%files -n python3-%{module}-devel
%{python3_sitearch}/%{module}/*.h
%{python3_sitearch}/%{module}/*.pyx
%{python3_sitearch}/%{module}/*.pxi

%changelog
* Sat Feb 03 2018 Antonio Trande <sagitterATfedoraproject.org> 0.6.5-3
- Rebuild for giac-1.4.9.45

* Sat Jan 27 2018 Antonio Trande <sagitterATfedoraproject.org> - 0.6.5-2
- Fix dependencies

* Mon Jan 15 2018 Antonio Trande <sagitterATfedoraproject.org> - 0.6.5-1
- Release 0.6.5
- Enable qcas support
- Packaging of the development files

* Fri Dec 22 2017 Antonio Trande <sagitterATfedoraproject.org> - 0.6.3-0.1
- Pre-release 0.6.3

* Sun Dec 17 2017 Antonio Trande <sagitterATfedoraproject.org> - 0.6.2-1
- Source package renamed with python- suffix as required by Python guidelines
- Source url grabbed by pythonhosted.org's repository
- Building processes restricted to the original directory

* Sat Dec 02 2017 Antonio Trande <sagitterATfedoraproject.org> - 0.6.2-1
- Initial package