telephony/asterisk: Add a subpackage for Lua dialplan support, use

CONFIGURE_STYLE=autoreconf, explicitly set --with-foo=no for some of the
newer build options.
This commit is contained in:
sthen 2020-04-08 22:10:50 +00:00
parent 7bd6e62370
commit 1e8de19e94
5 changed files with 69 additions and 26 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.315 2020/03/29 15:42:27 sthen Exp $
# $OpenBSD: Makefile,v 1.316 2020/04/08 22:10:50 sthen Exp $
COMMENT-main= open source multi-protocol PBX and telephony toolkit
@ -7,6 +7,7 @@ PJ_V= 2.9
DISTNAME= asterisk-${VER:S/beta/-beta/:S/rc/-rc/}
DISTFILES= ${DISTNAME}${EXTRACT_SUFX} pjproject-${PJ_V}.tar.bz2:0
PKGNAME-main= asterisk-${VER}
REVISION-main= 0
.if ${MACHINE_ARCH} == i386
# i386 issue linking libasteriskpj.so.0.0:
@ -57,8 +58,8 @@ COMPILER= ports-gcc
SHARED_LIBS+= asteriskssl 0.0 # 1
SHARED_LIBS+= asteriskpj 0.0 # 2
MULTI_PACKAGES= -main -calendar -http_post -kqueue -ldap -odbc \
-pgsql -snmp -speex -tds
MULTI_PACKAGES= -main -calendar -http_post -kqueue -ldap -lua \
-odbc -pgsql -snmp -speex -tds
PSEUDO_FLAVORS= ${MULTI_PACKAGES:N-main:N-kqueue:C/-/no_/g}
LIB_DEPENDS-main= ${MODGCC4_CPPLIBDEP} \
@ -91,16 +92,17 @@ MASTER_SITES0= https://raw.githubusercontent.com/asterisk/third-party/master/pjp
USE_GMAKE= Yes
CONFIGURE_STYLE= gnu
CONFIGURE_STYLE= autoreconf
AUTORECONF= ./bootstrap.sh
AUTOCONF_VERSION= 2.69
AUTOMAKE_VERSION= 1.15
BUILD_DEPENDS+= ${MODGNU_AUTOCONF_DEPENDS} \
${MODGNU_AUTOMAKE_DEPENDS} \
archivers/bzip2 \
AUTOMAKE_VERSION= 1.16
BUILD_DEPENDS+= archivers/bzip2 \
devel/libtool,-ltdl # bogus dependencies in menuselect
CPPFLAGS+= -I${X11BASE}/include -I${LOCALBASE}/include
LDFLAGS+= -L${X11BASE}/lib -L${LOCALBASE}/lib
CPPFLAGS+= -I${X11BASE}/include \
-I${LOCALBASE}/include
LDFLAGS+= -L${X11BASE}/lib \
-L${LOCALBASE}/lib
CONFIGURE_ENV+= CPPFLAGS="${CPPFLAGS}" \
CFLAGS="${CFLAGS}" \
LDFLAGS="${LDFLAGS}" \
@ -121,32 +123,40 @@ CONFIGURE_ENV+= PJPROJECT_CONFIGURE_OPTS="--disable-bcg729"
MAKE_ENV= LOCALBASE="${LOCALBASE}"
CONFIGURE_ARGS+= --with-asound=no \
--with-bfd=no \
--with-bluetooth=no \
--with-cap=no \
--with-codec2=no \
--with-cpg=no \
--with-dahdi=no \
--with-avcodec=no \
--with-gtk2=no \
--with-h323=no \
--with-hoard=no \
--with-isdnnet=no \
--with-jack=no \
--with-misdn=no \
--with-nbs=no \
--with-newt=no \
--with-openr2=no \
--with-opus=no \
--with-opusfile=no \
--with-osptk=no \
--with-oss=no \
--with-beanstalk=no \
--with-portaudio=${LOCALBASE} \
--with-pri=no \
--with-pwlib=no \
--with-SDL_image=no \
--with-fftw3=no \
--with-resample=no \
--with-sndfile=no \
--with-sdl=no \
--with-SDL_image=no \
--with-sqlite=no \
--with-ss7=no \
--with-suppserv=no \
--with-tinfo=no \
--with-tonezone=no \
--with-vpb=no
CONFIGURE_ARGS+= --with-jack=no \
--with-lua=no \
--with-resample=no
# Some build options (including a useful malloc debug) are available
# via menuselect. They may be enabled by running 'make menuselect'
# before building.
@ -216,6 +226,21 @@ COMMENT-kqueue= kqueue-backed timer for Asterisk
LIB_DEPENDS-kqueue=
WANTLIB-kqueue= pthread
# lua
MODULES= lang/lua
MODLUA_SA= yes
MODLUA_RUNDEP= no
MODLUA_VERSION= 5.3
COMMENT-lua= lua support for Asterisk
LIB_DEPENDS-lua= ${MODLUA_LIB_DEPENDS}
WANTLIB-lua= ${MODLUA_WANTLIB} m pthread
.if !${BUILD_PACKAGES:M-lua}
CONFIGURE_ARGS+= --with-lua=no
MODLUA_BUILDDEP= no
.else
CONFIGURE_ARGS+= --with-lua
.endif
# odbc
COMMENT-odbc= ODBC support for Asterisk
LIB_DEPENDS-odbc= databases/iodbc
@ -283,13 +308,6 @@ post-patch:
cd ${WRKSRC}/third-party/pjproject/source; ../../apply_patches ../patches .
touch ${WRKSRC}/third-party/pjproject/source/.unpacked
do-gen:
@#for clang# sed -i.beforesubst -e 's, -ftrampolines,,' ${WRKSRC}/Makefile
cd ${WRKSRC}; \
AUTOMAKE_VERSION=${AUTOMAKE_VERSION} \
AUTOCONF_VERSION=${AUTOCONF_VERSION} \
./bootstrap.sh
menuselect: configure
@cd ${WRKSRC}; ${_PBUILD} ${MAKE_PROGRAM} menuselect

