Blob Blame History Raw
%if 0%{?fedora}
%global with_python3 1
%global python3_pkgversion 3
%endif

%if 0%{?rhel} && 0%{?rhel} >= 7
%global with_python3 1
%endif

%if 0%{?rhel}
%global py2_prefix python
%else
%global py2_prefix python2
%endif

%global   checkout 31dbeb5065dd57da767fdee32f47dbe5db24c027
%global   date     20170807

Name: autowrap
Summary: Generates Python Extension modules from [Cython] PXD files
Version: 0.14.0
Release: 4.%{date}git%(echo %{checkout} | cut -c-6)%{?dist}
License: BSD
URL: https://github.com/uweschmitt/autowrap
Source0: https://github.com/uweschmitt/autowrap/archive/%{checkout}.zip#/%{name}-%{checkout}.zip
BuildArch: noarch

BuildRequires: %{py2_prefix}-devel, %{py2_prefix}-setuptools, %{py2_prefix}-nose, %{py2_prefix}-pytest, %{py2_prefix}-Cython
## For testing
BuildRequires: boost-devel, gcc
Requires: %{py2_prefix}-Cython

%description
This module uses the Cython "header" .pxd files to automatically generate
Cython input (.pyx) files. It does so by parsing the header files and possibly
annotations in the header files to generate correct Cython code.

%package -n python2-autowrap
Summary: Generates Python2 Extension modules from [Cython] PXD files
%{?python_provide:%python_provide python2-%{name}}
Requires: %{py2_prefix}-Cython
%description -n python2-autowrap
%{summary}.

%if 0%{?with_python3}
%package -n python%{python3_pkgversion}-autowrap
Summary: Generates Python3 Extension modules from [Cython] PXD files
%{?python_provide:%python_provide python%{python3_pkgversion}-%{name}}
BuildRequires: python%{python3_pkgversion}-devel
BuildRequires: python%{python3_pkgversion}-setuptools
BuildRequires: python%{python3_pkgversion}-nose
BuildRequires: python%{python3_pkgversion}-pytest
BuildRequires: python%{python3_pkgversion}-Cython
Requires: python%{python3_pkgversion}-Cython

%description -n python%{python3_pkgversion}-autowrap
%{summary}.
%endif # with_python3

%prep
%setup -qc

mv autowrap-%{checkout} python2
pushd python2
##Remove bundled files
rm -rf autowrap/data_files/boost
popd

%if 0%{?with_python3}
cp -a python2 python3
%endif # with_python3

%build
pushd python2
%py2_build
popd

%if 0%{?with_python3}
pushd python3
%py3_build
popd
%endif # with_python3

%install

# Must do the python3 install first because the scripts in /usr/bin are
# overwritten with every setup.py install (and we want the python2 version
# to be the default for now).
%if 0%{?with_python3}
pushd python3
%py3_install
mv $RPM_BUILD_ROOT%{_bindir}/autowrap $RPM_BUILD_ROOT%{_bindir}/autowrap-3

mkdir exe && pushd exe
for i in python%{python3_version}-autowrap autowrap-%{python3_version} autowrap-v%{version}-%{python3_version}; do
  touch -r $RPM_BUILD_ROOT%{_bindir}/autowrap-3 $i
  install -p $i $RPM_BUILD_ROOT%{_bindir}
  ln -sf %{_bindir}/autowrap-3 $RPM_BUILD_ROOT%{_bindir}/$i
done
popd
popd
%endif

pushd python2
%py2_install

mkdir exe && pushd exe
for i in autowrap-2 python%{python2_version}-autowrap autowrap-%{python2_version} autowrap-v%{version}-%{python2_version}; do
  touch -r $RPM_BUILD_ROOT%{_bindir}/autowrap $i
  install -p $i $RPM_BUILD_ROOT%{_bindir}
  ln -sf %{_bindir}/autowrap $RPM_BUILD_ROOT%{_bindir}/$i
done
popd

%check
%if 0%{?with_python3}
pushd python3
export CPPFLAGS="-I%{_includedir}/boost"
export CXXFLAGS="-I%{_includedir}/boost"
py.test-%{python3_version} -v tests
popd
%endif # with_python3

