Browse code

pkg: enable RHEL7-like distros to build with OpenSSL 1.1.1 [skip ci]

(cherry picked from commit ecc2cc69b08e797ca954af233c229ed44475ce33)

SPChan authored on 10/06/2021 23:51:11 • Sergey Safarov committed on 20/06/2021 09:21:43
Showing 1 changed files
... ...
@@ -172,6 +172,11 @@
172 172
 %define _rundir %{_localstatedir}/run
173 173
 %endif
174 174
 
175
+# build with openssl 1.1.1 on RHEL 7 based dists
176
+%if 0%{?rhel} == 7
177
+%bcond_with openssl11
178
+%endif
179
+
175 180
 # redefine buggy openSUSE Leap _sharedstatedir macro. More info at https://bugzilla.redhat.com/show_bug.cgi?id=183370
176 181
 %if 0%{?suse_version} == 1315
177 182
 %define _sharedstatedir /var/lib
... ...
@@ -279,8 +284,13 @@ Account transaction information in a JSON dictionary.
279 284
 %package    auth-ephemeral
280 285
 Summary:    Functions for authentication using ephemeral credentials
281 286
 Group:      %{PKGGROUP}
287
+%if 0%{?rhel} == 7 && %{with openssl11}
288
+Requires:   openssl11, kamailio = %ver
289
+BuildRequires:  openssl11-devel
290
+%else
282 291
 Requires:   openssl, kamailio = %ver
283 292
 BuildRequires:  openssl-devel
293
+%endif
284 294
 
285 295
 %description    auth-ephemeral
286 296
 Functions for authentication using ephemeral credentials.
... ...
@@ -365,9 +375,14 @@ Requires:   openssl
365 375
 BuildRequires:  openssl-devel
366 376
 %endif
367 377
 %if 0%{?rhel} == 7
378
+%if %{with openssl11}
379
+Requires:   openssl11-libs
380
+BuildRequires:  openssl11-devel
381
+%else
368 382
 Requires:   openssl-libs
369 383
 BuildRequires:  openssl-devel
370 384
 %endif
385
+%endif
371 386
 %if 0%{?fedora}
372 387
 Requires:   openssl-libs
373 388
 BuildRequires:  openssl-devel
... ...
@@ -673,8 +688,13 @@ MySQL database connectivity for Kamailio.
673 688
 %package    outbound
674 689
 Summary:    Outbound (RFC 5626) support for Kamailio
675 690
 Group:      %{PKGGROUP}
691
+%if 0%{?rhel} == 7 && %{with openssl11}
692
+Requires:   openssl11, kamailio = %ver
693
+BuildRequires:  openssl11-devel
694
+%else
676 695
 Requires:   openssl, kamailio = %ver
677 696
 BuildRequires:  openssl-devel
697
+%endif
678 698
 
679 699
 %description    outbound
680 700
 RFC 5626, "Managing Client-Initiated Connections in the Session Initiation
... ...
@@ -952,8 +972,13 @@ SQLite database connectivity for Kamailio.
952 972
 %package    tls
953 973
 Summary:    TLS transport for Kamailio
954 974
 Group:      %{PKGGROUP}
975
+%if 0%{?rhel} == 7 && %{with openssl11}
976
+Requires:   openssl11, kamailio = %ver
977
+BuildRequires:  openssl11-devel
978
+%else
955 979
 Requires:   openssl, kamailio = %ver
956 980
 BuildRequires:  openssl-devel
981
+%endif
957 982
 
958 983
 %description    tls
959 984
 TLS transport for Kamailio.
... ...
@@ -1008,8 +1033,13 @@ Non-SIP utitility functions for Kamailio.
1008 1033
 %package    websocket
1009 1034
 Summary:    WebSocket transport for Kamailio
1010 1035
 Group:      %{PKGGROUP}
1036
+%if 0%{?rhel} == 7 && %{with openssl11}
1037
+Requires:   libunistring, openssl11, kamailio = %ver
1038
+BuildRequires:  libunistring-devel, openssl11-devel
1039
+%else
1011 1040
 Requires:   libunistring, openssl, kamailio = %ver
1012 1041
 BuildRequires:  libunistring-devel, openssl-devel
1042
+%endif
1013 1043
 
1014 1044
 %description    websocket
1015 1045
 WebSocket transport for Kamailio.
... ...
@@ -1106,6 +1136,9 @@ make cfg prefix=/usr \
1106 1136
 make
1107 1137
 make every-module skip_modules="app_mono db_cassandra db_oracle iptrtpproxy \
1108 1138
     jabber ndb_cassandra osp" \
1139
+%if %{with openssl11}
1140
+    SSL_BUILDER="pkg-config libssl11" \
1141
+%endif
1109 1142
 %if 0%{?fedora} || 0%{?suse_version} || 0%{?rhel} == 8
1110 1143
     FREERADIUS=1 \
1111 1144
 %endif
... ...
@@ -1201,6 +1234,9 @@ rm -rf %{buildroot}
1201 1234
 make install
1202 1235
 make install-modules-all skip_modules="app_mono db_cassandra db_oracle \
1203 1236
     iptrtpproxy jabber osp" \
1237
+%if %{with openssl11}
1238
+    SSL_BUILDER="pkg-config libssl11" \
1239
+%endif
1204 1240
 %if 0%{?fedora} || 0%{?suse_version} || 0%{?rhel} == 8
1205 1241
     FREERADIUS=1 \
1206 1242
 %endif