fix and enable testsuite

- drop ancient Obsoletes: (rhbz#1002135)
- drop ruby < 2.0 conditional Requires:
This commit is contained in:
Dominik Mierzejewski 2014-04-27 03:01:05 +02:00
parent 6ca12212b7
commit ac3be1f201
2 changed files with 101 additions and 12 deletions

90
openbabel-tests.patch Normal file
View File

@ -0,0 +1,90 @@
diff -up openbabel-2.3.2/scripts/python/examples/testpybel.py.tests openbabel-2.3.2/scripts/python/examples/testpybel.py
--- openbabel-2.3.2/scripts/python/examples/testpybel.py.tests 2012-10-03 21:08:51.000000000 +0200
+++ openbabel-2.3.2/scripts/python/examples/testpybel.py 2014-04-27 02:52:33.409199059 +0200
@@ -336,7 +336,7 @@ class TestPybel(TestToolkit):
tpsaname = "TPSA"
Nbits = 3
Nfpbits = 32
- datakeys = ['NSC', 'Comment', 'OpenBabel Symmetry Classes']
+ datakeys = ['NSC', 'Comment', 'OpenBabel Symmetry Classes', 'MOL Chiral Flag']
def testFP_FP3(self):
"Checking the results from FP3"
diff -up openbabel-2.3.2/test/CMakeLists.txt.tests openbabel-2.3.2/test/CMakeLists.txt
--- openbabel-2.3.2/test/CMakeLists.txt.tests 2012-10-03 21:08:16.000000000 +0200
+++ openbabel-2.3.2/test/CMakeLists.txt 2014-04-27 01:45:09.814474935 +0200
@@ -2,7 +2,7 @@
add_definitions(-DTESTDATADIR="\\"${CMAKE_SOURCE_DIR}/test/files/\\"")
# define FORMATDIR for location of format plugin binaries
-add_definitions(-DFORMATDIR="\\"${openbabel_BINARY_DIR}/lib/\\"")
+add_definitions(-DFORMATDIR="\\"${openbabel_BINARY_DIR}/lib${LIB_SUFFIX}/\\"")
###########################################################
# new tests using obtest.h
@@ -64,7 +64,7 @@ foreach(test ${tests})
add_test(${test}_Test ${TEST_PATH}/test_${test})
set_tests_properties(${test}_Test PROPERTIES
FAIL_REGULAR_EXPRESSION "ERROR;FAIL;Test failed"
- ENVIRONMENT "BABEL_DATADIR=${CMAKE_SOURCE_DIR}/data;LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib")
+ ENVIRONMENT "BABEL_DATADIR=${CMAKE_SOURCE_DIR}/data;LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib${LIB_SUFFIX}")
endforeach(test ${tests})
############################################################
@@ -127,7 +127,7 @@ if(WITH_INCHI)
${TEST_PATH}/test_inchiwrite ${inchidata}/${test} ${inchidata}/${test}.txt)
set_tests_properties(inchi${test}_Test PROPERTIES
FAIL_REGULAR_EXPRESSION "Not ok"
- ENVIRONMENT "BABEL_DATADIR=${CMAKE_SOURCE_DIR}/data;LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib"
+ ENVIRONMENT "BABEL_DATADIR=${CMAKE_SOURCE_DIR}/data;LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib${LIB_SUFFIX}"
)
endforeach(test ${inchitests})
endif(WITH_INCHI)
@@ -141,7 +141,7 @@ foreach(test ${old_tests})
add_test(${test}_Test ${TEST_PATH}/test_${test})
set_tests_properties(${test}_Test PROPERTIES
FAIL_REGULAR_EXPRESSION "not ok"
- ENVIRONMENT "BABEL_DATADIR=${CMAKE_SOURCE_DIR}/data;LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib"
+ ENVIRONMENT "BABEL_DATADIR=${CMAKE_SOURCE_DIR}/data;LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib${LIB_SUFFIX}"
)
endforeach(test ${old_tests})
@@ -156,8 +156,8 @@ if(NOT BUILD_SHARED)
endif()
install(TARGETS roundtrip
RUNTIME DESTINATION bin
- LIBRARY DESTINATION lib
- ARCHIVE DESTINATION lib
+ LIBRARY DESTINATION lib${LIB_SUFFIX}
+ ARCHIVE DESTINATION lib${LIB_SUFFIX}
)
###########################
@@ -174,10 +174,10 @@ if(NOT MINGW AND NOT CYGWIN)
babel sym fastsearch unique kekule)
foreach(pytest ${pytests})
SET_SOURCE_FILES_PROPERTIES(test${pytest}.py PROPERTIES
- PYTHONPATH "${CMAKE_SOURCE_DIR}/scripts/python:${CMAKE_BINARY_DIR}/lib"
- BABEL_LIBDIR "${CMAKE_BINARY_DIR}/lib"
+ PYTHONPATH "${CMAKE_SOURCE_DIR}/scripts/python:${CMAKE_BINARY_DIR}/lib${LIB_SUFFIX}"
+ BABEL_LIBDIR "${CMAKE_BINARY_DIR}/lib${LIB_SUFFIX}"
BABEL_DATADIR "${CMAKE_SOURCE_DIR}/data"
- LD_LIBRARY_PATH "${CMAKE_BINARY_DIR}/lib"
+ LD_LIBRARY_PATH "${CMAKE_BINARY_DIR}/lib${LIB_SUFFIX}"
)
ADD_PYTHON_TEST(pytest_${pytest} test${pytest}.py)
set_tests_properties(pytest_${pytest} PROPERTIES
@@ -196,10 +196,10 @@ if (PYTHON_BINDINGS)
bindings _pybel example)
foreach(pybindtest ${pybindtests})
SET_SOURCE_FILES_PROPERTIES(test${pybindtest}.py PROPERTIES
- PYTHONPATH "${CMAKE_SOURCE_DIR}/scripts/python:${CMAKE_BINARY_DIR}/lib"
- BABEL_LIBDIR "${CMAKE_BINARY_DIR}/lib"
+ PYTHONPATH "${CMAKE_SOURCE_DIR}/scripts/python:${CMAKE_BINARY_DIR}/lib${LIB_SUFFIX}"
+ BABEL_LIBDIR "${CMAKE_BINARY_DIR}/lib${LIB_SUFFIX}"
BABEL_DATADIR "${CMAKE_SOURCE_DIR}/data"
- LD_LIBRARY_PATH "${CMAKE_BINARY_DIR}/lib"
+ LD_LIBRARY_PATH "${CMAKE_BINARY_DIR}/lib${LIB_SUFFIX}"
)
if(MSVC)
SET_SOURCE_FILES_PROPERTIES(test${pybindtest}.py PROPERTIES

View File

@ -10,7 +10,7 @@
Name: openbabel
Version: 2.3.2
Release: 3%{beta_ver}%{?dist}
Release: 4%{beta_ver}%{?dist}
Summary: Chemistry software file format converter
License: GPLv2
Group: Applications/File
@ -20,7 +20,8 @@ Source1: obgui.desktop
Patch1: %{name}-rpm.patch
# http://sourceforge.net/p/openbabel/bugs/839/ perl bindings fail to build
Patch2: openbabel-2.3.2-cmake.patch
# fix tests
Patch3: openbabel-tests.patch
# fix plugin directory location (#680292, patch by lg)
Patch4: openbabel-2.3.0-plugindir.patch
# Patch 5-7: all ruby related
@ -91,7 +92,6 @@ This package contains the graphical interface.
%package libs
Summary: Chemistry software file format converter - libraries
Group: System Environment/Libraries
Obsoletes: %{name} < 2.3.0-1
%description libs
Open Babel is a free, open-source version of the Babel chemistry file
@ -127,11 +127,7 @@ Python wrapper for the Open Babel library.
%package -n ruby-%{name}
Summary: Ruby wrapper for the Open Babel library
Group: Development/Libraries
%if 0%{?fedora} >= 19
Requires: ruby(release)
%else
Requires: ruby(abi) = 1.9.1
%endif
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
%description -n ruby-%{name}
@ -141,6 +137,7 @@ Ruby wrapper for the Open Babel library.
%setup -q -n %{name}-%{version}%{beta_dir}
%patch1 -p1 -b .rpm
%patch2 -p1 -b .cmakepol
%patch3 -p1 -b .tests
%patch4 -p1 -b .plugindir
%patch5 -p1 -b .gcc47
%patch6 -p1 -b .noswig_ruby
@ -169,11 +166,11 @@ done
-DOPENBABEL_USE_SYSTEM_INCHI=true \
-DENABLE_VERSIONED_FORMATS=false \
-DRUN_SWIG=true \
-DENABLE_TESTS:BOOL=ON \
.
make VERBOSE=1 %{?_smp_mflags}
%install
rm -rf %{buildroot}
make VERBOSE=1 DESTDIR=%{buildroot} ruby_headers= install
# Put Python bindings in the right place.
@ -192,10 +189,7 @@ chmod 755 %{buildroot}%{perl_vendorarch}/auto/Chemistry/OpenBabel/OpenBabel.so
desktop-file-install --dir=%{buildroot}%{_datadir}/applications %{SOURCE1}
install -Dpm644 babel.png %{buildroot}%{_datadir}/pixmaps/babel.png
%clean
rm -rf %{buildroot}
%if 0
%if 1
%check
make test
%endif
@ -251,6 +245,11 @@ make test
%{ruby_vendorarchdir}/openbabel.so
%changelog
* Sun Apr 27 2014 Dominik Mierzejewski <rpm@greysector.net> 2.3.2-4
- fix and enable testsuite
- drop ancient Obsoletes: (rhbz#1002135)
- drop ruby < 2.0 conditional Requires:
* Fri Apr 25 2014 Vít Ondruch <vondruch@redhat.com> - 2.3.2-3
- Rebuilt for https://fedoraproject.org/wiki/Changes/Ruby_2.1