diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2011-04-19 09:11:50 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2011-04-19 09:18:46 +0000 |
commit | 4e8b12d3f6298deff7893b9e13673058d029eb62 (patch) | |
tree | 7461a8d02aee51de13bc0233b089ab267198ec06 /testing/sems | |
parent | bd48ba5d5a0acc9688555721762769d797bda02c (diff) | |
download | aports-4e8b12d3f6298deff7893b9e13673058d029eb62.tar.bz2 aports-4e8b12d3f6298deff7893b9e13673058d029eb62.tar.xz |
testing/sems: remake of sems (1.3.1)
based on fedoras package and patches.
We split it in a similar way as fedora
Diffstat (limited to 'testing/sems')
13 files changed, 613 insertions, 0 deletions
diff --git a/testing/sems/APKBUILD b/testing/sems/APKBUILD new file mode 100644 index 000000000..046df3da4 --- /dev/null +++ b/testing/sems/APKBUILD @@ -0,0 +1,208 @@ +# Contributor: Francesco Colista <francesco.colista@gmail.com> +# Maintainer: Francesco Colista <francesco.colista@gmail.com> +pkgname=sems +pkgver=1.3.1 +pkgrel=0 +pkgdesc="SIP Express Media Server, an extensible SIP media server" +url="http://iptel.org/sems/" +arch="all" +license="GPLv2+" +pkgusers="sems" +pkggroups="sems" +install="$pkgname.pre-install" +makedepends="python-dev cmake bash openssl-dev + libsamplerate-dev spandsp-dev flite-dev gsm-dev speex-dev + " +subpackages="$pkgname-doc $pkgname-conf_auth $pkgname-conference + $pkgname-diameter_client $pkgname-dsm $pkgname-early_announce + $pkgname-g722 $pkgname-gsm $pkgname-ivr $pkgname-mailbox + $pkgname-pin_collect $pkgname-speex + $pkgname-xmlrpc2di" + +source="http://ftp.iptel.org/pub/sems/sems-$pkgver.tar.gz + sems-0001-Force-to-use-system-wide-GSM-includes.patch + sems-0002-Allow-rewrite-of-custom-makefiles-by-CMake.patch + sems-0003-Set-CFG_PREFIX-to-empty-string-by-default.patch + sems-0005-Add-sw_prepaid_sip-plugin-to-default-exclude-list-du.patch + sems-0006-last-minute-fix-proper-version.patch + sems-0007-Fix-gateway-module-s-version-passing-in-CMake.patch + sems-0008-Install-email-template.patch + sems-0009-Don-t-start-py_sems-by-default.patch + sems-0010-Move-CMake-defines.patch + sems-0011-Avoid-using-private-Glibc-functions.patch + + sems.initd + " + +_builddir="$srcdir/$pkgname-$pkgver" +prepare() { + cd "$_builddir" + rm -rf core/plug-in/gsm/gsm-1.0-pl10/ + for i in $source; do + case $i in + *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;; + esac + done +} + + +build() { + cd "$_builddir" + cmake \ + -DSEMS_USE_SPANDSP=yes \ + -DSEMS_USE_LIBSAMPLERATE=yes \ + -DSEMS_USE_ZRTP=NO \ + -DSEMS_USE_MP3=NO \ + -DSEMS_USE_ILBC=NO \ + -DSEMS_USE_TTS=yes \ + -DSEMS_USE_OPENSSL=yes \ + -DSEMS_USE_MONITORING=yes \ + -DSEMS_USE_IPV6=yes \ + -DSEMS_CFG_PREFIX= \ + -DSEMS_AUDIO_PREFIX=/usr/share \ + -DSEMS_EXEC_PREFIX=/usr \ + -DSEMS_LIBDIR=lib \ + || return 1 + make +} + +package() { + cd "$_builddir" + make install DESTDIR="$pkgdir" + install -m755 -D "$srcdir"/$pkgname.initd \ + "$pkgdir"/etc/init.d/$pkgname || return 1 + # is empty + rm -f "$pkgdir"/etc/sems/etc/conf_auth.conf + + install -o sems -g sems -d "$pkgdir"/var/spool/voicebox +} + +_mv_sub() { + local i + for i in "$@"; do + mkdir -p "$subpkgdir"/${i%/*} + mv "$pkgdir"/$i "$subpkgdir"/$i + done +} + +conf_auth() { + pkgdesc="Conference with authorization for SEMS" + depends="sems sems-ivr" + cd "$pkgdir" + _mv_sub usr/lib/sems/ivr/conf_auth* +} + +conference() { + pkgdesc="Conferencing application for SEMS" + depends="sems" + cd "$pkgdir" + _mv_sub etc/sems/etc/conference.conf \ + usr/lib/sems/plug-in/conference.so \ + usr/share/sems/audio/conference +} + +diameter_client() { + pkgdesc="A simple DIAMETER client implementation for SEMS" + depends="sems" + cd "$pkgdir" + _mv_sub usr/lib/sems/plug-in/diameter_client.so +} + +dsm() { + pkgdesc="The state machine interpreter for SEMS" + depends="sems" + cd "$pkgdir" + _mv_sub etc/sems/etc/dsm* \ + usr/lib/sems/plug-in/dsm.so \ + usr/lib/sems/dsm +} + +early_announce() { + pkgdesc="Early announce application for SEMS" + depends="sems" + cd "$pkgdir" + _mv_sub etc/sems/etc/early_announce.conf \ + usr/lib/sems/plug-in/early_announce.so +} + +g722() { + pkgdesc="G.722 support for SEMS" + depends="sems" + _mv_sub usr/lib/sems/plug-in/g722.so +} + +#gateway() { +# pkgdesc="ISDN gateway for SEMS" +# depends="sems" +#} + +gsm() { + pkgdesc="GSM support for SEMS" + depends="sems" + _mv_sub usr/lib/sems/plug-in/gsm.so +} + +ivr() { + pkgdesc="IVR functionallity for SEMS" + depends="sems python" + cd "$pkgdir" + _mv_sub etc/sems/etc/ivr.conf \ + usr/lib/sems/plug-in/ivr.so \ + usr/lib/sems/ivr/log.* +} + +mailbox() { + pkgdesc="Mailbox application for SEMS" + depends="sems sems-ivr" + cd "$pkgdir" + _mv_sub etc/sems/etc/mailbox*.conf \ + usr/share/sems/audio/mailbox \ + usr/lib/sems/plug-in/ivr.so \ + usr/lib/sems/ivr/*mailbox* +} + +pin_collect() { + pkgdesc="Collects a PIN for SEMS" + depends="sems sems-ivr" + cd "$pkgdir" + _mv_sub etc/sems/etc/pin_collect.conf \ + usr/share/sems/audio/pin_collect \ + usr/lib/sems/plug-in/ivr.so \ + usr/lib/sems/ivr/pin_collect* +} + +_python() { + pkgdesc="Python bindings for SEMS" + depends="python sems" + cd "$pkgdir" + _mv_sub \ + usr/lib/sems/plug-in/py_sems* +} + +speex() { + pkgdesc="Speex support for SEMS" + depends="sems" + _mv_sub usr/lib/sems/plug-in/speex.so +} + +xmlrpc2di() { + pkgdesc="XMLRPC interface for SEMS" + depends="sems" + _mv_sub \ + etc/sems/etc/xmlrpc2di.conf \ + usr/lib/sems/plug-in/xmlrpc2di.so +} + + +md5sums="2bc516670bd2c743d416160b69281665 sems-1.3.1.tar.gz +5b2fded836b44bda33f39adc37de4de7 sems-0001-Force-to-use-system-wide-GSM-includes.patch +b8efd1a6415afa08f7c676f6976fca36 sems-0002-Allow-rewrite-of-custom-makefiles-by-CMake.patch +331e7529833c906b4738006f32a65fde sems-0003-Set-CFG_PREFIX-to-empty-string-by-default.patch +36dcb80c802008bce3d4e8150dc9de5f sems-0005-Add-sw_prepaid_sip-plugin-to-default-exclude-list-du.patch +655aa414e940cbb6d1cccb412b3e6be0 sems-0006-last-minute-fix-proper-version.patch +2b14acc145c4f6934b8575ffaea68d75 sems-0007-Fix-gateway-module-s-version-passing-in-CMake.patch +5f3cad3b3c4d1c304a179614b3fa73ca sems-0008-Install-email-template.patch +5f3fd79c9fcdb17b29288c215089c288 sems-0009-Don-t-start-py_sems-by-default.patch +b24c336e00671c71e9b96f38c730271d sems-0010-Move-CMake-defines.patch +bf4070f110489ef21540b009347fcd81 sems-0011-Avoid-using-private-Glibc-functions.patch +36c2f993ba874781f5d3974b4f4c1503 sems.initd" diff --git a/testing/sems/sems-0001-Force-to-use-system-wide-GSM-includes.patch b/testing/sems/sems-0001-Force-to-use-system-wide-GSM-includes.patch new file mode 100644 index 000000000..d09b79339 --- /dev/null +++ b/testing/sems/sems-0001-Force-to-use-system-wide-GSM-includes.patch @@ -0,0 +1,26 @@ +From de3c54f85f893e4ee985b1da93cc014b00456fa8 Mon Sep 17 00:00:00 2001 +From: Peter Lemenkov <lemenkov@gmail.com> +Date: Wed, 31 Mar 2010 11:52:52 +0400 +Subject: [PATCH 01/11] Force to use system-wide GSM includes + +Signed-off-by: Peter Lemenkov <lemenkov@gmail.com> +--- + core/plug-in/gsm/gsm.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/core/plug-in/gsm/gsm.c b/core/plug-in/gsm/gsm.c +index 286a989..3517e59 100644 +--- a/core/plug-in/gsm/gsm.c ++++ b/core/plug-in/gsm/gsm.c +@@ -27,7 +27,7 @@ + + #include "amci.h" + #include "codecs.h" +-#include "gsm-1.0-pl10/inc/gsm.h" ++#include <gsm.h> + #include "../../log.h" + + #include <stdlib.h> +-- +1.7.3.4 + diff --git a/testing/sems/sems-0002-Allow-rewrite-of-custom-makefiles-by-CMake.patch b/testing/sems/sems-0002-Allow-rewrite-of-custom-makefiles-by-CMake.patch new file mode 100644 index 000000000..0cfeab8c8 --- /dev/null +++ b/testing/sems/sems-0002-Allow-rewrite-of-custom-makefiles-by-CMake.patch @@ -0,0 +1,33 @@ +From 26929b6a7a62299b71bf7c99f17f75670a2040e2 Mon Sep 17 00:00:00 2001 +From: Peter Lemenkov <lemenkov@gmail.com> +Date: Wed, 31 Mar 2010 11:53:48 +0400 +Subject: [PATCH 02/11] Allow rewrite of custom makefiles by CMake + +Signed-off-by: Peter Lemenkov <lemenkov@gmail.com> +--- + CMakeLists.txt | 9 --------- + 1 files changed, 0 insertions(+), 9 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index a6ff425..ef3934e 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -26,15 +26,6 @@ ELSE(IS_DEVEL) + ENDIF(IS_DEVEL) + MESSAGE(STATUS "Configuring ${CMAKE_PROJECT_NAME} v. ${SEMS_VERSION}") + +-IF(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR AND NOT MSVC_IDE) +- message(FATAL_ERROR "In-source builds are not allowed. +-CMake would overwrite all makefiles distributed with SEMS. +-Please create a directory and run cmake from there, passing the path +-to this source directory as the last argument. +-This process created the file `CMakeCache.txt' and the directory `CMakeFiles'. +-Please delete them.") +-ENDIF(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR AND NOT MSVC_IDE) +- + OPTION(SEMS_USE_SPANDSP "Build with spandsp" OFF) + OPTION(SEMS_USE_LIBSAMPLERATE "Build with libsamplerate" OFF) + OPTION(SEMS_USE_ZRTP "Build with ZRTP" OFF) +-- +1.7.3.4 + diff --git a/testing/sems/sems-0003-Set-CFG_PREFIX-to-empty-string-by-default.patch b/testing/sems/sems-0003-Set-CFG_PREFIX-to-empty-string-by-default.patch new file mode 100644 index 000000000..df0a5ad40 --- /dev/null +++ b/testing/sems/sems-0003-Set-CFG_PREFIX-to-empty-string-by-default.patch @@ -0,0 +1,26 @@ +From e322f2e00e48b639b5d87ed06738aa24d99396bf Mon Sep 17 00:00:00 2001 +From: Peter Lemenkov <lemenkov@gmail.com> +Date: Wed, 31 Mar 2010 18:56:39 +0400 +Subject: [PATCH 03/11] Set CFG_PREFIX to empty string by default + +Signed-off-by: Peter Lemenkov <lemenkov@gmail.com> +--- + CMakeLists.txt | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index ef3934e..c36ce62 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -48,7 +48,7 @@ ENDIF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} STREQUAL "2.4") + SET(CMAKE_DL_LIBS ${CMAKE_DL_LIBS} m pthread) + + IF (NOT SEMS_CFG_PREFIX) +- SET(SEMS_CFG_PREFIX "/usr/local") ++ SET(SEMS_CFG_PREFIX "") + ENDIF (NOT SEMS_CFG_PREFIX) + MESSAGE(STATUS "SEMS cfg prefix was set to: ${SEMS_CFG_PREFIX}") + +-- +1.7.3.4 + diff --git a/testing/sems/sems-0005-Add-sw_prepaid_sip-plugin-to-default-exclude-list-du.patch b/testing/sems/sems-0005-Add-sw_prepaid_sip-plugin-to-default-exclude-list-du.patch new file mode 100644 index 000000000..38807cb77 --- /dev/null +++ b/testing/sems/sems-0005-Add-sw_prepaid_sip-plugin-to-default-exclude-list-du.patch @@ -0,0 +1,26 @@ +From 2f0556c126f2cae0edec32b0fd269d496dd068f6 Mon Sep 17 00:00:00 2001 +From: Peter Lemenkov <lemenkov@gmail.com> +Date: Mon, 27 Sep 2010 14:13:00 +0400 +Subject: [PATCH 05/11] Add sw_prepaid_sip plugin to default exclude list (due to missing cc_acc) + +Signed-off-by: Peter Lemenkov <lemenkov@gmail.com> +--- + core/etc/sems.conf.cmake | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/core/etc/sems.conf.cmake b/core/etc/sems.conf.cmake +index 65d8534..eeeeb67 100644 +--- a/core/etc/sems.conf.cmake ++++ b/core/etc/sems.conf.cmake +@@ -140,7 +140,7 @@ plugin_path=${SEMS_EXEC_PREFIX}/${SEMS_LIBDIR}/sems/plug-in/ + # + # o binrpcctrl and unixsockctrl: excluded as sipctrl is default ctrl + # o precoded_announce: no precoded sample files present +-exclude_plugins=binrpcctrl;unixsockctrl;precoded_announce ++exclude_plugins=binrpcctrl;unixsockctrl;precoded_announce;sw_prepaid_sip + + # optional parameter: application + # +-- +1.7.3.4 + diff --git a/testing/sems/sems-0006-last-minute-fix-proper-version.patch b/testing/sems/sems-0006-last-minute-fix-proper-version.patch new file mode 100644 index 000000000..8d04ed8d3 --- /dev/null +++ b/testing/sems/sems-0006-last-minute-fix-proper-version.patch @@ -0,0 +1,26 @@ +From 708b02d96f4a4acb7c4ede0387a84d2f5948e0db Mon Sep 17 00:00:00 2001 +From: Peter Lemenkov <lemenkov@gmail.com> +Date: Mon, 27 Dec 2010 17:18:46 +0300 +Subject: [PATCH 06/11] last-minute fix - proper version + +Signed-off-by: Peter Lemenkov <lemenkov@gmail.com> +--- + CMakeLists.txt | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c36ce62..78a6dfb 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -13,7 +13,7 @@ PROJECT (SEMS) + + SET(SEMS_MAJOR_VERSION 1) + SET(SEMS_MINOR_VERSION 3) +-SET(SEMS_BUILD_VERSION 0) ++SET(SEMS_BUILD_VERSION 1) + SET(SEMS_EXTRA_VERSION dev) + + FIND_PATH(IS_DEVEL ".git" PATHS "${CMAKE_SOURCE_DIR}") +-- +1.7.3.4 + diff --git a/testing/sems/sems-0007-Fix-gateway-module-s-version-passing-in-CMake.patch b/testing/sems/sems-0007-Fix-gateway-module-s-version-passing-in-CMake.patch new file mode 100644 index 000000000..a36628f14 --- /dev/null +++ b/testing/sems/sems-0007-Fix-gateway-module-s-version-passing-in-CMake.patch @@ -0,0 +1,26 @@ +From 7f2c45fc1e9c2c1900244709abfa125c9b7e5755 Mon Sep 17 00:00:00 2001 +From: Peter Lemenkov <lemenkov@gmail.com> +Date: Wed, 29 Dec 2010 16:02:44 +0300 +Subject: [PATCH 07/11] Fix gateway module's version passing in CMake + +Signed-off-by: Peter Lemenkov <lemenkov@gmail.com> +--- + apps/gateway/CMakeLists.txt | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/apps/gateway/CMakeLists.txt b/apps/gateway/CMakeLists.txt +index e18389a..ef0acde 100644 +--- a/apps/gateway/CMakeLists.txt ++++ b/apps/gateway/CMakeLists.txt +@@ -6,7 +6,7 @@ mISDNNames.cpp + mISDNStack.cpp + ) + +-ADD_DEFINITIONS(-DGW_VERSION="0.1") ++ADD_DEFINITIONS(-DGW_VERSION=\\\"0.1\\\") + INCLUDE_DIRECTORIES(${MISDN_INCLUDE_DIR}/mISDNuser) + + SET(sems_module_name gateway) +-- +1.7.3.4 + diff --git a/testing/sems/sems-0008-Install-email-template.patch b/testing/sems/sems-0008-Install-email-template.patch new file mode 100644 index 000000000..3eaf04927 --- /dev/null +++ b/testing/sems/sems-0008-Install-email-template.patch @@ -0,0 +1,25 @@ +From 57e8f6ccdf5335207f7017414487db6bf81a64f3 Mon Sep 17 00:00:00 2001 +From: Peter Lemenkov <lemenkov@gmail.com> +Date: Wed, 29 Dec 2010 16:55:50 +0300 +Subject: [PATCH 08/11] Install email template + +Signed-off-by: Peter Lemenkov <lemenkov@gmail.com> +--- + apps/voicemail/CMakeLists.txt | 4 ++++ + 1 files changed, 4 insertions(+), 0 deletions(-) + +diff --git a/apps/voicemail/CMakeLists.txt b/apps/voicemail/CMakeLists.txt +index b82736f..38778bc 100644 +--- a/apps/voicemail/CMakeLists.txt ++++ b/apps/voicemail/CMakeLists.txt +@@ -25,3 +25,7 @@ SET(sems_module_name voicemail) + INCLUDE(${CMAKE_SOURCE_DIR}/cmake/module.rules.txt) + INCLUDE(${CMAKE_SOURCE_DIR}/cmake/audio.rules.txt) + INCLUDE(${CMAKE_SOURCE_DIR}/cmake/config.rules.txt) ++ ++INSTALL( ++ FILES ./default.template DESTINATION ${SEMS_CFG_PREFIX}/etc/sems/ ++) +-- +1.7.3.4 + diff --git a/testing/sems/sems-0009-Don-t-start-py_sems-by-default.patch b/testing/sems/sems-0009-Don-t-start-py_sems-by-default.patch new file mode 100644 index 000000000..ef3b946b0 --- /dev/null +++ b/testing/sems/sems-0009-Don-t-start-py_sems-by-default.patch @@ -0,0 +1,26 @@ +From 8712daf57f4ec10caadd215dc969b1f261a949b5 Mon Sep 17 00:00:00 2001 +From: Peter Lemenkov <lemenkov@gmail.com> +Date: Wed, 29 Dec 2010 17:02:49 +0300 +Subject: [PATCH 09/11] Don't start py_sems by default + +Signed-off-by: Peter Lemenkov <lemenkov@gmail.com> +--- + core/etc/sems.conf.cmake | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/core/etc/sems.conf.cmake b/core/etc/sems.conf.cmake +index eeeeb67..0e0ca62 100644 +--- a/core/etc/sems.conf.cmake ++++ b/core/etc/sems.conf.cmake +@@ -140,7 +140,7 @@ plugin_path=${SEMS_EXEC_PREFIX}/${SEMS_LIBDIR}/sems/plug-in/ + # + # o binrpcctrl and unixsockctrl: excluded as sipctrl is default ctrl + # o precoded_announce: no precoded sample files present +-exclude_plugins=binrpcctrl;unixsockctrl;precoded_announce;sw_prepaid_sip ++exclude_plugins=binrpcctrl;unixsockctrl;precoded_announce;sw_prepaid_sip;py_sems + + # optional parameter: application + # +-- +1.7.3.4 + diff --git a/testing/sems/sems-0010-Move-CMake-defines.patch b/testing/sems/sems-0010-Move-CMake-defines.patch new file mode 100644 index 000000000..be1b8be7a --- /dev/null +++ b/testing/sems/sems-0010-Move-CMake-defines.patch @@ -0,0 +1,66 @@ +From c6fe28de4a05e33c317019261711f2babe98b95d Mon Sep 17 00:00:00 2001 +From: Peter Lemenkov <lemenkov@gmail.com> +Date: Mon, 3 Jan 2011 22:16:24 +0300 +Subject: [PATCH 10/11] Move CMake defines + +Signed-off-by: Peter Lemenkov <lemenkov@gmail.com> +--- + CMakeLists.txt | 3 +++ + core/CMakeLists.txt | 6 ------ + 2 files changed, 3 insertions(+), 6 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 78a6dfb..fdc88f4 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -80,6 +80,7 @@ SET(CMAKE_VERBOSE_MAKEFILE ON) + # (which means that current debian and gentoo packages don't work) + IF(SEMS_USE_SPANDSP) + FIND_PACKAGE(Spandsp REQUIRED) ++ ADD_DEFINITIONS(-DUSE_SPANDSP -D__STDC_LIMIT_MACROS) + MESSAGE(STATUS "Using spandsp: YES") + ELSE(SEMS_USE_SPANDSP) + MESSAGE(STATUS "Using spandsp: NO (default)") +@@ -89,6 +90,7 @@ ENDIF(SEMS_USE_SPANDSP) + # (see http://www.mega-nerd.com/SRC/) + IF(SEMS_USE_LIBSAMPLERATE) + FIND_PACKAGE(Libsamplerate REQUIRED) ++ ADD_DEFINITIONS(-DUSE_LIBSAMPLERATE) + MESSAGE(STATUS "Using libsamplerate: YES") + ELSE(SEMS_USE_LIBSAMPLERATE) + MESSAGE(STATUS "Using libsamplerate: NO (default)") +@@ -128,6 +130,7 @@ ELSE(SEMS_USE_MONITORING) + ENDIF(SEMS_USE_MONITORING) + + IF(SEMS_USE_IPV6) ++ ADD_DEFINITIONS(-DSUPPORT_IPV6) + MESSAGE(STATUS "Enable IPv6 support: YES") + ELSE(SEMS_USE_IPV6) + MESSAGE(STATUS "Enable IPv6 support: NO (default)") +diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt +index 7bd1341..5f0fb3f 100644 +--- a/core/CMakeLists.txt ++++ b/core/CMakeLists.txt +@@ -18,19 +18,13 @@ ENDIF(NOT MAX_RTP_SESSIONS) + ADD_DEFINITIONS(-DMAX_RTP_SESSIONS=${MAX_RTP_SESSIONS}) + + IF(SPANDSP_FOUND) +- ADD_DEFINITIONS(-DUSE_SPANDSP -D__STDC_LIMIT_MACROS) + TARGET_LINK_LIBRARIES(sems ${CMAKE_DL_LIBS} spandsp) + ENDIF(SPANDSP_FOUND) + + IF(LIBSAMPLERATE_FOUND) +- ADD_DEFINITIONS(-DUSE_LIBSAMPLERATE) + TARGET_LINK_LIBRARIES(sems ${CMAKE_DL_LIBS} samplerate) + ENDIF(LIBSAMPLERATE_FOUND) + +-IF(SEMS_USE_IPV6) +- ADD_DEFINITIONS(-DSUPPORT_IPV6) +-ENDIF(SEMS_USE_IPV6) +- + ADD_SUBDIRECTORY(plug-in) + + # Create config-file from template +-- +1.7.3.4 + diff --git a/testing/sems/sems-0011-Avoid-using-private-Glibc-functions.patch b/testing/sems/sems-0011-Avoid-using-private-Glibc-functions.patch new file mode 100644 index 000000000..048a0a9ba --- /dev/null +++ b/testing/sems/sems-0011-Avoid-using-private-Glibc-functions.patch @@ -0,0 +1,67 @@ +From fb437ef493d6023e936bd55088df7e6d99452cfb Mon Sep 17 00:00:00 2001 +From: Peter Lemenkov <lemenkov@gmail.com> +Date: Tue, 4 Jan 2011 22:34:03 +0300 +Subject: [PATCH 11/11] Avoid using private Glibc functions + +Signed-off-by: Peter Lemenkov <lemenkov@gmail.com> +--- + core/sip/resolver.cpp | 33 +++++++++++++++++++++++++++------ + 1 files changed, 27 insertions(+), 6 deletions(-) + +diff --git a/core/sip/resolver.cpp b/core/sip/resolver.cpp +index e3443c7..3b3e4a6 100644 +--- a/core/sip/resolver.cpp ++++ b/core/sip/resolver.cpp +@@ -54,6 +54,27 @@ using std::list; + // (the limit is the # bits in dns_handle::srv_used) + #define MAX_SRV_RR (sizeof(unsigned int)*8) + ++/* The SEMS_GET16 macro and the sems_get16 function were copied from glibc 2.7 ++ * (include/arpa/nameser.h (NS_GET16) and resolv/ns_netint.c (ns_get16)) to ++ * avoid using private glibc functions. ++ */ ++ ++# define SEMS_GET16(s, cp) \ ++ do { \ ++ uint16_t *t_cp = (uint16_t *) (cp); \ ++ (s) = ntohs (*t_cp); \ ++ (cp) += NS_INT16SZ; \ ++} while (0) ++ ++u_int ++sems_get16(const u_char *src) ++{ ++ u_int dst; ++ ++ SEMS_GET16(dst, src); ++ return (dst); ++} ++ + struct ip_entry + : public dns_base_entry + { +@@ -399,15 +420,15 @@ dns_base_entry* dns_srv_entry::get_rr(dns_record* rr, u_char* begin, u_char* end + DBG("SRV:\tTTL=%i\t%s\tP=<%i> W=<%i> P=<%i> T=<%s>\n", + ns_rr_ttl(*rr), + ns_rr_name(*rr), +- ns_get16(rdata), +- ns_get16(rdata+2), +- ns_get16(rdata+4), ++ sems_get16(rdata), ++ sems_get16(rdata+2), ++ sems_get16(rdata+4), + name_buf); + + srv_entry* srv_r = new srv_entry(); +- srv_r->p = ns_get16(rdata); +- srv_r->w = ns_get16(rdata+2); +- srv_r->port = ns_get16(rdata+4); ++ srv_r->p = sems_get16(rdata); ++ srv_r->w = sems_get16(rdata+2); ++ srv_r->port = sems_get16(rdata+4); + srv_r->target = (const char*)name_buf; + + return srv_r; +-- +1.7.3.4 + diff --git a/testing/sems/sems.initd b/testing/sems/sems.initd new file mode 100755 index 000000000..3b6973b55 --- /dev/null +++ b/testing/sems/sems.initd @@ -0,0 +1,48 @@ +#!/sbin/runscript +# SIP Express Media Server configuration file +# Follows Gentoo/AlpineLinux standards +# GPL 2 License - N. Angelacos 2011 + +SVC="${SVCNAME#*.}" +SEMS_CFG_FILE=${SEMS_CFG_FILE:-/etc/sems/${SVC}.conf} +SEMS_PIDDIR=/var/run/sems +SEMS_PIDFILE=${SEMS_PIDFILE:-${SEMS_PIDDIR}/${SVC}.pid} +SEMS_BINARY=${SEMS_BINARY:-/usr/sbin/sems} +SEMS_USER=${SEMS_USER:-sems} +SEMS_GROUP=${SEMS_GROUP:-sems} + +checkconfig() { + if [ ! -f "${SEMS_CFG_FILE}" ] ; then + eerror "You need a "${SEMS_CFG_FILE}" file to run sems" + return 1; + fi +} + + +start() { + checkconfig || return 1 + ebegin "Starting ${SVCNAME}" + mkdir -p "${SEMS_PIDDIR}" + chown ${SEMS_USER}:${SEMS_GROUP} "${SEMS_PIDDIR}" + + start-stop-daemon --start --exec "${SEMS_BINARY}" \ + --pidfile "${SEMS_PIDFILE}" \ + --wait ${SEMS_WAIT:-500} \ + -- \ + -f "${SEMS_CFG_FILE}" \ + -P "${SEMS_PIDFILE}" \ + -u "${SEMS_USER}" \ + -g "${SEMS_GROUP}" + eend $? +} + +stop() { + if [ "${RC_CMD}" = "restart" ] ; then + checkconfig || return 1 + fi + + ebegin "Stopping ${SVCNAME}" + start-stop-daemon --stop --exec "${SEMS_BINARY}" \ + --pidfile "${SEMS_PIDFILE}" --quiet + eend $? +} diff --git a/testing/sems/sems.pre-install b/testing/sems/sems.pre-install new file mode 100644 index 000000000..f12669408 --- /dev/null +++ b/testing/sems/sems.pre-install @@ -0,0 +1,10 @@ +#!/bin/sh + +if ! getent group sems >/dev/null; then + addgroup -S sems +fi +if ! getent passwd sems >/dev/null; then + adduser -S -H -h /var/empty -s /bin/false -D -G sems sems 2>/dev/null +fi + +exit 0 |