Skip to content

Commit 581b983

Browse files
committed
ET#67880 Update the compilers to match server builds
1 parent 833a073 commit 581b983

File tree

1 file changed

+18
-46
lines changed

1 file changed

+18
-46
lines changed

packaging/mysql-connector-c++.spec.in

Lines changed: 18 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2018, 2020, Oracle and/or its affiliates.
33
#
44
# This program is free software; you can redistribute it and/or modify
55
# it under the terms of the GNU General Public License, version 2.0, as
@@ -26,30 +26,23 @@
2626
# You should have received a copy of the GNU General Public License
2727
# along with this program; if not, write to the Free Software Foundation, Inc.,
2828
# 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:
3130
#
3231
# mysql_dir Path to the MySQL installation, where to find the client lib
3332
# commercial If set, is a commercial build
34-
3533
%{?mysql_dir: %global mysql_opt -DMYSQL_DIR=%{mysql_dir}}
3634
%{!?commercial: %global license_type GPLv2}
3735
%{?commercial: %global license_type Commercial}
3836
%{?commercial: %global product_suffix -commercial}
3937
%{!?commercial: %global product_suffix %{nil}}
40-
4138
%{?el6:%global __strip /opt/rh/devtoolset-8/root/usr/bin/strip}
42-
4339
%if 0%{?suse_version} == 1315
4440
%global dist .sles12
4541
%endif
46-
4742
%if 0%{?suse_version} == 1500
4843
%global dist .sl15
4944
%endif
50-
5145
%global source_date_epoch_from_changelog 0
52-
5346
Summary: MySQL database connector for C++
5447
Name: mysql-connector-c++%{?product_suffix}
5548
Version: @CONCPP_VERSION@
@@ -63,19 +56,21 @@ BuildRequires: cmake3
6356
%else
6457
BuildRequires: cmake
6558
%endif
66-
%if 0%{?fedora} || 0%{?suse_version} || 0%{?rhel} >= 8
59+
%if 0%{?fedora} || 0%{?suse_version}
6760
BuildRequires: gcc
6861
BuildRequires: gcc-c++
69-
%else
70-
BuildRequires: devtoolset-8-gcc
71-
BuildRequires: devtoolset-8-gcc-c++
7262
%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++}
7369
%{!?mysql_dir:BuildRequires: mysql-devel}
7470
BuildRequires: openssl-devel
7571
%{?commercial:Obsoletes: mysql-connector-c++ < %{version}-%{release}}
7672
%description
7773
A C++ interface for communicating with MySQL servers.
78-
7974
%package jdbc
8075
Summary: MySQL Driver for C++ which mimics the JDBC 4.0 API
8176
%{?commercial:Obsoletes: mysql-connector-c++-jdbc < %{version}-%{release}}
@@ -85,7 +80,6 @@ Provides: libmysqlcppconn7 = %{version}-%{release}
8580
Provides: libmysqlcppconn-devel = %{version}-%{release}
8681
%description jdbc
8782
This MySQL Driver for C++ mimics the JDBC 4.0 API.
88-
8983
%package devel
9084
Summary: Development header files and libraries for MySQL C++ client applications
9185
%if 0%{?commercial}
@@ -99,7 +93,6 @@ Requires: mysql-connector-c++-jdbc = %{version}-%{release}
9993
%description devel
10094
This package contains the development header files and libraries necessary
10195
to develop MySQL client applications in C++.
102-
10396
%if 0%{?with_tests:1} && 0%{?with_gtest:1}
10497
%package test
10598
Summary: Regression tests for MySQL Connector/C++
@@ -115,46 +108,39 @@ Requires: mysql-connector-c++-jdbc = %{version}-%{release}
115108
This package contains the test files necessary to run regression
116109
test suite for MySQL Connector/C++
117110
%endif
118-
119111
%prep
120112
%setup -q -n mysql-connector-c++%{product_suffix}-%{version}-src
121-
122113
%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++}
128120
%if 0%{?with_tests:1} && 0%{?with_gtest:1}
129121
%global __cmake_test_opts -DWITH_TESTS=1 -DWITH_GTEST=%{with_gtest}
130122
%else
131123
%global __cmake_test_opts %{nil}
132124
%endif
133-
134125
%global __cmake_explicit_opts -DCMAKE_INSTALL_PREFIX="%_prefix" -DCMAKE_C_FLAGS:STRING="%optflags" -DCMAKE_CXX_FLAGS:STRING="%optflags"
135126
%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-
137127
%if 0%{?rhel}
138128
%global __cmake_cmd cmake3 %{__cmake_common_opts} %{__cmake_explicit_opts} ..
139129
%else
140130
%global __cmake_cmd cmake %{__cmake_common_opts} %{__cmake_explicit_opts} ..
141131
%endif
142-
143132
mkdir build-dynamic && pushd build-dynamic
144133
pwd
145134
%__cmake_cmd
146135
make %{?_smp_mflags} VERBOSE=1
147136
popd
148-
149137
mkdir build-static && pushd build-static
150138
%__cmake_cmd -DBUILD_STATIC=ON
151139
make %{?_smp_mflags} VERBOSE=1
152140
popd
153-
154141
%install
155142
pushd build-dynamic
156143
make DESTDIR=%{buildroot} install
157-
158144
%if 0%{?with_tests:1} && 0%{?with_gtest:1}
159145
# Generating the test groups and run CMake again
160146
# to process the generated TestGroups.cmake file
@@ -166,10 +152,8 @@ mv CTestTestfile.cmake %{buildroot}%{_libdir}/mysql-cppconn-8/dynamic/
166152
mv run_unit_tests %{buildroot}%{_libdir}/mysql-cppconn-8/dynamic/
167153
%endif
168154
popd
169-
170155
pushd build-static
171156
make DESTDIR=%{buildroot} install
172-
173157
%if 0%{?with_tests:1} && 0%{?with_gtest:1}
174158
# Generating the test groups and run CMake again
175159
# to process the generated TestGroups.cmake file
@@ -181,25 +165,19 @@ mv CTestTestfile.cmake %{buildroot}%{_libdir}/mysql-cppconn-8/static/
181165
mv run_unit_tests %{buildroot}%{_libdir}/mysql-cppconn-8/static/
182166
%endif
183167
popd
184-
185168
# Add compat dir and remove unwanted file
186169
ln -s mysql-cppconn-8 %{buildroot}%{_includedir}/mysql-cppconn
187170
rm %{buildroot}/usr/{INFO_SRC,INFO_BIN}
188-
189171
%post -p /sbin/ldconfig
190172
%postun -p /sbin/ldconfig
191-
192173
%post jdbc -p /sbin/ldconfig
193174
%postun jdbc -p /sbin/ldconfig
194-
195175
%files
196176
%doc README.txt LICENSE.txt INFO_SRC build-dynamic/INFO_BIN
197177
%{_libdir}/libmysqlcppconn8.so.@ABI_VERSION_MAJOR@*
198-
199178
%files jdbc
200179
%doc README.txt LICENSE.txt INFO_SRC build-dynamic/INFO_BIN
201180
%{_libdir}/libmysqlcppconn.so.@JDBC_ABI_VERSION_MAJOR@*
202-
203181
%files devel
204182
%doc README.txt LICENSE.txt INFO_SRC build-dynamic/INFO_BIN
205183
%{_libdir}/libmysqlcppconn.so
@@ -211,7 +189,6 @@ rm %{buildroot}/usr/{INFO_SRC,INFO_BIN}
211189
%{_includedir}/mysql-cppconn-8/mysqlx
212190
%{_includedir}/mysql-cppconn-8/mysql
213191
%{_includedir}/mysql-cppconn-8/jdbc
214-
215192
%if 0%{?with_tests:1} && 0%{?with_gtest:1}
216193
%files test
217194
%dir %{_libdir}/mysql-cppconn-8
@@ -222,30 +199,25 @@ rm %{buildroot}/usr/{INFO_SRC,INFO_BIN}
222199
%{_libdir}/mysql-cppconn-8/static/run_unit_tests
223200
%{_libdir}/mysql-cppconn-8/static/CTestTestfile.cmake
224201
%endif
225-
226202
%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
227205
* Thu Jun 04 2020 Gipson Pulla <[email protected]> - 8.0.21-1
228206
- Updated the macro to use the system date
229-
230207
* Fri Feb 15 2019 Bjorn Munch <[email protected]> - 8.0.16-1
231208
- CMake 3 should not be used on Fedora, only on Oracle Linux or Red Hat
232209
- Removed use of cmake_path as it is no longer needed
233-
234210
* Thu Feb 14 2019 Rafal Somla <[email protected]>
235211
- Use ABI version number taken from version.cmake in %files patterns
236-
237212
* Fri Dec 14 2018 Kent Boortz <[email protected]> - 8.0.15-1
238213
- Use CMake 3 on Fedora and Oracle Linux
239214
- Added option to specify what CMake to use, "--define 'cmake_path <path>'"
240-
241215
* Tue Nov 27 2018 Balasubramanian Kandasamy <[email protected]> - 8.0.14-1
242216
- Added INFO_BIN and INFO_SRC files
243-
244217
* Fri Aug 24 2018 Kent Boortz <[email protected]> - 8.0.13-1
245218
- Added "test" package
246-
247219
* Wed May 16 2018 Balasubramanian Kandasamy <[email protected]> - 8.0.11-1
248220
- Adapt to MySQL Connector C++ 8.0
249-
250221
* Tue Apr 05 2016 Kent Boortz <[email protected]> - 2.0.1-1
251222
- initial package
223+
Collapse

0 commit comments

Comments
 (0)