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
... ...
@@ -20,6 +20,7 @@
20 20
 %bcond_without mongodb
21 21
 %bcond_without perl
22 22
 %bcond_without phonenum
23
+%bcond_without python2
23 24
 %bcond_without python3
24 25
 %bcond_without rabbitmq
25 26
 %bcond_without redis
... ...
@@ -53,6 +54,7 @@
53 54
 %bcond_with mongodb
54 55
 %bcond_without perl
55 56
 %bcond_with phonenum
57
+%bcond_without python2
56 58
 %bcond_with python3
57 59
 %bcond_with rabbitmq
58 60
 %bcond_with redis
... ...
@@ -87,6 +89,7 @@
87 89
 %bcond_without mongodb
88 90
 %bcond_without perl
89 91
 %bcond_without phonenum
92
+%bcond_without python2
90 93
 %bcond_without python3
91 94
 %bcond_without rabbitmq
92 95
 %bcond_without redis
... ...
@@ -131,6 +134,53 @@
131 134
 %bcond_without mongodb
132 135
 %bcond_without perl
133 136
 %bcond_without phonenum
137
+%bcond_without python2
138
+%bcond_without python3
139
+%bcond_without rabbitmq
140
+%bcond_without redis
141
+%bcond_without ruby
142
+%bcond_without sctp
143
+%bcond_without websocket
144
+%bcond_without xmlrpc
145
+%endif
146
+
147
+%if 0%{?rhel} == 9
148
+%if 0%{?centos_ver}
149
+%define dist_name centos
150
+%define dist_version %{?centos}
151
+%define dist .el9.centos
152
+%endif
153
+%if 0%{?almalinux_ver}
154
+%define dist_name centos
155
+%define dist_version %{?almalinux}
156
+%define dist .el9.almalinux
157
+%endif
158
+%if 0%{?rocky_ver}
159
+%define dist_name centos
160
+%define dist_version %{?rocky}
161
+%define dist .el9.rocky
162
+%endif
163
+%if 0%{?centos_ver} == 0 && 0%{?almalinux_ver} == 0 && 0%{?rocky_ver} == 0
164
+%define dist_name rhel
165
+%define dist_version %{?rhel}
166
+%endif
167
+%bcond_without cnxcc
168
+%bcond_with dnssec
169
+%bcond_without evapi
170
+%bcond_without geoip
171
+%bcond_without http_async_client
172
+%bcond_without ims
173
+%bcond_without jansson
174
+%bcond_without json
175
+%bcond_without lua
176
+%bcond_without lwsc
177
+%bcond_without kazoo
178
+%bcond_without memcached
179
+%bcond_without mongodb
180
+%bcond_without nats
181
+%bcond_without perl
182
+%bcond_without phonenum
183
+%bcond_with python2
134 184
 %bcond_without python3
135 185
 %bcond_without rabbitmq
136 186
 %bcond_without redis
... ...
@@ -158,6 +208,7 @@
158 208
 %bcond_with mongodb
159 209
 %bcond_without perl
160 210
 %bcond_with phonenum
211
+%bcond_without python2
161 212
 %bcond_without python3
162 213
 %bcond_with rabbitmq
163 214
 %bcond_without redis
... ...
@@ -768,13 +819,11 @@ SIP Presence (and RLS, XCAP, etc) support for Kamailio.
768 819
 %package    python
769 820
 Summary:    Python extensions for Kamailio
770 821
 Group:      %{PKGGROUP}
822
+%if %{with python2}
771 823
 Requires:   python2, kamailio = %ver
772 824
 BuildRequires:  python2, python2-devel
773
-%if %{with python3}
774
-%if 0%{?rhel} == 7
775
-Requires:   python36, kamailio = %ver
776
-BuildRequires:  python36, python36-devel
777 825
 %endif
826
+%if %{with python3}
778 827
 %if 0%{?rhel} == 8
779 828
 Requires:   python39, kamailio = %ver
780 829
 BuildRequires:  python39, python39-devel
... ...
@@ -804,7 +853,7 @@ RabbitMQ module for Kamailio.
804 853
 Summary:    RADIUS modules for Kamailio
805 854
 Group:      %{PKGGROUP}
806 855
 Requires:   kamailio = %ver
807
-%if 0%{?fedora} || 0%{?suse_version} || 0%{?rhel} == 8
856
+%if 0%{?fedora} || 0%{?suse_version} || 0%{?rhel} >= 8
808 857
 Requires:   freeradius-client
809 858
 BuildRequires:  freeradius-client-devel
810 859
 %else
... ...
@@ -1121,14 +1170,14 @@ sed -i -e 's/python3/python2/' utils/kamctl/dbtextdb/dbtextdb.py
1121 1170
 %endif
1122 1171
 
1123 1172
 # on latest dist need to add --atexit=no for Kamailio options. More details GH #2616
1124
-%if 0%{?fedora} || 0%{?suse_version} || 0%{?rhel} == 8
1173
+%if 0%{?fedora} || 0%{?suse_version} || 0%{?rhel} >= 8
1125 1174
 sed -i -e 's|/usr/sbin/kamailio|/usr/sbin/kamailio --atexit=no|' pkg/kamailio/obs/kamailio.service
1126 1175
 %endif
1127 1176
 
1128 1177
 
1129 1178
 %build
