Skip to content

Commit

Permalink
pkg/kamailio/obs: added packaging for RHEL 8 and for CentOS 8 dists GH
Browse files Browse the repository at this point in the history
…#2078 [skip ci]

(cherry picked from commit a3ce062)
  • Loading branch information
sergey-safarov committed Oct 24, 2019
1 parent b40d13d commit dc0d4f8
Showing 1 changed file with 60 additions and 13 deletions.
73 changes: 60 additions & 13 deletions pkg/kamailio/obs/kamailio.spec
Expand Up @@ -203,6 +203,32 @@
%bcond_without xmlrpc
%endif

%if 0%{?centos_ver} == 8
%define dist_name centos
%define dist_version %{?centos}
%define dist .el8.centos
%bcond_with cnxcc
%bcond_with dnssec
%bcond_with geoip
%bcond_without http_async_client
%bcond_without ims
%bcond_without jansson
%bcond_without json
%bcond_without lua
%bcond_without kazoo
%bcond_without memcached
%bcond_without mongodb
%bcond_without perl
%bcond_with phonenum
%bcond_without python3
%bcond_without rabbitmq
%bcond_with redis
%bcond_without ruby
%bcond_without sctp
%bcond_without websocket
%bcond_without xmlrpc
%endif

%if 0%{?suse_version}
%define dist_name opensuse
%define dist_version %{?suse_version}
Expand Down Expand Up @@ -278,6 +304,31 @@
%bcond_without xmlrpc
%endif

%if 0%{?rhel} == 8 && 0%{?centos_ver} != 8
%define dist_name rhel
%define dist_version %{?rhel}
%bcond_with cnxcc
%bcond_with dnssec
%bcond_with geoip
%bcond_with http_async_client
%bcond_with ims
%bcond_with jansson
%bcond_with json
%bcond_with lua
%bcond_with kazoo
%bcond_with memcached
%bcond_without mongodb
%bcond_without perl
%bcond_with phonenum
%bcond_with python3
%bcond_with rabbitmq
%bcond_with redis
%bcond_with ruby
%bcond_with sctp
%bcond_with websocket
%bcond_without xmlrpc
%endif

# Defining missing macros on RHEL/CentOS 6
%if 0%{?rhel} == 6
%define _rundir %{_localstatedir}/run
Expand Down Expand Up @@ -819,8 +870,8 @@ SIP Presence (and RLS, XCAP, etc) support for Kamailio.
%package python
Summary: Python extensions for Kamailio
Group: %{PKGGROUP}
Requires: python, kamailio = %ver
BuildRequires: python, python-devel
Requires: python2, kamailio = %ver
BuildRequires: python2, python2-devel
%if %{with python3}
%if 0%{?rhel} == 7
Requires: python36, kamailio = %ver
Expand All @@ -830,9 +881,6 @@ Requires: python3, kamailio = %ver
BuildRequires: python3, python3-devel
%endif
%endif
%if 0%{?fedora}
BuildRequires: python2-devel
%endif

%description python
Python extensions for Kamailio.
Expand All @@ -854,7 +902,7 @@ RabbitMQ module for Kamailio.
Summary: RADIUS modules for Kamailio
Group: %{PKGGROUP}
Requires: kamailio = %ver
%if 0%{?fedora} || 0%{?suse_version}
%if 0%{?fedora} || 0%{?suse_version} || 0%{?rhel} == 8
Requires: freeradius-client
BuildRequires: freeradius-client-devel
%else
Expand Down Expand Up @@ -997,8 +1045,8 @@ Send commands to statsd server.
%package sqlang
Summary: Squirrel Language (SQLang) for Kamailio
Group: %{PKGGROUP}
Requires: squirrel-libs, kamailio = %version
BuildRequires: squirrel-devel gcc-c++
Requires: kamailio = %version
BuildRequires: gcc-c++

%description sqlang
app_sqlang module for Kamailio.
Expand Down Expand Up @@ -1151,10 +1199,9 @@ UUID module for Kamailio.
sed -i -e 's:#!/usr/bin/python:#!%{__python2}:' utils/kamctl/dbtextdb/dbtextdb.py
%endif


%build
ln -s ../obs pkg/kamailio/%{dist_name}/%{dist_version}
%if 0%{?fedora} || 0%{?suse_version}
%if 0%{?fedora} || 0%{?suse_version} || 0%{?rhel} == 8
export FREERADIUS=1
%endif
make cfg prefix=/usr \
Expand All @@ -1166,7 +1213,7 @@ make cfg prefix=/usr \
make
make every-module skip_modules="app_mono db_cassandra db_oracle iptrtpproxy \
jabber ndb_cassandra osp" \
%if 0%{?fedora} || 0%{?suse_version}
%if 0%{?fedora} || 0%{?suse_version} || 0%{?rhel} == 8
FREERADIUS=1 \
%endif
group_include="kstandard kautheph kberkeley kcarrierroute \
Expand Down Expand Up @@ -1250,7 +1297,7 @@ rm -rf %{buildroot}
make install
make install-modules-all skip_modules="app_mono db_cassandra db_oracle \
iptrtpproxy jabber osp" \
%if 0%{?fedora} || 0%{?suse_version}
%if 0%{?fedora} || 0%{?suse_version} || 0%{?rhel} == 8
FREERADIUS=1 \
%endif
group_include="kstandard kautheph kberkeley kcarrierroute \
Expand Down Expand Up @@ -1360,7 +1407,7 @@ install -m644 pkg/kamailio/%{dist_name}/%{dist_version}/sipcapture.sysconfig \
%if 0%{?suse_version}
%py_compile -O %{buildroot}%{_libdir}/kamailio/kamctl/dbtextdb
%endif
%if 0%{?fedora}
%if 0%{?fedora} || 0%{?rhel} == 8
%py_byte_compile %{__python2} %{buildroot}%{_libdir}/kamailio/kamctl/dbtextdb
%endif

Expand Down

0 comments on commit dc0d4f8

Please sign in to comment.