Browse code

pkg: enable CentOS 7 to build with OpenSSL 1.1.1

SPChan authored on 10/06/2021 23:51:11
Showing 1 changed files
... ...
@@ -217,6 +217,11 @@
217 217
 %define _rundir %{_localstatedir}/run
218 218
 %endif
219 219
 
220
+# build with openssl 1.1.1 on RHEL 7 based dists
221
+%if 0%{?rhel} == 7
222
+%bcond_with openssl11
223
+%endif
224
+
220 225
 # redefine buggy openSUSE Leap _sharedstatedir macro. More info at https://bugzilla.redhat.com/show_bug.cgi?id=183370
221 226
 %if 0%{?suse_version} == 1315
222 227
 %define _sharedstatedir /var/lib
... ...
@@ -324,8 +329,13 @@ Account transaction information in a JSON dictionary.
324 329
 %package    auth-ephemeral
325 330
 Summary:    Functions for authentication using ephemeral credentials
326 331
 Group:      %{PKGGROUP}
332
+%if 0%{?centos_ver} == 7 && %{with openssl11}
333
+Requires:   openssl11, kamailio = %ver
334
+BuildRequires:  openssl11-devel
335
+%else
327 336
 Requires:   openssl, kamailio = %ver
328 337
 BuildRequires:  openssl-devel
338
+%endif
329 339
 
330 340
 %description    auth-ephemeral
331 341
 Functions for authentication using ephemeral credentials.
... ...
@@ -410,9 +420,14 @@ Requires:   openssl
410 420
 BuildRequires:  openssl-devel
411 421
 %endif
412 422
 %if 0%{?rhel} == 7
423
+%if %{with openssl11}
424
+Requires:   openssl11-libs
425
+BuildRequires:  openssl11-devel
426
+%else
413 427
 Requires:   openssl-libs
414 428
 BuildRequires:  openssl-devel
415 429
 %endif
430
+%endif
416 431
 %if 0%{?fedora}
417 432
 Requires:   openssl-libs
418 433
 BuildRequires:  openssl-devel
... ...
@@ -716,8 +731,13 @@ MySQL database connectivity for Kamailio.
716 731
 %package    outbound
717 732
 Summary:    Outbound (RFC 5626) support for Kamailio
718 733
 Group:      %{PKGGROUP}
734
+%if 0%{?centos_ver} == 7 && %{with openssl11}
735
+Requires:   openssl11, kamailio = %ver
736
+BuildRequires:  openssl11-devel
737
+%else
719 738
 Requires:   openssl, kamailio = %ver
720 739
 BuildRequires:  openssl-devel
740
+%endif
721 741
 
722 742
 %description    outbound
723 743
 RFC 5626, "Managing Client-Initiated Connections in the Session Initiation
... ...
@@ -995,8 +1015,13 @@ SQLite database connectivity for Kamailio.
995 1015
 %package    tls
996 1016
 Summary:    TLS transport for Kamailio
997 1017
 Group:      %{PKGGROUP}
1018
+%if 0%{?centos_ver} == 7 && %{with openssl11}
1019
+Requires:   openssl11, kamailio = %ver
1020
+BuildRequires:  openssl11-devel
1021
+%else
998 1022
 Requires:   openssl, kamailio = %ver
999 1023
 BuildRequires:  openssl-devel
1024
+%endif
1000 1025
 
1001 1026
 %description    tls
1002 1027
 TLS transport for Kamailio.
... ...
@@ -1051,8 +1076,13 @@ Non-SIP utitility functions for Kamailio.
1051 1076
 %package    websocket
1052 1077
 Summary:    WebSocket transport for Kamailio
1053 1078
 Group:      %{PKGGROUP}
1079
+%if 0%{?centos_ver} == 7 && %{with openssl11}
1080
+Requires:   libunistring, openssl11, kamailio = %ver
1081
+BuildRequires:  libunistring-devel, openssl11-devel
1082
+%else
1054 1083
 Requires:   libunistring, openssl, kamailio = %ver
1055 1084
 BuildRequires:  libunistring-devel, openssl-devel
1085
+%endif
1056 1086
 
1057 1087
 %description    websocket
1058 1088
 WebSocket transport for Kamailio.
... ...
@@ -1149,6 +1179,9 @@ make cfg prefix=/usr \
1149 1179
 make
1150 1180
 make every-module skip_modules="app_mono db_cassandra db_oracle iptrtpproxy \
1151 1181
     jabber ndb_cassandra osp" \
1182
+%if %{with openssl11}
1183
+    SSL_BUILDER="pkg-config libssl11" \
1184
+%endif
1152 1185
 %if 0%{?fedora} || 0%{?suse_version} || 0%{?rhel} == 8
1153 1186
     FREERADIUS=1 \
1154 1187
 %endif
... ...
@@ -1242,6 +1275,9 @@ rm -rf %{buildroot}
1242 1275
 make install
1243 1276
 make install-modules-all skip_modules="app_mono db_cassandra db_oracle \
1244 1277
     iptrtpproxy jabber osp" \
1278
+%if %{with openssl11}
1279
+    SSL_BUILDER="pkg-config libssl11" \
1280
+%endif
1245 1281
 %if 0%{?fedora} || 0%{?suse_version} || 0%{?rhel} == 8
1246 1282
     FREERADIUS=1 \
1247 1283
 %endif