Browse code

pkg/kamailio/obs: used more recent gcc for RHEL and CentOS dists

Sergey Safarov authored on 16/04/2021 11:17:02
Showing 1 changed files
... ...
@@ -277,6 +277,18 @@ Requires:  systemd
277 277
 BuildRequires:  systemd-devel
278 278
 %endif
279 279
 
280
+%if 0%{?rhel} == 7
281
+# we want to use more recent GCC
282
+# yum install centos-release-scl && yum install devtoolset-9
283
+BuildRequires: devtoolset-9
284
+%endif
285
+
286
+%if 0%{?rhel} == 8
287
+# we want to use more recent GCC
288
+# dnf install gcc-toolset-9
289
+BuildRequires: gcc-toolset-9
290
+%endif
291
+
280 292
 %if 0%{?suse_version} == 1315 || 0%{?suse_version} == 1330
281 293
 Requires:  filesystem
282 294
 BuildRequires:  shadow
... ...
@@ -1136,6 +1148,16 @@ sed -i -e 's|/usr/sbin/kamailio|/usr/sbin/kamailio --atexit=no|' pkg/kamailio/ob
1136 1148
 
1137 1149
 
1138 1150
 %build
1151
+%if 0%{?rhel} == 7
1152
+# we want to use more recent GCC
1153
+. /opt/rh/devtoolset-9/enable
1154
+%endif
1155
+
1156
+%if 0%{?rhel} == 8
1157
+# we want to use more recent GCC
1158
+. /opt/rh/gcc-toolset-9/enable
1159
+%endif
1160
+
1139 1161
 ln -s ../obs pkg/kamailio/%{dist_name}/%{dist_version}
1140 1162
 %if 0%{?fedora} || 0%{?suse_version} || 0%{?rhel} == 8
1141 1163
 export FREERADIUS=1
... ...
@@ -1237,6 +1259,16 @@ make utils
1237 1259
 
1238 1260
 
1239 1261
 %install
1262
+%if 0%{?rhel} == 7
1263
+# we want to use more recent GCC
1264
+. /opt/rh/devtoolset-9/enable
1265
+%endif
1266
+
1267
+%if 0%{?rhel} == 8
1268
+# we want to use more recent GCC
1269
+. /opt/rh/gcc-toolset-9/enable
1270
+%endif
1271
+
1240 1272
 rm -rf %{buildroot}
1241 1273
 
1242 1274
 make install