Add new port wmq3 (sucessor to wmqmon), a dockapp that queries quake 3

servers and display information such as current map and number of players
This commit is contained in:
Patrick Li 2001-12-31 01:40:18 +00:00
parent 9cc48bbf3b
commit 4fec552889
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=52435
9 changed files with 158 additions and 0 deletions

View File

@ -485,6 +485,7 @@
SUBDIR += wmnet
SUBDIR += wmnet2
SUBDIR += wmnetmon
SUBDIR += wmq3
SUBDIR += wmwave
SUBDIR += xarchie
SUBDIR += xbone

32
net/wmq3/Makefile Normal file
View File

@ -0,0 +1,32 @@
# New ports collection makefile for: wmq3
# Date created: Sat Dec 29 23:19:57 EST 2001
# Whom: Patrick Li <pat@databits.net>
#
# $FreeBSD$
#
PORTNAME= wmq3
PORTVERSION= 0.2.2
CATEGORIES= net windowmaker games
MASTER_SITES= http://www.soberart.de/down/
MAINTAINER= pat@FreeBSD.org
RUN_DEPENDS= qstat:${PORTSDIR}/games/qstat
WRKSRC= ${WRKDIR}/${PORTNAME}/${PORTNAME}
USE_GMAKE= yes
USE_X_PREFIX= yes
USE_XPM= yes
do-install:
@${INSTALL_PROGRAM} ${WRKSRC}/wmq3 ${PREFIX}/bin
@${MKDIR} ${PREFIX}/share/examples/${PORTNAME}
@${INSTALL_DATA} ${WRKSRC}/wmq3rc \
${PREFIX}/share/examples/${PORTNAME}
post-install:
@${SED} 's|%%EXAMPLEDIR%%|${PREFIX}/share/examples/${PORTNAME}|' \
${PKGMESSAGE}
.include <bsd.port.mk>

1
net/wmq3/distinfo Normal file
View File

@ -0,0 +1 @@
MD5 (wmq3-0.2.2.tar.gz) = dd7cfe203fbecc11af021f325c408083

View File

@ -0,0 +1,38 @@
--- Makefile.orig Fri Dec 7 03:35:14 2001
+++ Makefile Sat Dec 29 23:02:58 2001
@@ -1,30 +1,15 @@
-LIBDIR = -L/usr/X11R6/lib
-MANDIR = /usr/local/man/man1/
-INSTALL = install
+LIBDIR = -L${X11BASE}/lib
LIBS = -lXpm -lXext -lX11
+CFLAGS += -I${X11BASE}/include
OBJS = wmq3.o \
../wmgeneral/wmgeneral.o \
../wmgeneral/misc.o \
../wmgeneral/list.o
-
.c.o:
- cc -c -O2 -Wall $< -o $*.o
+ ${CC} -c $< -o $*.o $(CFLAGS)
wmq3: $(OBJS)
- cc -o wmq3 $^ -lXext $(LIBDIR) $(LIBS)
-
-all:: wmifs
-
-clean::
- for i in $(OBJS) ; do \
- rm $$i ; \
- done
- rm wmq3
+ ${CC} -o wmq3 $^ -lXext $(LIBDIR) $(LIBS)
-install::
- cp -f wmq3 /usr/local/bin/
- cp -f wmq3rc /etc/
- chmod 755 /usr/local/bin/wmq3
- chown root:root /usr/local/bin/wmq3
- $(INSTALL) -m 644 -o root -g root ./wmq3.1 $(MANDIR)
+all: wmq3

View File

@ -0,0 +1,72 @@
--- wmq3.c.orig Sun Dec 9 18:34:46 2001
+++ wmq3.c Sun Dec 30 01:56:37 2001
@@ -72,6 +72,7 @@
int TimerDivisor=60;
int WaveForm=0;
int myStatus=0;
+char *rcfilename = NULL;
// serverstuff
char server[100][10];
@@ -100,7 +101,7 @@
void DrawStats(int *, int, int, int, int);
int left(char *mleft, char *line,char limiter);
void strip(char *line);
-int GetConfig();
+int GetConfig(char *config);
void ButtonUp(int);
void ButtonDown(int);
void execute();
@@ -118,11 +119,15 @@
if (strlen(ProgName) >= 4)
ProgName += (strlen(ProgName) - 4);
- if(GetConfig()<0)
- {
- printf("No servers in configfile\n");
- exit(0);
- }
+ if (!rcfilename)
+ {
+ char *homedir;
+ homedir = getenv("HOME");
+ rcfilename = calloc(1, strlen(homedir) + 9);
+ strcat(rcfilename, homedir);
+ strcat(rcfilename, "/.wmq3rc");
+ }
+ GetConfig(rcfilename);
currserver=0;
wmq3_routine(argc, argv);
return 1;
@@ -476,7 +481,7 @@
/*******************************************************************************
read config
******************************************************************************/
-int GetConfig()
+int GetConfig(char *config)
{
FILE *fh;
char buffer[256];
@@ -487,8 +492,10 @@
clickcall = (char **)malloc(30 * sizeof(char*));
// read configfile
- fh=fopen("/etc/wmq3rc","r");
+ fh=fopen(config,"r");
+ if(fh)
+ {
memset(buffer,0,sizeof(buffer));
clickparms=-1;
while(fgets(buffer,255,fh))
@@ -549,6 +556,10 @@
fclose(fh);
return scount;
+ } else {
+ fprintf(stderr,"No config file found.\n");
+ }
+
}
void strip(char *line)
{

1
net/wmq3/pkg-comment Normal file
View File

@ -0,0 +1 @@
Dockapp that query and display information on Quake 3 servers

5
net/wmq3/pkg-descr Normal file
View File

@ -0,0 +1,5 @@
wmq3 queries Quake 3 servers and display information such as what is the
current map and how many people are currently playing.
WWW: http://www.scriptgott.com/
Author: Sober <sober@scriptgott.com>

5
net/wmq3/pkg-message Normal file
View File

@ -0,0 +1,5 @@
==> Example configuration file has been installed to
==> %%EXAMPLEDIR%%/wmq3rc
==> Edit and copy it to ~/.wmq3rc

3
net/wmq3/pkg-plist Normal file
View File

@ -0,0 +1,3 @@
bin/wmq3
share/examples/wmq3/wmq3rc
@dirrm share/examples/wmq3