%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} Name: python-polybori Version: 0.5 Release: 5%{?dist} Summary: Framework for Boolean Rings Group: Development/Libraries License: GPLv2+ URL: http://polybori.sourceforge.net/ Source0: http://downloads.sourceforge.net/polybori/polybori-%{version}.tar.gz Patch0: polybori-0.5-dont-build-libcudd.diff BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: boost-devel BuildRequires: cudd-devel BuildRequires: cudd-static BuildRequires: doxygen BuildRequires: latex2html BuildRequires: m4ri-devel BuildRequires: python-devel BuildRequires: scons Requires: python-imaging Requires: ipython %description PolyBoRi is a special purpose computer algebra system for computations in Boolean Rings. The core is a C++ library, which provides high-level data types for Boolean polynomials and related structures. As a unique approach, binary decision diagrams are used as internal storage type for polynomial structures. On top of this, we provide a Python interface for parsing of complex polynomial systems, as well as for sophisticated and extendable strategies for Groebner base computation. %package docs Summary: Documentation for %{name} Group: Documentation %description docs Documentation for %{name}. %package devel Summary: Development files for %{name} Group: Development/Libraries Requires: %{name} = %{version}-%{release} Requires: boost-devel Requires: cudd-devel %description devel Development headers and libraries for %{name}. %package static Summary: Static libraries for %{name} Group: Development/Libraries Requires: %{name}-devel = %{version}-%{release} %description static Static libraries for %{name}. %prep %setup -q -n polybori-%{version} %patch0 -b .orig # Remove private copy of system lib (cudd) rm -rf Cudd sed -i -e 's|#include "cuddInt.h"|#include |' \ polybori/include/CCuddCore.h # Remove private copy of system lib (m4ri) rm -rf M4RI # Remove private copy of system lib (singular) rm -rf Singular sed -i '1,1d' pyroot/polybori/disttar.py # Try to avoid stripping shared objects at link time sed -i -e 's|^LDFLAGS_LINUX.*-s|LDFLAGS_LINUX = -lcudd|' \ polybori/Makefile.in sed -i -e "s|\['-s'\]|['-lcudd']|" SConstruct %ifarch x86_64 ppc64 sed -i -e "s|DevelInstPath('lib')|DevelInstPath('lib64')|" SConstruct %endif # Fix encoding iconv -f iso-8859-1 -t utf-8 ChangeLog > ChangeLog.utf-8 touch -r ChangeLog ChangeLog.utf-8 mv ChangeLog.utf-8 ChangeLog %build # scons = suck # we have to build in the install section %install rm -rf $RPM_BUILD_ROOT scons install \ PREFIX=$RPM_BUILD_ROOT%{_prefix} \ EPREFIX=$RPM_BUILD_ROOT%{_bindir} \ INSTALLDIR=$RPM_BUILD_ROOT%{_datadir}/%{name} \ DOCDIR=$RPM_BUILD_ROOT%{_docdir}/%{name} \ MANDIR=$RPM_BUILD_ROOT%{_mandir} \ PYINSTALLPREFIX=$RPM_BUILD_ROOT%{python_sitearch} \ DEVEL_PREFIX=$RPM_BUILD_ROOT%{_prefix} \ CFLAGS="%{optflags} -I%{_includedir}/cudd -I%{_includedir}/m4ri" \ CCFLAGS="%{optflags} -I%{_includedir}/cudd -I%{_includedir}/m4ri" \ CXXFLAGS="%{optflags} -I%{_includedir}/cudd -I%{_includedir}/m4ri" scons devel-install \ PREFIX=$RPM_BUILD_ROOT%{_prefix} \ EPREFIX=$RPM_BUILD_ROOT%{_bindir} \ INSTALLDIR=$RPM_BUILD_ROOT%{_datadir}/%{name} \ DOCDIR=$RPM_BUILD_ROOT%{_docdir}/%{name} \ MANDIR=$RPM_BUILD_ROOT%{_mandir} \ PYINSTALLPREFIX=$RPM_BUILD_ROOT%{python_sitearch} \ DEVEL_PREFIX=$RPM_BUILD_ROOT%{_prefix} \ CFLAGS="%{optflags} -I%{_includedir}/cudd -I%{_includedir}/m4ri" \ CCFLAGS="%{optflags} -I%{_includedir}/cudd -I%{_includedir}/m4ri" \ CXXFLAGS="%{optflags} -I%{_includedir}/cudd -I%{_includedir}/m4ri" # Empty header --- seems to be used, keep it for now #rm $RPM_BUILD_ROOT%{_includedir}/polybori/cacheopts.h # Remove buildroot from a generated file sed -i -e 's|%{buildroot}||' %{buildroot}%{_datadir}/%{name}/ipbori/ipythonrc-polybori %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root,-) %doc LICENSE README %{_bindir}/ipbori %{_mandir}/man1/ipbori.1* %{_datadir}/%{name} %{python_sitearch}/polybori %{_libdir}/lib*.so.* %files docs %defattr(-,root,root,-) %{_docdir}/%{name} %files devel %defattr(-,root,root,-) %doc ChangeLog %{_libdir}/lib*.so %{_includedir}/polybori %files static %defattr(-,root,root,-) %{_libdir}/lib*.a %changelog * Sat Mar 28 2009 Conrad Meyer - 0.5-5 - Add cudd-devel Requires to -devel subpackage. - Link against cudd at build time. - Fixed encoding of ChangeLog. * Tue Mar 24 2009 Conrad Meyer - 0.5-4 - Fix SF.net source0. - Fix License. - Fix rpm defines (should be globals). - Don't strip debugging information. - Fix Requires. * Mon Mar 23 2009 Conrad Meyer - 0.5-3 - Remove buildroot from an installed file (thanks, Mamoru). * Wed Mar 18 2009 Conrad Meyer - 0.5-2 - Add BR on scons. * Mon Dec 8 2008 Conrad Meyer - 0.5-1 - Initial package.