Browse code

pkg/kamailio/obs: added CentOS 9 support

(cherry picked from commit 19edea067f890814c767581fef65713046c768c6)

Sergey Safarov authored on 22/06/2022 18:16:41
Showing 1 changed files
... ...
@@ -19,6 +19,7 @@
19 19
 %bcond_without mongodb
20 20
 %bcond_without perl
21 21
 %bcond_without phonenum
22
+%bcond_without python2
22 23
 %bcond_without python3
23 24
 %bcond_without rabbitmq
24 25
 %bcond_without redis
... ...
@@ -45,6 +46,7 @@
45 46
 %bcond_with mongodb
46 47
 %bcond_without perl
47 48
 %bcond_with phonenum
49
+%bcond_without python2
48 50
 %bcond_with python3
49 51
 %bcond_with rabbitmq
50 52
 %bcond_with redis
... ...
@@ -72,6 +74,7 @@
72 74
 %bcond_without mongodb
73 75
 %bcond_without perl
74 76
 %bcond_without phonenum
77
+%bcond_without python2
75 78
 %bcond_without python3
76 79
 %bcond_without rabbitmq
77 80
 %bcond_without redis
... ...
@@ -99,6 +102,53 @@
99 102
 %bcond_without mongodb
100 103
 %bcond_without perl
101 104
 %bcond_without phonenum
105
+%bcond_without python2
106
+%bcond_without python3
107
+%bcond_without rabbitmq
108
+%bcond_without redis
109
+%bcond_without ruby
110
+%bcond_without sctp
111
+%bcond_without websocket
112
+%bcond_without xmlrpc
113
+%endif
114
+
115
+%if 0%{?rhel} == 9
116
+%if 0%{?centos_ver}
117
+%define dist_name centos
118
+%define dist_version %{?centos}
119
+%define dist .el9.centos
120
+%endif
121
+%if 0%{?almalinux_ver}
122
+%define dist_name centos
123
+%define dist_version %{?almalinux}
124
+%define dist .el9.almalinux
125
+%endif
126
+%if 0%{?rocky_ver}
127
+%define dist_name centos
128
+%define dist_version %{?rocky}
129
+%define dist .el9.rocky
130
+%endif
131
+%if 0%{?centos_ver} == 0 && 0%{?almalinux_ver} == 0 && 0%{?rocky_ver} == 0
132
+%define dist_name rhel
133
+%define dist_version %{?rhel}
134
+%endif
135
+%bcond_without cnxcc
136
+%bcond_with dnssec
137
+%bcond_without evapi
138
+%bcond_without geoip
139
+%bcond_without http_async_client
140
+%bcond_without ims
141
+%bcond_without jansson
142
+%bcond_without json
143
+%bcond_without lua
144
+%bcond_without lwsc
145
+%bcond_without kazoo
146
+%bcond_without memcached
147
+%bcond_without mongodb
148
+%bcond_without nats
149
+%bcond_without perl
150
+%bcond_without phonenum
151
+%bcond_with python2
102 152
 %bcond_without python3
103 153
 %bcond_without rabbitmq
104 154
 %bcond_without redis
... ...
@@ -125,6 +175,7 @@
125 175
 %bcond_with mongodb
126 176
 %bcond_without perl
127 177
 %bcond_with phonenum
178
+%bcond_without python2
128 179
 %bcond_without python3
129 180
 %bcond_with rabbitmq
130 181
 %bcond_without redis
... ...
@@ -801,13 +852,11 @@ SIP Presence (and RLS, XCAP, etc) support for Kamailio.
801 852
 %package    python
802 853
 Summary:    Python extensions for Kamailio
803 854
 Group:      %{PKGGROUP}
855
+%if %{with python2}
804 856
 Requires:   python2, kamailio = %ver
805 857
 BuildRequires:  python2, python2-devel
806
-%if %{with python3}
807
-%if 0%{?rhel} == 7
808
-Requires:   python36, kamailio = %ver
809
-BuildRequires:  python36, python36-devel
810 858
 %endif
859
+%if %{with python3}
811 860
 %if 0%{?rhel} == 8
812 861
 Requires:   python39, kamailio = %ver
813 862
 BuildRequires:  python39, python39-devel
... ...
@@ -837,7 +886,7 @@ RabbitMQ module for Kamailio.
837 886
 Summary:    RADIUS modules for Kamailio
838 887
 Group:      %{PKGGROUP}
839 888
 Requires:   kamailio = %ver
840
-%if 0%{?fedora} || 0%{?suse_version} || 0%{?rhel} == 8
889
+%if 0%{?fedora} || 0%{?suse_version} || 0%{?rhel} >= 8
841 890
 Requires:   freeradius-client
842 891
 BuildRequires:  freeradius-client-devel
843 892
 %else
... ...
@@ -1154,14 +1203,14 @@ sed -i -e 's/python3/python2/' utils/kamctl/dbtextdb/dbtextdb.py
1154 1203
 %endif
1155 1204
 
1156 1205
 # on latest dist need to add --atexit=no for Kamailio options. More details GH #2616
1157
-%if 0%{?fedora} || 0%{?suse_version} || 0%{?rhel} == 8
1206
+%if 0%{?fedora} || 0%{?suse_version} || 0%{?rhel} >= 8
1158 1207
 sed -i -e 's|/usr/sbin/kamailio|/usr/sbin/kamailio --atexit=no|' pkg/kamailio/obs/kamailio.service
