diff --git a/mariadb-connector-c.spec b/mariadb-connector-c.spec index 92ce276..4d2cc19 100644 --- a/mariadb-connector-c.spec +++ b/mariadb-connector-c.spec @@ -3,7 +3,7 @@ Name: mariadb-connector-c Version: 3.1.3 -Release: 1%{?with_debug:.debug}%{?dist} +Release: 2%{?with_debug:.debug}%{?dist} Summary: The MariaDB Native Client library (C driver) License: LGPLv2+ Source: https://downloads.mariadb.org/interstitial/connector-c-%{version}/mariadb-connector-c-%{version}-src.tar.gz @@ -12,6 +12,8 @@ Source3: client.cnf Url: http://mariadb.org/ # More information: https://mariadb.com/kb/en/mariadb/building-connectorc-from-source/ +Patch1: testsuite.patch + Requires: %{_sysconfdir}/my.cnf BuildRequires: zlib-devel cmake openssl-devel gcc-c++ # Remote-IO plugin @@ -37,6 +39,19 @@ Contains everything needed to build against libmariadb.so >=3 client library. +%package test +Summary: Testsuite files for mariadb-connector-c +Requires: %{name} = %{version}-%{release} +Requires: cmake +Recommends: mariadb-server + +%description test +Testsuite files for mariadb-connector-c. +Contains binaries and a prepared CMake ctest file. +Requires running MariaDB / MySQL server with create database "test". + + + %package config Summary: Configuration files for packages that use /etc/my.cnf as a configuration file BuildArch: noarch @@ -52,6 +67,7 @@ and require this package, so the /etc/my.cnf file is present. %prep %setup -q -n %{name}-%{version}-src +%patch1 -p1 # Remove unsused parts rm -r win zlib win-iconv examples @@ -176,6 +192,13 @@ popd +%files test +%dir %{_datadir}/%{name} +%{_datadir}/%{name}/* +%{_libdir}/libcctap.so + + + # Opened issues on the upstream tracker: # https://jira.mariadb.org/browse/CONC-293 # DESCRIPTION: add mysql_config and mariadb_config man page @@ -203,6 +226,9 @@ popd # Currently, one of the tests - 'ps_bugs' - is failing %changelog +* Mon Aug 19 2019 Michal Schorm - 3.1.3-2 +- Extract the prepared testsuite to the standalone subpackage so it can be run outside of the buildroot + * Fri Aug 02 2019 Michal Schorm - 3.1.3-1 - Rebase to 3.1.3 version - Patch upstreamed diff --git a/testsuite.patch b/testsuite.patch new file mode 100644 index 0000000..6a2d2d3 --- /dev/null +++ b/testsuite.patch @@ -0,0 +1,10 @@ +--- mariadb-connector-c-3.1.3-src/unittest/libmariadb/CMakeLists.txt 2019-07-25 10:03:48.000000000 -0400 ++++ mariadb-connector-c-3.1.3-src/unittest/libmariadb/CMakeLists.txt_patched 2019-08-19 17:02:26.317247605 -0400 +@@ -71,3 +71,7 @@ FOREACH(API_TEST ${MANUAL_TESTS}) + ADD_EXECUTABLE(${API_TEST} ${API_TEST}.c) + TARGET_LINK_LIBRARIES(${API_TEST} cctap ma_getopt mariadbclient) + ENDFOREACH() ++ ++INSTALL(TARGETS ${API_TESTS} DESTINATION ${SHAREDIR}/mariadb-connector-c/tests COMPONENT Tests) ++INSTALL(FILES ${CC_SOURCE_DIR}/unittest/mytap/libcctap.so PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE DESTINATION ${INSTALL_LIBDIR} COMPONENT Tests) ++INSTALL(FILES ${CC_SOURCE_DIR}/unittest/libmariadb/CTestTestfile.cmake DESTINATION ${SHAREDIR}/mariadb-connector-c/tests COMPONENT Tests)