%if ! (0%{?fedora} > 12 || 0%{?rhel} > 5) %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} %{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")} %endif %define SDIR %{name}-%{version}-beta1 Name: cgal-python Version: 0.9.4 Release: 0.9.beta1%{?dist} Summary: Python bindings for the CGAL library Group: Development/Libraries License: LGPLv2 URL: http://cgal-python.gforge.inria.fr/ Source0: https://gforge.inria.fr/frs/download.php/19498/%{SDIR}.tgz Source1: CGAL_PYTHON_1.pdf Source2: cgal-python-0.9.4-VoronoiDemo.py BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: CGAL-devel BuildRequires: python2-devel %if ! (0%{?fedora} > 8 || 0%{?rhel} > 5) BuildRequires: python-setuptools %endif %description The goal of the CGAL-Python project is to provide Python bindings for the CGAL library. CGAL is the Computational Geometry Algorithms Library, a C++ library of generic, efficient and robust geometric algorithms. CGAL-Python is implemented using Boost.Python, which allows to mimic a large part of the original C++ interface of CGAL. Since CGAL is heavily based on the generic programming paradigm (templates), some choices have been made to accommodate the Python programming model instead. Python allows much faster prototyping than C++, by simplifying the complexity of the language and removing the typical long compilation times of C++. We also hope that CGAL-Python can be used for teaching geometric algorithms, without requiring knowledge of C++ as is currently the case with CGAL. %prep %setup -q -n %{SDIR} %build export CPATH=`ls -d %{_includedir}/python*`:%{_includedir}/boost export CFLAGS="$RPM_OPT_FLAGS" %if ! (0%{?fedora} > 8 || 0%{?rhel} > 5) %{__python} -c 'import setuptools; execfile("setup.py")' build %else %{__python} setup.py build %endif %install rm -rf %{buildroot} %if ! (0%{?fedora} > 8 || 0%{?rhel} > 5) %{__python} -c 'import setuptools; execfile("setup.py")' install --skip-build --root %{buildroot} %else %{__python} setup.py install --skip-build --root=%{buildroot} %endif cp %{SOURCE1} $RPM_BUILD_DIR/%{SDIR}/%{name}.pdf cp %{SOURCE2} $RPM_BUILD_DIR/%{SDIR}/VoronoiDemo.py %clean rm -rf %{buildroot} %files %defattr(-,root,root,-) %doc LICENSE.LGPL README.txt %{name}.pdf VoronoiDemo.py %{python_sitearch}/CGAL %{python_sitearch}/*.egg-info %changelog * Sun Apr 18 2010 Paulo Roma 0.9.4-0.9.beta1 - Using python-setuptools for rhel5. * Sat Mar 06 2010 Paulo Roma 0.9.4-0.8.beta1 - Removed unneeded BRs. - Included an example for testing. * Fri Nov 13 2009 Paulo Roma 0.9.4-0.7.beta1 - Rebuilt with CGAL 3.5 - Installing egg-info. * Sat Jun 20 2009 Paulo Roma 0.9.4-0.6.beta1 - Update to 0.9.4 - Using setup.py * Tue Nov 06 2007 Paulo Roma 0.9.3-6 - No new feature has been added, but it works now with CGAL 3.3, and it also works on Mac OS X. - Using %%{SDIR} since the source is in %%{name} and not in %%{name}-%%{version} anymore. * Sun Mar 11 2007 Paulo Roma 0.9.1-5 - Replaced cgal_package for a symbolic link in %%{python_sitearch} to CGAL. - Replaced BR mpfr-devel for %%{_libdir}/libmpfr.so * Sat Mar 10 2007 Paulo Roma 0.9.1-3 - Installing in %%{name}-%%{version} following windows version. - Created fake cgal-package, and a symbolic link, for the examples work. * Sat Mar 10 2007 Paulo Roma 0.9.1-2 - Removed .h, .o, .cpp, and .vcproj from package. * Tue Mar 06 2007 Paulo Roma 0.9.1-1 - Initial spec file.