Blob Blame History Raw
%if 0%{?fedora} > 12 || 0%{?rhel} > 6
%global with_python3 1
%else
%{!?python_sitearch: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib(1))")}
%endif

Name: pymilia
Version: 1.0.0
Release: 7%{?dist}
Summary: Python wrappers for milia
License: GPLv3+

Group: Development/Languages
URL: http://guaix.fis.ucm.es/projects/pymilia/wiki
Source0: ftp://astrax.fis.ucm.es/pub/software/pymilia/%{name}-%{version}.tar.gz

BuildRequires: python-devel python-setuptools 
BuildRequires: Cython milia-devel >= 1.0.0

# we don't want to provide private python extension libs
%{?filter_setup:
%filter_provides_in %{python_sitearch}/.*\.so$ 
%filter_setup
}

%description
Python wrappers for milia. Milia is a C++ library created to 
compute cosmological distances and ages in the 
Friedmann-LemaƮtre-Robertson-Walker metric.

%if 0%{?with_python3}
%package -n python3-pymilia
Summary: Python wrappers for milia
BuildRequires: python3-devel python3-setuptools 
BuildRequires: python3-Cython milia-devel >= 1.0.0

# we don't want to provide private python extension libs
%{?filter_setup:
%filter_provides_in %{python3_sitearch}/.*\.so$
%filter_setup
}

%description -n python3-pymilia 
Python wrappers for milia. Milia is a C++ library created to 
compute cosmological distances and ages in the 
Friedmann-LemaƮtre-Robertson-Walker metric.
%endif # with_python3

%prep
%setup -q

%if 0%{?with_python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
#find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'
#python3-2to3 --no-diffs --write --nobackup %{py3dir}
%endif # with_python3

%build
CFLAGS="%{optflags}" %{__python} setup.py build

%if 0%{?with_python3}
pushd %{py3dir}
CFLAGS="%{optflags}" %{__python3} setup.py build
popd
%endif # with_python3

%install
rm -rf %{buildroot}
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py install --skip-build --root  %{buildroot}
chmod 755 %{buildroot}%{python3_sitearch}/milia/*.so
popd
%endif # with_python3

%{__python} setup.py install --skip-build --root  %{buildroot}
chmod 755 %{buildroot}%{python_sitearch}/milia/*.so
 
%files
%doc LICENSE.txt README.txt NEWS.txt
%{python_sitearch}/milia/
%{python_sitearch}/*.egg-info

%if 0%{?with_python3}
%files -n python3-pymilia
%doc LICENSE.txt README.txt NEWS.txt
%{python3_sitearch}/milia/
%{python3_sitearch}/*.egg-info
%endif # with_python3

%changelog
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.0-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Sat May 02 2015 Kalev Lember <kalevlember@gmail.com> - 1.0.0-6
- Rebuilt for GCC 5 C++11 ABI change

* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Tue May 27 2014 Kalev Lember <kalevlember@gmail.com> - 1.0.0-3
- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4

* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Fri Apr 05 2013 Sergio Pascual <sergiopr@fedoraproject.org> - 1.0.0-1
- New upstream source
- Adding support for python3

* Sun Feb 10 2013 Denis Arnaud <denis.arnaud_fedora@m4x.org> - 0.3.0-16
- Rebuild for Boost-1.53.0

* Sat Feb 09 2013 Denis Arnaud <denis.arnaud_fedora@m4x.org> - 0.3.0-15
- Rebuild for Boost-1.53.0

* Mon Aug 13 2012 Sergio Pascual <sergiopr@fedoraproject.org> - 0.3.0-14
- Rebuilt for new boost 1.50

* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.0-13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Thu May 20 2012 Sergio Pascual <sergiopr@fedoraproject.org> - 0.3.0-12
- Rebuilt for new milia

* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.0-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Thu Nov 24 2011 Sergio Pascual <sergiopr@fedoraproject.org> - 0.3.0-10
- Rebuilt for new boost 1.48

* Tue Aug 23 2011 Sergio Pascual <sergiopr@fedoraproject.org> - 0.3.0-9
- Added filter to remove false provides

* Thu Apr 07 2011 Sergio Pascual <sergiopr@fedoraproject.org> - 0.3.0-8
- Rebuilt for new boost

* Thu Mar 17 2011 Sergio Pascual <sergiopr@fedoraproject.org> - 0.3.0-7
- Rebuilt for new boost

* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.0-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Sun Feb 06 2011 Thomas Spura <tomspur@fedoraproject.org> - 0.3.0-5
- rebuild for new boost

* Wed Jul 21 2010 David Malcolm <dmalcolm@redhat.com> - 0.3.0-4
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild

* Wed Jan 20 2010 Sergio Pascual <sergiopr at fedoraproject.com> - 0.3.0-3
- Adding CFLAGS in build line

* Wed Jan 20 2010 Sergio Pascual <sergiopr at fedoraproject.com> - 0.3.0-2
- Updated build requires
- Corrected minor typos

* Mon Jan 18 2010 Sergio Pascual <sergiopr at fedoraproject.com> - 0.3.0-1
- Initial spec file