%define major8 2 %define libname8 %mklibname mysqlcppconn 8 %{major8} %define major 9 %define libname %mklibname mysqlcppconn %{major} %define develname %mklibname mysqlcppconn8 -d %ifarch aarch64 %global _smp_ncpus_max 4 %endif Summary: A MySQL database connector for C++ Name: mysql-connector-c++ Version: 8.0.28 Release: %mkrel 1 Group: System/Libraries License: GPLv2 URL: http://dev.mysql.com/downloads/connector/cpp/ Source0: https://dev.mysql.com/get/Downloads/Connector-C++/%{name}-%{version}-src.tar.gz Patch1: mysql-connector-cpp-openssl3.patch ## from opensuse Patch3: mysql-connector-cpp-libmysql_dynamic_proxy_typos.patch Patch4: mysql-connector-cpp-mariadb.patch Patch6: mysql-connector-cpp-use-system-protobuf.patch Patch7: mysql-connector-cpp-test-feature.patch BuildRequires: cmake BuildRequires: mysql-devel BuildRequires: boost-devel BuildRequires: rapidjson BuildRequires: pkgconfig(protobuf) %description MySQL Connector/C++ is a MySQL database connector for C++ development. The MySQL driver for C++ can be used to connect to MySQL from C++ applications. The driver mimics the JDBC 4.0 API. It implements a significant subset of JDBC 4.0. The Driver for C++ is designed to work best with MySQL 5.1 or later. Note - its full functionality is not available when connecting to MySQL 5.0. You cannot connect to MySQL 4.1 or earlier. Using MySQL Connector/C++ instead of the MySQL C API (MySQL Client Library) offers the following advantages for C++ users: * Convenience of pure C++ - no C function calls * Support of a well designed API - JDBC 4.0 * Support of a commonly known and well documented API - JDBC 4.0 * Support of the object oriented programming paradigma * Shorter development times %package -n %{libname} Summary: The shared mysql-connector-cpp library Group: System/Libraries Provides: %{name} = %{version}-%{release} Provides: mysql-connector-cpp = %{version}-%{release} %description -n %{libname} MySQL Connector/C++ is a MySQL database connector for C++ development. The MySQL driver for C++ can be used to connect to MySQL from C++ applications. The driver mimics the JDBC 4.0 API. It implements a significant subset of JDBC 4.0. The Driver for C++ is designed to work best with MySQL 5.1 or later. Note - its full functionality is not available when connecting to MySQL 5.0. You cannot connect to MySQL 4.1 or earlier. Using MySQL Connector/C++ instead of the MySQL C API (MySQL Client Library) offers the following advantages for C++ users: * Convenience of pure C++ - no C function calls * Support of a well designed API - JDBC 4.0 * Support of a commonly known and well documented API - JDBC 4.0 * Support of the object oriented programming paradigma * Shorter development times %package -n %{libname8} Summary: The shared mysql-connector-cpp library Group: System/Libraries %description -n %{libname8} MySQL Connector/C++ is a MySQL database connector for C++ development. The MySQL driver for C++ can be used to connect to MySQL from C++ applications. The driver mimics the JDBC 4.0 API. It implements a significant subset of JDBC 4.0. The Driver for C++ is designed to work best with MySQL 5.1 or later. Note - its full functionality is not available when connecting to MySQL 5.0. You cannot connect to MySQL 4.1 or earlier. Using MySQL Connector/C++ instead of the MySQL C API (MySQL Client Library) offers the following advantages for C++ users: * Convenience of pure C++ - no C function calls * Support of a well designed API - JDBC 4.0 * Support of a commonly known and well documented API - JDBC 4.0 * Support of the object oriented programming paradigma * Shorter development times %package -n %{develname} Summary: Development library and header files for development with mysql-connector-cpp Group: Development/C++ Requires: %{libname} = %{version}-%{release} Requires: %{libname8} = %{version}-%{release} Provides: %{name}-devel = %{version}-%{release} Provides: mysql-connector-cpp-devel = %{version}-%{release} %description -n %{develname} MySQL Connector/C++ is a MySQL database connector for C++ development. The MySQL driver for C++ can be used to connect to MySQL from C++ applications. The driver mimics the JDBC 4.0 API. It implements a significant subset of JDBC 4.0. The Driver for C++ is designed to work best with MySQL 5.1 or later. Note - its full functionality is not available when connecting to MySQL 5.0. You cannot connect to MySQL 4.1 or earlier. Using MySQL Connector/C++ instead of the MySQL C API (MySQL Client Library) offers the following advantages for C++ users: * Convenience of pure C++ - no C function calls * Support of a well designed API - JDBC 4.0 * Support of a commonly known and well documented API - JDBC 4.0 * Support of the object oriented programming paradigma * Shorter development times %prep %autosetup -n %{name}-%{version}-src -p1 chmod -x jdbc/examples/*.{cpp,txt} # Save examples to keep directory clean (for doc) cp -apr jdbc/examples examples rm -rf examples/CMakeLists.txt %build export CXXFLAGS="%{build_cxxflags} -Wno-deprecated-declarations" %cmake \ -DMYSQL_INCLUDE_DIR=%{_includedir}/mysql \ -DCMAKE_INSTALL_LIBDIR=%{_libdir} \ -DMYSQL_LIB=%{_libdir}/libmysqlclient.so \ -DWITH_SSL=system \ -DWITH_JDBC=ON \ -DMYSQLCLIENT_STATIC_BINDING=OFF \ -DMYSQLCLIENT_STATIC_LINKING=OFF \ -DDEBUG_PREFIX_MAP=OFF %cmake_build %install %cmake_install mv -f %{buildroot}%{_prefix}/INFO_* . %files -n %{libname8} %license LICENSE* INFO_BIN %{_libdir}/libmysqlcppconn8.so.%{major8}{,.*} %files -n %{libname} %license LICENSE* INFO_BIN %{_libdir}/libmysqlcppconn.so.%{major}{,.*} %files -n %{develname} %doc README* CONTRIBUTING* examples %{_includedir}/mysqlx/ %{_includedir}/jdbc/ %{_includedir}/mysql/jdbc.h %{_libdir}/libmysqlcppconn.so %{_libdir}/libmysqlcppconn8.so