View File

@ -0,0 +1,20 @@
$OpenBSD: patch-configure_ac,v 1.52 2020/04/08 22:10:50 sthen Exp $
- cope with OpenBSD's nonstandard header location for Lua
Index: configure.ac
--- configure.ac.orig
+++ configure.ac
@@ -2538,10 +2538,10 @@ fi
AST_EXT_LIB_CHECK([OPUSFILE], [opusfile], [op_open_callbacks], [opus/opusfile.h], [], [$__opus_include])
for ver in 5.3 5.2 5.1; do
- AST_EXT_LIB_CHECK([LUA], lua${ver}, [luaL_newstate], lua${ver}/lua.h, [-lm])
+ AST_EXT_LIB_CHECK([LUA], lua${ver}, [luaL_newstate], lua-${ver}/lua.h, [-lm])
if test "x${PBX_LUA}" = "x1" ; then
if test x"${LUA_DIR}" = x; then
- LUA_INCLUDE="${LUA_INCLUDE} -I/usr/include/lua${ver}"
+ LUA_INCLUDE="${LUA_INCLUDE} -I/usr/local/include/lua-${ver}"
else
LUA_INCLUDE="${LUA_INCLUDE} -I${LUA_DIR}/lua${ver}"
fi

View File

@ -0,0 +1 @@
Lua dialplan support for Asterisk.

View File

@ -0,0 +1,5 @@
@comment $OpenBSD: PLIST-lua,v 1.1 2020/04/08 22:10:51 sthen Exp $
@conflict asterisk-<16.9.0p0
@so lib/asterisk/modules/pbx_lua.so
share/examples/asterisk/default/extensions.lua
@sample ${SYSCONFDIR}/asterisk/extensions.lua

View File

@ -1,4 +1,4 @@
@comment $OpenBSD: PLIST-main,v 1.84 2020/01/19 21:35:24 sthen Exp $
@comment $OpenBSD: PLIST-main,v 1.85 2020/04/08 22:10:51 sthen Exp $
@conflict asterisk-sounds-<=1.2.1p2
@conflict asterisk-curl-*
@conflict asterisk-fax-*
@ -684,7 +684,6 @@ share/examples/asterisk/default/extconfig.conf
@sample ${SYSCONFDIR}/asterisk/extconfig.conf
share/examples/asterisk/default/extensions.ael
share/examples/asterisk/default/extensions.conf
share/examples/asterisk/default/extensions.lua
share/examples/asterisk/default/extensions_minivm.conf
share/examples/asterisk/default/features.conf
share/examples/asterisk/default/festival.conf