From e4ff9a7c5dae25e0d58dbe0f2e48d84303839b1a Mon Sep 17 00:00:00 2001 From: pav Date: Fri, 23 Jun 2006 12:56:40 +0000 Subject: IAXmodem is a software modem written in C that uses an IAX channel (commonly provided by an Asterisk PBX system) instead of a traditional phone line and uses a DSP library instead of DSP hardware chipsets. WWW: http://sourceforge.net/projects/iaxmodem PR: ports/99238 Submitted by: Filippo Natali --- net/Makefile | 1 + net/iaxmodem/Makefile | 52 ++++++++++++++++++++++++++++ net/iaxmodem/distinfo | 3 ++ net/iaxmodem/files/iaxmodem.sh.in | 25 ++++++++++++++ net/iaxmodem/files/patch-aa | 72 +++++++++++++++++++++++++++++++++++++++ net/iaxmodem/files/pkg-message.in | 15 ++++++++ net/iaxmodem/pkg-descr | 6 ++++ net/iaxmodem/pkg-plist | 10 ++++++ 8 files changed, 184 insertions(+) create mode 100644 net/iaxmodem/Makefile create mode 100644 net/iaxmodem/distinfo create mode 100644 net/iaxmodem/files/iaxmodem.sh.in create mode 100644 net/iaxmodem/files/patch-aa create mode 100644 net/iaxmodem/files/pkg-message.in create mode 100644 net/iaxmodem/pkg-descr create mode 100644 net/iaxmodem/pkg-plist (limited to 'net') diff --git a/net/Makefile b/net/Makefile index 52dec15f113..dfc0144ad3e 100644 --- a/net/Makefile +++ b/net/Makefile @@ -189,6 +189,7 @@ SUBDIR += htpdate SUBDIR += http_ping SUBDIR += httping + SUBDIR += iaxmodem SUBDIR += icmpinfo SUBDIR += icpld SUBDIR += ifdepd diff --git a/net/iaxmodem/Makefile b/net/iaxmodem/Makefile new file mode 100644 index 00000000000..8344270d0c1 --- /dev/null +++ b/net/iaxmodem/Makefile @@ -0,0 +1,52 @@ +# New ports collection makefile for: iaxmodem +# Date created: 15 Jun 2006 +# Whom: Filippo Natali +# +# $FreeBSD$ +# + +PORTNAME= iaxmodem +PORTVERSION= 0.1.9 +CATEGORIES= comms +MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} +MASTER_SITE_SUBDIR= ${PORTNAME} + +MAINTAINER= filippo.natali@gmail.com +COMMENT= Software modem that connects ta IAX channel + +LIB_DEPENDS= tiff.4:${PORTSDIR}/graphics/tiff + +MAN1= iaxmodem.1 +CFLAGS+= -I${LOCALBASE}/include +LDFLAGS= -L${LOCALBASE}/lib +MAKE_ENV= LDFLAGS="${LDFLAGS}" + +SUB_FILES= pkg-message +USE_RC_SUBR= iaxmodem.sh + +post-patch: + @${REINPLACE_CMD} -e "s|/usr/local/etc|${PREFIX}/etc|g" ${WRKSRC}/iaxmodem.1 + @${REINPLACE_CMD} -e "s|/etc/iaxmodem|${PREFIX}/etc/iaxmodem|g" ${WRKSRC}/iaxmodem.c + +do-build: + @cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ./build static + +do-install: + ${INSTALL_PROGRAM} ${WRKSRC}/iaxmodem ${PREFIX}/sbin/ && \ + ${MKDIR} ${PREFIX}/etc/iaxmodem && \ + ${MKDIR} /var/log/iaxmodem && \ + ${MKDIR} ${EXAMPLESDIR} && \ + ${INSTALL_DATA} ${WRKSRC}/config.ttyIAX ${EXAMPLESDIR}/ && \ + ${INSTALL_DATA} ${WRKSRC}/iaxmodem-cfg.ttyIAX ${EXAMPLESDIR}/ + ${INSTALL_MAN} ${WRKSRC}/iaxmodem.1 ${MAN1PREFIX}/man/man1 +.if !defined(NOPORTDOCS) + ${MKDIR} ${DOCSDIR} && \ + ${INSTALL_DATA} ${WRKSRC}/README ${WRKSRC}/TODO ${WRKSRC}/FAQ ${WRKSRC}/CHANGES ${DOCSDIR} +.endif + +post-install: +.if !defined(BATCH) + @${CAT} ${PKGMESSAGE} +.endif + +.include diff --git a/net/iaxmodem/distinfo b/net/iaxmodem/distinfo new file mode 100644 index 00000000000..dabc27a8459 --- /dev/null +++ b/net/iaxmodem/distinfo @@ -0,0 +1,3 @@ +MD5 (iaxmodem-0.1.9.tar.gz) = 621ea4c684d2b7ea14485e9493ecc703 +SHA256 (iaxmodem-0.1.9.tar.gz) = b692beeb075e1047300373d4b928a6c29cc3ec702d40046f9b7540455028cd87 +SIZE (iaxmodem-0.1.9.tar.gz) = 2006491 diff --git a/net/iaxmodem/files/iaxmodem.sh.in b/net/iaxmodem/files/iaxmodem.sh.in new file mode 100644 index 00000000000..c9ceba75397 --- /dev/null +++ b/net/iaxmodem/files/iaxmodem.sh.in @@ -0,0 +1,25 @@ +#!/bin/sh + +# PROVIDE: iaxmodem +# REQUIRE: DAEMON +# KEYWORD: shutdown + +# +# Add the following lines to /etc/rc.conf to enable iaxmodem: +# +# iaxmodem_enable="YES" +# + +. %%RC_SUBR%% + +name=iaxmodem +rcvar=`set_rcvar` + +command=%%PREFIX%%/sbin/iaxmodem + +pidfile=${iaxmodem_pidfile:-"/var/run/iaxmodem.pid"} + +iaxmodem_enable=${iaxmodem_enable:-"NO"} + +load_rc_config $name +run_rc_command "$1" diff --git a/net/iaxmodem/files/patch-aa b/net/iaxmodem/files/patch-aa new file mode 100644 index 00000000000..87bc13a48fd --- /dev/null +++ b/net/iaxmodem/files/patch-aa @@ -0,0 +1,72 @@ +--- build.orig Mon Jun 12 17:03:49 2006 ++++ build Thu Jun 15 14:24:34 2006 +@@ -16,14 +17,14 @@ + ./configure && \ + make && \ + cd ../spandsp && \ +- ./configure && \ ++ ./configure CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" && \ + make && \ + cd ../.. && \ +- gcc -Wall -O2 -g -DMODEMVER=\"$MODEMVER\" -DDSPVER=\"$DSPVER\" -DIAXVER=\"$IAXVER\" -DSTATICLIBS -D_GNU_SOURCE \ ++ gcc $CFLAGS $LDFLAGS -Wall -O2 -g -DMODEMVER=\"$MODEMVER\" -DDSPVER=\"$DSPVER\" -DIAXVER=\"$IAXVER\" -DSTATICLIBS -D_GNU_SOURCE \ + -std=c99 -Ilib/libiax2/src -Ilib/spandsp/src -c -o iaxmodem.o iaxmodem.c && \ +- gcc -lm -lutil -ltiff -o iaxmodem iaxmodem.o lib/spandsp/src/.libs/libspandsp.a lib/libiax2/src/.libs/libiax.a ++ gcc $CFLAGS $LDFLAGS -lm -lutil -ltiff -o iaxmodem iaxmodem.o lib/spandsp/src/.libs/libspandsp.a lib/libiax2/src/.libs/libiax.a + else +- gcc -Wall -O2 -g -DMODEMVER=\"$MODEMVER\" -DDSPVER=\"$DSPVER\" -DIAXVER=\"$IAXVER\" \ ++ gcc $CFLAGS $LDFLAGS -Wall -O2 -g -DMODEMVER=\"$MODEMVER\" -DDSPVER=\"$DSPVER\" -DIAXVER=\"$IAXVER\" \ + -lm -liax -lutil -lspandsp -ltiff -o iaxmodem iaxmodem.c + fi + if [ -n "`ls /etc/iaxmodem-cfg.* 2>/dev/null`" ]; then +--- iaxmodem.c.orig Mon Jun 12 15:54:33 2006 ++++ iaxmodem.c Thu Jun 15 14:26:12 2006 +@@ -17,11 +17,13 @@ + */ + #include + #include +-#ifndef __OpenBSD__ ++#if !defined(__OpenBSD__) && !defined(__FreeBSD__) + #include + #else + #include ++#if !defined(__FreeBSD__) + #include ++#endif + #endif + #include + #include +--- lib/libiax2/src/iax.c.orig Mon Jun 12 15:54:46 2006 ++++ lib/libiax2/src/iax.c Thu Jun 15 14:22:17 2006 +@@ -64,9 +64,9 @@ + #include + #include + +-#if !defined(MACOSX) && !defined(__OpenBSD__) ++#if !defined(MACOSX) && !defined(__OpenBSD__) && !defined(__FreeBSD__) + #include +-#if !defined(SOLARIS) ++#if !defined(SOLARIS) && !defined(__FreeBSD__) + #include + #endif + #endif +@@ -97,7 +97,7 @@ + #ifdef MACOSX + #define IAX_SOCKOPTS MSG_DONTWAIT + #else +-#if defined(SOLARIS) || defined(__OpenBSD__) ++#if defined(SOLARIS) || defined(__OpenBSD__) || defined(__FreeBSD__) + #define IAX_SOCKOPTS MSG_DONTWAIT + #else /* Linux and others */ + #define IAX_SOCKOPTS MSG_DONTWAIT | MSG_NOSIGNAL +--- lib/spandsp/src/spandsp/t4.h.orig Mon Jun 12 15:54:34 2006 ++++ lib/spandsp/src/spandsp/t4.h Thu Jun 15 14:17:20 2006 +@@ -28,6 +28,8 @@ + + /*! \file */ + ++#include ++ + #if !defined(_T4_H_) + #define _T4_H_ + diff --git a/net/iaxmodem/files/pkg-message.in b/net/iaxmodem/files/pkg-message.in new file mode 100644 index 00000000000..a1bdfb2802d --- /dev/null +++ b/net/iaxmodem/files/pkg-message.in @@ -0,0 +1,15 @@ +To use iaxmodem with Hylafax: + +- Install and configure Hylafax + +- Take a look to %%EXAMPLESDIR%%/config.ttyIAX to configure the "virtual" modem + +- For accepting incoming FAX/data calls, modify /etc/ttys as below + and send SIGHUP to init process: + +>ttyIAX "%%PREFIX%%/sbin/faxgetty" dialup on secure + +Additional Documentation: +%%DOCSDIR%% +%%EXAMPLESDIR%% +http://www.voip-info.org/wiki/view/Asterisk+IAXmodem diff --git a/net/iaxmodem/pkg-descr b/net/iaxmodem/pkg-descr new file mode 100644 index 00000000000..e13c336a5ed --- /dev/null +++ b/net/iaxmodem/pkg-descr @@ -0,0 +1,6 @@ +IAXmodem is a software modem written in C that uses +an IAX channel (commonly provided by an Asterisk PBX +system) instead of a traditional phone line and uses +a DSP library instead of DSP hardware chipsets. + +WWW: http://sourceforge.net/projects/iaxmodem diff --git a/net/iaxmodem/pkg-plist b/net/iaxmodem/pkg-plist new file mode 100644 index 00000000000..01a5ac91331 --- /dev/null +++ b/net/iaxmodem/pkg-plist @@ -0,0 +1,10 @@ +sbin/iaxmodem +%%EXAMPLESDIR%%/iaxmodem-cfg.ttyIAX +%%EXAMPLESDIR%%/config.ttyIAX +%%PORTDOCS%%%%DOCSDIR%%/README +%%PORTDOCS%%%%DOCSDIR%%/FAQ +%%PORTDOCS%%%%DOCSDIR%%/CHANGES +%%PORTDOCS%%%%DOCSDIR%%/TODO +@dirrm etc/iaxmodem +@dirrm %%EXAMPLESDIR%% +%%PORTDOCS%%@dirrm %%DOCSDIR%% -- cgit