aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorLeo <thinkabit.ukim@gmail.com>2020-01-21 08:06:23 +0100
committerLeo <thinkabit.ukim@gmail.com>2020-01-21 08:27:04 +0100
commit15f290c5527418c9f83f25241dd087ef9c8cb0aa (patch)
tree9482efd9d5f3ea9a2024da71469af8ef63cea011 /main
parentf394160245d03b0794977b24652abb0da1a2a64d (diff)
downloadaports-15f290c5527418c9f83f25241dd087ef9c8cb0aa.tar.bz2
aports-15f290c5527418c9f83f25241dd087ef9c8cb0aa.tar.xz
main/kamailio: drop python2, modernize
Diffstat (limited to 'main')
-rw-r--r--main/kamailio/APKBUILD77
1 files changed, 32 insertions, 45 deletions
diff --git a/main/kamailio/APKBUILD b/main/kamailio/APKBUILD
index 31cf8e0832..772ce0243c 100644
--- a/main/kamailio/APKBUILD
+++ b/main/kamailio/APKBUILD
@@ -5,16 +5,16 @@
pkgname=kamailio
pkgver=5.2.5
-pkgrel=1
+pkgrel=2
# If building from a git snapshot, specify the gitcommit
# If building a proper release, leave gitcommit blank
#_gitcommit=991fe9b28e0e201309048f3b38a135037e40357a
-[ ! -z "${_gitcommit}" ] && pkgver="${pkgver}.$(date +%Y%m%d)"
-[ ! -z "${_gitcommit}" ] && _suffix="-${_gitcommit:0:7}"
-[ ! -z "${_gitcommit}" ] && builddir="$srcdir/$pkgname-$_gitcommit" || builddir="$srcdir/$pkgname-$pkgver"
-[ -z "${_gitcommit}" ] && _gitcommit="${pkgver}"
+[ ! -z "$_gitcommit" ] && pkgver="$pkgver.$(date +%Y%m%d)"
+[ ! -z "$_gitcommit" ] && _suffix="-${_gitcommit:0:7}"
+[ ! -z "$_gitcommit" ] && builddir="$srcdir/$pkgname-$_gitcommit" || builddir="$srcdir/$pkgname-$pkgver"
+[ -z "$_gitcommit" ] && _gitcommit="$pkgver"
pkgdesc="Open Source SIP Server"
url="http://www.kamailio.org/"
@@ -25,7 +25,7 @@ arch="all"
license="GPL-2.0-or-later"
depends="gawk"
makedepends="bison db-dev flex freeradius-client-dev expat-dev
- lksctp-tools-dev perl-dev postgresql-dev python2-dev python3-dev
+ lksctp-tools-dev perl-dev postgresql-dev python3-dev
pcre-dev mariadb-dev libxml2-dev curl-dev unixodbc-dev
confuse-dev ncurses-dev sqlite-dev lua-dev openldap-dev openssl-dev
net-snmp-dev libuuid libev-dev jansson-dev json-c-dev libevent-dev
@@ -161,9 +161,6 @@ _mod_list_lua="app_lua"
# - modules depending on perl library
_mod_list_perl="app_perl db_perlvdb"
-# - modules depending on python2 library
-_mod_list_python="app_python"
-
# - modules depending on python3 libarary
_mod_list_python3="app_python3"
@@ -251,14 +248,14 @@ for _i in db postgres sqlite dbtext mysql \
ldap utils tls presence lua ims outbound debugger \
extras json websocket authephemeral \
uuid ev memcached redis geoip2 jansson sqlang sipdump \
- jsdt http_async kazoo rabbitmq sctp radius perl python \
- python3 ruby; do
+ jsdt http_async kazoo rabbitmq sctp radius perl python3 \
+ ruby; do
- subpackages="$subpackages $pkgname-$_i"
- eval "_modules=\"\$_modules \$_mod_list_$_i\""
+ subpackages="$subpackages $pkgname-$_i"
+ eval "_modules=\"\$_modules \$_mod_list_$_i\""
done
-source="${pkgname}-${pkgver}${_suffix}.tar.gz::https://github.com/kamailio/$pkgname/archive/$_gitcommit.tar.gz
+source="kamailio-${pkgver}$_suffix.tar.gz::https://github.com/kamailio/kamailio/archive/$_gitcommit.tar.gz
0001-mohqueue.patch
0004-src_core_tcp_read_c.patch
dont-force-mips-revision.patch
@@ -266,27 +263,23 @@ source="${pkgname}-${pkgver}${_suffix}.tar.gz::https://github.com/kamailio/$pkgn
"
snapshot() {
- if [ ! -f "$SRCDEST"/${pkgname}-${pkgver}${_suffix}.tar.gz ]; then
- wget -O "$SRCDEST"/${pkgname}-${pkgver}${_suffix}.tar.gz https://github.com/kamailio/$pkgname/archive/$_gitcommit.tar.gz
- fi
- SHA512SUM=$(sha512sum "$SRCDEST"/${pkgname}-${pkgver}${_suffix}.tar.gz | sed -e "s:$SRCDEST/::")
- sed -i -e "s/^\(sha512sums=.\).*/\1$SHA512SUM/" APKBUILD
+ if [ ! -f "$SRCDEST"/$pkgname-${pkgver}$_suffix.tar.gz ]; then
+ wget -O "$SRCDEST"/$pkgname-${pkgver}$_suffix.tar.gz https://github.com/kamailio/$pkgname/archive/$_gitcommit.tar.gz
+ fi
+ SHA512SUM=$(sha512sum "$SRCDEST"/$pkgname-${pkgver}$_suffix.tar.gz | sed -e "s:$SRCDEST/::")
+ sed -i -e "s/^\(sha512sums=.\).*/\1$SHA512SUM/" APKBUILD
}
prepare() {
default_prepare
- cd "$builddir"
-
cd utils/kamctl/
sed -i -e 's:/var/run/kamailio.pid:/var/run/kamailio/kamailio.pid:g' \
- kamctl.base kamctlrc || return 1
+ kamctl.base kamctlrc
# we actually dont need bash
- sed -i -e 's:/bin/bash:/bin/sh:' kamctl kamdbctl \
- || return 1
+ sed -i -e 's:/bin/bash:/bin/sh:' kamctl kamdbctl
}
build() {
- cd "$builddir"
make FLAVOUR=kamailio STUN=1 \
PREFIX=/usr \
CC_EXTRA_OPTS="$CFLAGS -D_GNU_SOURCE" \
@@ -298,12 +291,11 @@ build() {
cfg_prefix="$pkgdir" \
cfg
make EMBEDDED_UTF8_DECODE=1 STUN=1 FREERADIUS=1 \
- all || return 1
+ all
}
package() {
- cd "$builddir"
- make FREERADIUS=1 -j1 install || return 1
+ make FREERADIUS=1 -j1 install
install -m755 -D "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
install -d -o kamailio "$pkgdir"/var/run/kamailio
@@ -313,7 +305,7 @@ _mv_mod() {
local moddir=usr/lib/kamailio/modules i=
mkdir -p "$subpkgdir"/$moddir
for i in $@; do
- mv "$pkgdir"/$moddir/$i.so "$subpkgdir"/$moddir/ || return 1
+ mv "$pkgdir"/$moddir/$i.so "$subpkgdir"/$moddir/
done
}
@@ -327,13 +319,13 @@ _generic_pkg() {
_db_driver() {
pkgdesc="Database drivers for $1"
depends="$pkgname $pkgname-db"
- _mv_mod db_$2 || return 1
+ _mv_mod db_$2
mkdir -p "$subpkgdir"/usr/share/kamailio \
"$subpkgdir"/usr/lib/kamailio/kamctl
mv "$pkgdir"/usr/share/kamailio/$3 \
- "$subpkgdir"/usr/share/kamailio/ || return 1
+ "$subpkgdir"/usr/share/kamailio/
mv "$pkgdir"/usr/lib/kamailio/kamctl/*.$4 \
- "$subpkgdir"/usr/lib/kamailio/kamctl/ || return 1
+ "$subpkgdir"/usr/lib/kamailio/kamctl/
}
@@ -354,13 +346,13 @@ sqlite() {
}
dbtext() {
- _db_driver DBText text dbtext dbtext || return 1
+ _db_driver DBText text dbtext dbtext
# kamdbctl.dbtext is a python script - but we will not make python
# a dependency because kamdbctl is not normaly used
depends="$depends"
- mkdir -p "$subpkgdir"/usr/lib/kamailio/kamctl || return 1
+ mkdir -p "$subpkgdir"/usr/lib/kamailio/kamctl
mv "$pkgdir"/usr/lib/kamailio/kamctl/dbtextdb \
- "$subpkgdir"/usr/lib/kamailio/kamctl/ || return 1
+ "$subpkgdir"/usr/lib/kamailio/kamctl/
}
cpl() {
@@ -370,13 +362,13 @@ cpl() {
xml() {
_generic_pkg "XML related modules: $_mod_list_xml" \
- "$_mod_list_xml" || return 1
+ "$_mod_list_xml"
mkdir -p "$subpkgdir"/usr/share/kamailio
mv "$pkgdir"/usr/share/kamailio/xhttp_pi \
- "$subpkgdir"/usr/share/kamailio || return 1
+ "$subpkgdir"/usr/share/kamailio
mkdir -p "$subpkgdir"/etc/kamailio/
mv "$pkgdir"/etc/kamailio/pi_framework.xml \
- "$subpkgdir"/etc/kamailio || return 1
+ "$subpkgdir"/etc/kamailio
}
unixodbc() {
@@ -386,10 +378,10 @@ unixodbc() {
snmpstats() {
_generic_pkg "SNMP statistics support" \
- "$_mod_list_snmpstats" || return 1
+ "$_mod_list_snmpstats"
mkdir -p "$subpkgdir"/usr/share/snmp
mv "$builddir"/src/modules/snmpstats/mibs \
- "$subpkgdir"/usr/share/snmp/ || return 1
+ "$subpkgdir"/usr/share/snmp/
}
xmpp() {
@@ -528,11 +520,6 @@ perl() {
"$_mod_list_perl"
}
-python() {
- _generic_pkg "Execute embedded Python2 scripts" \
- "$_mod_list_python"
-}
-
python3() {
_generic_pkg "Execute embedded Python3 scripts" \
"$_mod_list_python3"