48
48
49
49
%{?el8:%global gcc_toolset gcc-toolset-13}
50
50
%{?el9:%global gcc_toolset gcc-toolset-13}
51
+
52
+ %global cmake_cmd cmake%{?el6:3}%{?el7:3}
53
+
51
54
%if 0%{?suse_version} == 1315
52
55
%global dist .sles12
53
56
%endif
@@ -78,7 +81,7 @@ Source0: https://dev.mysql.com/get/Downloads/Connector-C++/mysql-connecto
78
81
Provides: libmysqlcppconn8.so.2()(%{?__isa_bits}bit) = %{version}-%{release}
79
82
Obsoletes: mysql-connector-c++%{?product_suffix} < %{version}-%{release}
80
83
Obsoletes: mysql-connector-c++ < %{version}-%{release}
81
- BuildRequires: cmake%{?el6:3}%{?el7:3}
84
+ BuildRequires: %{cmake_cmd} >= 3.15.0
82
85
%if 0%{?fedora} || 0%{?suse_version}
83
86
BuildRequires: gcc
84
87
BuildRequires: gcc-c++
@@ -138,17 +141,16 @@ cd ${RPM_BUILD_DIR}
138
141
139
142
# Note: use relative paths for CMAKE_INSTALL_XXX options
140
143
141
- %global __cmake_cmd cmake%{?el6:3}%{?el7:3}
142
144
%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
143
- %global __cmake_config %{__cmake_cmd } %{__cmake_common_opts} %{__cmake_explicit_opts}
145
+ %global __cmake_config %{cmake_cmd } %{__cmake_common_opts} %{__cmake_explicit_opts}
144
146
145
147
rm -rf build-static && mkdir build-static
146
148
%{__cmake_config} -S ${SRC} -B build-static -DBUILD_STATIC=1
147
- %{__cmake_cmd } --build build-static --verbose
149
+ %{cmake_cmd } --build build-static --verbose
148
150
149
151
rm -rf build-dynamic && mkdir build-dynamic
150
152
%{__cmake_config} -S ${SRC} -B build-dynamic -DBUILD_STATIC=0
151
- %{__cmake_cmd } --build build-dynamic --verbose
153
+ %{cmake_cmd } --build build-dynamic --verbose
152
154
153
155
154
156
%install
@@ -157,8 +159,8 @@ cd ${RPM_BUILD_DIR}
157
159
158
160
# Note: order of installations is important!
159
161
160
- %{__cmake_cmd } --install build-static --prefix %{buildroot}
161
- %{__cmake_cmd } --install build-dynamic --prefix %{buildroot}
162
+ %{cmake_cmd } --install build-static --prefix %{buildroot}
163
+ %{cmake_cmd } --install build-dynamic --prefix %{buildroot}
162
164
163
165
# Remove unwanted files
164
166
rm %{buildroot}/{INFO_SRC,INFO_BIN}
0 commit comments