pushd python2
export CPPFLAGS="-I%{_includedir}/boost"
export CXXFLAGS="-I%{_includedir}/boost"
py.test-%{python2_version} -v tests
popd

%files -n python2-autowrap
%doc python2/README.md python2/CONCEPT
%license python2/LICENSE
%{_bindir}/autowrap
%{_bindir}/autowrap-2
%{_bindir}/autowrap-%{python2_version}
%{_bindir}/python%{python2_version}-autowrap
%{_bindir}/autowrap-v%{version}-%{python2_version}
%{python2_sitelib}/autowrap/
%exclude %{python2_sitelib}/tests
%{python2_sitelib}/*.egg-info

%if 0%{?with_python3}
%files -n python%{python3_pkgversion}-autowrap
%doc python3/README.md python3/CONCEPT
%license python3/LICENSE
%{_bindir}/autowrap-3
%{_bindir}/autowrap-%{python3_version}
%{_bindir}/python%{python3_version}-autowrap
%{_bindir}/autowrap-v%{version}-%{python3_version}
%{python3_sitelib}/autowrap/
%exclude %{python3_sitelib}/tests
%{python3_sitelib}/*.egg-info
%endif

%changelog
* Wed Feb 21 2018 Antonio Trande <sagitterATfedoraproject.org> - 0.14.0-4.20170807git31dbeb
- Explicit Python2 dependencies on fedora

* Wed Feb 07 2018 Iryna Shcherbina <ishcherb@redhat.com> - 0.14.0-3.20170807git31dbeb
- Update Python 2 dependency declarations to new packaging standards
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)

* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.14.0-2.20170807git31dbeb
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Fri Jan 05 2018 Antonio Trande <sagitterATfedoraproject.org> - 0.14.0-1.20170807git31dbeb
- Update to 0.14.0

* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.11.0-3.20170519git97b2f5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Mon Jul 03 2017 Jonathan Wakely <jwakely@redhat.com> - 0.11.0-2.20170519git97b2f5
- Rebuilt for Boost 1.64

* Fri Jun 09 2017 Antonio Trande <sagitterATfedoraproject.org> - 0.11.0-1.20170519git97b2f5
- Update to 0.11.0

* Sun Apr 23 2017 Antonio Trande <sagitterATfedoraproject.org> - 0.10.0-1.20170412git669ea3
- Update to 0.10.0

* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.2-3.20161226gitee9a4e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Fri Jan 27 2017 Jonathan Wakely <jwakely@redhat.com> - 0.9.2-2.20161226gitee9a4e
- Rebuilt for Boost 1.63

* Mon Dec 26 2016 Antonio Trande <sagitterATfedoraproject.org> - 0.9.2-1.20161226gitee9a4e
- Update to 0.9.2

* Sat Dec 24 2016 Antonio Trande <sagitterATfedoraproject.org> - 0.8.0-3.20130921git3f4808
- Exclude tests.test_main.test* (upstream bug #56)

* Mon Dec 19 2016 Miro HronĨok <mhroncok@redhat.com> - 0.8.0-2.20160921git3f4808
- Rebuild for Python 3.6

* Tue Nov 08 2016 Antonio Trande <sagitterATfedoraproject.org> - 0.8.0-1.20130921git3f4808
- Update to 0.8.0

* Wed Aug 17 2016 Antonio Trande <sagitterATfedoraproject.org> - 0.7.2-4.20130710git03c5d3
- Rebuild for Python-3.5.2

* Sat Aug 06 2016 Antonio Trande <sagitterATfedoraproject.org> - 0.7.2-3.20130710git03c5d3
- Build Python3.4 version on epel7

* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.7.2-2.20160710git03c5d3
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages

* Mon Jul 11 2016 Antonio Trande <sagitterATfedoraproject.org> - 0.7.2-1.20130710git03c5d3
- Update to 0.7.2 (commit #03c5d3)

* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.7.1-5.20151201gitbd06ff
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Fri Jan 29 2016 Antonio Trande <sagitterATfedoraproject.org> - 0.7.1-4.20151201gitbd06ff
- Renamed Python2 package

* Thu Jan 14 2016 Jonathan Wakely <jwakely@redhat.com> - 0.7.1-3.20151201gitbd06ff
- Rebuilt for Boost 1.60

* Thu Dec 10 2015 Antonio Trande <sagitterATfedoraproject.org> - 0.7.1-2.20151201gitbd06ff
- SPEC file adapted to recent guidelines for Python

* Thu Nov 26 2015 Antonio Trande <sagitterATfedoraproject.org> 0.7.1-1.20151201gitbd06ff
- Update to 0.7.1
- autowrap-? renamed as autowrap?

* Thu Nov 26 2015 Antonio Trande <sagitterATfedoraproject.org> 0.7.0-1.20151124gitd5e233
- Update to 0.7.0

* Thu Nov 12 2015 Kalev Lember <klember@redhat.com> - 0.6.1-11.20150209gitd0e9a5
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5

* Tue Nov 10 2015 Antonio Trande <sagitterATfedoraproject.org> 0.6.1-10.20150209gitd0e9a5
- Rebuilt for Python3.5

* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.1-9.20150209gitd0e9a5
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5

* Sun Sep 27 2015 Antonio Trande <sagitterATfedoraproject.org> 0.6.1-8.20150209gitd0e9a5
- Avoid executable conflicts

* Thu Aug 27 2015 Jonathan Wakely <jwakely@redhat.com> - 0.6.1-7.20150209gitd0e9a5
- Rebuilt for Boost 1.59

* Wed Jul 29 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.1-6.20150209gitd0e9a5
- Rebuilt for https://fedoraproject.org/wiki/Changes/F23Boost159

* Wed Jul 22 2015 David Tardon <dtardon@redhat.com> - 0.6.1-5.20150209gitd0e9a5
- rebuild for Boost 1.58

* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.1-4.20150209gitd0e9a5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Thu Apr 16 2015 Antonio Trande <sagitterATfedoraproject.org> 0.6.1-3.20150209gitd0e9a5
- Adapted to EPEL6/7
- Built on F23

* Mon Feb 09 2015 Antonio Trande <sagitterATfedoraproject.org> 0.6.1-2.20150209gitd0e9a5
- Added missing pytest BR package
- Used %%license

* Mon Feb 09 2015 Antonio Trande <sagitterATfedoraproject.org> 0.6.1-1.20150209gitd0e9a5
- Update to 0.6.1

* Tue Jan 27 2015 Petr Machata <pmachata@redhat.com> - 0.5.0-5.20140603git1753b9
- Rebuild for boost 1.57.0

* Thu Jul 31 2014 Antonio Trande <sagitterATfedoraproject.org> 0.5.0-4.20140603git1753b9
- Package is now noarch

* Wed Jul 30 2014 Antonio Trande <sagitterATfedoraproject.org> 0.5.0-3.20140603git1753b9
- Fixed BuildRequires and Requires for python3 sub-package
- Removed TODO and CONCEPT files as user documentation

* Wed Jun 11 2014 Antonio Trande <sagitterATfedoraproject.org> 0.5.0-2.20140603git1753b9
- Fixed nosetests command according to new default python3 stack on Fedora 21+

* Thu Jun 05 2014 Antonio Trande <sagitterATfedoraproject.org> 0.5.0-1.20140603git1753b9
- Release 0.5.0

* Mon Jun 02 2014 Antonio Trande <sagitterATfedoraproject.org> 0.4.0-4.20140602gitebde9f
- Update to a new commit (fixed all license headers)

* Mon Jun 02 2014 Antonio Trande <sagitterATfedoraproject.org> 0.4.0-3.20140321git26e901
- Removed conditional macros for EPEL
- Fixed Source0

* Sun Jun 01 2014 Antonio Trande <sagitterATfedoraproject.org> 0.4.0-2.20140321git26e901
- Fixed License
- Fixed Requires package for python2/python3
- Excluded 'tests' directories by packaging
- Performing building operations to packaging independent Python3 module
- Disabled generation of the useless debuginfo package

* Fri May 30 2014 Antonio Trande <sagitterATfedoraproject.org> 0.4.0-1.20140321git26e901
- Initial build
- Fixed Version tag