1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-24 00:45:52 +00:00

soundmodem Tom's userland modem on FreeBSD

WWW: http://www.baycom.org/~tom/ham/soundmodem/

- Diane Bruce, VA3DB
db@db.net

PR:		ports/106823
Submitted by:   Diane Bruce <db@db.net>
This commit is contained in:
Martin Wilke 2006-12-21 21:19:26 +00:00
parent 5019b8e140
commit 96130cd2a7
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=180395
14 changed files with 269 additions and 0 deletions

View File

@ -101,6 +101,7 @@
SUBDIR += sms_client
SUBDIR += smstools
SUBDIR += snooper
SUBDIR += soundmodem
SUBDIR += spandsp
SUBDIR += splat
SUBDIR += sredird

48
comms/soundmodem/Makefile Normal file
View File

@ -0,0 +1,48 @@
# ports collection makefile for: soundmodem
# Date created: 4 November 2006
# Whom: db
#
# $FreeBSD$
#
PORTNAME= soundmodem
PORTVERSION= 0.10
CATEGORIES= comms hamradio
MASTER_SITES= http://www.baycom.org/~tom/ham/soundmodem/ \
http://chronos.org.uk/distfiles/
MAINTAINER= db@db.net
COMMENT= Amateur Radio sound modem
LIB_DEPENDS= audiofile:${PORTSDIR}/audio/libaudiofile
CONFIGURE_ARGS= --disable-alsatest
WRKSRC= ${WRKDIR}/${DISTNAME}
USE_GMAKE= yes
HAS_CONFIGURE= yes
ONLY_FOR_ARCHS= i386
USE_GNOME= gtk12 libxml
MAN8= soundmodem.8 soundmodemconfig.8
PLIST_FILES= bin/soundmodemconfig etc/rc.d/soundmodem \
include/modem.h include/simd.h sbin/soundmodem
pre-patch:
@${CP} ${FILESDIR}/soundmodem ${WRKSRC}
post-patch:
${REINPLACE_CMD} -e 's|%%PREFIX%%|${PREFIX}|g' \
${WRKSRC}/soundcard/soundmodem.8 \
${WRKSRC}/soundcard/main.c \
${WRKSRC}/configapp/src/soundmodemconfig.8 \
${WRKSRC}/configapp/src/main.c \
${WRKSRC}/soundmodem
post-install:
${INSTALL_SCRIPT} ${WRKSRC}/soundmodem ${PREFIX}/etc/rc.d
.include <bsd.port.pre.mk>
.if ${OSVERSION} < 500000
BROKEN= Does not compile on FreeBSD 4.x
.endif
.include <bsd.port.post.mk>

View File

@ -0,0 +1,3 @@
MD5 (soundmodem-0.10.tar.gz) = 6bf9acaf19c55e57628a49bdff79c8f9
SHA256 (soundmodem-0.10.tar.gz) = e7a42c413a180b873ae76b2c252904a3e34c9807c2604f2315426443d9e28627
SIZE (soundmodem-0.10.tar.gz) = 491112

View File

