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
... ...
@@ -21,6 +21,7 @@
21 21
 %bcond_without nats
22 22
 %bcond_without perl
23 23
 %bcond_without phonenum
24
+%bcond_without python2
24 25
 %bcond_without python3
25 26
 %bcond_without rabbitmq
26 27
 %bcond_without redis
... ...
@@ -55,6 +56,7 @@
55 56
 %bcond_with nats
56 57
 %bcond_without perl
57 58
 %bcond_with phonenum
59
+%bcond_without python2
58 60
 %bcond_with python3
59 61
 %bcond_with rabbitmq
60 62
 %bcond_with redis
... ...
@@ -90,6 +92,7 @@
90 92
 %bcond_with nats
91 93
 %bcond_without perl
92 94
 %bcond_without phonenum
95
+%bcond_without python2
93 96
 %bcond_without python3
94 97
 %bcond_without rabbitmq
95 98
 %bcond_without redis
... ...
@@ -135,6 +138,53 @@
135 138
 %bcond_without nats
136 139
 %bcond_without perl
137 140
 %bcond_without phonenum
141
+%bcond_without python2
142
+%bcond_without python3
143
+%bcond_without rabbitmq
144
+%bcond_without redis
145
+%bcond_without ruby
146
+%bcond_without sctp
147
+%bcond_without websocket
148
+%bcond_without xmlrpc
149
+%endif
150
+
151
+%if 0%{?rhel} == 9
152
+%if 0%{?centos_ver}
153
+%define dist_name centos
154
+%define dist_version %{?centos}
155
+%define dist .el9.centos
156
+%endif
157
+%if 0%{?almalinux_ver}
158
+%define dist_name centos
159
+%define dist_version %{?almalinux}
160
+%define dist .el9.almalinux
161
+%endif
162
+%if 0%{?rocky_ver}
163
+%define dist_name centos
164
+%define dist_version %{?rocky}
165
+%define dist .el9.rocky
166
+%endif
167
+%if 0%{?centos_ver} == 0 && 0%{?almalinux_ver} == 0 && 0%{?rocky_ver} == 0
168
+%define dist_name rhel
169
+%define dist_version %{?rhel}
170
+%endif
171
+%bcond_without cnxcc
172
+%bcond_with dnssec
173
+%bcond_without evapi
174
+%bcond_without geoip
175
+%bcond_without http_async_client
176
+%bcond_without ims
177
+%bcond_without jansson
178
+%bcond_without json
179
+%bcond_without lua
180
+%bcond_without lwsc
181
+%bcond_without kazoo
182
+%bcond_without memcached
183
+%bcond_without mongodb
184
+%bcond_without nats
185
+%bcond_without perl
186
+%bcond_without phonenum
187
+%bcond_with python2
138 188
 %bcond_without python3
139 189
 %bcond_without rabbitmq
140 190
 %bcond_without redis
... ...
@@ -163,6 +213,7 @@
163 213
 %bcond_with nats
164 214
 %bcond_without perl
165 215
 %bcond_with phonenum
216
+%bcond_without python2
166 217
 %bcond_without python3
167 218
 %bcond_with rabbitmq
168 219
 %bcond_without redis
... ...
@@ -788,13 +839,11 @@ SIP Presence (and RLS, XCAP, etc) support for Kamailio.
788 839
 %package    python
789 840
 Summary:    Python extensions for Kamailio
790 841
 Group:      %{PKGGROUP}
842
+%if %{with python2}
791 843
 Requires:   python2, kamailio = %ver
792 844
 BuildRequires:  python2, python2-devel
793
-%if %{with python3}
794
-%if 0%{?rhel} == 7
795
-Requires:   python36, kamailio = %ver
796
-BuildRequires:  python36, python36-devel
797 845
 %endif
846
+%if %{with python3}
798 847
 %if 0%{?rhel} == 8
799 848
 Requires:   python39, kamailio = %ver
800 849
 BuildRequires:  python39, python39-devel
... ...
@@ -824,7 +873,7 @@ RabbitMQ module for Kamailio.
824 873
 Summary:    RADIUS modules for Kamailio
825 874
 Group:      %{PKGGROUP}
826 875
 Requires:   kamailio = %ver
827
-%if 0%{?fedora} || 0%{?suse_version} || 0%{?rhel} == 8
876
+%if 0%{?fedora} || 0%{?suse_version} || 0%{?rhel} >= 8
828 877
 Requires:   freeradius-client
829 878
 BuildRequires:  freeradius-client-devel
830 879
 %else
... ...
@@ -1158,14 +1207,14 @@ sed -i -e 's/python3/python2/' utils/kamctl/dbtextdb/dbtextdb.py
1158 1207
 %endif
1159 1208
 
1160 1209
 # on latest dist need to add --atexit=no for Kamailio options. More details GH #2616
1161
-%if 0%{?fedora} || 0%{?suse_version} || 0%{?rhel} == 8
1210
+%if 0%{?fedora} || 0%{?suse_version} || 0%{?rhel} >= 8
1162 1211
 sed -i -e 's|/usr/sbin/kamailio|/usr/sbin/kamailio --atexit=no|' pkg/kamailio/obs/kamailio.service
1163 1212
 %endif
1164 1213
 
1165 1214
 
1166 1215
 %build
