%{!?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: 13%{?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 <cuddInt.h>|' \
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.
# Also link in cudd and cuddobj.
sed -i -e 's|^LDFLAGS_LINUX.*-s|LDFLAGS_LINUX = -lcudd -lcuddobj|' \
polybori/Makefile.in
sed -i -e "s|\['-s'\]|['-lcudd -lcuddobj']|" SConstruct
%ifarch x86_64 ppc64 s390x sparc64
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
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5-13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
* Sun Feb 06 2011 Thomas Spura <tomspur@fedoraproject.org> - 0.5-12
- rebuild for new boost
* Wed Sep 29 2010 jkeating - 0.5-11
- Rebuilt for gcc bug 634757
* Fri Sep 24 2010 Dan HorĂ¡k <dan[at]danny.cz> - 0.5-10
- add s390x and sparc64 to 64-bit platforms
* Tue Sep 14 2010 Toshio Kuratomi <toshio@fedoraproject.org> - 0.5-9
- Rebuilt for broken deps on old boost
* Thu Jul 22 2010 David Malcolm <dmalcolm@redhat.com> - 0.5-8
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild
* Fri Jan 22 2010 Rahul Sundaram <sundaram@fedoraproject.org> - 0.5-7
- Rebuild for Boost soname bump
* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
* Sat Mar 28 2009 Conrad Meyer <konrad@tylerc.org> - 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 <konrad@tylerc.org> - 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 <konrad@tylerc.org> - 0.5-3
- Remove buildroot from an installed file (thanks, Mamoru).
* Wed Mar 18 2009 Conrad Meyer <konrad@tylerc.org> - 0.5-2
- Add BR on scons.
* Mon Dec 8 2008 Conrad Meyer <konrad@tylerc.org> - 0.5-1
- Initial package.