[polybori] Initial import.

Jerry James jjames at fedoraproject.org
Tue Jan 3 15:15:44 UTC 2012


commit 9b430699bb194e6195008dc3dcc276fe4b5b1737
Author: Jerry James <loganjerry at gmail.com>
Date:   Tue Jan 3 08:15:22 2012 -0700

    Initial import.

 .gitignore                 |    2 +
 polybori-import.patch      |   17 +++
 polybori-m4ri.patch        |   11 ++
 polybori-system-cudd.patch |   89 +++++++++++++++
 polybori-warning.patch     |  203 ++++++++++++++++++++++++++++++++++
 polybori.desktop           |   12 ++
 polybori.spec              |  261 ++++++++++++++++++++++++++++++++++++++++++++
 sources                    |    2 +
 8 files changed, 597 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..d187c81 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1,2 @@
+/polybori-0.8.0.tar.gz
+/polybori-logos.tar.xz
diff --git a/polybori-import.patch b/polybori-import.patch
new file mode 100644
index 0000000..f63bf9f
--- /dev/null
+++ b/polybori-import.patch
@@ -0,0 +1,17 @@
+--- pyroot/polybori/fglm.py.orig	2011-09-07 14:25:22.000000000 -0600
++++ pyroot/polybori/fglm.py	2011-09-15 14:24:57.796200180 -0600
+@@ -1,6 +1,13 @@
+ from polybori.PyPolyBoRi import BooleSet, Polynomial, BoolePolynomialVector, FGLMStrategy,\
+-    dp_asc, Monomial, Ring
++    OrderCode, Monomial, Ring
+ from polybori.blocks import declare_ring
++
++lp=OrderCode.lp
++dlex=OrderCode.dlex
++dp_asc=OrderCode.dp_asc
++block_dp_asc=OrderCode.block_dp_asc
++block_dlex=OrderCode.block_dlex
++
+ def fglm(I, from_ring, to_ring):
+     """
+     converts *reduced* Groebner Basis in from_ring to a GroebnerBasis in to_ring.
diff --git a/polybori-m4ri.patch b/polybori-m4ri.patch
new file mode 100644
index 0000000..12ea3c4
--- /dev/null
+++ b/polybori-m4ri.patch
@@ -0,0 +1,11 @@
+--- SConstruct.orig	2011-10-14 15:32:11.456352734 -0600
++++ SConstruct	2011-10-14 15:34:36.631184084 -0600
+@@ -529,7 +529,7 @@
+         }
+         """  %  \
+         ("%s", ''.join(["""
+-        #if defined(__M4RI_HAVE_%(macro)s) || defined(HAVE_%(macro)s )
++        #if (defined(__M4RI_HAVE_%(macro)s) && __M4RI_HAVE_%(macro)s) || defined(HAVE_%(macro)s )
+           printf("-m%(option)s ");
+         #endif""" % \
+         dict(macro=opt.replace('.','_').upper(), option=opt) for opt in \
diff --git a/polybori-system-cudd.patch b/polybori-system-cudd.patch
new file mode 100644
index 0000000..2217b3c
--- /dev/null
+++ b/polybori-system-cudd.patch
@@ -0,0 +1,89 @@
+--- SConstruct.orig	2011-09-07 14:25:22.000000000 -0600
++++ SConstruct	2011-09-13 13:30:43.500527102 -0600
+@@ -713,18 +713,18 @@
+ env.Append(CPPDEFINES=["HAVE_IEEE_754"])
+ 
+ 
+-cudd_headers = [ CuddPath('cudd/' + fname + '.h') for fname in Split("""
+-cuddInt cudd""") ]
++#cudd_headers = [ CuddPath('cudd/' + fname + '.h') for fname in Split("""
++#cuddInt cudd""") ]
+     
+-cudd_resources = [CuddPath('cudd/cudd' + elt) for elt in Split("""
+-API.c Cache.c Init.c LCache.c Ref.c Table.c ZddFuncs.c ZddSetop.c""") ]
++#cudd_resources = [CuddPath('cudd/cudd' + elt) for elt in Split("""
++#API.c Cache.c Init.c LCache.c Ref.c Table.c ZddFuncs.c ZddSetop.c""") ]
+ 
+-cudd_shared = shared_object(cudd_resources, CPPPATH = env['CPPPATH'] + [CuddPath()])
++#cudd_shared = shared_object(cudd_resources, CPPPATH = env['CPPPATH'] + [CuddPath()])
+ 
+ #libCudd = env.StaticLibrary(CuddPath(cudd_name), cudd_resources)
+ #DefaultBuild(libCudd)
+ 
+-shared_resources += cudd_shared
++#shared_resources += cudd_shared
+ 
+ ###################
+ # End of Cudd stuff
+@@ -780,7 +780,7 @@
+ libpb_name = 'polybori'
+ libpb_name_static = libpb_name
+ 
+-libpb=env.StaticLibrary(PBPath(libpb_name_static), pb_src + cudd_resources)
++libpb=env.StaticLibrary(PBPath(libpb_name_static), pb_src) #+ cudd_resources)
+ 
+ if isinstance(libpb,list):
+     libpb=libpb[0]
+@@ -1065,9 +1065,9 @@
+         allsrcs.append(env.Dir(dirname))
+ 
+     # Cudd is not distributed completely (unused and unfree things removed)
+-    allsrcs += [CuddPath(src) for src in Split("""LICENSE README
+-    RELEASE.NOTES""") ]
+-    allsrcs += [env.Dir(CuddPath(src)) for src in Split("""cudd""") ]
++    #allsrcs += [CuddPath(src) for src in Split("""LICENSE README
++    #RELEASE.NOTES""") ]
++    #allsrcs += [env.Dir(CuddPath(src)) for src in Split("""cudd""") ]
+ 
+     # doc is not distributed completely
+     allsrcs += [ DocPath(dsrc) for dsrc in Split("""doxygen.conf index.html.in
+@@ -1129,7 +1129,7 @@
+                 glob(GBPath('include/polybori/groebner/*.h')))
+ 
+     # Install our own copy the cudd header to ensure correct (patched) version 
+-    env.Install(DevelInstInclPath('cudd'), cudd_headers)
++    #env.Install(DevelInstInclPath('cudd'), cudd_headers)
+ 
+     if not(external_m4ri):
+         env.Install(DevelInstInclPath('m4ri'), glob('M4RI/m4ri/*.h'))
+@@ -1389,8 +1389,8 @@
+     documastersubdirs += " c++"
+ 
+ env.DocuMaster(DocPath('index.html'), [DocPath('index.html.in')] + [
+-    env.Dir(DocPath(srcs)) for srcs in Split(documastersubdirs) ] + [
+-    env.Dir('Cudd/cudd/doc')])  
++    env.Dir(DocPath(srcs)) for srcs in Split(documastersubdirs) ]) #+ [
++    #env.Dir('Cudd/cudd/doc')])  
+ 
+ pbrpmname = pboriname + '-' + pboriversion + "." + pborirelease 
+ 
+@@ -1564,8 +1564,8 @@
+     env.Clean(pydocuinst, pydocuinst)
+ 
+     # Copy Cudd documentation
+-    CopyAll(InstDocPath('cudd'), 'Cudd/cudd/doc', env) 
+-    CopyAll(InstDocPath('cudd/icons'), 'Cudd/cudd/doc/icons', env)
++    #CopyAll(InstDocPath('cudd'), 'Cudd/cudd/doc', env) 
++    #CopyAll(InstDocPath('cudd/icons'), 'Cudd/cudd/doc/icons', env)
+ 
+     # Copy Tutorial
+     if have_l2h or have_t4h :
+@@ -1577,7 +1577,7 @@
+     FinalizeNonExecs(env.DocuMaster(InstDocPath('index.html'),
+                                     [DocPath('index.html.in')] + [ 
+         env.Dir(InstDocPath(srcs)) for srcs in Split("""tutorial python
+-        c++ cudd""") ] ))
++        c++""") ] ))
+ 
+     # Non-executables to be installed
+     pyfile_srcs = glob(PyRootPath('polybori/*.py'))
diff --git a/polybori-warning.patch b/polybori-warning.patch
new file mode 100644
index 0000000..d071cba
--- /dev/null
+++ b/polybori-warning.patch
@@ -0,0 +1,203 @@
+--- ./libpolybori/include/polybori/factories/VariableFactory.h.orig	2011-09-07 14:25:22.000000000 -0600
++++ ./libpolybori/include/polybori/factories/VariableFactory.h	2011-09-29 15:26:37.579079066 -0600
+@@ -6,7 +6,7 @@
+  * @date 2011-05-05
+  *
+  * This file defines the base class VariableFactory which is used for
+- * @i currying the constructors of @c BooleVariable with a BoolePolyRing.
++ * @em currying the constructors of @c BooleVariable with a BoolePolyRing.
+  *
+  * @par Copyright:
+  *   (c) by The PolyBoRi Team
+@@ -25,8 +25,8 @@
+ BEGIN_NAMESPACE_PBORI
+ 
+ /** @class VariableFactory
+- * @brief This base class VariableFactory is used for @i currying
+- * monimial constructors with a BoolePolyRing.
++ * @brief This base class VariableFactory is used for @em currying
++ * variable constructors with a BoolePolyRing.
+  *
+  **/
+ 
+--- ./libpolybori/include/polybori/factories/MonomialFactory.h.orig	2011-09-07 14:25:22.000000000 -0600
++++ ./libpolybori/include/polybori/factories/MonomialFactory.h	2011-09-29 15:26:37.579079066 -0600
+@@ -6,7 +6,7 @@
+  * @date 2011-05-05
+  *
+  * This file defines the base class MonomialFactory which is used for
+- * @i currying the constructors of @c BooleMonomial with a BoolePolyRing.
++ * @em currying the constructors of @c BooleMonomial with a BoolePolyRing.
+  *
+  * @par Copyright:
+  *   (c) by The PolyBoRi Team
+@@ -25,8 +25,8 @@
+ BEGIN_NAMESPACE_PBORI
+ 
+ /** @class MonomialFactory
+- * @brief This base class MonomialFactory is used for @i currying
+- * monimial constructors with a BoolePolyRing.
++ * @brief This base class MonomialFactory is used for @em currying
++ * monomial constructors with a BoolePolyRing.
+  *
+  **/
+ 
+--- ./libpolybori/include/polybori/factories/SetFactory.h.orig	2011-09-07 14:25:22.000000000 -0600
++++ ./libpolybori/include/polybori/factories/SetFactory.h	2011-09-29 15:26:37.580079044 -0600
+@@ -6,7 +6,7 @@
+  * @date 2011-05-056
+  *
+  * This file defines the base class SetFactory which is used for
+- * @i currying the constructors of @c BooleSet with a BoolePolyRing.
++ * @em currying the constructors of @c BooleSet with a BoolePolyRing.
+  *
+  * @par Copyright:
+  *   (c) by The PolyBoRi Team
+@@ -25,8 +25,8 @@
+ BEGIN_NAMESPACE_PBORI
+ 
+ /** @class SetFactory
+- * @brief This base class SetFactory is used for @i currying
+- * monimial constructors with a BoolePolyRing.
++ * @brief This base class SetFactory is used for @em currying
++ * set constructors with a BoolePolyRing.
+  *
+  **/
+ 
+--- ./libpolybori/include/polybori/factories/CFactoryBase.h.orig	2011-09-07 14:25:22.000000000 -0600
++++ ./libpolybori/include/polybori/factories/CFactoryBase.h	2011-09-29 15:26:37.580079044 -0600
+@@ -5,7 +5,7 @@
+  * @author Alexander Dreyer
+  * @date 2011-05-05
+  *
+- * This file defines the base class CFactoryBase which is used for @i currying
++ * This file defines the base class CFactoryBase which is used for @em currying
+  * other constructors with a BoolePolyRing.
+  *
+  * @par Copyright:
+@@ -25,7 +25,7 @@
+ BEGIN_NAMESPACE_PBORI
+ 
+ /** @class CFactoryBase
+- * @brief This base class CFactoryBase is used for @i currying
++ * @brief This base class CFactoryBase is used for @em currying
+  * other constructors with a BoolePolyRing.
+  *
+  * We generate psuedo constructors that a ring to be provided, because the
+--- ./libpolybori/include/polybori/factories/PolynomialFactory.h.orig	2011-09-07 14:25:22.000000000 -0600
++++ ./libpolybori/include/polybori/factories/PolynomialFactory.h	2011-09-29 15:26:37.581079022 -0600
+@@ -6,7 +6,7 @@
+  * @date 2011-05-056
+  *
+  * This file defines the base class PolynomialFactory which is used for
+- * @i currying the constructors of @c BoolePolynomial with a BoolePolyRing.
++ * @em currying the constructors of @c BoolePolynomial with a BoolePolyRing.
+  *
+  * @par Copyright:
+  *   (c) by The PolyBoRi Team
+@@ -25,8 +25,8 @@
+ BEGIN_NAMESPACE_PBORI
+ 
+ /** @class PolynomialFactory
+- * @brief This base class PolynomialFactory is used for @i currying
+- * monimial constructors with a BoolePolyRing.
++ * @brief This base class PolynomialFactory is used for @em currying
++ * polynomial constructors with a BoolePolyRing.
+  *
+  **/
+ 
+--- ./libpolybori/include/polybori/ring/CCallbackWrapper.h.orig	2011-09-07 14:25:22.000000000 -0600
++++ ./libpolybori/include/polybori/ring/CCallbackWrapper.h	2011-09-29 15:26:37.582079000 -0600
+@@ -30,7 +30,7 @@
+  * If applies a stored member function pointer (together with a stored object
+  * reference) to the argument of operator().
+  *
+- * It is to be used as a face of @Type, e. g. for @c CCallbackWrapper below.
++ * It is to be used as a face of @c Type, e. g. for @c CCallbackWrapper below.
+  *
+  * @note Specialized variant to void member functions
+  * @attention Currently, the class supports unary functions only.
+--- ./libpolybori/include/polybori/ring/CCuddInterface.h.orig	2011-09-07 14:25:22.000000000 -0600
++++ ./libpolybori/include/polybori/ring/CCuddInterface.h	2011-09-29 15:26:37.581079022 -0600
+@@ -44,15 +44,15 @@
+ // get cudd error texts
+ inline const char* error_text(DdManager* mgr) {
+     switch (Cudd_ReadErrorCode(mgr)) {
+-    CUDD_MEMORY_OUT:
++    case CUDD_MEMORY_OUT:
+       return("Out of memory.");
+-    CUDD_TOO_MANY_NODES:
++    case CUDD_TOO_MANY_NODES:
+       return("To many nodes.");
+-    CUDD_MAX_MEM_EXCEEDED:
++    case CUDD_MAX_MEM_EXCEEDED:
+       return("Maximum memory exceeded.");
+-    CUDD_INVALID_ARG:
++    case CUDD_INVALID_ARG:
+       return("Invalid argument.");
+-    CUDD_INTERNAL_ERROR:
++    case CUDD_INTERNAL_ERROR:
+       return("Internal error.");
+     }
+     return("Unexpected error.");
+--- ./libpolybori/include/polybori/iterators/CTermStack.h.orig	2011-09-07 14:25:22.000000000 -0600
++++ ./libpolybori/include/polybori/iterators/CTermStack.h	2011-09-29 15:26:37.582079000 -0600
+@@ -411,7 +411,7 @@
+     bool invalid = true;
+     while (!base::empty() && invalid) {
+       incrementElse();
+-      if (invalid = base::isInvalid())
++      if ((invalid = base::isInvalid()))
+         base::decrementNode();
+     }
+   }
+@@ -627,7 +627,7 @@
+     while (!atBegin() && invalid) {
+       PBORI_ASSERT(!base::isConstant());
+       base::incrementElse();
+-      if (invalid = base::isInvalid())
++      if ((invalid = base::isInvalid()))
+         base::decrementNode();
+     }
+   }
+@@ -810,7 +810,7 @@
+         }
+         base::gotoEnd();
+ 
+-        if (doloop = (base::isInvalid() || (base::size() != size)) )
++        if ((doloop = (base::isInvalid() || (base::size() != size)) ))
+           base::decrementNode();
+ 
+     } while (!base::empty() && doloop);
+--- ./libpolybori/include/polybori/orderings/order_tags.h.orig	2011-09-07 14:25:22.000000000 -0600
++++ ./libpolybori/include/polybori/orderings/order_tags.h	2011-09-29 15:26:37.578079087 -0600
+@@ -36,7 +36,7 @@
+  **/
+ struct dp_asc_tag {};
+ 
+-/**@class block_tag<Tag>
++/**@class block_tag
+  * @brief Marker for block orderings.
+  **/
+ template <class TagType>
+--- ./PyPolyBoRi/main_wrapper.cc.orig	2011-09-07 14:25:22.000000000 -0600
++++ ./PyPolyBoRi/main_wrapper.cc	2011-09-29 15:26:37.583078979 -0600
+@@ -126,7 +126,7 @@
+   export_poly();
+   export_nav();
+   export_test_util();
+-  #ifdef HANVE_NTL
++  #ifdef HAVE_NTL
+   export_ntl();
+   #endif
+   enum_<COrderEnums::ordercodes>("OrderCode")
+--- ./groebner/include/polybori/groebner/ExpLexLess.h.orig	2011-09-07 14:25:22.000000000 -0600
++++ ./groebner/include/polybori/groebner/ExpLexLess.h	2011-09-29 15:27:22.129121193 -0600
+@@ -1,6 +1,6 @@
+ // -*- c++ -*-
+ //*****************************************************************************
+-/** @file groebner_ExpLexLess.h 
++/** @file ExpLexLess.h 
+  *
+  * @author Michael Brickenstein
+  * @date 2011-07-01
diff --git a/polybori.desktop b/polybori.desktop
new file mode 100644
index 0000000..7e3c3d7
--- /dev/null
+++ b/polybori.desktop
@@ -0,0 +1,12 @@
+[Desktop Entry]
+Version=1.0
+Type=Application
+Name=PolyBoRi
+GenericName=Boolean Rings
+Comment=PolyBoRi GUI
+Exec=PolyGUI %U
+TryExec=PolyGUI
+Terminal=false
+StartupNotify=false
+Icon=polybori
+Categories=Education;Science;Math;Qt;
diff --git a/polybori.spec b/polybori.spec
new file mode 100644
index 0000000..dfe8be7
--- /dev/null
+++ b/polybori.spec
@@ -0,0 +1,261 @@
+# NOTE: %%{_includedir}/polybori/cacheopts.h is empty on some platforms, but
+# it must be present anyway.  DO NOT REMOVE IT.
+
+Name:           polybori
+Version:        0.8.0
+Release:        3%{?dist}
+Summary:        Framework for Boolean Rings
+Group:          Development/Libraries
+License:        GPLv2+
+URL:            http://polybori.sourceforge.net/
+Source0:        http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz
+Source1:        %{name}.desktop
+# These logos were created with gimp from the official polybori logo
+Source2:        %{name}-logos.tar.xz
+# This patch is specific to Fedora.  Use system CUDD libraries instead of
+# building the included CUDD sources
+Patch0:         %{name}-system-cudd.patch
+# Sent upstream 7 Sep 2011.  Fix some broken code that leads to compiler
+# warnings.
+Patch1:         %{name}-warning.patch
+# Sent upstream 7 Sep 2011.  Fix a broken Python import.
+Patch2:         %{name}-import.patch
+# Sent upstream 14 Oct 2011.  The __M4RI_HAVE_ macros may be defined, but have
+# the value 0.
+Patch3:         %{name}-m4ri.patch
+
+BuildRequires:  boost-devel
+BuildRequires:  cudd-devel
+BuildRequires:  cudd-static
+BuildRequires:  desktop-file-utils
+BuildRequires:  doxygen
+BuildRequires:  gd-devel
+BuildRequires:  m4ri-devel
+BuildRequires:  pyparsing
+BuildRequires:  PyQt4-devel
+BuildRequires:  python2-devel
+BuildRequires:  python-imaging-devel
+BuildRequires:  scons
+BuildRequires:  tex4ht
+
+%global __provides_exclude_from ^%{python_sitearch}/.*\\\.so$
+%global icondir %{_datadir}/icons/hicolor
+
+# The Provides and Obsoletes below can be removed once F16 reaches EOL.
+
+%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 Gröbner base computation.
+
+%package        devel
+Summary:        Development files for %{name}
+Group:          Development/Libraries
+Requires:       %{name}%{?_isa} = %{version}-%{release}
+Requires:       boost-devel%{?_isa}
+Requires:       cudd-devel%{?_isa}
+Provides:       python-%{name}-devel = %{version}-%{release}
+Obsoletes:      python-%{name}-devel < 0.8.0-1
+
+%description    devel
+Development headers and libraries for %{name}.
+
+%package        static
+Summary:        Static libraries for %{name}
+Group:          Development/Libraries
+Requires:       %{name}-devel%{?_isa} = %{version}-%{release}
+Provides:       python-%{name}-static = %{version}-%{release}
+Obsoletes:      python-%{name}-static < 0.8.0-1
+
+%description    static
+Static libraries for %{name}.
+
+%package        docs
+Summary:        Documentation for %{name}
+Group:          Documentation
+Requires:       %{name}%{?_isa} = %{version}-%{release}
+Provides:       python-%{name}-docs = %{version}-%{release}
+Obsoletes:      python-%{name}-docs < 0.8.0-1
+BuildArch:      noarch
+
+%description    docs
+Documentation for %{name}.
+
+%package -n python-%{name}
+Summary:        Python interface to %{name}
+Group:          Development/Libraries
+Requires:       %{name}%{?_isa} = %{version}-%{release}
+Requires:       python-imaging%{?_isa}
+Requires:       pyparsing
+
+%description -n python-%{name}
+Python interface to %{name}.
+
+%package        ipbori
+Summary:        Command-line interface to %{name}
+Group:          Applications/Engineering
+Requires:       python-%{name}%{?_isa} = %{version}-%{release}
+Requires:       ipython
+
+%description    ipbori
+Command-line interface to %{name}.
+
+%package        gui
+Summary:        Qt GUI for %{name}
+Group:          Applications/Engineering
+Requires:       python-%{name}%{?_isa} = %{version}-%{release}
+Requires:       PyQt4, hicolor-icon-theme
+Provides:       python-%{name}-gui = %{version}-%{release}
+Obsoletes:      python-%{name}-gui < 0.8.0-1
+
+%description    gui
+Qt GUI for %{name}.
+
+%prep
+%setup -q
+%patch0
+%patch1
+%patch2
+%patch3
+
+# Remove private copy of system libs (cudd, m4ri, and pyparsing) and obsolete
+# Singular interface
+rm -rf Cudd M4RI Singular PyPolyBoRi/pyparsing.py
+
+# Fix up includes of cudd header files, without changing timestamps
+for fil in libpolybori/include/polybori/diagram/CCuddDDFacade.h \
+    libpolybori/include/polybori/diagram/CDDOperations.h \
+    libpolybori/include/polybori/pbori_defs.h \
+    libpolybori/include/polybori/ring/CCuddInterface.h \
+    libpolybori/include/polybori/routines/pbori_algo.h \
+    libpolybori/src/BoolePolyRing.cc \
+    libpolybori/src/pbori_routines.cc; do
+  sed 's|polybori/cudd|cudd|' ${fil} > ${fil}.new
+  touch -r ${fil} ${fil}.new
+  mv ${fil}.new ${fil}
+done
+
+# Fix library path for 64 bit systems
+if [ %{__isa_bits} = "64" ]; then
+  sed -i "s|'\$DEVEL_PREFIX/lib'|'\$DEVEL_PREFIX/lib64'|" SConstruct
+fi
+
+# Fix a dependency
+sed "s|/usr/bin/env python|/usr/bin/python|" pyroot/polybori/cluster.py > foo
+touch -r pyroot/polybori/cluster.py foo
+mv -f foo pyroot/polybori/cluster.py
+
+%build
+scons %{?_smp_mflags} prepare-install \
+  CCFLAGS="%{optflags} -I%{_includedir}/m4ri" \
+  LIBS="-lcudd"
+
+%install
+scons %{?_smp_mflags} install devel-install \
+  PREFIX=%{buildroot}%{_prefix} \
+  INSTALLDIR=%{buildroot}%{_datadir}/%{name} \
+  DOCDIR=%{buildroot}%{_docdir}/%{name} \
+  MANDIR=%{buildroot}%{_mandir} \
+  PYINSTALLPREFIX=%{buildroot}%{python_sitearch} \
+  DEVEL_PREFIX=%{buildroot}%{_prefix} \
+  CCFLAGS="%{optflags} -I%{_includedir}/m4ri" \
+  LIBS="-lcudd"
+
+# Relink against a minimal set of libraries to eliminate rpmlint warnings
+# about unused direct dependencies on libraries.  Also PyPolyBoRi.so is created
+# to contain all of the object files in both libpolybori and
+# libpolybori_groebner, instead of linking against them.
+g++ -o %{buildroot}%{_libdir}/libpolybori-%{version}.so.0.0.0 -shared \
+  -Wl,-soname,lib%{name}-%{version}.so.0 libpolybori/src/*.os %{optflags} \
+  -Wl,--as-needed -lcudd
+
+g++ -o %{buildroot}%{_libdir}/libpolybori_groebner-%{version}.so.0.0.0 \
+  -shared -Wl,-soname,lib%{name}_groebner-%{version}.so.0 groebner/src/*.os \
+  %{optflags} -Wl,--as-needed -L%{buildroot}%{_libdir} -l%{name}-%{version} \
+  -lcudd -lgd -lm4ri
+
+g++ -o %{buildroot}%{python_sitearch}/polybori/dynamic/PyPolyBoRi.so -shared \
+  PyPolyBoRi/*.os %{optflags} -Wl,--as-needed -L%{buildroot}%{_libdir} \
+  -l%{name}_groebner-%{version} -l%{name}-%{version} -lboost_python
+
+# Install the desktop file
+cp -p %{SOURCE1} .
+desktop-file-install --dir=%{buildroot}%{_datadir}/applications %{name}.desktop
+
+# Install the icons
+mkdir -p %{buildroot}%{icondir}
+tar xJf %{SOURCE2} -C %{buildroot}%{icondir}
+
+# Add a missing executable bit
+chmod a+x %{buildroot}%{python_sitearch}/%{name}/cluster.py
+
+# Move the ipbori script to bindir
+rm -f %{buildroot}%{_bindir}/ipbori
+sed "s|^THIS=.*|THIS=%{_datadir}/%{name}/ipbori|" \
+  %{buildroot}%{_datadir}/%{name}/ipbori/ipbori > %{buildroot}%{_bindir}/ipbori
+touch -r %{buildroot}%{_datadir}/%{name}/ipbori/ipbori \
+  %{buildroot}%{_bindir}/ipbori
+chmod a+x %{buildroot}%{_bindir}/ipbori
+rm -f %{buildroot}%{_datadir}/%{name}/ipbori/ipbori
+
+%post -p /sbin/ldconfig
+
+%postun -p /sbin/ldconfig
+
+%post gui
+update-desktop-database -q >& /dev/null || :
+touch --no-create %{icondir} >&/dev/null ||:
+gtk-update-icon-cache %{icondir} >&/dev/null ||:
+
+%postun gui
+update-desktop-database -q >& /dev/null || :
+touch --no-create %{icondir} >&/dev/null ||:
+gtk-update-icon-cache %{icondir} >&/dev/null ||:
+
+%files
+%doc LICENSE README
+%{_libdir}/lib*.so.*
+
+%files devel
+%doc ChangeLog
+%{_libdir}/lib*.so
+%{_includedir}/%{name}/
+%{_includedir}/%{name}.h
+
+%files static
+%{_libdir}/lib*.a
+
+%files docs
+%{_docdir}/%{name}/
+
+%files -n python-%{name}
+%{python_sitearch}/%{name}/
+
+%files ipbori
+%{_bindir}/ipbori
+%{_mandir}/man1/ipbori.1*
+%{_datadir}/%{name}/
+%exclude %{_datadir}/%{name}/gui/
+
+%files gui
+%{_bindir}/PolyGUI
+%{_datadir}/applications/%{name}.desktop
+%dir %{_datadir}/%{name}/
+%{_datadir}/%{name}/gui/
+%{icondir}/*/apps/%{name}.png
+%{_mandir}/man1/PolyGUI.1*
+
+%changelog
+* Thu Dec 29 2011 Jerry James <loganjerry at gmail.com> - 0.8.0-3
+- Rearrange subpackages to fix issues found on review
+
+* Thu Dec 22 2011 Jerry James <loganjerry at gmail.com> - 0.8.0-2
+- Put ipbori script in %%{_bindir} instead of a symlink
+- Preserve timestamps on files with fixed include directives
+
+* Fri Oct 14 2011 Jerry James <loganjerry at gmail.com> - 0.8.0-1
+- New spec file based on old python-polybori spec.
diff --git a/sources b/sources
index e69de29..4a271aa 100644
--- a/sources
+++ b/sources
@@ -0,0 +1,2 @@
+5024b793bc086c81f1a56be8309a0137  polybori-0.8.0.tar.gz
+099395c28ed53d45853be366b9a58036  polybori-logos.tar.xz


More information about the scm-commits mailing list