- updated to 2.2.0

- fixed testsuite
- added strict perl version requirements (patch by Paul Howarth)
- fixed some rpmlint warnings
- merged a sed call into -rpm patch
This commit is contained in:
Dominik Mierzejewski 2008-07-06 14:57:34 +00:00
parent e5a93508d3
commit 7ec9e5e5c4
6 changed files with 50 additions and 368 deletions

View File

@ -1 +1 @@
openbabel-2.2.0b7-20080627-r2628.tar.gz
openbabel-2.2.0.tar.gz

12
openbabel-check.patch Normal file
View File

@ -0,0 +1,12 @@
diff -up openbabel-2.2.0b7/test/bond.cpp.chk openbabel-2.2.0b7/test/bond.cpp
--- openbabel-2.2.0b7/test/bond.cpp.chk 2008-06-13 22:48:05.000000000 +0200
+++ openbabel-2.2.0b7/test/bond.cpp 2008-07-06 14:05:26.000000000 +0200
@@ -58,7 +58,7 @@ int main(int argc,char *argv[])
bond1.SetBegin(&begin1);
bond1.SetEnd(&end1);
- cout << "ok 4\n";
+ cout << "ok 3\n";
return(0);
}

View File

@ -1,348 +0,0 @@
Index: scripts/openbabel-python2.i
===================================================================
--- scripts/openbabel-python2.i (revision 0)
+++ scripts/openbabel-python2.i (revision 2535)
@@ -0,0 +1,92 @@
+%module obconversion
+
+%{
+// used to set import/export for Cygwin DLLs
+#ifdef WIN32
+#define USING_OBDLL
+#endif
+
+#include <openbabel/base.h>
+
+#include <openbabel/generic.h>
+#include <openbabel/griddata.h>
+#include <openbabel/math/vector3.h>
+#include <openbabel/bitvec.h>
+
+#include <openbabel/mol.h>
+#include <openbabel/obconversion.h>
+#include <openbabel/oberror.h>
+#include <openbabel/plugin.h>
+#include <openbabel/fingerprint.h>
+#include <openbabel/descriptor.h>
+#include <openbabel/format.h>
+#include <openbabel/forcefield.h>
+#include <openbabel/op.h>
+
+%}
+
+// These methods are renamed to valid Python method names, as otherwise
+// they cannot be used from Python
+%rename(inc) *::operator++;
+%rename(good) *::operator bool;
+
+%import <openbabel/babelconfig.h>
+
+%import <openbabel/base.h>
+%import <openbabel/generic.h>
+%import <openbabel/griddata.h>
+
+%import <openbabel/math/vector3.h>
+%import <openbabel/bitvec.h>
+
+%import <openbabel/chains.h>
+%import <openbabel/typer.h>
+
+%include <openbabel/plugin.h>
+%include <openbabel/oberror.h>
+%include <openbabel/format.h>
+%include <openbabel/obconversion.h>
+%import <openbabel/residue.h>
+%import <openbabel/internalcoord.h>
+%import <openbabel/atom.h>
+%import <openbabel/bond.h>
+%import <openbabel/mol.h>
+%import <openbabel/ring.h>
+%import <openbabel/parsmart.h>
+
+%include <openbabel/fingerprint.h>
+%include <openbabel/descriptor.h>
+%include <openbabel/forcefield.h>
+
+%include <openbabel/op.h>
+%include <openbabel/bitvec.h>
+
+%ignore *::operator=;
+
+%include "carrays.i"
+%array_class(double, doubleArray)
+%pythoncode %{
+def double_array(mylist):
+ """Create a C array of doubles from a list."""
+ c = doubleArray(len(mylist))
+ for i,v in enumerate(mylist):
+ c[i] = v
+ return c
+%}
+
+# Functions to set the log file to std::cout and std::cerr
+
+%ignore OBForceField::SetLogFile(std::ostream *pos);
+%extend OpenBabel::OBForceField {
+ void SetLogToStdOut()
+ {
+ self->SetLogFile(&std::cout);
+ }
+
+ void SetLogToStdErr()
+ {
+ self->SetLogFile(&std::cerr);
+ }
+};
+
+
Index: scripts/openbabel-python3.i
===================================================================
--- scripts/openbabel-python3.i (revision 0)
+++ scripts/openbabel-python3.i (revision 2535)
@@ -0,0 +1,65 @@
+%module obtemplate
+
+%{
+// used to set import/export for Cygwin DLLs
+#ifdef WIN32
+#define USING_OBDLL
+#endif
+
+#include <openbabel/base.h>
+#include <openbabel/mol.h>
+#include <openbabel/atom.h>
+#include <openbabel/bond.h>
+#include <openbabel/residue.h>
+#include <openbabel/ring.h>
+
+%}
+
+%include "std_list.i"
+%include "std_map.i"
+%include "std_vector.i"
+%include "std_string.i"
+
+namespace std {
+%template (vectorInt) vector<int>;
+%template (vectorUnsignedInt) vector<unsigned int>;
+%template (vvInt) vector< vector<int> >;
+%template (vectorDouble) vector<double>;
+%template (vectorString) vector<std::string>;
+%template (vVector3) vector<OpenBabel::vector3>;
+
+%template (vectorMol) vector<OpenBabel::OBMol>;
+%template (vectorBond) vector<OpenBabel::OBBond>;
+%template (vectorResidue) vector<OpenBabel::OBResidue>;
+%template (vectorRing) vector<OpenBabel::OBRing>;
+%template (vectorpRing) vector<OpenBabel::OBRing*>;
+%template (vectorData) vector<OpenBabel::OBGenericData*>;
+}
+
+// These methods are renamed to valid Python method names, as otherwise
+// they cannot be used from Python
+%rename(inc) *::operator++;
+%rename(good) *::operator bool;
+
+%import <openbabel/babelconfig.h>
+
+%import <openbabel/base.h>
+%import <openbabel/residue.h>
+%import <openbabel/atom.h>
+%import <openbabel/bond.h>
+%import <openbabel/mol.h>
+%import <openbabel/ring.h>
+
+%ignore *::operator=;
+
+%include "carrays.i"
+%array_class(double, doubleArray)
+%pythoncode %{
+def double_array(mylist):
+ """Create a C array of doubles from a list."""
+ c = doubleArray(len(mylist))
+ for i,v in enumerate(mylist):
+ c[i] = v
+ return c
+%}
+
Index: scripts/python/setup.py
===================================================================
--- scripts/python/setup.py (revision 2534)
+++ scripts/python/setup.py (revision 2535)
@@ -60,13 +60,27 @@
OBinclude,OBlibrary = find_likely_directory()
-obExtension = Extension('_openbabel',
- ['openbabel_python.cpp'],
- include_dirs=OBinclude,
- library_dirs=OBlibrary,
- libraries=['openbabel']
- )
+obCore = Extension('_obcore',
+ ['obcore.cpp'],
+ include_dirs=OBinclude,
+ library_dirs=OBlibrary,
+ libraries=['openbabel']
+ )
+obConversion = Extension('_obconversion',
+ ['obconversion.cpp'],
+ include_dirs=OBinclude,
+ library_dirs=OBlibrary,
+ libraries=['openbabel']
+ )
+
+obTemplate = Extension('_obtemplate',
+ ['obtemplate.cpp'],
+ include_dirs=OBinclude,
+ library_dirs=OBlibrary,
+ libraries=['openbabel']
+ )
+
setup(name='openbabel',
version='1.3',
author='Noel O\'Boyle',
@@ -74,7 +88,7 @@
url='http://openbabel.sourceforge.net/',
license='http://www.gnu.org/copyleft/gpl.html',
py_modules=['openbabel','pybel'],
- ext_modules=[obExtension],
+ ext_modules=[obCore, obConversion, obTemplate],
description = 'openbabel: Python interface to the Open Babel chemistry library',
classifiers=[
'Development Status :: 5 - Production/Stable',
Index: scripts/python/openbabel.py
===================================================================
--- scripts/python/openbabel.py (revision 0)
+++ scripts/python/openbabel.py (revision 2535)
@@ -0,0 +1,11 @@
+import sys
+if sys.platform.find("linux") != -1:
+ try:
+ import dl
+ except ImportError:
+ import DLFCN as dl
+ sys.setdlopenflags(sys.getdlopenflags() | dl.RTLD_GLOBAL)
+
+import obcore
+import obconversion
+import obtemplate
Index: scripts/Makefile.am
===================================================================
--- scripts/Makefile.am (revision 2534)
+++ scripts/Makefile.am (revision 2535)
@@ -20,8 +20,9 @@
if MAINTAINER_MODE
if BUILD_SWIG
-BUILT_SOURCES = perl/openbabel_perl.cpp python/openbabel_python.cpp \
- java/openbabel_java.cpp
+BUILT_SOURCES = perl/openbabel_perl.cpp \
+ java/openbabel_java.cpp \
+ python/obcore.cpp python/obconversion.cpp python/obtemplate.cpp
script_includes = $(top_srcdir)/include/openbabel
script_headers = $(script_includes)/mol.h $(script_includes)/obconversion.h \
@@ -34,20 +35,18 @@
sed -e "s/^@EXPORT.*/& sub dl_load_flags { 0x01 }/" <perl/OpenBabel.pm >perl/OpenBabel.new;
mv perl/OpenBabel.new perl/OpenBabel.pm;
-python/openbabel_python.cpp: openbabel-python.i $(script_headers)
- $(SWIG) -python -modern -naturalvar -fastinit \
+python/obconversion.cpp: openbabel-python2.i $(script_headers)
+ $(SWIG) -small -O -python -templatereduce -naturalvar \
-c++ -o $@ -I$(top_srcdir)/include -I$(top_builddir)/include $<;
- echo "import sys" >python/ob.py;
- echo "if sys.platform.find(\"linux\") != -1:" >>python/ob.py;
- echo " try:" >>python/ob.py;
- echo " import dl" >>python/ob.py;
- echo " except ImportError:" >>python/ob.py;
- echo " import DLFCN as dl" >>python/ob.py;
- echo " sys.setdlopenflags(sys.getdlopenflags() | dl.RTLD_GLOBAL)" >>python/ob.py;
- echo >>python/ob.py;
- cat python/openbabel.py >>python/ob.py;
- mv python/ob.py python/openbabel.py;
+python/obtemplate.cpp: openbabel-python3.i $(script_headers)
+ $(SWIG) -small -O -python -templatereduce -naturalvar \
+ -c++ -o $@ -I$(top_srcdir)/include -I$(top_builddir)/include $<;
+
+python/obcore.cpp: openbabel-python.i $(script_headers)
+ $(SWIG) -small -O -python -templatereduce -naturalvar \
+ -c++ -o $@ -I$(top_srcdir)/include -I$(top_builddir)/include $<;
+
java/openbabel_java.cpp: openbabel-java.i $(script_headers)
$(SWIG) -java -naturalvar -c++ -o $@ -I$(top_srcdir)/include \
-I$(top_builddir)/include $<;
Index: scripts/openbabel-python.i
===================================================================
--- scripts/openbabel-python.i (revision 2534)
+++ scripts/openbabel-python.i (revision 2535)
@@ -1,4 +1,4 @@
-%module openbabel
+%module obcore
%{
// used to set import/export for Cygwin DLLs
@@ -41,28 +41,6 @@
%}
-%include "std_list.i"
-%include "std_map.i"
-%include "std_vector.i"
-%include "std_string.i"
-
-namespace std {
-%template (vectorInt) vector<int>;
-%template (vectorUnsignedInt) vector<unsigned int>;
-%template (vvInt) vector< vector<int> >;
-%template (vectorDouble) vector<double>;
-%template (vectorString) vector<std::string>;
-%template (vVector3) vector<OpenBabel::vector3>;
-
-%template (vectorMol) vector<OpenBabel::OBMol>;
-%template (vectorBond) vector<OpenBabel::OBBond>;
-%template (vectorResidue) vector<OpenBabel::OBResidue>;
-%template (vectorRing) vector<OpenBabel::OBRing>;
-%template (vectorpRing) vector<OpenBabel::OBRing*>;
-%template (vectorData) vector<OpenBabel::OBGenericData*>;
-}
-
-
%inline %{
OpenBabel::OBPairData *toPairData(OpenBabel::OBGenericData *data) {
return (OpenBabel::OBPairData *) data;
@@ -95,11 +73,11 @@
//# %import <openbabel/bitvec.h>
%import <openbabel/typer.h>
-%include <openbabel/plugin.h>
+%import <openbabel/plugin.h>
-%include <openbabel/oberror.h>
-%include <openbabel/format.h>
-%include <openbabel/obconversion.h>
+%import <openbabel/oberror.h>
+%import <openbabel/format.h>
+%import <openbabel/obconversion.h>
%include <openbabel/residue.h>
%include <openbabel/internalcoord.h>
%include <openbabel/atom.h>
@@ -110,11 +88,11 @@
%include <openbabel/alias.h>
%include <openbabel/atomclass.h>
-%include <openbabel/fingerprint.h>
-%include <openbabel/descriptor.h>
-%include <openbabel/forcefield.h>
+%import <openbabel/fingerprint.h>
+%import <openbabel/descriptor.h>
+%import <openbabel/forcefield.h>
-%include <openbabel/op.h>
+%import <openbabel/op.h>
%include <openbabel/bitvec.h>

View File

@ -1,9 +1,9 @@
diff -up openbabel-2.2.0b3-20080215-r2249/scripts/Makefile.am.r openbabel-2.2.0b3-20080215-r2249/scripts/Makefile.am
--- openbabel-2.2.0b3-20080215-r2249/scripts/Makefile.am.r 2008-01-24 21:43:42.000000000 +0100
+++ openbabel-2.2.0b3-20080215-r2249/scripts/Makefile.am 2008-02-23 15:48:26.000000000 +0100
@@ -58,8 +58,8 @@ ruby/openbabel_ruby.cpp: openbabel-ruby.
$(SWIG) -ruby -naturalvar -autorename -c++ -o $@ -I$(top_srcdir)/include \
-I$(top_builddir)/include $<;
diff -up openbabel-2.2.0/scripts/Makefile.am.r openbabel-2.2.0/scripts/Makefile.am
--- openbabel-2.2.0/scripts/Makefile.am.r 2008-07-03 20:25:54.000000000 +0200
+++ openbabel-2.2.0/scripts/Makefile.am 2008-07-06 15:59:23.000000000 +0200
@@ -63,8 +63,8 @@ ruby/openbabel_ruby.cpp: openbabel-ruby.
$(SWIG) -small -O -ruby -naturalvar -autorename -c++ -o $@ \
-templatereduce -I$(top_srcdir)/include -I$(top_builddir)/include $<;
(cd ruby; ruby extconf.rb \
- --with-openbabel-include=$(includedir)/openbabel-2.0 \
- --with-openbabel-lib=$(libdir) )
@ -12,3 +12,17 @@ diff -up openbabel-2.2.0b3-20080215-r2249/scripts/Makefile.am.r openbabel-2.2.0b
sed -e 's/rb_define_module(\"Openbabel\")/rb_define_module(\"OpenBabel\")/' -e 's/void Init_OpenBabel/void Init_openbabel/' <ruby/openbabel_ruby.cpp >ruby/openbabel_ruby.new
mv ruby/openbabel_ruby.new ruby/openbabel_ruby.cpp
endif # BUILD_RUBY
diff -up openbabel-2.2.0/scripts/perl/Makefile.PL.r openbabel-2.2.0/scripts/perl/Makefile.PL
--- openbabel-2.2.0/scripts/perl/Makefile.PL.r 2008-07-06 16:16:45.000000000 +0200
+++ openbabel-2.2.0/scripts/perl/Makefile.PL 2008-07-06 16:48:59.000000000 +0200
@@ -3,8 +3,8 @@ use ExtUtils::MakeMaker;
use lib 'inc';
use Devel::CheckLib;
-check_lib_or_exit( lib => 'openbabel' , libpath =>
-@ENV{"LD_LIBRARY_PATH"});
+#check_lib_or_exit( lib => 'openbabel' , libpath =>
+#@ENV{"LD_LIBRARY_PATH"});
$CC = 'g++';
$srcdir = '../../src';

View File

@ -4,12 +4,12 @@
%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
%define ruby_sitearch %(ruby -rrbconfig -e 'puts Config::CONFIG["sitearchdir"]')
%define beta_ver b7
%define beta_str b7-20080627-r2628
%define beta_ver %{nil}
%define beta_str %{nil}
Name: openbabel
Version: 2.2.0
Release: 0.5.%{beta_ver}%{?dist}
Release: 1%{?dist}
Summary: Chemistry software file format converter
License: GPLv2
Group: Applications/File
@ -17,6 +17,7 @@ URL: http://openbabel.org/
Source: http://dl.sourceforge.net/sourceforge/openbabel/%{name}-%{version}%{beta_str}.tar.gz
Patch: %{name}-gcc43.patch
Patch1: %{name}-rpm.patch
Patch2: %{name}-check.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: inchi-devel
BuildRequires: libtool
@ -62,8 +63,9 @@ you should install %{name}-devel. You'll also need to have the
%package -n perl-%{name}
Group: System Environment/Libraries
Summary: Perl wrapper for the Open Babel library
Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
Obsoletes: %{name}-perl < 2.2.0
Provides: %{name}-perl
Provides: %{name}-perl = %{version}-%{release}
%description -n perl-%{name}
Perl wrapper for the Open Babel library.
@ -72,7 +74,7 @@ Perl wrapper for the Open Babel library.
Group: System Environment/Libraries
Summary: Python wrapper for the Open Babel library
Obsoletes: %{name}-python < 2.2.0
Provides: %{name}-python
Provides: %{name}-python = %{version}-%{release}
%description -n python-%{name}
Python wrapper for the Open Babel library.
@ -90,7 +92,8 @@ Ruby wrapper for the Open Babel library.
%setup -q -n %{name}-%{version}%{beta_ver}
%patch -p1 -b .gcc43
%patch1 -p1 -b .r
find . -name "._*" | xargs rm
%patch2 -p1 -b .chk
chmod 644 src/formats/{mmcif,fchk}format.cpp
%build
# don't reference m4 include directory which isn't shipped in the tarball
@ -101,9 +104,6 @@ autoreconf --force --install
%{__make} %{?_smp_mflags}
pushd scripts/perl
# disable the check for the installed library, the library isn't installed yet
# at this point and isn't expected to
sed -i -e 's/check_lib_or_exit/#check_lib_or_exit/g' Makefile.PL
perl Makefile.PL INSTALLDIRS="vendor"
%{__make} %{?_smp_mflags} OPTIMIZE="$RPM_OPT_FLAGS"
popd
@ -134,6 +134,7 @@ pushd scripts/python
%{__python} setup.py install --skip-build --root $RPM_BUILD_ROOT
%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
popd
chmod 755 $RPM_BUILD_ROOT%{python_sitearch}/_openbabel.so
pushd scripts/ruby
%{__make} install DESTDIR=$RPM_BUILD_ROOT
@ -187,11 +188,14 @@ popd
%{ruby_sitearch}/openbabel.so
%changelog
* Wed Jul 02 2008 Dominik Mierzejewski <rpm@greysector.net> 2.2.0-0.6.b7
- updated to 2.2.0 beta7
* Sun Jul 06 2008 Dominik Mierzejewski <rpm@greysector.net> 2.2.0-1
- updated to 2.2.0
- new URL
- dropped Python binding split patch (broken, reverted upstream)
- removed weird Macintosh files
- fixed testsuite and disabled inchi tests temporarily
- added strict perl version requirements (patch by Paul Howarth)
- fixed some rpmlint warnings
- merged a sed call into -rpm patch
* Fri Jun 06 2008 Kevin Kofler <Kevin@tigcc.ticalc.org> 2.2.0-0.5.b5
- backport upstream patch to split Python binding (should fix #427700 for good)

View File

@ -1 +1 @@
541d2e8654d95afe5aee2ad9055e33b2 openbabel-2.2.0b7-20080627-r2628.tar.gz
643a18c7ba09254d36e93afd6277346f openbabel-2.2.0.tar.gz