1159 1208
 %endif
1160 1209
 
1161 1210
 
1162 1211
 %build
1163 1212
 ln -s ../obs pkg/kamailio/%{dist_name}/%{dist_version}
1164
-%if 0%{?fedora} || 0%{?suse_version} || 0%{?rhel} == 8
1213
+%if 0%{?fedora} || 0%{?suse_version} || 0%{?rhel} >= 8
1165 1214
 export FREERADIUS=1
1166 1215
 %endif
1167 1216
 make cfg prefix=/usr \
... ...
@@ -1176,10 +1225,10 @@ make every-module skip_modules="app_mono db_cassandra db_oracle iptrtpproxy \
1176 1225
 %if %{with openssl11}
1177 1226
     SSL_BUILDER="pkg-config libssl11" \
1178 1227
 %endif
1179
-%if 0%{?fedora} || 0%{?suse_version} || 0%{?rhel} == 8
1228
+%if 0%{?fedora} || 0%{?suse_version} || 0%{?rhel} >= 8
1180 1229
     FREERADIUS=1 \
1181 1230
 %endif
1182
-%if 0%{?rhel} == 8
1231
+%if 0%{?rhel} >= 8
1183 1232
     PYTHON3=python3.9 \
1184 1233
 %endif
1185 1234
     group_include="kstandard kautheph kberkeley kcarrierroute \
... ...
@@ -1237,7 +1286,10 @@ make every-module skip_modules="app_mono db_cassandra db_oracle iptrtpproxy \
1237 1286
 %if %{with phonenum}
1238 1287
     kphonenum \
1239 1288
 %endif
1240
-    kpostgres kpresence kpython \
1289
+    kpostgres kpresence \
1290
+%if %{with python2}
1291
+    kpython \
1292
+%endif
1241 1293
 %if %{with python3}
1242 1294
     kpython3 \
1243 1295
 %endif
... ...
@@ -1274,10 +1326,10 @@ make install-modules-all skip_modules="app_mono db_cassandra db_oracle \
1274 1326
 %if %{with openssl11}
1275 1327
     SSL_BUILDER="pkg-config libssl11" \
1276 1328
 %endif
1277
-%if 0%{?fedora} || 0%{?suse_version} || 0%{?rhel} == 8
1329
+%if 0%{?fedora} || 0%{?suse_version} || 0%{?rhel} >= 8
1278 1330
     FREERADIUS=1 \
1279 1331
 %endif
1280
-%if 0%{?rhel} == 8
1332
+%if 0%{?rhel} >= 8
1281 1333
     PYTHON3=python3.9 \
1282 1334
 %endif
1283 1335
     group_include="kstandard kautheph kberkeley kcarrierroute \
... ...
@@ -1335,7 +1387,10 @@ make install-modules-all skip_modules="app_mono db_cassandra db_oracle \
1335 1387
 %if %{with phonenum}
1336 1388
     kphonenum \
1337 1389
 %endif
1338
-    kpostgres kpresence kpython \
1390
+    kpostgres kpresence \
1391
+%if %{with python2}
1392
+    kpython \
1393
+%endif
1339 1394
 %if %{with python3}
1340 1395
     kpython3 \
1341 1396
 %endif
... ...
@@ -1395,8 +1450,8 @@ install -m644 pkg/kamailio/%{dist_name}/%{dist_version}/sipcapture.sysconfig \
1395 1450
 %if 0%{?suse_version}
1396 1451
 %py_compile -O %{buildroot}%{_libdir}/kamailio/kamctl/dbtextdb
1397 1452
 %endif
1398
-%if 0%{?fedora} || 0%{?rhel} == 8
1399
-%py_byte_compile %{__python2} %{buildroot}%{_libdir}/kamailio/kamctl/dbtextdb
1453
+%if 0%{?fedora} || 0%{?rhel} >= 8
1454
+%py_byte_compile %{__python3} %{buildroot}%{_libdir}/kamailio/kamctl/dbtextdb
1400 1455
 %endif
1401 1456
 
1402 1457
 # Removing devel files
... ...
@@ -1754,8 +1809,8 @@ fi
1754 1809
 
1755 1810
 %dir %{_libdir}/kamailio/kamctl/dbtextdb
1756 1811
 %{_libdir}/kamailio/kamctl/dbtextdb/dbtextdb.py
1757
-%{_libdir}/kamailio/kamctl/dbtextdb/dbtextdb.pyc
1758
-%{_libdir}/kamailio/kamctl/dbtextdb/dbtextdb.pyo
1812
+%dir %{_libdir}/kamailio/kamctl/dbtextdb/__pycache__
1813
+%{_libdir}/kamailio/kamctl/dbtextdb/__pycache__/*.pyc
1759 1814
 
1760 1815
 %{_mandir}/man5/*
1761 1816
 %{_mandir}/man8/*
... ...
@@ -2106,8 +2161,10 @@ fi
2106 2161
 
2107 2162
 %files      python
2108 2163
 %defattr(-,root,root)
2164
+%if %{with python2}
2109 2165
 %doc %{_docdir}/kamailio/modules/README.app_python
2110 2166
 %{_libdir}/kamailio/modules/app_python.so
2167
+%endif
2111 2168
 %if %{with python3}
2112 2169
 %doc %{_docdir}/kamailio/modules/README.app_python3
2113 2170
 %{_libdir}/kamailio/modules/app_python3.so