Skip to content

Commit 0bec1c6

Browse files
committed
Fix to have debug builds back for rpm builds
1 parent 92c4205 commit 0bec1c6

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

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

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ Requires: mysql-community-client-plugins = %{version}
7676
%endif
7777
%description
7878
A C++ interface for communicating with MySQL servers.
79+
7980
%package jdbc
8081
Summary: MySQL Driver for C++ which mimics the JDBC 4.0 API
8182
%{?commercial:Obsoletes: mysql-connector-c++-jdbc < %{version}-%{release}}
@@ -85,6 +86,7 @@ Provides: libmysqlcppconn7 = %{version}-%{release}
8586
Provides: libmysqlcppconn-devel = %{version}-%{release}
8687
%description jdbc
8788
This MySQL Driver for C++ mimics the JDBC 4.0 API.
89+
8890
%package devel
8991
Summary: Development header files and libraries for MySQL C++ client applications
9092
%if 0%{?commercial}
@@ -99,6 +101,7 @@ Requires: mysql-connector-c++-jdbc = %{version}-%{release}
99101
This package contains the development header files and libraries necessary
100102
to develop MySQL client applications in C++.
101103
%if 0%{?with_tests:1} && 0%{?with_gtest:1}
104+
102105
%package test
103106
Summary: Regression tests for MySQL Connector/C++
104107
%if 0%{?commercial}
@@ -114,14 +117,22 @@ This package contains the test files necessary to run regression
114117
test suite for MySQL Connector/C++
115118
%endif
116119
%prep
120+
117121
%setup -q -n mysql-connector-c++%{product_suffix}-%{version}-src
118122
%build
123+
124+
%{?el6:. /opt/rh/devtoolset-8/enable}
119125
%{?el6:export CC=/opt/rh/devtoolset-8/root/usr/bin/gcc}
120126
%{?el6:export CXX=/opt/rh/devtoolset-8/root/usr/bin/g++}
127+
128+
%{?el7:. /opt/rh/devtoolset-9/enable}
121129
%{?el7:export CC=/opt/rh/devtoolset-9/root/usr/bin/gcc}
122130
%{?el7:export CXX=/opt/rh/devtoolset-9/root/usr/bin/g++}
131+
132+
%{?el8:. /opt/rh/gcc-toolset-9/enable}
123133
%{?el8:export CC=/opt/rh/gcc-toolset-9/root/usr/bin/gcc}
124134
%{?el8:export CXX=/opt/rh/gcc-toolset-9/root/usr/bin/g++}
135+
125136
%if 0%{?with_tests:1} && 0%{?with_gtest:1}
126137
%global __cmake_test_opts -DWITH_TESTS=1 -DWITH_GTEST=%{with_gtest}
127138
%else
@@ -143,7 +154,12 @@ mkdir build-static && pushd build-static
143154
%__cmake_cmd -DBUILD_STATIC=ON
144155
make %{?_smp_mflags} VERBOSE=1
145156
popd
157+
146158
%install
159+
%{?el6:. /opt/rh/devtoolset-8/enable}
160+
%{?el7:. /opt/rh/devtoolset-9/enable}
161+
%{?el8:. /opt/rh/gcc-toolset-9/enable}
162+
147163
pushd build-dynamic
148164
make DESTDIR=%{buildroot} install
149165
%if 0%{?with_tests:1} && 0%{?with_gtest:1}
@@ -173,16 +189,23 @@ popd
173189
# Add compat dir and remove unwanted file
174190
ln -s mysql-cppconn-8 %{buildroot}%{_includedir}/mysql-cppconn
175191
rm %{buildroot}/usr/{INFO_SRC,INFO_BIN}
192+
176193
%post -p /sbin/ldconfig
194+
177195
%postun -p /sbin/ldconfig
196+
178197
%post jdbc -p /sbin/ldconfig
198+
179199
%postun jdbc -p /sbin/ldconfig
200+
180201
%files
181202
%doc README.txt LICENSE.txt INFO_SRC build-dynamic/INFO_BIN
182203
%{_libdir}/libmysqlcppconn8.so.@ABI_VERSION_MAJOR@*
204+
183205
%files jdbc
184206
%doc README.txt LICENSE.txt INFO_SRC build-dynamic/INFO_BIN
185207
%{_libdir}/libmysqlcppconn.so.@JDBC_ABI_VERSION_MAJOR@*
208+
186209
%files devel
187210
%doc README.txt LICENSE.txt INFO_SRC build-dynamic/INFO_BIN
188211
%{_libdir}/libmysqlcppconn.so
@@ -195,6 +218,7 @@ rm %{buildroot}/usr/{INFO_SRC,INFO_BIN}
195218
%{_includedir}/mysql-cppconn-8/mysql
196219
%{_includedir}/mysql-cppconn-8/jdbc
197220
%if 0%{?with_tests:1} && 0%{?with_gtest:1}
221+
198222
%files test
199223
%dir %{_libdir}/mysql-cppconn-8
200224
%dir %{_libdir}/mysql-cppconn-8/dynamic
@@ -204,6 +228,7 @@ rm %{buildroot}/usr/{INFO_SRC,INFO_BIN}
204228
%{_libdir}/mysql-cppconn-8/static/run_unit_tests
205229
%{_libdir}/mysql-cppconn-8/static/CTestTestfile.cmake
206230
%endif
231+
207232
%changelog
208233
* Tue Jun 30 2020 Sreedhar S <[email protected]> - 8.0.22-1
209234
- Updated the dependency list to use server's client-plugin package

0 commit comments

Comments
 (0)