1 |
%define major8 2 |
2 |
%define libname8 %mklibname mysqlcppconn 8 %{major8} |
3 |
|
4 |
%define major 9 |
5 |
%define libname %mklibname mysqlcppconn %{major} |
6 |
|
7 |
%define develname %mklibname mysqlcppconn8 -d |
8 |
|
9 |
%ifarch aarch64 |
10 |
%global _smp_ncpus_max 4 |
11 |
%endif |
12 |
|
13 |
Summary: A MySQL database connector for C++ |
14 |
Name: mysql-connector-c++ |
15 |
Version: 8.0.32 |
16 |
Release: %mkrel 3 |
17 |
Group: System/Libraries |
18 |
License: GPLv2 |
19 |
URL: https://dev.mysql.com/downloads/connector/cpp/ |
20 |
Source0: https://dev.mysql.com/get/Downloads/Connector-C++/%{name}-%{version}-src.tar.gz |
21 |
## from opensuse |
22 |
Patch3: mysql-connector-cpp-libmysql_dynamic_proxy_typos.patch |
23 |
Patch4: mysql-connector-cpp-mariadb.patch |
24 |
Patch7: mysql-connector-cpp-test-feature.patch |
25 |
|
26 |
BuildRequires: cmake |
27 |
BuildRequires: cmake(rapidjson) |
28 |
BuildRequires: mysql-devel |
29 |
BuildRequires: boost-devel |
30 |
BuildRequires: pkgconfig(liblz4) |
31 |
BuildRequires: pkgconfig(libzstd) |
32 |
BuildRequires: pkgconfig(protobuf) |
33 |
BuildRequires: pkgconfig(zlib) |
34 |
|
35 |
%description |
36 |
MySQL Connector/C++ is a MySQL database connector for C++ development. The |
37 |
MySQL driver for C++ can be used to connect to MySQL from C++ applications. The |
38 |
driver mimics the JDBC 4.0 API. It implements a significant subset of JDBC 4.0. |
39 |
|
40 |
The Driver for C++ is designed to work best with MySQL 5.1 or later. Note - its |
41 |
full functionality is not available when connecting to MySQL 5.0. You cannot |
42 |
connect to MySQL 4.1 or earlier. |
43 |
|
44 |
Using MySQL Connector/C++ instead of the MySQL C API (MySQL Client Library) |
45 |
offers the following advantages for C++ users: |
46 |
|
47 |
* Convenience of pure C++ - no C function calls |
48 |
* Support of a well designed API - JDBC 4.0 |
49 |
* Support of a commonly known and well documented API - JDBC 4.0 |
50 |
* Support of the object oriented programming paradigm |
51 |
* Shorter development times |
52 |
|
53 |
%package -n %{libname} |
54 |
Summary: The shared mysql-connector-cpp library |
55 |
Group: System/Libraries |
56 |
Provides: %{name} = %{version}-%{release} |
57 |
Provides: mysql-connector-cpp = %{version}-%{release} |
58 |
|
59 |
%description -n %{libname} |
60 |
MySQL Connector/C++ is a MySQL database connector for C++ development. The |
61 |
MySQL driver for C++ can be used to connect to MySQL from C++ applications. The |
62 |
driver mimics the JDBC 4.0 API. It implements a significant subset of JDBC 4.0. |
63 |
|
64 |
The Driver for C++ is designed to work best with MySQL 5.1 or later. Note - its |
65 |
full functionality is not available when connecting to MySQL 5.0. You cannot |
66 |
connect to MySQL 4.1 or earlier. |
67 |
|
68 |
Using MySQL Connector/C++ instead of the MySQL C API (MySQL Client Library) |
69 |
offers the following advantages for C++ users: |
70 |
|
71 |
* Convenience of pure C++ - no C function calls |
72 |
* Support of a well designed API - JDBC 4.0 |
73 |
* Support of a commonly known and well documented API - JDBC 4.0 |
74 |
* Support of the object oriented programming paradigm |
75 |
* Shorter development times |
76 |
|
77 |
%package -n %{libname8} |
78 |
Summary: The shared mysql-connector-cpp library |
79 |
Group: System/Libraries |
80 |
|
81 |
%description -n %{libname8} |
82 |
MySQL Connector/C++ is a MySQL database connector for C++ development. The |
83 |
MySQL driver for C++ can be used to connect to MySQL from C++ applications. The |
84 |
driver mimics the JDBC 4.0 API. It implements a significant subset of JDBC 4.0. |
85 |
|
86 |
The Driver for C++ is designed to work best with MySQL 5.1 or later. Note - its |
87 |
full functionality is not available when connecting to MySQL 5.0. You cannot |
88 |
connect to MySQL 4.1 or earlier. |
89 |
|
90 |
Using MySQL Connector/C++ instead of the MySQL C API (MySQL Client Library) |
91 |
offers the following advantages for C++ users: |
92 |
|
93 |
* Convenience of pure C++ - no C function calls |
94 |
* Support of a well designed API - JDBC 4.0 |
95 |
* Support of a commonly known and well documented API - JDBC 4.0 |
96 |
* Support of the object oriented programming paradigm |
97 |
* Shorter development times |
98 |
|
99 |
%package -n %{develname} |
100 |
Summary: Development library and header files for development with mysql-connector-cpp |
101 |
Group: Development/C++ |
102 |
Requires: %{libname} = %{version}-%{release} |
103 |
Requires: %{libname8} = %{version}-%{release} |
104 |
Provides: %{name}-devel = %{version}-%{release} |
105 |
Provides: mysql-connector-cpp-devel = %{version}-%{release} |
106 |
|
107 |
%description -n %{develname} |
108 |
MySQL Connector/C++ is a MySQL database connector for C++ development. The |
109 |
MySQL driver for C++ can be used to connect to MySQL from C++ applications. The |
110 |
driver mimics the JDBC 4.0 API. It implements a significant subset of JDBC 4.0. |
111 |
|
112 |
The Driver for C++ is designed to work best with MySQL 5.1 or later. Note - its |
113 |
full functionality is not available when connecting to MySQL 5.0. You cannot |
114 |
connect to MySQL 4.1 or earlier. |
115 |
|
116 |
Using MySQL Connector/C++ instead of the MySQL C API (MySQL Client Library) |
117 |
offers the following advantages for C++ users: |
118 |
|
119 |
* Convenience of pure C++ - no C function calls |
120 |
* Support of a well designed API - JDBC 4.0 |
121 |
* Support of a commonly known and well documented API - JDBC 4.0 |
122 |
* Support of the object oriented programming paradigm |
123 |
* Shorter development times |
124 |
|
125 |
%prep |
126 |
%autosetup -n %{name}-%{version}-src -p1 |
127 |
|
128 |
chmod -x jdbc/examples/*.{cpp,txt} |
129 |
|
130 |
# drop bundled stuff |
131 |
rm -rf cdk/extra/protobuf/protobuf-*/ |
132 |
rm -rf cdk/extra/rapidjson/include/ |
133 |
rm -rf cdk/extra/lz4/ |
134 |
rm -rf cdk/extra/zlib/ |
135 |
rm -rf cdk/extra/zstd/ |
136 |
|
137 |
# Save examples to keep directory clean (for doc) |
138 |
cp -apr jdbc/examples examples |
139 |
rm -rf examples/CMakeLists.txt |
140 |
|
141 |
%build |
142 |
export CXXFLAGS="%{build_cxxflags} -Wno-deprecated-declarations" |
143 |
%cmake \ |
144 |
-DMYSQL_INCLUDE_DIR=%{_includedir}/mysql \ |
145 |
-DCMAKE_INSTALL_LIBDIR=%{_libdir} \ |
146 |
-DMYSQL_LIB=%{_libdir}/libmysqlclient.so \ |
147 |
-DBUNDLE_DEPENDENCIES=OFF \ |
148 |
-DWITH_PROTOBUF=system \ |
149 |
-DWITH_LZ4=system \ |
150 |
-DWITH_SSL=system \ |
151 |
-DWITH_ZLIB=system \ |
152 |
-DWITH_ZSTD=system \ |
153 |
-DWITH_JDBC=ON \ |
154 |
-DMYSQLCLIENT_STATIC_BINDING=OFF \ |
155 |
-DMYSQLCLIENT_STATIC_LINKING=OFF \ |
156 |
-DDEBUG_PREFIX_MAP=OFF |
157 |
%cmake_build |
158 |
|
159 |
%install |
160 |
%cmake_install |
161 |
|
162 |
mv -f %{buildroot}%{_prefix}/INFO_* . |
163 |
|
164 |
%files -n %{libname8} |
165 |
%license LICENSE* INFO_BIN |
166 |
%{_libdir}/libmysqlcppconn8.so.%{major8}{,.*} |
167 |
|
168 |
%files -n %{libname} |
169 |
%license LICENSE* INFO_BIN |
170 |
%{_libdir}/libmysqlcppconn.so.%{major}{,.*} |
171 |
|
172 |
%files -n %{develname} |
173 |
%doc README* CONTRIBUTING* examples |
174 |
%{_includedir}/mysqlx/ |
175 |
%{_includedir}/jdbc/ |
176 |
%{_includedir}/mysql/jdbc.h |
177 |
%{_libdir}/libmysqlcppconn.so |
178 |
%{_libdir}/libmysqlcppconn8.so |