1167 1216
 ln -s ../obs pkg/kamailio/%{dist_name}/%{dist_version}
1168
-%if 0%{?fedora} || 0%{?suse_version} || 0%{?rhel} == 8
1217
+%if 0%{?fedora} || 0%{?suse_version} || 0%{?rhel} >= 8
1169 1218
 export FREERADIUS=1
1170 1219
 %endif
1171 1220
 make cfg prefix=/usr \
... ...
@@ -1180,10 +1229,10 @@ make every-module skip_modules="app_mono db_cassandra db_oracle iptrtpproxy \
1180 1229
 %if %{with openssl11}
1181 1230
     SSL_BUILDER="pkg-config libssl11" \
1182 1231
 %endif
1183
-%if 0%{?fedora} || 0%{?suse_version} || 0%{?rhel} == 8
1232
+%if 0%{?fedora} || 0%{?suse_version} || 0%{?rhel} >= 8
1184 1233
     FREERADIUS=1 \
1185 1234
 %endif
1186
-%if 0%{?rhel} == 8
1235
+%if 0%{?rhel} >= 8
1187 1236
     PYTHON3=python3.9 \
1188 1237
 %endif
1189 1238
     group_include="kstandard kautheph kberkeley kcarrierroute \
... ...
@@ -1244,7 +1293,10 @@ make every-module skip_modules="app_mono db_cassandra db_oracle iptrtpproxy \
1244 1293
 %if %{with phonenum}
1245 1294
     kphonenum \
1246 1295
 %endif
1247
-    kpostgres kpresence kpython \
1296
+    kpostgres kpresence \
1297
+%if %{with python2}
1298
+    kpython \
1299
+%endif
1248 1300
 %if %{with python3}
1249 1301
     kpython3 \
1250 1302
 %endif
... ...
@@ -1284,10 +1336,10 @@ make install-modules-all skip_modules="app_mono db_cassandra db_oracle \
1284 1336
 %if %{with openssl11}
1285 1337
     SSL_BUILDER="pkg-config libssl11" \
1286 1338
 %endif
1287
-%if 0%{?fedora} || 0%{?suse_version} || 0%{?rhel} == 8
1339
+%if 0%{?fedora} || 0%{?suse_version} || 0%{?rhel} >= 8
1288 1340
     FREERADIUS=1 \
1289 1341
 %endif
1290
-%if 0%{?rhel} == 8
1342
+%if 0%{?rhel} >= 8
1291 1343
     PYTHON3=python3.9 \
1292 1344
 %endif
1293 1345
     group_include="kstandard kautheph kberkeley kcarrierroute \
... ...
@@ -1348,7 +1400,10 @@ make install-modules-all skip_modules="app_mono db_cassandra db_oracle \
1348 1400
 %if %{with phonenum}
1349 1401
     kphonenum \
1350 1402
 %endif
1351
-    kpostgres kpresence kpython \
1403
+    kpostgres kpresence \
1404
+%if %{with python2}
1405
+    kpython \
1406
+%endif
1352 1407
 %if %{with python3}
1353 1408
     kpython3 \
1354 1409
 %endif
... ...
@@ -1411,8 +1466,8 @@ install -m644 pkg/kamailio/%{dist_name}/%{dist_version}/sipcapture.sysconfig \
1411 1466
 %if 0%{?suse_version}
1412 1467
 %py_compile -O %{buildroot}%{_libdir}/kamailio/kamctl/dbtextdb
1413 1468
 %endif
1414
-%if 0%{?fedora} || 0%{?rhel} == 8
1415
-%py_byte_compile %{__python2} %{buildroot}%{_libdir}/kamailio/kamctl/dbtextdb
1469
+%if 0%{?fedora} || 0%{?rhel} >= 8
1470
+%py_byte_compile %{__python3} %{buildroot}%{_libdir}/kamailio/kamctl/dbtextdb
1416 1471
 %endif
1417 1472
 
1418 1473
 # Removing devel files
... ...
@@ -1778,8 +1833,8 @@ fi
1778 1833
 
1779 1834
 %dir %{_libdir}/kamailio/kamctl/dbtextdb
1780 1835
 %{_libdir}/kamailio/kamctl/dbtextdb/dbtextdb.py
1781
-%{_libdir}/kamailio/kamctl/dbtextdb/dbtextdb.pyc
1782
-%{_libdir}/kamailio/kamctl/dbtextdb/dbtextdb.pyo
1836
+%dir %{_libdir}/kamailio/kamctl/dbtextdb/__pycache__
1837
+%{_libdir}/kamailio/kamctl/dbtextdb/__pycache__/*.pyc
1783 1838
 
1784 1839
 %{_mandir}/man5/*
1785 1840
 %{_mandir}/man8/*
... ...
@@ -2145,8 +2200,10 @@ fi
2145 2200
 
2146 2201
 %files      python
2147 2202
 %defattr(-,root,root)
2203
+%if %{with python2}
2148 2204
 %doc %{_docdir}/kamailio/modules/README.app_python
2149 2205
 %{_libdir}/kamailio/modules/app_python.so
2206
+%endif
2150 2207
 %if %{with python3}
2151 2208
 %doc %{_docdir}/kamailio/modules/README.app_python3
2152 2209
 %{_libdir}/kamailio/modules/app_python3.so