1
1
#
2
- # Copyright (c) 2018, 2019 , Oracle and/or its affiliates. All rights reserved .
2
+ # Copyright (c) 2018, 2020 , Oracle and/or its affiliates.
3
3
#
4
4
# This program is free software; you can redistribute it and/or modify
5
5
# it under the terms of the GNU General Public License, version 2.0, as
26
26
# You should have received a copy of the GNU General Public License
27
27
# along with this program; if not, write to the Free Software Foundation, Inc.,
28
28
# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
29
-
30
- # Arguments that can be fiven to "rpmbuild"
29
+ # Arguments that can be given to rpmbuild:
31
30
#
32
31
# mysql_dir Path to the MySQL installation, where to find the client lib
33
32
# commercial If set, is a commercial build
34
-
35
33
%{?mysql_dir: %global mysql_opt -DMYSQL_DIR=%{mysql_dir}}
36
34
%{!?commercial: %global license_type GPLv2}
37
35
%{?commercial: %global license_type Commercial}
38
36
%{?commercial: %global product_suffix -commercial}
39
37
%{!?commercial: %global product_suffix %{nil}}
40
-
41
38
%{?el6:%global __strip /opt/rh/devtoolset-8/root/usr/bin/strip}
42
-
43
39
%if 0%{?suse_version} == 1315
44
40
%global dist .sles12
45
41
%endif
46
-
47
42
%if 0%{?suse_version} == 1500
48
43
%global dist .sl15
49
44
%endif
50
-
51
45
%global source_date_epoch_from_changelog 0
52
-
53
46
Summary: MySQL database connector for C++
54
47
Name: mysql-connector-c++%{?product_suffix}
55
48
Version: @CONCPP_VERSION@
@@ -63,19 +56,21 @@ BuildRequires: cmake3
63
56
%else
64
57
BuildRequires: cmake
65
58
%endif
66
- %if 0%{?fedora} || 0%{?suse_version} || 0%{?rhel} >= 8
59
+ %if 0%{?fedora} || 0%{?suse_version}
67
60
BuildRequires: gcc
68
61
BuildRequires: gcc-c++
69
- %else
70
- BuildRequires: devtoolset-8-gcc
71
- BuildRequires: devtoolset-8-gcc-c++
72
62
%endif
63
+ %{?el6:BuildRequires: devtoolset-8-gcc}
64
+ %{?el6:BuildRequires: devtoolset-8-gcc-c++}
65
+ %{?el7:BuildRequires: devtoolset-9-gcc}
66
+ %{?el7:BuildRequires: devtoolset-9-gcc-c++}
67
+ %{?el8:BuildRequires: gcc-toolset-9-gcc}
68
+ %{?el8:BuildRequires: gcc-toolset-9-gcc-c++}
73
69
%{!?mysql_dir:BuildRequires: mysql-devel}
74
70
BuildRequires: openssl-devel
75
71
%{?commercial:Obsoletes: mysql-connector-c++ < %{version}-%{release}}
76
72
%description
77
73
A C++ interface for communicating with MySQL servers.
78
-
79
74
%package jdbc
80
75
Summary: MySQL Driver for C++ which mimics the JDBC 4.0 API
81
76
%{?commercial:Obsoletes: mysql-connector-c++-jdbc < %{version}-%{release}}
@@ -85,7 +80,6 @@ Provides: libmysqlcppconn7 = %{version}-%{release}
85
80
Provides: libmysqlcppconn-devel = %{version}-%{release}
86
81
%description jdbc
87
82
This MySQL Driver for C++ mimics the JDBC 4.0 API.
88
-
89
83
%package devel
90
84
Summary: Development header files and libraries for MySQL C++ client applications
91
85
%if 0%{?commercial}
@@ -99,7 +93,6 @@ Requires: mysql-connector-c++-jdbc = %{version}-%{release}
99
93
%description devel
100
94
This package contains the development header files and libraries necessary
101
95
to develop MySQL client applications in C++.
102
-
103
96
%if 0%{?with_tests:1} && 0%{?with_gtest:1}
104
97
%package test
105
98
Summary: Regression tests for MySQL Connector/C++
@@ -115,46 +108,39 @@ Requires: mysql-connector-c++-jdbc = %{version}-%{release}
115
108
This package contains the test files necessary to run regression
116
109
test suite for MySQL Connector/C++
117
110
%endif
118
-
119
111
%prep
120
112
%setup -q -n mysql-connector-c++%{product_suffix}-%{version}-src
121
-
122
113
%build
123
- %if 0%{?rhel} < 8
124
- %{?rhel:export CC=/opt/rh/devtoolset-8/root/usr/bin/gcc}
125
- %{?rhel:export CXX=/opt/rh/devtoolset-8/root/usr/bin/g++}
126
- %endif
127
-
114
+ %{?el6:export CC=/opt/rh/devtoolset-8/root/usr/bin/gcc}
115
+ %{?el6:export CXX=/opt/rh/devtoolset-8/root/usr/bin/g++}
116
+ %{?el7:export CC=/opt/rh/devtoolset-9/root/usr/bin/gcc}
117
+ %{?el7:export CXX=/opt/rh/devtoolset-9/root/usr/bin/g++}
118
+ %{?el8:export CC=/opt/rh/gcc-toolset-9/root/usr/bin/gcc}
119
+ %{?el8:export CXX=/opt/rh/gcc-toolset-9/root/usr/bin/g++}
128
120
%if 0%{?with_tests:1} && 0%{?with_gtest:1}
129
121
%global __cmake_test_opts -DWITH_TESTS=1 -DWITH_GTEST=%{with_gtest}
130
122
%else
131
123
%global __cmake_test_opts %{nil}
132
124
%endif
133
-
134
125
%global __cmake_explicit_opts -DCMAKE_INSTALL_PREFIX="%_prefix" -DCMAKE_C_FLAGS:STRING="%optflags" -DCMAKE_CXX_FLAGS:STRING="%optflags"
135
126
%global __cmake_common_opts -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_INCLUDEDIR=%{_includedir}/mysql-cppconn-8 -DWITH_JDBC=ON -DWITH_SSL=system %{__cmake_test_opts} %{?mysql_opt} -DDEBUG_PREFIX_MAP=OFF
136
-
137
127
%if 0%{?rhel}
138
128
%global __cmake_cmd cmake3 %{__cmake_common_opts} %{__cmake_explicit_opts} ..
139
129
%else
140
130
%global __cmake_cmd cmake %{__cmake_common_opts} %{__cmake_explicit_opts} ..
141
131
%endif
142
-
143
132
mkdir build-dynamic && pushd build-dynamic
144
133
pwd
145
134
%__cmake_cmd
146
135
make %{?_smp_mflags} VERBOSE=1
147
136
popd
148
-
149
137
mkdir build-static && pushd build-static
150
138
%__cmake_cmd -DBUILD_STATIC=ON
151
139
make %{?_smp_mflags} VERBOSE=1
152
140
popd
153
-
154
141
%install
155
142
pushd build-dynamic
156
143
make DESTDIR=%{buildroot} install
157
-
158
144
%if 0%{?with_tests:1} && 0%{?with_gtest:1}
159
145
# Generating the test groups and run CMake again
160
146
# to process the generated TestGroups.cmake file
@@ -166,10 +152,8 @@ mv CTestTestfile.cmake %{buildroot}%{_libdir}/mysql-cppconn-8/dynamic/
166
152
mv run_unit_tests %{buildroot}%{_libdir}/mysql-cppconn-8/dynamic/
167
153
%endif
168
154
popd
169
-
170
155
pushd build-static
171
156
make DESTDIR=%{buildroot} install
172
-
173
157
%if 0%{?with_tests:1} && 0%{?with_gtest:1}
174
158
# Generating the test groups and run CMake again
175
159
# to process the generated TestGroups.cmake file
@@ -181,25 +165,19 @@ mv CTestTestfile.cmake %{buildroot}%{_libdir}/mysql-cppconn-8/static/
181
165
mv run_unit_tests %{buildroot}%{_libdir}/mysql-cppconn-8/static/
182
166
%endif
183
167
popd
184
-
185
168
# Add compat dir and remove unwanted file
186
169
ln -s mysql-cppconn-8 %{buildroot}%{_includedir}/mysql-cppconn
187
170
rm %{buildroot}/usr/{INFO_SRC,INFO_BIN}
188
-
189
171
%post -p /sbin/ldconfig
190
172
%postun -p /sbin/ldconfig
191
-
192
173
%post jdbc -p /sbin/ldconfig
193
174
%postun jdbc -p /sbin/ldconfig
194
-
195
175
%files
196
176
%doc README.txt LICENSE.txt INFO_SRC build-dynamic/INFO_BIN
197
177
%{_libdir}/libmysqlcppconn8.so.@ABI_VERSION_MAJOR@*
198
-
199
178
%files jdbc
200
179
%doc README.txt LICENSE.txt INFO_SRC build-dynamic/INFO_BIN
201
180
%{_libdir}/libmysqlcppconn.so.@JDBC_ABI_VERSION_MAJOR@*
202
-
203
181
%files devel
204
182
%doc README.txt LICENSE.txt INFO_SRC build-dynamic/INFO_BIN
205
183
%{_libdir}/libmysqlcppconn.so
@@ -211,7 +189,6 @@ rm %{buildroot}/usr/{INFO_SRC,INFO_BIN}
211
189
%{_includedir}/mysql-cppconn-8/mysqlx
212
190
%{_includedir}/mysql-cppconn-8/mysql
213
191
%{_includedir}/mysql-cppconn-8/jdbc
214
-
215
192
%if 0%{?with_tests:1} && 0%{?with_gtest:1}
216
193
%files test
217
194
%dir %{_libdir}/mysql-cppconn-8
@@ -222,30 +199,25 @@ rm %{buildroot}/usr/{INFO_SRC,INFO_BIN}
222
199
%{_libdir}/mysql-cppconn-8/static/run_unit_tests
223
200
%{_libdir}/mysql-cppconn-8/static/CTestTestfile.cmake
224
201
%endif
225
-
226
202
%changelog
203
+ * Thu Jun 04 2020 Sreedhar S <
[email protected] > - 8.0.22-1
204
+ - Updated the compliers for el|678 to match server builds
227
205
* Thu Jun 04 2020 Gipson Pulla <
[email protected] > - 8.0.21-1
228
206
- Updated the macro to use the system date
229
-
230
207
* Fri Feb 15 2019 Bjorn Munch <
[email protected] > - 8.0.16-1
231
208
- CMake 3 should not be used on Fedora, only on Oracle Linux or Red Hat
232
209
- Removed use of cmake_path as it is no longer needed
233
-
234
210
* Thu Feb 14 2019 Rafal Somla <
[email protected] >
235
211
- Use ABI version number taken from version.cmake in %files patterns
236
-
237
212
* Fri Dec 14 2018 Kent Boortz <
[email protected] > - 8.0.15-1
238
213
- Use CMake 3 on Fedora and Oracle Linux
239
214
- Added option to specify what CMake to use, "--define 'cmake_path <path>'"
240
-
241
215
* Tue Nov 27 2018 Balasubramanian Kandasamy <
[email protected] > - 8.0.14-1
242
216
- Added INFO_BIN and INFO_SRC files
243
-
244
217
* Fri Aug 24 2018 Kent Boortz <
[email protected] > - 8.0.13-1
245
218
- Added "test" package
246
-
247
219
* Wed May 16 2018 Balasubramanian Kandasamy <
[email protected] > - 8.0.11-1
248
220
- Adapt to MySQL Connector C++ 8.0
249
-
250
221
* Tue Apr 05 2016 Kent Boortz <
[email protected] > - 2.0.1-1
251
222
- initial package
223
+ Collapse
0 commit comments