diff --git a/comms/linrad/Makefile b/comms/linrad/Makefile index 3ce2e3ae2804..864b4aa5be92 100644 --- a/comms/linrad/Makefile +++ b/comms/linrad/Makefile @@ -6,33 +6,39 @@ # PORTNAME= linrad -PORTVERSION= 0.16a +PORTVERSION= 2.14 CATEGORIES= comms hamradio MASTER_SITES= http://www.nitehawk.com/sm5bsz/linuxdsp/archive/ -DISTNAME= lir01-20 +DISTNAME= lir02-14 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 +WRKSRC= ${WRKDIR}/${PORTNAME}-02.14 USE_AUTOTOOLS= autoconf:253 HAS_CONFIGURE= yes USE_BZIP2= yes - -CONFIGURE_TARGET= --build=${MACHINE_ARCH}-portbld-freebsd${OSREL} +USE_X_PREFIX= yes +ONLY_FOR_ARCHS= i386 post-patch: - @${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|' \ - ${WRKSRC}/configure.in ${WRKSRC}/Makefile.in - + @${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|g' \ + -e 's|%%X11BASE%%|${X11BASE}|g' \ + -e 's|-pthread|${PTHREAD_LIBS}|' ${WRKSRC}/Makefile.in + @${REINPLACE_CMD} -e 's|%%DATADIR%%|${DATADIR}/|' \ + ${WRKSRC}/help.c do-install: - ${INSTALL_PROGRAM} -m04555 ${WRKSRC}/${PORTNAME} ${PREFIX}/bin/${PORTNAME} + ${MKDIR} ${DATADIR} + ${INSTALL_DATA} ${WRKSRC}/errors.lir ${DATADIR}/errors.lir + ${INSTALL_DATA} ${WRKSRC}/help.lir ${DATADIR}/help.lir +# ${INSTALL_PROGRAM} -m04555 ${WRKSRC}/${PORTNAME} ${PREFIX}/bin/${PORTNAME} + ${INSTALL_PROGRAM} -m04555 ${WRKSRC}/x${PORTNAME} ${PREFIX}/bin/x${PORTNAME} + .if !defined(NOPORTDOCS) ${MKDIR} ${DOCSDIR} ${INSTALL_DATA} ${WRKSRC}/z_APM.txt ${DOCSDIR}/z_APM.txt @@ -40,11 +46,11 @@ do-install: ${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_MOUSE.txt ${DOCSDIR}/z_MOUSE.txt + ${INSTALL_DATA} ${WRKSRC}/z_PARALLEL_PORT.txt ${DOCSDIR}/z_PARALLEL_PORT.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_EXTRA.txt ${DOCSDIR}/z_USERS_EXTRA.txt ${INSTALL_DATA} ${WRKSRC}/z_USERS_HWARE.txt ${DOCSDIR}/z_USERS_HWARE.txt ${INSTALL_DATA} ${WRKSRC}/z_USLEEP.txt ${DOCSDIR}/z_USLEEP.txt @${ECHO} "" diff --git a/comms/linrad/distinfo b/comms/linrad/distinfo index 55ff8a938a57..43224bb7acc2 100644 --- a/comms/linrad/distinfo +++ b/comms/linrad/distinfo @@ -1,3 +1,3 @@ -MD5 (linrad/lir01-20.tbz) = 34b6f5ef52adf8b9a8af444db43ddf70 -SHA256 (linrad/lir01-20.tbz) = b463cf28cf4aa462961025f1a6c6d23d4504e738e67dca0a018ca31e52fb8f12 -SIZE (linrad/lir01-20.tbz) = 330472 +MD5 (linrad/lir02-14.tbz) = a4e451b891459023bb9272d5fe0f590b +SHA256 (linrad/lir02-14.tbz) = 4a95bf060c900899969e83d0e164ec5e9932ffe34cf2c2485bbea6179fb8e899 +SIZE (linrad/lir02-14.tbz) = 423720 diff --git a/comms/linrad/files/patch-Makefile.in b/comms/linrad/files/patch-Makefile.in index 99ba885668bc..6c414e91c2cb 100644 --- a/comms/linrad/files/patch-Makefile.in +++ b/comms/linrad/files/patch-Makefile.in @@ -1,57 +1,77 @@ ---- Makefile.in.orig Tue May 18 09:43:30 2004 -+++ Makefile.in Sat Nov 12 11:41:30 2005 -@@ -1,11 +1,14 @@ -+INCLUDE= %%LOCALBASE%%/include -+LIBS= %%LOCALBASE%%/lib -+ - - .c.o: --# gcc -I/usr/local/include -c -o $*.o $< -- gcc -O -W -Wimplicit -Wreturn-type -Wformat \ +--- Makefile.in.orig Sat May 27 07:48:22 2006 ++++ Makefile.in Mon Jun 19 21:40:59 2006 +@@ -4,17 +4,14 @@ + # Name the output files *.ol instead of *.o + # so we definitely know it is for Linux. + # (*.o files can be present by mistake) +-LCC = gcc ++LCC = ${CC} + # Use the mingw cross compiler for Windows + # Name the output files *.ow instead of *.o + # so we definitely know it is for Windows. + # (*.o files can be present by mistake) + WCC = /usr/bin/i586-mingw32msvc-gcc + # Always use the same flags. +-CFL = -g -O -DOSNUM=1 -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 \ -+#$< +--Wparentheses -Wstrict-prototypes -Werror -ffast-math \ +--fomit-frame-pointer -c -o ++CFL = ${CFLAGS} -I%%LOCALBASE%%/include -I%%X11BASE%%/include -L%%LOCALBASE%%/lib -L%%X11BASE%%/lib -DOSNUM=1 -ffast-math -fomit-frame-pointer -c -o + CFW = -g -O -DOSNUM=2 -W -Wimplicit -Wreturn-type -Wformat \ + -Wunused -Wcomment -Wchar-subscripts -Wshadow -Wuninitialized \ + -Wparentheses -Wstrict-prototypes -Werror -ffast-math \ +@@ -360,7 +357,8 @@ - .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 + # ---------------------- Linux console specific things ------------------ +-linrad: Makefile lmain.ol ui.ol uivar.ol fft1var.ol lsetad.ol hware.ol rxin.ol \ ++all: xlinrad ++linrad: lmain.ol ui.ol uivar.ol fft1var.ol lsetad.ol hware.ol rxin.ol \ + wide_graph.ol getiq.ol fft0.ol fft1.ol adtest.ol screenvar.ol sigvar.ol \ + baseb_graph.ol afc_graph.ol hires_graph.ol fftasm.ol palette.ol gifsave.ol \ + calibrate.ol calsub.ol calsub2.ol llsqvar.ol caliq.ol hwaredriver.ol \ +@@ -374,7 +372,7 @@ + menu.ol screen.ol sdrvar.ol lsys.ol sdr14.ol keyboard_var.ol linvar.ol \ + fonts.ol screensub.ol membeg.ol lxsys.ol memend.ol - 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 +- gcc -olinrad -lvgagl -lvga -lpthread -lm \ ++ ${CC} -olinrad -I%%LOCALBASE%%/include -L%%LOCALBASE%%/lib -I%%X11BASE%%/include -L%%X11BASE%%/lib -lvgagl -lvga -lpthread -lm \ + -Wl,-Map,linrad.lmap,-warn-common,--cref \ + membeg.ol lmain.ol linvar.ol ui.ol lsetad.ol fft1.ol buf.ol \ + mouse.ol wide_graph.ol getiq.ol fft0.ol adtest.ol hires_graph.ol \ +@@ -403,7 +401,7 @@ + $(LCC) lmain.c $(CFL) lmain.ol - 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 + # ---------------------- Linux X11 specific things ------------------ +-xlinrad: Makefile xmain.ol ui.ol uivar.ol fft1var.ol lsetad.ol hware.ol rxin.ol \ ++xlinrad: xmain.ol ui.ol uivar.ol fft1var.ol lsetad.ol hware.ol rxin.ol \ + wide_graph.ol getiq.ol fft0.ol fft1.ol adtest.ol screenvar.ol sigvar.ol \ + baseb_graph.ol afc_graph.ol hires_graph.ol fftasm.ol palette.ol gifsave.ol \ + calibrate.ol calsub.ol calsub2.ol llsqvar.ol caliq.ol hwaredriver.ol \ +@@ -420,7 +418,7 @@ - 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 + + +- gcc -oxlinrad -L/usr/X11R6/lib -lX11 -lpthread -lm \ ++ ${CC} -oxlinrad -L%%X11BASE%%/lib -lX11 -lpthread -lm \ + -Wl,-Map,linrad.xmap,-warn-common,--cref \ + membeg.ol xmain.ol xvar.ol ui.ol lsetad.ol fft1.ol buf.ol \ + mouse.ol wide_graph.ol getiq.ol fft0.ol adtest.ol hires_graph.ol \ +@@ -636,13 +634,13 @@ + + # ------------------ Tools for Linux ----------------------- + vgatest: vgatest.ol +- gcc -ovgatest -lvgagl -lvga -lm -Wl -s vgatest.ol ++ ${CC} -ovgatest -I%%LOCALBASE%%/include -L%%LOCALBASE%%/lib -lvgagl -lvga -lm -Wl -s vgatest.ol + vgatest.ol: vgatest.c +- gcc vgatest.c -c -o vgatest.ol ++ ${CC} vgatest.c -I%%LOCALBASE%%/include -c -o vgatest.ol + mousetest: mousetest.ol +- gcc -omousetest -lvgagl -lvga -lm -Wl -s mousetest.ol ++ ${CC} -omousetest -L%%LOCALBASE%%/lib -lvgagl -lvga -lm -Wl -s mousetest.ol + mousetest.ol: mousetest.c +- gcc mousetest.c -c -o mousetest.ol ++ ${CC} mousetest.c -I%%LOCALBASE%%/include -L%%LOCALBASE%%/lib -c -o mousetest.ol + thrdef.h: rusage.h + rm -f x.x + cp thrdef.h x.x diff --git a/comms/linrad/files/patch-configure.in b/comms/linrad/files/patch-configure.in deleted file mode 100644 index 86a164a68cb2..000000000000 --- a/comms/linrad/files/patch-configure.in +++ /dev/null @@ -1,31 +0,0 @@ ---- 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-help.c b/comms/linrad/files/patch-help.c new file mode 100644 index 000000000000..0361d8e7a7bb --- /dev/null +++ b/comms/linrad/files/patch-help.c @@ -0,0 +1,20 @@ +--- help.c.orig Sat May 27 07:48:22 2006 ++++ help.c Tue Jun 20 20:37:14 2006 +@@ -344,7 +344,7 @@ + printf("\n%s",s); + DEB"\n%s",s); + } +-msg_filename="errors.lir"; ++msg_filename="%%DATADIR%%errors.lir"; + line=3; + if(screen_mode) + { +@@ -359,7 +359,7 @@ + { + int line; + if(msg_no < 0)return; +-msg_filename="help.lir"; ++msg_filename="%%DATADIR%%help.lir"; + line=0; + settextcolor(15); + clear_screen(); diff --git a/comms/linrad/files/patch-hwaredriver.c b/comms/linrad/files/patch-hwaredriver.c deleted file mode 100644 index 17764dedba94..000000000000 --- a/comms/linrad/files/patch-hwaredriver.c +++ /dev/null @@ -1,19 +0,0 @@ ---- hwaredriver.c.orig Tue May 18 09:43:30 2004 -+++ hwaredriver.c Fri Jul 9 11:26:15 2004 -@@ -1,6 +1,6 @@ - - #include --#include -+#include - #include - #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-lmain.c b/comms/linrad/files/patch-lmain.c new file mode 100644 index 000000000000..8a04628007fc --- /dev/null +++ b/comms/linrad/files/patch-lmain.c @@ -0,0 +1,38 @@ +--- lmain.c.orig Sat May 27 07:48:22 2006 ++++ lmain.c Sat Jun 17 23:49:10 2006 +@@ -11,7 +11,6 @@ + #define MAX_MOUSE_CURSIZE 50 + + +-#include + #include + #include + #include +@@ -97,6 +96,7 @@ + simd1=0; + mmx_present=i&1; + if(mmx_present != 0)simd_present=i/2; else simd_present=0; ++#if 0 + if(i!=0) + { + file = fopen("/proc/cpuinfo", "r"); +@@ -142,9 +142,11 @@ + file=NULL; + } + } ++#endif + file = fopen(userint_filename, "rb"); + if (file == NULL) + { ++#if 0 + if(xxprint != 0) + { + i=0; +@@ -170,6 +172,7 @@ + printf("\nwith appropriate patches.\n\n"); + } + } ++#endif + printf("\nSetup file %s missing.",userint_filename); + full_setup:; + for(i=0; iMAX_DEVNAMES) ++if(n>MAX_DEVNAMES) + { + lirerr(9236); + return; + } +-m=num/10; +-if(m > 0) +- { +- devname[k]=m+'0'; +- k++; +- } +-devname[k]=num-m*10+'0'; +-if(devname[k]<'0')devname[k]=0; +-k++; +-devname[k]=0; +-// put /dev/dsp at the end of the list +-if ((n+2)==MAX_DEVNAMES){ +- k=DEVNAMPOS; +- devname[k]=0; +- k++; +- devname[k]=0; +- } ++ sprintf(dev_name, "/dev/dspW%d", n); + } + // ------------------------------------------------------------- + // The original code was: +@@ -557,7 +538,7 @@ + if(i&AFMT_S16_LE)ui.max_output_bytes=2; + ui.max_output_speed=ABOVE_MAX_SPEED; + ui.min_output_speed=1; +-if(ioctl(audio_out, SNDCTL_DSP_SPEED, &ui.max_output_speed) == -1) ++if(ioctl(audio_out, SNDCTL_DSP_SPEED, &ui.min_output_speed) == -1) + { + lirerr(1072); + return; +@@ -666,7 +647,7 @@ + return; + } + make_devname(ui.ad_device_no&255); +-audio_in=open( devname ,ui.ad_device_mode , 0); ++audio_in=open( dev_name ,ui.ad_device_mode , 0); + if(audio_in == -1) + { + lirerr(1007); +@@ -676,7 +657,7 @@ + { + i=ui.ad_device_no/255-1; + make_devname(i); +- audio_in2=open( devname ,ui.ad_device_mode , 0); ++ audio_in2=open( dev_name ,ui.ad_device_mode , 0); + if(audio_in2 == -1) + { + lirerr(1174); +@@ -869,7 +850,7 @@ + return; + } + make_devname(ui.ad_device_no&255); +- audio_out=open( devname ,O_WRONLY , 0); ++ audio_out=open( dev_name ,O_WRONLY , 0); + if(audio_out == -1) + { + lirerr(1086); +@@ -909,7 +890,7 @@ + else + { + make_devname(ui.da_device_no); +- audio_out=open( devname ,O_WRONLY , 0); ++ audio_out=open( dev_name ,O_WRONLY , 0); + if(audio_out == -1) + { + if(disksave_flag==2) +@@ -1048,9 +1029,9 @@ + for(device_no=0; device_no",devname); ++ sprintf(s,"Open %s as RDONLY or RDWR? (O/W) =>",dev_name); + lir_text(10,10,s); + await_processed_keyboard(); + if(kill_all_flag) goto setad_errexit; +@@ -2010,9 +1992,9 @@ + } + sndlog_sync(); + clear_screen(); +-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]); + lir_text(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) + { + lirerr(1038); +@@ -2108,13 +2090,16 @@ + lir_text(0,7,"to reconfigure the hardware. (Under OSS, run ossmix)"); + max=dev_max_rd_speed[ui.ad_device_no&255]; + min=dev_min_rd_speed[ui.ad_device_no&255]; ++#if 0 + if(max == ABOVE_MAX_SPEED || max < 1000) + { + max = ABOVE_MAX_SPEED; + speed_warning = 1; + } ++#endif + sprintf(s,"Select sampling speed(%d to %d)", min,max); + lir_text(0,10,s); ++#if 0 + if(speed_warning != 0) + { + settextcolor(12); +@@ -2123,6 +2108,7 @@ + lir_text(0,13,"Incorrect (not supported) values may cause system to hang"); + settextcolor(7); + } ++#endif + column=0; + while(s[column] != 0)column++; + ui.input_speed=lir_get_integer(column+2, 10, 8, min,max); +@@ -2131,6 +2117,7 @@ + rdwr_max_speed=ui.input_speed; + SNDLOG"\n%d Hz selected by user",ui.input_speed); + clear_lines(5,10); ++ui.input_speed; + if(ioctl(audio_in, SNDCTL_DSP_SPEED, &ui.input_speed)==-1) + { + lirerr(1041); +@@ -2249,7 +2236,7 @@ + goto setad_errexit; + } + settextcolor(12); +-sprintf(s,"Trying to read %s",devname); ++sprintf(s,"Trying to read %s",dev_name); + lir_text(10,10,s); + lir_text(0,12,"If you see this message for more than 2 seconds READ failed"); + lir_text(0,13,"Then try another device"); +@@ -2313,7 +2300,7 @@ + } + SNDLOG"\nRead test OK"); + clear_lines(10,13); +-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); + lir_text(0,6,s); + lir_text(0,7,"This may cause your system to hang. Try ctrlC to exit (or reboot)"); + lir_text(0,8,"Try another input device or install another sound system."); +@@ -2326,7 +2313,7 @@ + if(read_test_ad(testbuff)!=0)goto clr_wrdev; + make_devname(i); + cn=0; +- sprintf(s,"%02d:%12s",i,devname); ++ sprintf(s,"%02d:%12s",i,dev_name); + lir_text(0,line,s); + column=0; + while(s[column] != 0)column++; +@@ -2338,7 +2325,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 +@@ -2356,7 +2343,7 @@ + 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(read_test_ad(testbuff)!=0)goto clr_wrdev; + if(audio_out != -1) + { +@@ -2364,7 +2351,7 @@ + j=0; + ioctl(audio_out, SNDCTL_DSP_COOKEDMODE, &j); + #endif +- SNDLOG"\n%s opened as WRONLY",devname); ++ SNDLOG"\n%s opened as WRONLY",dev_name); + sndlog_sync(); + if(ioctl(audio_in, SNDCTL_DSP_GETISPACE, &ad_info) == -1) + { +@@ -2562,20 +2549,20 @@ + for(i=0; i ++#include ++#include ++#include ++#include + #include + #include + #include +@@ -14,6 +16,7 @@ + #include "lindef.h" + #include "hwaredef.h" + ++extern int saved_euid; + + char *locktext[6]={"*W A R N I N G* Read z_MLOCK.txt for info.", + "*** mlockall can cause system crashes!! ***", +@@ -40,11 +43,9 @@ + // Get permission to write to the parallel port + if(ui.parport < 0x400-4) + { +- i=ioperm(ui.parport,4,1); +- } +-else +- { +- i=iopl(3); ++ seteuid(saved_euid); ++ i=i386_set_ioperm(ui.parport,4,1); ++ seteuid(getuid()); + } + if(i != 0) + { +@@ -189,11 +190,9 @@ + int i; + if(ui.parport < 0x400-4) + { +- i=ioperm(ui.parport,4,1); +- } +-else +- { +- i=iopl(3); ++ seteuid(saved_euid); ++ i=i386_set_ioperm(ui.parport,4,1); ++ seteuid(getuid()); + } + if(i!=0)lirerr(764921); + i=1000; +@@ -206,11 +205,9 @@ + int i; + if(ui.parport < 0x400-4) + { +- i=ioperm(ui.parport,4,1); +- } +-else +- { +- i=iopl(3); ++ seteuid(saved_euid); ++ i=i386_set_ioperm(ui.parport,4,1); ++ seteuid(getuid()); + } + if(i!=0)lirerr(764921); + return inb(port); diff --git a/comms/linrad/files/patch-main.c b/comms/linrad/files/patch-main.c deleted file mode 100644 index 8207749a98c1..000000000000 --- a/comms/linrad/files/patch-main.c +++ /dev/null @@ -1,37 +0,0 @@ ---- 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 deleted file mode 100644 index 7dbc0ca8afbe..000000000000 --- a/comms/linrad/files/patch-modesub.c +++ /dev/null @@ -1,37 +0,0 @@ ---- modesub.c.orig Tue May 18 09:43:30 2004 -+++ modesub.c Fri Jul 9 11:17:15 2004 -@@ -5,7 +5,7 @@ - #include - #include - #include --#include -+#include - #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 deleted file mode 100644 index 0b9098d7d610..000000000000 --- a/comms/linrad/files/patch-setad.c +++ /dev/null @@ -1,390 +0,0 @@ ---- 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",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 -+#include - #include - #include - #include -- -+#include - #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 index 11bfbf0bf30f..b11e12dff47e 100644 --- a/comms/linrad/files/patch-uidef.h +++ b/comms/linrad/files/patch-uidef.h @@ -1,9 +1,11 @@ ---- uidef.h.orig Tue May 18 09:43:30 2004 -+++ uidef.h Thu Jul 8 18:27:42 2004 -@@ -1,4 +1,5 @@ --#include -+#include -+#include +--- uidef.h.orig Mon Jun 19 20:18:17 2006 ++++ uidef.h Mon Jun 19 20:18:24 2006 +@@ -5,7 +5,7 @@ + #define MAX_FLOWCNT 31 - +-#define MAX_DEVNAMES 65 ++#define MAX_DEVNAMES 10 + #define MAX_LOWSPEED 10 + #define ABOVE_MAX_SPEED 768000 + diff --git a/comms/linrad/files/patch-uivar.c b/comms/linrad/files/patch-uivar.c deleted file mode 100644 index 58be3bee833e..000000000000 --- a/comms/linrad/files/patch-uivar.c +++ /dev/null @@ -1,11 +0,0 @@ ---- 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 - - - ROUTINE par_from_keyboard_routine; diff --git a/comms/linrad/files/patch-wcw.c b/comms/linrad/files/patch-wcw.c deleted file mode 100644 index 40e57c762866..000000000000 --- a/comms/linrad/files/patch-wcw.c +++ /dev/null @@ -1,28 +0,0 @@ ---- 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/files/patch-xmain.c b/comms/linrad/files/patch-xmain.c new file mode 100644 index 000000000000..32db8e4f53b1 --- /dev/null +++ b/comms/linrad/files/patch-xmain.c @@ -0,0 +1,20 @@ +--- xmain.c.orig Mon Jun 19 22:40:14 2006 ++++ xmain.c Mon Jun 19 23:33:03 2006 +@@ -38,7 +38,7 @@ + float total; + }PIXINFO; + +- ++int saved_euid=-1; + + int main(int argc, char **argv) + { +@@ -58,6 +58,8 @@ + XTextProperty window_title_property; + unsigned short int *ipalette; + XColor xco; ++saved_euid=geteuid(); ++setuid(getuid()); /* XXX drop perms! */ + if(UNINIT_MEMDATA != 0) + { + memptr=(void*)(&uninit_mem_begin); diff --git a/comms/linrad/pkg-plist b/comms/linrad/pkg-plist index 369a90999bc6..b1166f8fe50e 100644 --- a/comms/linrad/pkg-plist +++ b/comms/linrad/pkg-plist @@ -1,14 +1,17 @@ -bin/linrad +bin/xlinrad +%%DATADIR%%/errors.lir +%%DATADIR%%/help.lir %%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_MOUSE.txt +%%PORTDOCS%%%%DOCSDIR%%/z_PARALLEL_PORT.txt %%PORTDOCS%%%%DOCSDIR%%/z_SETTINGS.txt -%%PORTDOCS%%%%DOCSDIR%%/z_SPEED.txt -%%PORTDOCS%%%%DOCSDIR%%/z_SVGALIB.txt +%%PORTDOCS%%%%DOCSDIR%%/z_USERS_EXTRA.txt %%PORTDOCS%%%%DOCSDIR%%/z_USERS_HWARE.txt %%PORTDOCS%%%%DOCSDIR%%/z_USLEEP.txt %%PORTDOCS%%@dirrm %%DOCSDIR%% +@dirrm %%DATADIR%%