@ -0,0 +1,11 @@
--- configapp/src/main.c.orig Sun Nov 5 21:45:29 2006
+++ configapp/src/main.c Sun Nov 5 21:45:50 2006
@@ -358,7 +358,7 @@
#else /* WIN32 */
static xmlDocPtr doc = NULL;
-static const char *cfgfile = "/etc/ax25/soundmodem.conf";
+static const char *cfgfile = "%%PREFIX%%/etc/soundmodem.conf";
static xmlNodePtr findconfig(const char *newname)
{

View File

@ -0,0 +1,11 @@
--- configapp/src/soundmodemconfig.8.orig Fri Aug 9 16:01:51 2002
+++ configapp/src/soundmodemconfig.8 Sun Nov 5 21:59:09 2006
@@ -15,7 +15,7 @@
.SH DESCRIPTION
.B soundmodemconfig
is a GUI tool for creating a configuration file for soundmodem (8).
-The default file name is /etc/ax25/soundmodem.conf, though
+The default file name is %%PREFIX%%/etc/soundmodem.conf, though
any other file name may be specified on the command line.

View File

@ -0,0 +1,22 @@
--- configure.orig Tue Sep 12 14:52:56 2006
+++ configure Tue Sep 12 16:48:30 2006
@@ -7912,7 +7912,8 @@
int
main ()
{
-
+#include <stdio.h>
+printf("RUNNING a conftest!\n");
/* ensure backward compatibility */
#if !defined(SND_LIB_MAJOR) && defined(SOUNDLIB_VERSION_MAJOR)
#define SND_LIB_MAJOR SOUNDLIB_VERSION_MAJOR
@@ -7979,9 +7980,6 @@
echo "$as_me:$LINENO: result: not present." >&5
echo "${ECHO_T}not present." >&6
- { { echo "$as_me:$LINENO: error: Sufficiently new version of libasound not found." >&5
-echo "$as_me: error: Sufficiently new version of libasound not found." >&2;}
- { (exit 1); exit 1; }; }
alsa_found=no
fi

View File

@ -0,0 +1,12 @@
--- libmisc/getopt.h.orig Mon Sep 18 22:42:44 2006
+++ libmisc/getopt.h Tue Sep 19 17:43:44 2006
@@ -101,7 +101,9 @@
errors, only prototype getopt for the GNU C library. */
extern int getopt (int argc, char *const *argv, const char *shortopts);
#else /* not __GNU_LIBRARY__ */
+#if 0
extern int getopt ();
+#endif
#endif /* not __GNU_LIBRARY__ */
extern int getopt_long (int argc, char *const *argv, const char *shortopts,
const struct option *longopts, int *longind);

View File

@ -0,0 +1,25 @@
--- pammodem/meas.c.orig Tue Sep 19 17:44:23 2006
+++ pammodem/meas.c Tue Sep 19 17:51:00 2006
@@ -32,6 +32,8 @@
#ifdef HAVE_STROPTS_H
#include <stropts.h>
#endif
+#include <sys/param.h>
+#include <sys/types.h>
#ifdef HAVE_SYS_CONF_H
#include <sys/conf.h>
#endif
@@ -45,12 +47,12 @@
#include <sys/soundcard.h>
#endif
-#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <poll.h>
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include <strings.h>
#include <unistd.h>
#include <signal.h>

View File

@ -0,0 +1,11 @@
--- pskmodem/measpsk.c.orig Tue Sep 19 17:51:37 2006
+++ pskmodem/measpsk.c Tue Sep 19 17:52:15 2006
@@ -32,6 +32,8 @@
#ifdef HAVE_STROPTS_H
#include <stropts.h>
#endif
+#include <sys/param.h>
+#include <sys/types.h>
#ifdef HAVE_SYS_CONF_H
#include <sys/conf.h>
#endif

View File

@ -0,0 +1,11 @@
--- soundcard/main.c.orig Sun Nov 5 21:44:34 2006
+++ soundcard/main.c Sun Nov 5 21:44:53 2006
@@ -354,7 +354,7 @@
{ "daemonize", 0, 0, 'D' },
{ 0, 0, 0, 0 }
};
- char *configname = NULL, *cfgname, *filename = "/etc/ax25/soundmodem.conf";
+ char *configname = NULL, *cfgname, *filename = "%%PREFIX%%/etc/soundmodem.conf";
unsigned int verblevel = 2, tosyslog = 0, simd = 1, schedrr = 0, lockmem = 0, daemonize = 0;
int c, err = 0;
xmlDocPtr doc;

View File

@ -0,0 +1,60 @@
--- soundcard/ptt.c.orig Sat Nov 9 10:31:53 2002
+++ soundcard/ptt.c Mon Nov 6 00:17:03 2006
@@ -48,6 +48,9 @@
#ifdef HAVE_LINUX_PPDEV_H
#include <linux/ppdev.h>
+#elif defined(__FreeBSD__)
+#include <dev/ppbus/ppi.h>
+#include <dev/ppbus/ppbconf.h>
#else
#include "ppdev.h"
#endif
@@ -62,7 +65,11 @@
struct modemparams pttparams[] = {
{ "file", "PTT Driver", "Path name of the serial or parallel port driver for outputting PTT", "none", MODEMPAR_COMBO,
+#ifdef __FreeBSD__
+ { c: { { "none", "/dev/ttyd0", "/dev/ttyd1", "/dev/lp0", "/dev/lp1" } } } },
+#else
{ c: { { "none", "/dev/ttyS0", "/dev/ttyS1", "/dev/parport0", "/dev/parport1" } } } },
+#endif
{ NULL }
};
@@ -87,7 +94,11 @@
if (!ioctl(fd, TIOCMBIC, &y)) {
state->fd = fd;
state->mode = serport;
+#ifdef __FreeBSD__
+ } else if (!ioctl(fd, PPISDATA, &x)) {
+#else
} else if (!ioctl(fd, PPCLAIM, 0) && !ioctl(fd, PPRDATA, &x)) {
+#endif
state->fd = fd;
state->mode = parport;
} else {
@@ -122,7 +133,11 @@
#endif
} else if (state->mode == parport) {
reg = state->ptt | (state->dcd << 1);
+#ifdef __FreeBSD__
+ ioctl(state->fd, PPISDATA, &reg);
+#else
ioctl(state->fd, PPWDATA, &reg);
+#endif
}
}
@@ -148,7 +163,11 @@
#endif
} else if (state->mode == parport) {
reg = state->ptt | (state->dcd << 1);
+#ifdef __FreeBSD__
+ ioctl(state->fd, PPISDATA, &reg);
+#else
ioctl(state->fd, PPWDATA, &reg);
+#endif
}
}

View File

@ -0,0 +1,11 @@
--- soundcard/soundmodem.8.orig Fri Aug 9 16:01:52 2002
+++ soundcard/soundmodem.8 Sun Nov 5 21:47:40 2006
@@ -20,7 +20,7 @@
driver (enable CONFIG_MKISS).
.B soundmodem
is controlled by a configuration file. The default filename is
-/etc/ax25/soundmodem.conf. Any other name may be specified on the command line.
+%%PREFIX%%/etc/soundmodem.conf. Any other name may be specified on the command line.

View File

@ -0,0 +1,37 @@
#! /bin/sh
#
# PROVIDE: soundmodem
# REQUIRE: LOGIN
#
# Add the following lines to /etc/rc.conf to enable soundmodem:
#
#soundmodem_enable="YES"
. /etc/rc.subr
name=soundmodem
rcvar=`set_rcvar`
load_rc_config $name
soundmodem_enable=${soundmodem_enable-"NO"}
command=/usr/local/sbin/soundmodem
start_cmd=soundmodem_start
stop_cmd=soundmodem_stop
pidfile=/var/run/soundmodem.pid
required_files=/usr/local/etc/soundmodem.conf
soundmodem_start()
{
echo "Starting Soundmodem: "
/usr/local/sbin/soundmodem --daemonize
return 0
}
soundmodem_stop()
{
echo "Stopping Soundmodem: "
killall soundmodem
return 0
}
run_rc_command "$1"

View File

@ -0,0 +1,6 @@
soundmodem Tom's userland modem on FreeBSD
WWW: http://www.baycom.org/~tom/ham/soundmodem/
- Diane Bruce, VA3DB
db@db.net