summaryrefslogtreecommitdiff
path: root/comms/linrad
diff options
context:
space:
mode:
authorPav Lucistnik <pav@FreeBSD.org>2004-07-14 16:09:39 +0000
committerPav Lucistnik <pav@FreeBSD.org>2004-07-14 16:09:39 +0000
commit004697d45d2a5ed5a4c4e83cbd12ac53fbf114d9 (patch)
tree2413bc4495482d5286bfb8cf26f9cb86dd88ef0a /comms/linrad
parentUpdate to 2.0.99 and make fetcheable again. (diff)
Add linrad, Amateur Radio DSP utility (SDR)
PR: ports/68873 Submitted by: Diane Bruce <db@heceta.db.net>
Notes
Notes: svn path=/head/; revision=113662
Diffstat (limited to 'comms/linrad')
-rw-r--r--comms/linrad/Makefile53
-rw-r--r--comms/linrad/distinfo2
-rw-r--r--comms/linrad/files/patch-Makefile.in57
-rw-r--r--comms/linrad/files/patch-configure.in31
-rw-r--r--comms/linrad/files/patch-hwaredriver.c19
-rw-r--r--comms/linrad/files/patch-main.c37
-rw-r--r--comms/linrad/files/patch-modesub.c37
-rw-r--r--comms/linrad/files/patch-setad.c390
-rw-r--r--comms/linrad/files/patch-tune.c15
-rw-r--r--comms/linrad/files/patch-uidef.h9
-rw-r--r--comms/linrad/files/patch-uivar.c11
-rw-r--r--comms/linrad/files/patch-wcw.c28
-rw-r--r--comms/linrad/pkg-descr10
-rw-r--r--comms/linrad/pkg-plist14
14 files changed, 713 insertions, 0 deletions
diff --git a/comms/linrad/Makefile b/comms/linrad/Makefile
new file mode 100644
index 000000000000..d5802d799377
--- /dev/null
+++ b/comms/linrad/Makefile
@@ -0,0 +1,53 @@
+# ports collection makefile for: linrad
+# Date created: 7 July 2004
+# Whom: db
+#
+# $FreeBSD$
+#
+
+PORTNAME= linrad
+PORTVERSION= 0.16a
+CATEGORIES= comms
+MASTER_SITES= http://www.nitehawk.com/sm5bsz/linuxdsp/archive/
+DISTNAME= lir01-20
+EXTRACT_SUFX= .tbz
+DIST_SUBDIR= ${PORTNAME}
+
+MAINTAINER= db@db.net
+COMMENT= Amateur Radio DSP utility (SDR)
+
+LIB_DEPENDS= vga.1:${PORTSDIR}/graphics/svgalib
+BUILD_DEPENDS= nasm:${PORTSDIR}/devel/nasm
+
+WRKSRC= ${WRKDIR}/${PORTNAME}-01.20
+
+USE_AUTOCONF_VER= 253
+HAS_CONFIGURE= yes
+USE_BZIP2= yes
+USE_REINPLACE= yes
+
+post-patch:
+ @${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|' ${WRKSRC}/configure.in
+
+do-install:
+ ${INSTALL_PROGRAM} -m04555 ${WRKSRC}/${PORTNAME} ${PREFIX}/bin/${PORTNAME}
+.if !defined(NOPORTDOCS)
+ ${MKDIR} ${DOCSDIR}
+ ${INSTALL_DATA} ${WRKSRC}/z_APM.txt ${DOCSDIR}/z_APM.txt
+ ${INSTALL_DATA} ${WRKSRC}/z_BUFFERS.txt ${DOCSDIR}/z_BUFFERS.txt
+ ${INSTALL_DATA} ${WRKSRC}/z_CALIBRATE.txt ${DOCSDIR}/z_CALIBRATE.txt
+ ${INSTALL_DATA} ${WRKSRC}/z_COPYRIGHT.txt ${DOCSDIR}/z_COPYRIGHT.txt
+ ${INSTALL_DATA} ${WRKSRC}/z_GIFINFO.txt ${DOCSDIR}/z_GIFINFO.txt
+ ${INSTALL_DATA} ${WRKSRC}/z_INSTALL.txt ${DOCSDIR}/z_INSTALL.txt
+ ${INSTALL_DATA} ${WRKSRC}/z_MLOCK.txt ${DOCSDIR}/z_MLOCK.txt
+ ${INSTALL_DATA} ${WRKSRC}/z_SETTINGS.txt ${DOCSDIR}/z_SETTINGS.txt
+ ${INSTALL_DATA} ${WRKSRC}/z_SPEED.txt ${DOCSDIR}/z_SPEED.txt
+ ${INSTALL_DATA} ${WRKSRC}/z_SVGALIB.txt ${DOCSDIR}/z_SVGALIB.txt
+ ${INSTALL_DATA} ${WRKSRC}/z_USERS_HWARE.txt ${DOCSDIR}/z_USERS_HWARE.txt
+ ${INSTALL_DATA} ${WRKSRC}/z_USLEEP.txt ${DOCSDIR}/z_USLEEP.txt
+ @${ECHO} ""
+ @${ECHO} "linrad docs installed in ${DOCSDIR}"
+ @${ECHO} ""
+.endif
+
+.include <bsd.port.mk>
diff --git a/comms/linrad/distinfo b/comms/linrad/distinfo
new file mode 100644
index 000000000000..904edfa16a75
--- /dev/null
+++ b/comms/linrad/distinfo
@@ -0,0 +1,2 @@
+MD5 (linrad/lir01-20.tbz) = 34b6f5ef52adf8b9a8af444db43ddf70
+SIZE (linrad/lir01-20.tbz) = 330472
diff --git a/comms/linrad/files/patch-Makefile.in b/comms/linrad/files/patch-Makefile.in
new file mode 100644
index 000000000000..4f1f06aa1eee
--- /dev/null
+++ b/comms/linrad/files/patch-Makefile.in
@@ -0,0 +1,57 @@
+--- Makefile.in.orig Tue May 18 09:43:30 2004
++++ Makefile.in Fri Jul 9 00:43:44 2004
+@@ -1,11 +1,14 @@
++INCLUDE= /usr/local/include
++LIBS= /usr/local/lib
++
+
+ .c.o:
+-# gcc -I/usr/local/include -c -o $*.o $<
+- gcc -O -W -Wimplicit -Wreturn-type -Wformat \
+--Wunused -Wcomment -Wchar-subscripts -Wshadow -Wuninitialized \
+--Wparentheses -Wstrict-prototypes -Werror -ffast-math -fforce-mem \
+--fomit-frame-pointer -c -o $*.o \
+-$<
++ ${CC} -I${INCLUDE} -c -o $*.o $<
++# gcc -O -W -Wimplicit -Wreturn-type -Wformat \
++#-Wunused -Wcomment -Wchar-subscripts -Wshadow -Wuninitialized \
++#-Wparentheses -Wstrict-prototypes -Werror -ffast-math -fforce-mem \
++#-fomit-frame-pointer -c -o $*.o \
++#$<
+
+ .s.o:
+ nasm -w-orphan-labels -felf -s $<
+@@ -23,7 +26,7 @@
+ tune.o txtest.o network.o mouse.o freq_control.o vgatest mousetest morse.o \
+ cwspeed.o coh_osc.o cw_carrier.o
+
+- gcc -olinrad -lvgagl -lvga -lm \
++ ${CC} -I${INCLUDE} -L${LIBS} -olinrad -lvgagl -lvga -lm \
+ -Wl,-s,-Map,linrad.map,-warn-common,--cref\
+ main.o ui.o setvga.o setad.o fft1.o buf.o mouse.o wide_graph.o \
+ getiq.o fft0.o rxtest.o hires_graph.o fftasm.o baseb_graph.o mix2.o \
+@@ -37,10 +40,10 @@
+ cw_carrier.o fft3.o
+
+ vgatest: vgatest.o
+- gcc -ovgatest -lvgagl -lvga -lm -Wl -s vgatest.o
++ ${CC} -I${INCLUDE} -ovgatest -L${LIBS} -lvgagl -lvga -lm -Wl -s vgatest.o
+
+ mousetest: mousetest.o
+- gcc -omousetest -lvgagl -lvga -lm -Wl -s mousetest.o
++ ${CC} -I${INCLUDE} -omousetest -L${LIBS} -lvgagl -lvga -lm -Wl -s mousetest.o
+
+ afc_graph.o : globdef.h uidef.h fft1def.h fft2def.h screendef.h vernr.h \
+ seldef.h llsqdef.h sigdef.h
+@@ -126,3 +129,11 @@
+ configure : Makefile.in conf.h.in configure.in
+ rm -f configure
+ autoconf
++
++all: vgatest mousetest linrad
++
++clean:
++ rm -f vgatest mousetest linrad *.o
++
++install:
++ install -oroot -m04566 linrad ${PREFIX}/bin/linrad
diff --git a/comms/linrad/files/patch-configure.in b/comms/linrad/files/patch-configure.in
new file mode 100644
index 000000000000..86a164a68cb2
--- /dev/null
+++ b/comms/linrad/files/patch-configure.in
@@ -0,0 +1,31 @@
+--- configure.in.orig Tue May 18 09:43:30 2004
++++ configure.in Fri Jul 9 12:49:33 2004
+@@ -2,13 +2,13 @@
+ rm -f conf.h
+ AC_INIT(main.c)
+ AC_CHECK_FILE( /usr/lib/oss/soundcard.h, OSSN="1")
+-AC_CHECK_FILE( /usr/local/lib/oss/soundcard.h, OSSN="3")
++AC_CHECK_FILE( %%LOCALBASE%%/lib/oss/soundcard.h, OSSN="3")
+ AC_CHECK_FILE( /lib/oss/soundcard.h, OSSN="5")
+ AC_CHECK_FILE( /var/lib/oss/soundcard.h, OSSN="7")
+ AC_CHECK_FILE( /opt/oss/soundcard.h, OSSN="9")
+ AC_CHECK_FILE( /root/oss/soundcard.h, OSSN="11")
+ AC_CHECK_FILE( /usr/lib/oss/include/sys/soundcard.h, OSSN="2")
+-AC_CHECK_FILE( /usr/local/lib/oss/include/sys/soundcard.h, OSSN="4")
++AC_CHECK_FILE( %%LOCALBASE%%/lib/oss/include/sys/soundcard.h, OSSN="4")
+ AC_CHECK_FILE( /lib/oss/include/sys/soundcard.h, OSSN="6")
+ AC_CHECK_FILE( /var/lib/oss/include/sys/soundcard.h, OSSN="8")
+ AC_CHECK_FILE( /opt/oss/include/sys/soundcard.h, OSSN="10")
+@@ -25,10 +25,10 @@
+ AC_SUBST(USERHWDEF)
+ AC_CHECK_FILE( ./users_hwaredef.h, DEPS2="users_hwaredef.h")
+ AC_SUBST(DEPS2)
+-AC_CHECK_HEADER(vga.h,, AC_MSG_ERROR(
++AC_CHECK_HEADER(%%LOCALBASE%%/include/vga.h,, AC_MSG_ERROR(
+ Must have svgalib package installed to compile
+ vga.h missing!!!))
+-AC_CHECK_HEADER(vgagl.h,, AC_MSG_ERROR(
++AC_CHECK_HEADER(%%LOCALBASE%%/include/vgagl.h,, AC_MSG_ERROR(
+ Must have svgalib package installed to compile
+ vgagl.h missing!!!))
+ AC_CHECK_FILE( /usr/include/png.h, IMGFMT="1")
diff --git a/comms/linrad/files/patch-hwaredriver.c b/comms/linrad/files/patch-hwaredriver.c
new file mode 100644
index 000000000000..17764dedba94
--- /dev/null
+++ b/comms/linrad/files/patch-hwaredriver.c
@@ -0,0 +1,19 @@
+--- hwaredriver.c.orig Tue May 18 09:43:30 2004
++++ hwaredriver.c Fri Jul 9 11:26:15 2004
+@@ -1,6 +1,6 @@
+
+ #include <vga.h>
+-#include <sys/io.h>
++#include <machine/cpufunc.h>
+ #include <ctype.h>
+ #include "conf.h"
+ #include "globdef.h"
+@@ -169,7 +169,7 @@
+ void users_open_devices(void)
+ {
+ // Get permission to write to the parallel port
+-ioperm(HWARE_PORT,4,1);
++i386_set_ioperm(HWARE_PORT,4,1);
+ allow_parport=1;
+ }
+
diff --git a/comms/linrad/files/patch-main.c b/comms/linrad/files/patch-main.c
new file mode 100644
index 000000000000..8207749a98c1
--- /dev/null
+++ b/comms/linrad/files/patch-main.c
@@ -0,0 +1,37 @@
+--- main.c.orig Thu Jul 8 18:24:25 2004
++++ main.c Thu Jul 8 18:25:02 2004
+@@ -355,7 +355,9 @@
+ end_program(436);
+ }
+ lir_errors:;
++#if 0
+ if(ui.memlock == 0)munlockall();
++#endif
+ close_all_except_vga();
+ if(lir_status > LIR_OK)
+ {
+@@ -640,7 +642,9 @@
+ {
+ bufreduce:;
+ vga_clear();
++#if 0
+ if(ui.memlock == 0)munlockall();
++#endif
+ settextcolor(15);
+ switch (lir_status)
+ {
+@@ -854,12 +858,14 @@
+ else
+ {
+ if(chr != 'Y')goto gtswap;
++#if 0
+ if(mlockall(MCL_CURRENT) != 0)
+ {
+ if(errno == EPERM)end_program(1168);
+ if(errno == ENOMEM)end_program(1169);
+ end_program(1170);
+ }
++#endif
+ }
+ clearscreen();
+ printf("Use usleep when the CPU is not needed\nRead z_USLEEP.txt for info.");
diff --git a/comms/linrad/files/patch-modesub.c b/comms/linrad/files/patch-modesub.c
new file mode 100644
index 000000000000..7dbc0ca8afbe
--- /dev/null
+++ b/comms/linrad/files/patch-modesub.c
@@ -0,0 +1,37 @@
+--- modesub.c.orig Tue May 18 09:43:30 2004
++++ modesub.c Fri Jul 9 11:17:15 2004
+@@ -5,7 +5,7 @@
+ #include <unistd.h>
+ #include <ctype.h>
+ #include <sys/mman.h>
+-#include <sys/io.h>
++#include <machine/cpufunc.h>
+ #include "globdef.h"
+ #include "uidef.h"
+ #include "fft1def.h"
+@@ -1068,6 +1068,7 @@
+ j++;
+ if(j > 1000)
+ {
++#if 0
+ if(mlockall(MCL_CURRENT) != 0)
+ {
+ handle[0]=(int)(chk_free(testbuf));
+@@ -1075,6 +1076,7 @@
+ return 0;
+ }
+ j=0;
++#endif
+ }
+ }
+ }
+@@ -1597,7 +1599,9 @@
+ idle_start=recent_time;
+ if(ui.memlock == 0)
+ {
++#if 0
+ if(mlockall(MCL_CURRENT) != 0)lir_status=LIR_MEMERR;
++#endif
+ }
+ work_flag=0;
+
diff --git a/comms/linrad/files/patch-setad.c b/comms/linrad/files/patch-setad.c
new file mode 100644
index 000000000000..0b9098d7d610
--- /dev/null
+++ b/comms/linrad/files/patch-setad.c
@@ -0,0 +1,390 @@
+--- setad.c.orig Tue May 18 09:43:30 2004
++++ setad.c Thu Jul 8 14:17:52 2004
+@@ -16,11 +16,11 @@
+ #define ABOVE_MAX_SPEED 768000
+ #if SND_DEV == 1
+ #define DEVNAME_SIZE 12
+-char devname[DEVNAME_SIZE]="/dev/dsp ";
++char dev_name[DEVNAME_SIZE]="/dev/dsp ";
+ #define DEVNAMPOS 8
+ #else
+ #define DEVNAME_SIZE 18
+-char devname[DEVNAME_SIZE]="/dev/sound/dsp ";
++char dev_name[DEVNAME_SIZE]="/dev/sound/dsp ";
+ #define DEVNAMPOS 14
+ #endif
+
+@@ -36,7 +36,7 @@
+ sync();
+ }
+
+-void make_devname(int n)
++void make_dev_name(int n)
+ {
+ int k,num,m;
+ if(n < 0)end_program(9235);
+@@ -47,13 +47,13 @@
+ m=num/10;
+ if(m > 0)
+ {
+- devname[k]=m+'0';
++ dev_name[k]=m+'0';
+ k++;
+ }
+-devname[k]=num-m*10+'0';
+-if(devname[k]<'0')devname[k]=0;
++dev_name[k]=num-m*10+'0';
++if(dev_name[k]<'0')dev_name[k]=0;
+ k++;
+-devname[k]=0;
++dev_name[k]=0;
+ }
+
+ void set_da_parms(void)
+@@ -148,14 +148,14 @@
+ if(disksave_flag == 2 || network_flag == 2)return;
+ if( (ui.input_mode&NO_DUPLEX) != 0 && audio_out != -1)return;
+ if( (audio_in) != -1)end_program(1000);
+-make_devname(ui.ad_device_no&255);
+-audio_in=open( devname ,ui.ad_device_mode , 0);
++make_dev_name(ui.ad_device_no&255);
++audio_in=open( dev_name ,ui.ad_device_mode , 0);
+ if(audio_in == -1)end_program(1007);
+ if(ui.ad_device_no > 255)
+ {
+ i=ui.ad_device_no/255-1;
+- make_devname(i);
+- audio_in2=open( devname ,ui.ad_device_mode , 0);
++ make_dev_name(i);
++ audio_in2=open( dev_name ,ui.ad_device_mode , 0);
+ if(audio_in2 == -1)end_program(1174);
+ }
+ if(ui.ad_frag != 0)
+@@ -238,8 +238,8 @@
+ if(disksave_flag >=2)
+ {
+ if(audio_in != -1)end_program(9865);
+- make_devname(ui.ad_device_no&255);
+- audio_out=open( devname ,O_WRONLY , 0);
++ make_dev_name(ui.ad_device_no&255);
++ audio_out=open( dev_name ,O_WRONLY , 0);
+ if(audio_out == -1)end_program(1086);
+ goto set_da;
+ }
+@@ -275,8 +275,8 @@
+ }
+ else
+ {
+- make_devname(ui.da_device_no);
+- audio_out=open( devname ,O_WRONLY|O_NONBLOCK , 0);
++ make_dev_name(ui.da_device_no);
++ audio_out=open( dev_name ,O_WRONLY|O_NONBLOCK , 0);
+ if(audio_out == -1)end_program(1017);
+ set_da:;
+ // Set a small fragment size so we can stop playing quickly.
+@@ -397,24 +397,24 @@
+ for(device_no=0; device_no<MAX_DEVNAMES; device_no++)
+ {
+ dev_flag[device_no]=0;
+- make_devname(device_no);
+- fprintf(sndlog,"Checking %s\n",devname);
++ make_dev_name(device_no);
++ fprintf(sndlog,"Checking %s\n",dev_name);
+ flush_sync();
+ for(mode=0; mode<3; mode++)
+ {
+ k=1<<mode;
+ sprintf(s,
+ "Trying to open %s %s. Device defective if system hangs here. Read %s ",
+- devname, devmode_txt[mode],logfile_name);
++ dev_name, devmode_txt[mode],logfile_name);
+ flush_sync();
+ settextcolor(12);
+ xytext(0,line+1,s);
+ settextcolor(7);
+- audio_out=open( devname, devmodes[mode]|O_NONBLOCK, 0);
++ audio_out=open( dev_name, devmodes[mode]|O_NONBLOCK, 0);
+ if(audio_out != -1)
+ {
+ for(nn=0; nn<80; nn++)fprintf(sndlog,"-");
+- fprintf(sndlog,"\n%s opened as %s ",devname, devmode_txt[mode]);
++ fprintf(sndlog,"\n%s opened as %s ",dev_name, devmode_txt[mode]);
+ flush_sync();
+ rdwr_fmt=16;
+ rdwr_channels=0;
+@@ -575,7 +575,7 @@
+ if( (dev_flag[device_no]&1) == 1)
+ {
+ sprintf(ss,"\n%02d:%12s %7d Hz %d Chan. %d bit",
+- device_no,devname,dev_rd_speed[device_no],
++ device_no,dev_name,dev_rd_speed[device_no],
+ dev_rd_channels[device_no],
+ dev_rd_bits[device_no]);
+ }
+@@ -584,7 +584,7 @@
+ if( (dev_flag[device_no]&2) == 2)
+ {
+ sprintf(ss,"\n%02d:%12s %7d Hz %d Chan. %d bit",
+- device_no,devname,dev_wr_speed[device_no],
++ device_no,dev_name,dev_wr_speed[device_no],
+ dev_wr_channels[device_no],
+ dev_wr_bits[device_no]);
+ }
+@@ -631,11 +631,11 @@
+ color=0x17;
+ sprintf(&ss[maxcolumn],
+ "\n%02d:%12s %7d Hz %d Chan. %d bit %s",
+- device_no,devname,dev_wr_speed[device_no],
++ device_no,dev_name,dev_wr_speed[device_no],
+ dev_wr_channels[device_no],
+ dev_wr_bits[device_no],devmode_txt[1]);
+ sprintf(ss,"\n%02d:%12s %7d Hz %d Chan. %d bit %s",
+- device_no,devname,dev_rd_speed[device_no],
++ device_no,dev_name,dev_rd_speed[device_no],
+ dev_rd_channels[device_no],
+ dev_rd_bits[device_no],devmode_txt[0]);
+ }
+@@ -649,17 +649,17 @@
+ color=0x17;
+ sprintf(&ss[2*maxcolumn],
+ "\n%02d:%12s %7d Hz %d Chan. %d bit %s",
+- device_no,devname,dev_wr_speed[device_no],
++ device_no,dev_name,dev_wr_speed[device_no],
+ dev_wr_channels[device_no],
+ dev_wr_bits[device_no],devmode_txt[1]);
+ sprintf(&ss[maxcolumn],
+ "\n%02d:%12s %7d Hz %d Chan. %d bit %s",
+- device_no,devname,dev_rd_speed[device_no],
++ device_no,dev_name,dev_rd_speed[device_no],
+ dev_rd_channels[device_no],
+ dev_rd_bits[device_no],devmode_txt[0]);
+ sprintf(ss,
+ "\n%02d:%12s %7d Hz %d Chan. %d bit %s",
+- device_no,devname,dev_rdwr_speed[device_no],
++ device_no,dev_name,dev_rdwr_speed[device_no],
+ dev_rdwr_channels[device_no],
+ dev_rdwr_bits[device_no],devmode_txt[2]);
+ }
+@@ -672,12 +672,12 @@
+ color=0x17;
+ sprintf(&ss[maxcolumn],
+ "\n%02d:%12s %7d Hz %d Chan. %d bit %s",
+- device_no,devname,dev_wr_speed[device_no],
++ device_no,dev_name,dev_wr_speed[device_no],
+ dev_wr_channels[device_no],
+ dev_wr_bits[device_no],devmode_txt[1]);
+ sprintf(ss,
+ "\n%02d:%12s %7d Hz %d Chan. %d bit %s %s",
+- device_no,devname,dev_rd_speed[device_no],
++ device_no,dev_name,dev_rd_speed[device_no],
+ dev_rd_channels[device_no], dev_rd_bits[device_no],
+ devmode_txt[0],devmode_txt[2]);
+ }
+@@ -686,12 +686,12 @@
+ color=0x1d;
+ sprintf(&ss[maxcolumn],
+ "\n%02d:%12s %7d Hz %d Chan. %d bit %s %s",
+- device_no,devname,dev_wr_speed[device_no],
++ device_no,dev_name,dev_wr_speed[device_no],
+ dev_wr_channels[device_no], dev_wr_bits[device_no],
+ devmode_txt[1],devmode_txt[2]);
+ sprintf(ss,
+ "\n%02d:%12s %7d Hz %d Chan. %d bit %s",
+- device_no,devname,dev_rd_speed[device_no],
++ device_no,dev_name,dev_rd_speed[device_no],
+ dev_rd_channels[device_no], dev_rd_bits[device_no],
+ devmode_txt[0]);
+ }
+@@ -777,8 +777,8 @@
+ }
+ }
+ vga_clear();
+-make_devname(ui.ad_device_no);
+-fprintf(sndlog,"\n\n %s selected by user for input.",devname);
++make_dev_name(ui.ad_device_no);
++fprintf(sndlog,"\n\n %s selected by user for input.",dev_name);
+ fprintf(sndlog," dev_flag=%d",dev_flag[ui.ad_device_no]);
+ flush_sync();
+ // High end users might need two devices to read four A/D channels.
+@@ -819,8 +819,8 @@
+ if(vga_inkey != 'Y')goto gt_dual;
+ vga_clear();
+ fprintf(sndlog,"\nUser wants to try to open two read devices");
+- make_devname(ui.ad_device_no);
+- audio_in=open( devname, O_RDONLY, 0);
++ make_dev_name(ui.ad_device_no);
++ audio_in=open( dev_name, O_RDONLY, 0);
+ if(audio_in == -1)end_program(1102);
+ // Check for DSP_CAP_TRIGGER capability
+ if(ioctl(audio_in, SNDCTL_DSP_GETCAPS,&caps) == -1)end_program(1182);
+@@ -834,14 +834,14 @@
+ if(ioctl(audio_in, SNDCTL_DSP_CHANNELS, &j) == -1)end_program(1185);
+ if(j != 2)end_program(1186);
+ }
+- make_devname(i);
+- audio_in2=open( devname, O_RDONLY|O_NONBLOCK, 0);
++ make_dev_name(i);
++ audio_in2=open( dev_name, O_RDONLY|O_NONBLOCK, 0);
+ if(audio_in2 != -1)
+ {
+ line++;
+- fprintf(sndlog,"\n%s opened as second read device",devname);
++ fprintf(sndlog,"\n%s opened as second read device",dev_name);
+ sprintf(s,"\n%02d:%12s %7d Hz %d Chan. %d bit",
+- i,devname,dev_rd_speed[i], dev_rd_channels[i],
++ i,dev_name,dev_rd_speed[i], dev_rd_channels[i],
+ dev_rd_bits[i]);
+ xytext(0,line,s);
+ close(audio_in2);
+@@ -866,13 +866,13 @@
+ goto get_addev2;
+ }
+ // We store the second A/D device in the second byte of ad_device_no
+- make_devname(i);
++ make_dev_name(i);
+ ui.ad_device_no+=256*(i+1);
+ for(i=0; i<MAX_DEVNAMES; i++)
+ {
+ dev_flag[i]&=255;
+ }
+- audio_in2=open( devname, O_RDONLY|O_NONBLOCK, 0);
++ audio_in2=open( dev_name, O_RDONLY|O_NONBLOCK, 0);
+ if(audio_in2 == -1)end_program(1172);
+ // Check for DSP_CAP_TRIGGER capability
+ if(ioctl(audio_in2, SNDCTL_DSP_GETCAPS,&caps) == -1)end_program(1182);
+@@ -883,7 +883,7 @@
+ close(audio_in2);
+ goto skip_dual_devices;
+ }
+- fprintf(sndlog,"\n %s is second input device.",devname);
++ fprintf(sndlog,"\n %s is second input device.",dev_name);
+ ui.input_mode=TWO_CHANNELS+IQ_DATA;
+ ui.rx_channels=2;
+ ui.ad_channels=4;
+@@ -894,7 +894,7 @@
+ }
+ // Now that we decided what device to use for input, open it and let
+ // the user decide how to use it.
+-make_devname(ui.ad_device_no);
++make_dev_name(ui.ad_device_no);
+ flush_sync();
+ ui.ad_device_mode=O_RDONLY;
+ mode=0;
+@@ -903,7 +903,7 @@
+ if( (1 & dev_flag[ui.ad_device_no]) != 0)
+ {
+ gt_rdo:;
+- sprintf(s,"Open %s as RDONLY or RDWR? (O/W)\n=>",devname);
++ sprintf(s,"Open %s as RDONLY or RDWR? (O/W)\n=>",dev_name);
+ xytext(10,10,s);
+ vga_inkey=vga_getkey();
+ clean_vga_inkey();
+@@ -925,9 +925,9 @@
+ }
+ flush_sync();
+ vga_clear();
+-sprintf(s,"For analog input: %s opened in %s mode",devname,devmode_txt[mode]);
++sprintf(s,"For analog input: %s opened in %s mode",dev_name,devmode_txt[mode]);
+ xytext(0,0,s);
+-audio_in=open( devname, ui.ad_device_mode, 0);
++audio_in=open( dev_name, ui.ad_device_mode, 0);
+ if(audio_in == -1)end_program(1038);
+ j=dev_rd_channels[ui.ad_device_no];
+ xytext(0,10,"Select radio interface:");
+@@ -1123,7 +1123,7 @@
+
+
+ settextcolor(12);
+-sprintf(s,"Trying to read %s",devname);
++sprintf(s,"Trying to read %s",dev_name);
+ xytext(10,10,s);
+ xytext(0,12,"If you see this message for more than 2 seconds READ failed");
+ xytext(0,13,"Then try another device");
+@@ -1176,7 +1176,7 @@
+ }
+ fprintf(sndlog,"\nRead test OK");
+ for(i=10; i<14; i++)xytext(0,i,ss);
+-sprintf(s,"Now trying to open a second device while %s is open",devname);
++sprintf(s,"Now trying to open a second device while %s is open",dev_name);
+ xytext(0,6,s);
+ xytext(0,7,"This may cause your system to hang. Try ctrlC to exit (or reboot)");
+ xytext(0,8,"Try another input device or install another sound system.");
+@@ -1192,9 +1192,9 @@
+ read(audio_in, testbuff, 1024);
+ if(ioctl(audio_in,SNDCTL_DSP_GETISPACE,&ad_info) == -1)end_program(1093);
+ }
+- make_devname(i);
++ make_dev_name(i);
+ cn=0;
+- sprintf(s,"%02d:%12s",i,devname);
++ sprintf(s,"%02d:%12s",i,dev_name);
+ xytext(0,line,s);
+ column=0;
+ while(s[column] != 0)column++;
+@@ -1206,7 +1206,7 @@
+ if( (ui.input_mode&DWORD_INPUT) != 0 || ui.ad_channels > 2)
+ {
+ sprintf(&s[column],
+- " RDWR useless (too many bits or channels) %d: %s",i,devname);
++ " RDWR useless (too many bits or channels) %d: %s",i,dev_name);
+ dev_flag[i]=0;
+ }
+ else
+@@ -1224,10 +1224,10 @@
+ dev_flag[i]&=0xffff-4;
+ if( (dev_flag[i]&2) != 0 )
+ {
+- audio_out=open( devname, O_WRONLY|O_NONBLOCK, 0);
++ audio_out=open( dev_name, O_WRONLY|O_NONBLOCK, 0);
+ if(audio_out != -1)
+ {
+- fprintf(sndlog,"\n%s opened as WRONLY",devname);
++ fprintf(sndlog,"\n%s opened as WRONLY",dev_name);
+ flush_sync();
+ if(ioctl(audio_in, SNDCTL_DSP_GETISPACE,
+ &ad_info) == -1)end_program(1094);
+@@ -1380,17 +1380,17 @@
+ line=0;
+ for(i=0; i<MAX_DEVNAMES; i++)
+ {
+- make_devname(i);
+- fprintf(sndlog,"\n%s ",devname);
++ make_dev_name(i);
++ fprintf(sndlog,"\n%s ",dev_name);
+ cn=0;
+- sprintf(s,"%02d:%12s",i,devname);
++ sprintf(s,"%02d:%12s",i,dev_name);
+ xytext(0,line,s);
+ column=0;
+ while(s[column] != 0)column++;
+- audio_out=open( devname, O_WRONLY|O_NONBLOCK, 0);
++ audio_out=open( dev_name, O_WRONLY|O_NONBLOCK, 0);
+ if(audio_out != -1)
+ {
+- fprintf(sndlog,"\n%s opened as WRONLY with no input open.",devname);
++ fprintf(sndlog,"\n%s opened as WRONLY with no input open.",dev_name);
+ flush_sync();
+ j=AFMT_U8;
+ if(ioctl(audio_out, SNDCTL_DSP_SETFMT, &j) == -1)
+@@ -1528,8 +1528,8 @@
+ ui.da_device_no=j;
+ if( (6 & dev_flag[ui.da_device_no]) == 0) goto get_dadev;
+ }
+-make_devname(ui.da_device_no);
+-fprintf(sndlog,"\nUser selected %s for output.",devname);
++make_dev_name(ui.da_device_no);
++fprintf(sndlog,"\nUser selected %s for output.",dev_name);
+ for(i=6; i<=line; i++)xytext(0,i,ss);
+ xytext(0,8,"Use close and reopen for D/A when");
+ xytext(0,9,"a new signal is selected? (Y/N)");
+@@ -1563,8 +1563,8 @@
+ }
+ else
+ {
+- audio_out=open( devname ,O_WRONLY , 0);
+- sprintf(s,"\nUsing %s for output",devname);
++ audio_out=open( dev_name ,O_WRONLY , 0);
++ sprintf(s,"\nUsing %s for output",dev_name);
+ xytext(0,6,s);
+ if(audio_out == -1)end_program(1068);
+ da_wrbuf = NULL;
diff --git a/comms/linrad/files/patch-tune.c b/comms/linrad/files/patch-tune.c
new file mode 100644
index 000000000000..641da1db0441
--- /dev/null
+++ b/comms/linrad/files/patch-tune.c
@@ -0,0 +1,15 @@
+--- tune.c.orig Tue May 18 09:43:30 2004
++++ tune.c Fri Jul 9 12:25:02 2004
+@@ -1,10 +1,9 @@
+
+-
+-#include <sys/io.h>
++#include <sys/types.h>
+ #include <vga.h>
+ #include <vgagl.h>
+ #include <unistd.h>
+-
++#include <machine/cpufunc.h>
+ #include "globdef.h"
+ #include "uidef.h"
+ #include "fft1def.h"
diff --git a/comms/linrad/files/patch-uidef.h b/comms/linrad/files/patch-uidef.h
new file mode 100644
index 000000000000..11bfbf0bf30f
--- /dev/null
+++ b/comms/linrad/files/patch-uidef.h
@@ -0,0 +1,9 @@
+--- uidef.h.orig Tue May 18 09:43:30 2004
++++ uidef.h Thu Jul 8 18:27:42 2004
+@@ -1,4 +1,5 @@
+-#include <arpa/inet.h>
++#include <sys/types.h>
++#include <netinet/in.h>
+
+ #define MAX_FLOWCNT 31
+
diff --git a/comms/linrad/files/patch-uivar.c b/comms/linrad/files/patch-uivar.c
new file mode 100644
index 000000000000..58be3bee833e
--- /dev/null
+++ b/comms/linrad/files/patch-uivar.c
@@ -0,0 +1,11 @@
+--- uivar.c.orig Tue May 18 09:43:30 2004
++++ uivar.c Thu Jul 8 14:17:52 2004
+@@ -2,7 +2,7 @@
+ #include "globdef.h"
+ #include "uidef.h"
+ #include "conf.h"
+-
++#include <netinet/in.h>
+
+
+ ROUTINE par_from_keyboard_routine;
diff --git a/comms/linrad/files/patch-wcw.c b/comms/linrad/files/patch-wcw.c
new file mode 100644
index 000000000000..40e57c762866
--- /dev/null
+++ b/comms/linrad/files/patch-wcw.c
@@ -0,0 +1,28 @@
+--- wcw.c.orig Thu Jul 8 18:22:12 2004
++++ wcw.c Thu Jul 8 18:22:55 2004
+@@ -116,10 +116,12 @@
+ int syncflag, baseb_graph_time;
+ audio_buf_info ad_info, ad_info2;
+ touch_stack();
++#if 0
+ if(ui.memlock == 0)
+ {
+ if(mlockall(MCL_CURRENT) != 0)end_program(1165);
+ }
++#endif
+ baseb_graph_time=0;
+ get_buffers(0);
+ if(lir_status != LIR_OK)return;
+@@ -181,10 +183,12 @@
+ diskread_timer=recent_time;
+ latest_idle_time=recent_time;
+ lirsta=RX_LOW_PRIO;
++#if 0
+ if(ui.memlock == 0)
+ {
+ if(mlockall(MCL_CURRENT) != 0)lir_status=LIR_MEMERR;
+ }
++#endif
+ if(lir_status != LIR_OK)goto wcw_exit;
+ // *******************************************************
+ // MAIN RECEIVE LOOP
diff --git a/comms/linrad/pkg-descr b/comms/linrad/pkg-descr
new file mode 100644
index 000000000000..a7e3ee7e6b10
--- /dev/null
+++ b/comms/linrad/pkg-descr
@@ -0,0 +1,10 @@
+Amateur Radio DSP utility (SDR)
+
+Linrad receives a signal in digital form by reading a device. Currently Linrad
+operates by sampling sound on line-in channel of an audio card. In the future
+boards sampling directly at RF frequencies will be available.
+
+WWW: http://www.nitehawk.com/sm5bsz/linuxdsp/linrad.htm
+
+- Diane Bruce, VA3DB
+db@db.net
diff --git a/comms/linrad/pkg-plist b/comms/linrad/pkg-plist
new file mode 100644
index 000000000000..369a90999bc6
--- /dev/null
+++ b/comms/linrad/pkg-plist
@@ -0,0 +1,14 @@
+bin/linrad
+%%PORTDOCS%%%%DOCSDIR%%/z_APM.txt
+%%PORTDOCS%%%%DOCSDIR%%/z_BUFFERS.txt
+%%PORTDOCS%%%%DOCSDIR%%/z_CALIBRATE.txt
+%%PORTDOCS%%%%DOCSDIR%%/z_COPYRIGHT.txt
+%%PORTDOCS%%%%DOCSDIR%%/z_GIFINFO.txt
+%%PORTDOCS%%%%DOCSDIR%%/z_INSTALL.txt
+%%PORTDOCS%%%%DOCSDIR%%/z_MLOCK.txt
+%%PORTDOCS%%%%DOCSDIR%%/z_SETTINGS.txt
+%%PORTDOCS%%%%DOCSDIR%%/z_SPEED.txt
+%%PORTDOCS%%%%DOCSDIR%%/z_SVGALIB.txt
+%%PORTDOCS%%%%DOCSDIR%%/z_USERS_HWARE.txt
+%%PORTDOCS%%%%DOCSDIR%%/z_USLEEP.txt
+%%PORTDOCS%%@dirrm %%DOCSDIR%%