[packages/mariadb-connector-c] - from fc

arekm arekm at pld-linux.org
Mon Jun 15 07:59:13 CEST 2020


commit e8a1d0e408f3ec01fb04b4371c5049cce9ab9032
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Mon Jun 15 07:58:37 2020 +0200

    - from fc

 client.cnf               |  13 ++++
 mariadb-connector-c.spec | 161 +++++++++++++++++++++++++++++++++++++++++++++++
 my.cnf                   |  11 ++++
 testsuite.patch          |  10 +++
 4 files changed, 195 insertions(+)
---
diff --git a/mariadb-connector-c.spec b/mariadb-connector-c.spec
new file mode 100644
index 0000000..a4e4dd6
--- /dev/null
+++ b/mariadb-connector-c.spec
@@ -0,0 +1,161 @@
+#
+%bcond_with	tests
+#
+Summary:	The MariaDB Native Client library (C driver)
+Name:		mariadb-connector-c
+Version:	3.1.8
+Release:	1
+License:	LGPL v2+
+Group:		Libraries
+Source0:	https://downloads.mariadb.org/interstitial/connector-c-%{version}/%{name}-%{version}-src.tar.gz
+# Source0-md5:	0beaee9a77f78a0bf37a1d91999643c6
+Source2:	my.cnf
+Source3:	client.cnf
+URL:		http://mariadb.org/
+# More information: https://mariadb.com/kb/en/mariadb/building-connectorc-from-source/
+Patch1:		testsuite.patch
+BuildRequires:	cmake
+BuildRequires:	libstdc++-devel
+BuildRequires:	openssl-devel
+BuildRequires:	zlib-devel
+Requires:	%{_sysconfdir}/my.cnf
+# Remote-IO plugin
+BuildRequires:	curl-devel
+# auth_gssapi_client plugin
+BuildRequires:	heimdal-devel
+
+%description
+The MariaDB Native Client library (C driver) is used to connect
+applications developed in C/C++ to MariaDB and MySQL databases.
+
+%package devel
+Summary:	Development files for mariadb-connector-c
+Group:		Development/Libraries
+Requires:	%{name} = %{version}-%{release}
+Requires:	openssl-devel
+Requires:	zlib-devel
+
+%description devel
+Development files for mariadb-connector-c. Contains everything needed
+to build against libmariadb.so >=3 client library.
+
+%package test
+Summary:	Testsuite files for mariadb-connector-c
+Group:		Libraries
+Requires:	%{name} = %{version}-%{release}
+Requires:	cmake
+Suggests:	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
+Group:		Libraries
+BuildArch:	noarch
+
+%description config
+This package delivers /etc/my.cnf that includes other configuration
+files from the /etc/my.cnf.d directory and ships this directory as
+well. Other packages should only put their files into /etc/my.cnf.d
+directory 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
+
+%build
+%cmake \
+	-DCMAKE_SYSTEM_PROCESSOR="%{_arch}" \
+	-DMARIADB_UNIX_ADDR=%{_sharedstatedir}/mysql/mysql.sock \
+	-DMARIADB_PORT=3306 \
+	-DWITH_EXTERNAL_ZLIB=YES \
+	-DWITH_SSL=OPENSSL \
+	-DWITH_MYSQLCOMPAT=ON \
+	-DPLUGIN_CLIENT_ED25519=DYNAMIC \
+	-DINSTALL_LAYOUT=RPM \
+	-DCMAKE_INSTALL_PREFIX="%{_prefix}" \
+	-DINSTALL_BINDIR="bin" \
+	-DINSTALL_LIBDIR="%{_lib}" \
+	-DINSTALL_INCLUDEDIR="include/mysql" \
+	-DINSTALL_PLUGINDIR="%{_lib}/mariadb/plugin" \
+	-DINSTALL_PCDIR="%{_lib}/pkgconfig" \
+	-DWITH_UNITTEST=ON \
+	.
+
+%{__make}
+
+%if %{with tests}
+# Check the generated configuration on the actual machine
+$RPM_BUILD_ROOT%{_bindir}/mariadb_config
+
+# Run the unit tests
+# - don't run mytap tests
+# - ignore the testsuite result for now. Enable tests now, fix them later.
+# Note: there must be a database called 'test' created for the testcases to be run
+cd unittest/libmariadb/
+ctest || :
+cd ../..
+%endif
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+%{__make} install \
+	DESTDIR=$RPM_BUILD_ROOT
+
+# Remove static linked libraries and symlinks to them
+rm $RPM_BUILD_ROOT%{_libdir}/lib*.a
+
+# Add a compatibility symlinks
+ln -s mariadb_config $RPM_BUILD_ROOT%{_bindir}/mysql_config
+ln -s mariadb_version.h $RPM_BUILD_ROOT%{_includedir}/mysql/mysql_version.h
+
+# Install config files
+install -D -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/my.cnf
+install -D -p %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/my.cnf.d/client.cnf
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(644,root,root,755)
+%doc README
+%attr(755,root,root) %{_libdir}/libmariadb.so.3
+%dir %{_libdir}/mariadb
+%dir %{_libdir}/mariadb/plugin
+%attr(755,root,root) %{_libdir}/mariadb/plugin/*.so
+
+%files devel
+%defattr(644,root,root,755)
+# Binary which provides compiler info for software compiling against this library
+%attr(755,root,root) %{_bindir}/mariadb_config
+%attr(755,root,root) %{_bindir}/mysql_config
+
+# Symlinks to the versioned library
+%attr(755,root,root) %{_libdir}/libmariadb.so
+%attr(755,root,root) %{_libdir}/libmysqlclient.so
+%attr(755,root,root) %{_libdir}/libmysqlclient_r.so
+
+# Pkgconfig
+%{_pkgconfigdir}/libmariadb.pc
+
+%{_includedir}/mysql
+
+%files config
+%defattr(644,root,root,755)
+%dir %{_sysconfdir}/my.cnf.d
+%config(noreplace) %{_sysconfdir}/my.cnf
+%config(noreplace) %{_sysconfdir}/my.cnf.d/client.cnf
+
+%files test
+%defattr(644,root,root,755)
+%dir %{_datadir}/%{name}
+%{_datadir}/%{name}/*
+%attr(755,root,root) %{_libdir}/libcctap.so
diff --git a/client.cnf b/client.cnf
new file mode 100644
index 0000000..9028505
--- /dev/null
+++ b/client.cnf
@@ -0,0 +1,13 @@
+#
+# These two groups are read by the client library
+# Use it for options that affect all clients, but not the server
+#
+
+
+[client]
+
+# This group is not read by mysql client library,
+# If you use the same .cnf file for MySQL and MariaDB,
+# use it for MariaDB-only client options
+[client-mariadb]
+
diff --git a/my.cnf b/my.cnf
new file mode 100644
index 0000000..913b88f
--- /dev/null
+++ b/my.cnf
@@ -0,0 +1,11 @@
+#
+# This group is read both both by the client and the server
+# use it for options that affect everything
+#
+[client-server]
+
+#
+# include all files from the config directory
+#
+!includedir /etc/my.cnf.d
+
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)
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/mariadb-connector-c.git/commitdiff/e8a1d0e408f3ec01fb04b4371c5049cce9ab9032



More information about the pld-cvs-commit mailing list