1130 1179
 ln -s ../obs pkg/kamailio/%{dist_name}/%{dist_version}
1131
-%if 0%{?fedora} || 0%{?suse_version} || 0%{?rhel} == 8
1180
+%if 0%{?fedora} || 0%{?suse_version} || 0%{?rhel} >= 8
1132 1181
 export FREERADIUS=1
1133 1182
 %endif
1134 1183
 make cfg prefix=/usr \
... ...
@@ -1143,10 +1192,10 @@ make every-module skip_modules="app_mono db_cassandra db_oracle iptrtpproxy \
1143 1192
 %if %{with openssl11}
1144 1193
     SSL_BUILDER="pkg-config libssl11" \
1145 1194
 %endif
1146
-%if 0%{?fedora} || 0%{?suse_version} || 0%{?rhel} == 8
1195
+%if 0%{?fedora} || 0%{?suse_version} || 0%{?rhel} >= 8
1147 1196
     FREERADIUS=1 \
1148 1197
 %endif
1149
-%if 0%{?rhel} == 8
1198
+%if 0%{?rhel} >= 8
1150 1199
     PYTHON3=python3.9 \
1151 1200
 %endif
1152 1201
     group_include="kstandard kautheph kberkeley kcarrierroute \
... ...
@@ -1204,7 +1253,10 @@ make every-module skip_modules="app_mono db_cassandra db_oracle iptrtpproxy \
1204 1253
 %if %{with phonenum}
1205 1254
     kphonenum \
1206 1255
 %endif
1207
-    kpostgres kpresence kpython \
1256
+    kpostgres kpresence \
1257
+%if %{with python2}
1258
+    kpython \
1259
+%endif
1208 1260
 %if %{with python3}
1209 1261
     kpython3 \
1210 1262
 %endif
... ...
@@ -1244,10 +1296,10 @@ make install-modules-all skip_modules="app_mono db_cassandra db_oracle \
1244 1296
 %if %{with openssl11}
1245 1297
     SSL_BUILDER="pkg-config libssl11" \
1246 1298
 %endif
1247
-%if 0%{?fedora} || 0%{?suse_version} || 0%{?rhel} == 8
1299
+%if 0%{?fedora} || 0%{?suse_version} || 0%{?rhel} >= 8
1248 1300
     FREERADIUS=1 \
1249 1301
 %endif
1250
-%if 0%{?rhel} == 8
1302
+%if 0%{?rhel} >= 8
1251 1303
     PYTHON3=python3.9 \
1252 1304
 %endif
1253 1305
     group_include="kstandard kautheph kberkeley kcarrierroute \
... ...
@@ -1305,7 +1357,10 @@ make install-modules-all skip_modules="app_mono db_cassandra db_oracle \
1305 1357
 %if %{with phonenum}
1306 1358
     kphonenum \
1307 1359
 %endif
1308
-    kpostgres kpresence kpython \
1360
+    kpostgres kpresence \
1361
+%if %{with python2}
1362
+    kpython \
1363
+%endif
1309 1364
 %if %{with python3}
1310 1365
     kpython3 \
1311 1366
 %endif
... ...
@@ -1368,8 +1423,8 @@ install -m644 pkg/kamailio/%{dist_name}/%{dist_version}/sipcapture.sysconfig \
1368 1423
 %if 0%{?suse_version}
1369 1424
 %py_compile -O %{buildroot}%{_libdir}/kamailio/kamctl/dbtextdb
1370 1425
 %endif
1371
-%if 0%{?fedora} || 0%{?rhel} == 8
1372
-%py_byte_compile %{__python2} %{buildroot}%{_libdir}/kamailio/kamctl/dbtextdb
1426
+%if 0%{?fedora} || 0%{?rhel} >= 8
1427
+%py_byte_compile %{__python3} %{buildroot}%{_libdir}/kamailio/kamctl/dbtextdb
1373 1428
 %endif
1374 1429
 
1375 1430
 # Removing devel files
... ...
@@ -1731,8 +1786,8 @@ fi
1731 1786
 
1732 1787
 %dir %{_libdir}/kamailio/kamctl/dbtextdb
1733 1788
 %{_libdir}/kamailio/kamctl/dbtextdb/dbtextdb.py
1734
-%{_libdir}/kamailio/kamctl/dbtextdb/dbtextdb.pyc
1735
-%{_libdir}/kamailio/kamctl/dbtextdb/dbtextdb.pyo
1789
+%dir %{_libdir}/kamailio/kamctl/dbtextdb/__pycache__
1790
+%{_libdir}/kamailio/kamctl/dbtextdb/__pycache__/*.pyc
1736 1791
 
1737 1792
 %{_mandir}/man5/*
1738 1793
 %{_mandir}/man8/*
... ...
@@ -2090,8 +2145,10 @@ fi
2090 2145
 
2091 2146
 %files      python
2092 2147
 %defattr(-,root,root)
2148
+%if %{with python2}
2093 2149
 %doc %{_docdir}/kamailio/modules/README.app_python
2094 2150
 %{_libdir}/kamailio/modules/app_python.so
2151
+%endif
2095 2152
 %if %{with python3}
2096 2153
 %doc %{_docdir}/kamailio/modules/README.app_python3
2097 2154
 %{_libdir}/kamailio/modules/app_python3.so