[Midnightbsd-cvs] mports: mports/comms: An afterstep modem monitor program.

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Sat Aug 16 23:31:11 EDT 2008


Log Message:
-----------
An afterstep modem monitor program.

Modified Files:
--------------
    mports/comms:
        Makefile (r1.10 -> r1.11)

Added Files:
-----------
    mports/comms/asmodem:
        Makefile (r1.1)
        distinfo (r1.1)
        pkg-descr (r1.1)
    mports/comms/asmodem/files:
        patch-aa (r1.1)
        patch-ab (r1.1)
        patch-ac (r1.1)

-------------- next part --------------
Index: Makefile
===================================================================
RCS file: /home/cvs/mports/comms/Makefile,v
retrieving revision 1.10
retrieving revision 1.11
diff -L comms/Makefile -L comms/Makefile -u -r1.10 -r1.11
--- comms/Makefile
+++ comms/Makefile
@@ -5,6 +5,7 @@
 
     SUBDIR += acfax
     SUBDIR += aldo
+    SUBDIR += asmodem
     SUBDIR += efax
     SUBDIR += libirman
     SUBDIR += libticables
--- /dev/null
+++ comms/asmodem/pkg-descr
@@ -0,0 +1,8 @@
+Asmodem displays the modem status in an Afterstep type window.  It was
+adapted from asmail.  It indicates the status of your modem with 3
+blinking lights that indicate when the modem is connected, transmitting, 
+and receiving.  It is especially useful for internal modems.
+It can execute programs to dial, re-dial, and hang-up when clicked on.
+It only works on device ppp0.
+
+WWW: http://www.cmdrtaco.net/linux/mystuff.shtml
--- /dev/null
+++ comms/asmodem/Makefile
@@ -0,0 +1,26 @@
+# New ports collection makefile for:	asmodem
+# Date created:		11 May 1998
+# Whom:			Sean Cole <scole at aracnet.com>
+#
+# $MidnightBSD: mports/comms/asmodem/Makefile,v 1.1 2008/08/17 03:31:08 laffer1 Exp $
+# $FreeBSD: ports/comms/asmodem/Makefile,v 1.14 2008/04/19 17:47:05 miwi Exp $
+#
+
+PORTNAME=	asmodem
+PORTVERSION=	0.6.1
+CATEGORIES=	comms
+MASTER_SITES=	${MASTER_SITE_AFTERSTEP}
+MASTER_SITE_SUBDIR=	apps/asmodem
+DISTNAME=	${PORTNAME}-0.6-1
+
+MAINTAINER=	ports at MidnightBSD.org
+COMMENT=	Displays the modem status, designed to match AfterStep
+LICENSE=	unknown
+
+USE_IMAKE=	yes
+USE_XORG=	xpm
+
+MAN1=		asmodem.1
+PLIST_FILES=	bin/asmodem
+
+.include <bsd.port.mk>
--- /dev/null
+++ comms/asmodem/distinfo
@@ -0,0 +1,3 @@
+MD5 (asmodem-0.6-1.tar.gz) = 357c46651b33c0dcf3df3eb133ff4dc5
+SHA256 (asmodem-0.6-1.tar.gz) = b2cfd556cb96aa630e2ea77cb4bcb37db2352e12210bd988e37e591997fc95e0
+SIZE (asmodem-0.6-1.tar.gz) = 39731
--- /dev/null
+++ comms/asmodem/files/patch-ac
@@ -0,0 +1,17 @@
+--- Imakefile.orig	Sat Mar  1 09:48:45 1997
++++ Imakefile	Fri Oct  1 02:09:36 1999
+@@ -1,12 +1,12 @@
+ 
+-XPMLIB = -L/usr/lib/X11 -lXpm   
++XPMLIB = -lXpm   
+ DEPLIBS = $(DEPXLIB) 
+ 
+ LOCAL_LIBRARIES = $(XPMLIB) $(XLIB)  
+ 
+ LINTLIBS = $(LINTXLIB)
+ 
+-SRCS = asmodem.cpp
++SRCS = asmodem.c
+ OBJS = asmodem.o
+ 
+ ComplexProgramTarget(asmodem)
--- /dev/null
+++ comms/asmodem/files/patch-ab
@@ -0,0 +1,25 @@
+--- asmodem-0.6/asmodem.man	Mon May 11 17:01:06 1998
++++ asmodem.man	Mon May 11 17:23:34 1998
+@@ -1,4 +1,4 @@
+-.TH asmodem 0.4 "15 Sept 1996" asmail
++.TH asmodem 0.6 "15 Sept 1996" asmail
+ .UC
+ .SH NAME
+ \fBasmail\fP \- AfterStep Modem
+@@ -102,10 +102,16 @@
+ asmodem: http://www.cs.hope.edu/~malda/
+ .RE
+ asmail:http://www.rby.hk-r.se/~pt95pli/
++.RE
++afterstep:http://www.afterstep.org/
++.SH FREEBSD PORT
+ 
++Note that the FreeBSD port uses /var/run/cuaa1.if as its default lockfile and the names of the serial devices (modems) are spelled with two aa's (e.g. /dev/cuaa1 ).
+ 
++Modified May 1998 for FreeBSD.
+ 
+ 
++ 
+ 
+ 
+ 
--- /dev/null
+++ comms/asmodem/files/patch-aa
@@ -0,0 +1,101 @@
+--- asmodem.c.orig	Sun Oct  4 12:56:57 1998
++++ asmodem.c	Sat Sep  7 20:40:13 2002
+@@ -25,9 +25,8 @@
+ #include <sys/socket.h>
+ #include <net/if.h>
+ 
+-#include <asm/types.h>
+-#include <linux/types.h>
+-#include <linux/ppp_defs.h>
++#include <sys/types.h>
++#include <net/if_ppp.h>
+ 
+ 
+ /* XPM struct and icons ******************************************************/
+@@ -63,7 +62,7 @@
+ #define DEFINTERVAL 3		/* Default interval 2 sec */
+ #define TRUE 1;
+ #define FALSE 0;
+-#define DEFAULTMODEM "/var/lock/LCK..modem"
++#define DEFAULTMODEM "/var/run/cuaa1.if"
+ 
+ int	withdrawn= FALSE;
+ Display	*Disp;	 
+@@ -114,8 +113,8 @@
+ 	fprintf(stderr,"options:\n");
+         fprintf(stderr,"        -w               withdrawn mode (For WindowMaker's Dock)\n");  
+ 	fprintf(stderr,"        -s               transparent edge mode\n");
+-	fprintf(stderr,"        -m <file>        modem lockfile (ie /var/lock/LCK..cua1) \n");
+-        fprintf(stderr,"			 default is /var/lock/LCK..modem (/dev/modem) \n");
++	fprintf(stderr,"        -m <file>        modem lockfile (ie /var/lock/LCK..modem) \n");
++        fprintf(stderr,"			 default is /var/run/cuaa1.if \n");
+ 	fprintf(stderr,"        -u <sec>         update frequency (default 5 sec)\n");	
+ 	fprintf(stderr,"        -p [+|-]x[+|-]y  position of asmodem\n");
+ 	fprintf(stderr,"        -d <program>     program to execute on click while disconnected (dial?)\n");
+@@ -298,7 +297,7 @@
+ {
+ 	XEvent Event;            
+ 	XpmIcon Prev;
+-	struct 	ifreq     ifreq;
++	struct 	ifpppstatsreq     ifreq;
+ 	struct 	ppp_stats stats;
+ 	int  	rb, tb;
+ 			      
+@@ -315,12 +314,12 @@
+ 		//fprintf(stderr, "x ");
+ 		if (CarrierOn) {
+ 			memset(&ifreq, 0, sizeof(ifreq));
+-			strcpy(ifreq.ifr_ifrn.ifrn_name, "ppp0");
+-			ifreq.ifr_ifru.ifru_data = (caddr_t)&stats;
+-			if ((ioctl(sock,SIOCDEVPRIVATE,(caddr_t)&ifreq) < 0)){
++			strcpy(ifreq.ifr_name, "ppp0");
++			if ((ioctl(sock,SIOCGPPPSTATS,&ifreq) < 0)){
+ 				fprintf(stderr, "asmodem: ioctl f*cked\n");
+ 				prb = ptb = 0;
+ 			} else {
++				stats = ifreq.stats;
+ 				rb = stats.p.ppp_ibytes;
+ 				tb = stats.p.ppp_obytes;
+ 				if (rb > prb) {
+@@ -409,7 +408,7 @@
+ 	int WasStatus = 1;
+ 	int NewMailn = 0;
+ 
+-	MailFile = fopen(Mbox, "r");
++/*	MailFile = fopen(Mbox, "r");
+ 
+ 	while(!feof(MailFile))
+ 	{
+@@ -425,6 +424,8 @@
+ 	fclose(MailFile);
+ 
+ 	return (NewMailn||!WasStatus);
++*/
++	return 0;
+ }
+ 
+ /****************************************************************************/
+@@ -433,7 +434,7 @@
+ 	FILE* MailFile = 0;
+ 	int Ret = 0;            
+ 
+-	MailFile = fopen(Mbox, "r");	
++/*	MailFile = fopen(Mbox, "r");	
+ 	if(MailFile == 0)
+ 		Ret = 0;
+ 	else
+@@ -447,6 +448,14 @@
+ 	}
+ 
+ 	return Ret;    
++*/
++
++	if ((MailFile=fopen(Mbox,"r"))==NULL)
++	  return 0;
++	else {
++	  fclose(MailFile);
++	  return 1;
++	}   
+ }
+ 
+ /****************************************************************************/


More information about the Midnightbsd-cvs mailing list