26
26
# along with this program; if not, write to the Free Software Foundation, Inc.,
27
27
# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
28
28
29
+ ###############################################
29
30
# Arguments that can be given to rpmbuild:
30
31
#
31
32
# mysql_dir Path to the MySQL installation, where to find the client lib
32
33
# commercial If set, is a commercial build
33
-
34
+ # with_compat If set the -compat package is built
35
+ ###############################################
34
36
35
37
%{?mysql_dir: %global mysql_opt -DMYSQL_DIR=%{mysql_dir}}
36
38
%{!?commercial: %global license_type GPLv2}
@@ -82,11 +84,16 @@ Version: @CONCPP_VERSION@
82
84
Release: 1%{?commercial:.1}%{?dist}
83
85
License: %{license_type}
84
86
URL: https://dev.mysql.com/doc/connector-cpp/en/
85
- Source0: https://dev.mysql.com/get/Downloads/Connector-C++/mysql-connector-c++%{?product_suffix}-%{version}-src.tar.gz
86
87
# Note: This connector is compatible with the 8.x series.
87
- Provides: libmysqlcppconn8.so.2()(%{?__isa_bits}bit) = %{version}-%{release}
88
+ Provides: libmysqlcppconn8.so.2()(%{?__isa_bits}bit) = %{version}-%{release}
88
89
Obsoletes: mysql-connector-c++%{?product_suffix} < %{version}-%{release}
89
90
Obsoletes: mysql-connector-c++ < %{version}-%{release}
91
+
92
+ Source0: https://dev.mysql.com/get/Downloads/Connector-C++/mysql-connector-c++%{?product_suffix}-%{version}-src.tar.gz
93
+ %if 0%{?with_compat}
94
+ Source1: https://dev.mysql.com/get/Downloads/Connector-C++/mysql-connector-c++%{?product_suffix}-8.4.0-src.tar.gz
95
+ %endif
96
+
90
97
BuildRequires: %{cmake_cmd} >= 3.15.0
91
98
%if 0%{?fedora} || 0%{?suse_version}
92
99
BuildRequires: gcc
@@ -113,6 +120,20 @@ Obsoletes: mysql-connector-c++-jdbc < %{version}-%{release}
113
120
%description jdbc
114
121
This MySQL Driver for C++ mimics the JDBC 4.0 API.
115
122
123
+
124
+ %if 0%{?with_compat}
125
+ %package compat
126
+ Summary: MySQL Connector/C++ -- backward compatibility libraries
127
+ Provides: libmysqlcppconn9 = %{version}-%{release}
128
+ Obsoletes: libmysqlcppconn9 < %{version}-%{release}
129
+ Obsoletes: mysql-connector-c++%{?product_suffix}-compat < %{version}-%{release}
130
+ Obsoletes: mysql-connector-c++-compat < %{version}-%{release}
131
+ Obsoletes: mysql-connector-c++%{?product_suffix}-jdbc < 9.0.0
132
+ Obsoletes: mysql-connector-c++-jdbc < 9.0.0
133
+ %description compat
134
+ MySQL Connector/C++ -- backward compatibility libraries
135
+ %endif
136
+
116
137
%package devel
117
138
Summary: Development header files and libraries for MySQL C++ client applications
118
139
Requires: mysql-connector-c++%{?product_suffix} = %{version}-%{release}
@@ -129,12 +150,26 @@ to develop MySQL client applications in C++.
129
150
###############################################
130
151
131
152
%prep
132
- %setup -q -n %{name}-%{version}-src
153
+ %setup -q %{?with_compat:-b1} -n %{name}-%{version}-src
154
+
155
+ SRC=`pwd`
156
+ SRC1=%{name}-8.4.0-src
157
+
158
+ cd ${RPM_BUILD_DIR}
159
+
160
+ %if 0%{?with_compat}
161
+
162
+ # Patch compatiblity sources:
163
+ git apply --directory ${SRC1} ${SRC}/packaging/compat.patch
164
+
165
+ %endif
133
166
134
167
135
168
%build
136
169
137
170
SRC=`pwd`
171
+ SRC1=%{name}-8.4.0-src
172
+
138
173
cd ${RPM_BUILD_DIR}
139
174
140
175
%global plugin_dir %{_libdir}/mysql/%{lib_base_name_jdbc}/plugin
@@ -153,6 +188,12 @@ cd ${RPM_BUILD_DIR}
153
188
%global __cmake_common_opts -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_LIBDIR=.%{_libdir} -DCMAKE_INSTALL_INCLUDEDIR=.%{_includedir}/mysql-cppconn -DWITH_SSL=system -DDEFAULT_PLUGIN_DIR=%{plugin_dir} -DWITH_JDBC=1 -DMYSQLCLIENT_STATIC_LINKING=1 -DBUNDLE_DEPENDENCIES=1 %{?mysql_opt} %{__cmake_test_opts} -DDEBUG_PREFIX_MAP=OFF
154
189
%global __cmake_config %{cmake_cmd} %{__cmake_common_opts} %{__cmake_explicit_opts}
155
190
191
+ %if 0%{?with_compat}
192
+ rm -rf build-compat && mkdir build-compat
193
+ %{__cmake_config} -S ${SRC1} -B build-compat
194
+ %{cmake_cmd} --build build-compat --verbose
195
+ %endif
196
+
156
197
rm -rf build-static && mkdir build-static
157
198
%{__cmake_config} -S ${SRC} -B build-static -DBUILD_STATIC=1
158
199
%{cmake_cmd} --build build-static --verbose
@@ -168,6 +209,9 @@ cd ${RPM_BUILD_DIR}
168
209
169
210
# Note: order of installations is important!
170
211
212
+ %if 0%{?with_compat}
213
+ %{cmake_cmd} --install build-compat --prefix %{buildroot}
214
+ %endif
171
215
%{cmake_cmd} --install build-static --prefix %{buildroot}
172
216
%{cmake_cmd} --install build-dynamic --prefix %{buildroot}
173
217
@@ -217,6 +261,13 @@ rm -rf %{buildroot}%{_libdir}/{plugin,private}
217
261
%{_libdir}/libmysqlcppconn.so.@JDBC_ABI_VERSION_MAJOR@*
218
262
%{plugin_dir}
219
263
264
+ %if 0%{?with_compat}
265
+ %files compat
266
+ %doc LICENSE.txt
267
+ %doc README.txt
268
+ %{_libdir}/libmysqlcppconn.so.9*
269
+ %endif
270
+
220
271
%files devel
221
272
%doc LICENSE.txt
222
273
%doc README.txt ../build-dynamic/INFO_SRC ../build-dynamic/INFO_BIN
@@ -236,6 +287,9 @@ rm -rf %{buildroot}%{_libdir}/{plugin,private}
236
287
237
288
%changelog
238
289
290
+ * Thu Sep 12 2024 Rafal Somla <
[email protected] > - 9.1.0-1
291
+ - Add definitions for -compat package (WL#16462)
292
+
239
293
* Fri Aug 09 2024 Rafal Somla <
[email protected] > - 9.1.0-1
240
294
- Bundle authentication plugins in the -jdbc package (WL#16458)
241
295
0 commit comments