2014-12-15 15:46:25 +01:00
|
|
|
# $FreeBSD$
|
|
|
|
|
|
|
|
PORTNAME= asterisk
|
2015-08-08 15:04:49 +02:00
|
|
|
PORTVERSION= 13.5.0
|
2014-12-15 15:46:25 +01:00
|
|
|
CATEGORIES= net
|
|
|
|
MASTER_SITES= http://downloads.asterisk.org/pub/telephony/asterisk/ \
|
|
|
|
http://downloads.asterisk.org/pub/telephony/asterisk/old-releases/
|
|
|
|
PKGNAMESUFFIX= 13
|
|
|
|
|
|
|
|
MAINTAINER= madpilot@FreeBSD.org
|
|
|
|
COMMENT= Open Source PBX and telephony toolkit
|
|
|
|
|
|
|
|
LIB_DEPENDS= libexecinfo.so:${PORTSDIR}/devel/libexecinfo \
|
|
|
|
libuuid.so:${PORTSDIR}/misc/e2fsprogs-libuuid \
|
|
|
|
libsqlite3.so:${PORTSDIR}/databases/sqlite3 \
|
|
|
|
libjansson.so:${PORTSDIR}/devel/jansson
|
|
|
|
RUN_DEPENDS= mpg123:${PORTSDIR}/audio/mpg123
|
|
|
|
|
|
|
|
ONLY_FOR_ARCHS= i386 amd64 powerpc sparc64
|
|
|
|
|
|
|
|
GNU_CONFIGURE= yes
|
2015-01-26 23:00:04 +01:00
|
|
|
USE_CSTD= gnu89
|
2014-12-15 15:46:25 +01:00
|
|
|
USE_GNOME= libxml2
|
|
|
|
USE_LDCONFIG= yes
|
2015-08-08 15:04:49 +02:00
|
|
|
USE_OPENSSL= yes
|
|
|
|
USES= bison cpe gmake iconv localbase ncurses shebangfix
|
2014-12-15 15:46:25 +01:00
|
|
|
CPE_VENDOR= digium
|
|
|
|
USE_RC_SUBR= asterisk
|
2015-03-26 00:51:05 +01:00
|
|
|
MAKE_ENV= PTHREAD_LIBS="-lpthread" \
|
2014-12-15 15:46:25 +01:00
|
|
|
MKDIR="${MKDIR}" \
|
|
|
|
PWLIBDIR=${LOCALBASE}/share/pwlib \
|
|
|
|
OSVERSION=${OSVERSION} \
|
|
|
|
DOCSDIR=${DOCSDIR} \
|
|
|
|
ASTCFLAGS="${CFLAGS}"
|
2015-08-08 15:04:49 +02:00
|
|
|
MAKE_ARGS+= NOISY_BUILD=YES
|
|
|
|
CONFIGURE_ARGS+= --datarootdir=${DATADIR} \
|
|
|
|
--with-crypto=${OPENSSLBASE} \
|
|
|
|
--with-ssl=${OPENSSLBASE}
|
|
|
|
|
|
|
|
SHEBANG_FILES= agi/agi-test.agi \
|
|
|
|
agi/jukebox.agi
|
2014-12-15 15:46:25 +01:00
|
|
|
|
|
|
|
CONFLICTS= ossp-uuid-[0-9]*
|
|
|
|
CONFLICTS_BUILD= linuxthreads-*
|
|
|
|
CONFLICTS_INSTALL= asterisk*-1.8* asterisk*-11*
|
|
|
|
|
2015-08-08 15:04:49 +02:00
|
|
|
OPTIONS_DEFINE= CURL EXCHANGE FREETDS GSM LDAP LUA MYSQL \
|
|
|
|
NEWG711 ODBC OOH323 PGSQL PJSIP PORTAUDIO \
|
|
|
|
RADIUS SNMP SPANDSP SPEEX SQLITE2 SRTP \
|
|
|
|
SYSINFO VORBIS XMPP
|
|
|
|
|
|
|
|
OPTIONS_SINGLE= COMPILER
|
|
|
|
OPTIONS_SINGLE_COMPILER= BASE GCC
|
|
|
|
OPTIONS_DEFAULT= CURL FREETDS GCC GSM LUA ODBC PGSQL PJSIP \
|
|
|
|
PORTAUDIO RADIUS SNMP SPEEX SQLITE2 VORBIS \
|
|
|
|
XMPP
|
2014-12-15 15:46:25 +01:00
|
|
|
|
2015-08-08 15:04:49 +02:00
|
|
|
OPTIONS_DEFINE_i386= DAHDI
|
|
|
|
OPTIONS_DEFINE_amd64= DAHDI
|
|
|
|
OPTIONS_DEFINE_sparc64= DAHDI
|
2014-12-15 15:46:25 +01:00
|
|
|
|
2015-08-08 15:04:49 +02:00
|
|
|
OPTIONS_DEFAULT_i386= DAHDI
|
|
|
|
OPTIONS_DEFAULT_amd64= DAHDI
|
2014-12-15 15:46:25 +01:00
|
|
|
OPTIONS_DEFAULT_sparc64= DAHDI
|
|
|
|
|
2015-08-08 15:04:49 +02:00
|
|
|
BASE_DESC= Use base compiler (experimental)
|
|
|
|
DAHDI_DESC?= DAHDI support
|
2014-12-15 15:46:25 +01:00
|
|
|
EXCHANGE_DESC?= Exchange calendar support
|
2015-08-08 15:04:49 +02:00
|
|
|
GCC_DESC= Use gcc from ports
|
2014-12-15 15:46:25 +01:00
|
|
|
NEWG711_DESC?= New G711 Codec
|
|
|
|
OOH323_DESC?= ooh323 support
|
|
|
|
PJSIP_DESC?= Build the PJSIP based SIP channel
|
2015-08-08 15:04:49 +02:00
|
|
|
SRTP_DESC?= SecureRTP support
|
2015-04-19 01:10:07 +02:00
|
|
|
SYSINFO_DESC?= Use devel/libsysinfo to get system information
|
2015-08-08 15:04:49 +02:00
|
|
|
XMPP_DESC?= XMPP/GTALK support
|
|
|
|
|
|
|
|
OPTIONS_SUB= yes
|
|
|
|
|
|
|
|
CURL_CONFIGURE_ON= --with-libcurl
|
|
|
|
CURL_CONFIGURE_OFF= --with-libcurl=no
|
|
|
|
CURL_LIB_DEPENDS= libcurl.so:${PORTSDIR}/ftp/curl
|
2014-12-15 15:46:25 +01:00
|
|
|
|
|
|
|
DAHDI_CONFIGURE_ON= --with-dahdi --with-openr2
|
|
|
|
DAHDI_CONFIGURE_OFF= --without-dahdi --without-openr2
|
|
|
|
DAHDI_BUILD_DEPENDS= libpri>=1.4.10:${PORTSDIR}/misc/libpri \
|
|
|
|
${LOCALBASE}/include/dahdi/user.h:${PORTSDIR}/misc/dahdi
|
|
|
|
DAHDI_LIB_DEPENDS= libpri.so:${PORTSDIR}/misc/libpri \
|
|
|
|
libopenr2.so:${PORTSDIR}/misc/openr2
|
2015-08-08 15:04:49 +02:00
|
|
|
|
|
|
|
EXCHANGE_CONFIGURE_OFF= --without-neon --without-neon29
|
|
|
|
EXCHANGE_LIB_DEPENDS= libneon.so:${PORTSDIR}/www/neon
|
|
|
|
|
2014-12-15 15:46:25 +01:00
|
|
|
FREETDS_CONFIGURE_ON= --with-tds=${LOCALBASE}
|
|
|
|
FREETDS_CONFIGURE_OFF= --without-tds
|
|
|
|
FREETDS_LIB_DEPENDS= libsybdb.so:${PORTSDIR}/databases/freetds
|
2015-08-08 15:04:49 +02:00
|
|
|
|
|
|
|
GCC_USE= GCC=yes
|
|
|
|
|
2014-12-15 15:46:25 +01:00
|
|
|
GSM_CONFIGURE_WITH= gsm
|
|
|
|
GSM_LIB_DEPENDS= libgsm.so:${PORTSDIR}/audio/gsm
|
2015-08-08 15:04:49 +02:00
|
|
|
|
|
|
|
LDAP_CONFIGURE_WITH= ldap
|
|
|
|
LDAP_USE= OPENLDAP=yes
|
|
|
|
|
2014-12-15 15:46:25 +01:00
|
|
|
LUA_CONFIGURE_WITH= lua
|
|
|
|
LUA_USES= lua:51
|
|
|
|
LUA_CFLAGS= -I${LUA_INCDIR}
|
|
|
|
LUA_LDFLAGS= -L${LUA_LIBDIR}
|
2015-08-08 15:04:49 +02:00
|
|
|
|
|
|
|
MYSQL_CONFIGURE_WITH= mysqlclient
|
|
|
|
MYSQL_USE= MYSQL=yes
|
|
|
|
|
|
|
|
ODBC_CONFIGURE_WITH= unixodbc
|
|
|
|
ODBC_CONFIGURE_ON= --with-ltdl
|
|
|
|
ODBC_LIB_DEPENDS= libodbc.so:${PORTSDIR}/databases/unixODBC \
|
|
|
|
libltdl.so:${PORTSDIR}/devel/libltdl
|
|
|
|
|
|
|
|
OOH323_CPPFLAGS= -I${LOCALBASE}/include/openh323
|
|
|
|
OOH323_LIB_DEPENDS= libpt_r.so:${PORTSDIR}/devel/pwlib \
|
|
|
|
libh323_r.so:${PORTSDIR}/net/openh323
|
|
|
|
OOH323_MAKE_ENV= OPENH323DIR=${LOCALBASE}/share/openh323
|
|
|
|
|
|
|
|
PGSQL_CONFIGURE_WITH= postgres
|
|
|
|
PGSQL_USES= pgsql
|
|
|
|
|
2014-12-15 15:46:25 +01:00
|
|
|
PJSIP_CONFIGURE_WITH= pjproject
|
|
|
|
PJSIP_USES= pkgconfig
|
2015-08-08 15:04:49 +02:00
|
|
|
|
2015-06-06 01:30:10 +02:00
|
|
|
PORTAUDIO_CONFIGURE_WITH= portaudio
|
|
|
|
PORTAUDIO_LIB_DEPENDS= libportaudio.so:${PORTSDIR}/audio/portaudio
|
2015-08-08 15:04:49 +02:00
|
|
|
|
|
|
|
RADIUS_CONFIGURE_WITH= radius
|
|
|
|
RADIUS_LIB_DEPENDS= libradiusclient-ng.so:${PORTSDIR}/net/radiusclient
|
|
|
|
|
|
|
|
SNMP_CONFIGURE_WITH= netsnmp
|
|
|
|
SNMP_LIB_DEPENDS= libnetsnmp.so:${PORTSDIR}/net-mgmt/net-snmp
|
|
|
|
|
|
|
|
SPANDSP_CONFIGURE_WITH= spandsp
|
|
|
|
SPANDSP_LIB_DEPENDS= libspandsp.so:${PORTSDIR}/comms/spandsp
|
|
|
|
|
2015-01-13 12:54:03 +01:00
|
|
|
SPEEX_LIB_DEPENDS= libspeex.so:${PORTSDIR}/audio/speex
|
2014-12-15 15:46:25 +01:00
|
|
|
SPEEX_CONFIGURE_WITH= speex
|
2015-08-08 15:04:49 +02:00
|
|
|
|
|
|
|
SQLITE2_CONFIGURE_WITH= sqlite
|
|
|
|
SQLITE2_LIB_DEPENDS= libsqlite.so:${PORTSDIR}/databases/sqlite2
|
|
|
|
|
|
|
|
SRTP_CONFIGURE_WITH= srtp
|
|
|
|
|
2015-04-19 01:10:07 +02:00
|
|
|
SYSINFO_LIB_DEPENDS= libsysinfo.so:${PORTSDIR}/devel/libsysinfo
|
2015-08-08 15:04:49 +02:00
|
|
|
|
|
|
|
VORBIS_CONFIGURE_WITH= ogg
|
|
|
|
VORBIS_LIB_DEPENDS= libvorbis.so:${PORTSDIR}/audio/libvorbis
|
|
|
|
|
|
|
|
XMPP_CONFIGURE_WITH= iksemel
|
|
|
|
XMPP_LIB_DEPENDS= libiksemel.so:${PORTSDIR}/textproc/iksemel
|
2014-12-15 15:46:25 +01:00
|
|
|
|
|
|
|
ASTERISK_USER?= asterisk
|
|
|
|
ASTERISK_GROUP?= asterisk
|
|
|
|
|
|
|
|
USERS= ${ASTERISK_USER}
|
|
|
|
GROUPS= ${ASTERISK_GROUP} dahdi
|
|
|
|
|
2015-01-13 12:54:03 +01:00
|
|
|
.include <bsd.port.options.mk>
|
|
|
|
|
2015-05-06 22:10:09 +02:00
|
|
|
.if ${PORT_OPTIONS:MPJSIP} && ${PORT_OPTIONS:MSRTP}
|
|
|
|
LIB_DEPENDS+= libpj.so:${PORTSDIR}/net/pjsip-extsrtp
|
|
|
|
.elif ${PORT_OPTIONS:MPJSIP} && ! ${PORT_OPTIONS:MSRTP}
|
|
|
|
LIB_DEPENDS+= libpj.so:${PORTSDIR}/net/pjsip
|
|
|
|
.elif ! ${PORT_OPTIONS:MPJSIP} && ${PORT_OPTIONS:MSRTP}
|
|
|
|
LIB_DEPENDS+= libsrtp.so:${PORTSDIR}/net/libsrtp
|
2015-01-13 12:54:03 +01:00
|
|
|
.endif
|
|
|
|
|
2014-12-15 15:46:25 +01:00
|
|
|
.include <bsd.port.pre.mk>
|
|
|
|
|
2015-04-15 10:20:27 +02:00
|
|
|
.if empty(ICONV_LIB)
|
|
|
|
CONFIGURE_ARGS+=ac_cv_lib_iconv_iconv_open=no \
|
|
|
|
ac_cv_lib_iconv_libiconv_open=no
|
|
|
|
.endif
|
|
|
|
|
2014-12-15 15:46:25 +01:00
|
|
|
.if ${PREFIX} == ${LOCALBASE}
|
|
|
|
VARDIR=/var
|
|
|
|
.else
|
|
|
|
VARDIR=${PREFIX}/var
|
|
|
|
.endif
|
|
|
|
|
|
|
|
SUB_LIST+= ASTERISK_USER=${ASTERISK_USER}
|
2015-08-08 15:04:49 +02:00
|
|
|
PLIST_SUB+= ASTERISK_USER=${ASTERISK_USER} \
|
|
|
|
ASTERISK_GROUP=${ASTERISK_GROUP} \
|
|
|
|
VARDIR=${VARDIR}
|
2014-12-15 15:46:25 +01:00
|
|
|
|
|
|
|
post-extract:
|
2015-04-19 01:10:07 +02:00
|
|
|
@${FIND} ${WRKSRC} -name '*.d' -delete
|
2014-12-15 15:46:25 +01:00
|
|
|
|
|
|
|
post-patch:
|
2015-04-19 01:10:07 +02:00
|
|
|
@${REINPLACE_CMD} -e 's|/var/lib|${PREFIX}/share|g' ${WRKSRC}/configs/samples/musiconhold.conf.sample
|
|
|
|
.if ${PORT_OPTIONS:MSYSINFO}
|
|
|
|
@${REINPLACE_CMD} -e 's/%%LIBSYSINFO%%/-lsysinfo/' ${WRKSRC}/main/Makefile
|
|
|
|
.else
|
|
|
|
@${REINPLACE_CMD} -e '/#define HAVE_SYSINFO 1/d' ${WRKSRC}/configure
|
|
|
|
@${REINPLACE_CMD} -e '/%%LIBSYSINFO%%/d' ${WRKSRC}/main/Makefile
|
|
|
|
.endif
|
2014-12-15 15:46:25 +01:00
|
|
|
|
|
|
|
post-configure:
|
|
|
|
@cd ${WRKSRC} && ${MAKE_CMD} menuselect.makeopts
|
|
|
|
@cd ${WRKSRC} && ./menuselect/menuselect --disable res_timing_kqueue menuselect.makeopts
|
2015-04-02 02:12:13 +02:00
|
|
|
@cd ${WRKSRC} && ./menuselect/menuselect --enable chan_mgcp menuselect.makeopts
|
|
|
|
@cd ${WRKSRC} && ./menuselect/menuselect --enable res_pktccops menuselect.makeopts
|
2014-12-15 15:46:25 +01:00
|
|
|
.if ${PORT_OPTIONS:MMYSQL}
|
|
|
|
@cd ${WRKSRC} && ./menuselect/menuselect --enable res_config_mysql menuselect.makeopts
|
|
|
|
@cd ${WRKSRC} && ./menuselect/menuselect --enable app_mysql menuselect.makeopts
|
|
|
|
@cd ${WRKSRC} && ./menuselect/menuselect --enable cdr_mysql menuselect.makeopts
|
|
|
|
.endif
|
|
|
|
.if ${PORT_OPTIONS:MOOH323}
|
|
|
|
@cd ${WRKSRC} && ./menuselect/menuselect --enable chan_ooh323 menuselect.makeopts
|
|
|
|
.endif
|
|
|
|
.if ${PORT_OPTIONS:MNEWG711}
|
|
|
|
@cd ${WRKSRC} && ./menuselect/menuselect --enable G711_NEW_ALGORITHM menuselect.makeopts
|
|
|
|
.endif
|
|
|
|
|
|
|
|
post-install:
|
|
|
|
@${RM} ${STAGEDIR}${ETCDIR}/*.conf ${STAGEDIR}${ETCDIR}/extensions.ael ${STAGEDIR}${ETCDIR}/extensions.lua
|
|
|
|
|
|
|
|
.include <bsd.port.post.mk>
|