diff --git a/math/wmcalc/Makefile b/math/wmcalc/Makefile new file mode 100644 index 00000000000..e5fcfe315dd --- /dev/null +++ b/math/wmcalc/Makefile @@ -0,0 +1,28 @@ +# $OpenBSD: Makefile,v 1.1.1.1 2001/01/16 21:31:43 naddy Exp $ + +DISTNAME= wmcalc-0.21 +CATEGORIES= math x11 +NEED_VERSION= 1.340 +HOMEPAGE= http://members.access1.net/ehflora/ + +MAINTAINER= Peter Stromberg + +PERMIT_PACKAGE_CDROM= Yes +PERMIT_PACKAGE_FTP= Yes +PERMIT_DISTFILES_CDROM= Yes +PERMIT_DISTFILES_FTP= Yes + +MASTER_SITES= ${HOMEPAGE}wmcalc/ + +SAMPLE_DIR= ${PREFIX}/share/examples/wmcalc + +SUBST_VARS+= SAMPLE_DIR + +USE_X11= Yes + +do-install: + ${INSTALL_PROGRAM} ${WRKBUILD}/wmcalc ${PREFIX}/bin + ${INSTALL_DATA_DIR} ${SAMPLE_DIR} + ${INSTALL_DATA} ${WRKSRC}/.wmcalc ${SAMPLE_DIR}/dot.wmcalc.sample + +.include diff --git a/math/wmcalc/files/md5 b/math/wmcalc/files/md5 new file mode 100644 index 00000000000..a3edcc8e0b3 --- /dev/null +++ b/math/wmcalc/files/md5 @@ -0,0 +1,3 @@ +MD5 (wmcalc-0.21.tar.gz) = 8718c48b7af8b8b23f7da2d7c5207232 +RMD160 (wmcalc-0.21.tar.gz) = 2a842865ac14ad61d3b9b747d433a208de072e19 +SHA1 (wmcalc-0.21.tar.gz) = bfbe61b02efac08b64dc5bb638aeb311cb5a1e6e diff --git a/math/wmcalc/patches/patch-Makefile b/math/wmcalc/patches/patch-Makefile new file mode 100644 index 00000000000..0858b7568cb --- /dev/null +++ b/math/wmcalc/patches/patch-Makefile @@ -0,0 +1,25 @@ +$OpenBSD: patch-Makefile,v 1.1.1.1 2001/01/16 21:31:44 naddy Exp $ +--- Makefile.orig Thu Sep 21 04:22:25 2000 ++++ Makefile Tue Jan 16 22:09:16 2001 +@@ -1,15 +1,17 @@ +-INCLUDES =-I/usr/X11R6/include/X11 -I/usr/local/include -I/usr/include/X11R6/X11 +-LIBINC =-L/usr/X11R6/lib -L/usr/include/lib ++INCLUDES =-I${X11BASE}/include -I${X11BASE}/include/X11 ++LIBINC =-L${X11BASE}/lib + LIBS = -lX11 -lXpm -lXext -lm + + TARGET = wmcalc + OBJECTS = wmcalc.o readln.o wmcalcswitch.o wmcalcfunc.o + + .c.o: +- gcc -O2 -c -Wall ${INCLUDES} ${FLAGS} $< -o $*.o ++ ${CC} ${CFLAGS} -c ${INCLUDES} ${FLAGS} $< -o $*.o + + ${TARGET}: ${OBJECTS} +- gcc -O2 -o ${TARGET} ${OBJECTS} ${LIBINC} ${LIBS} ++ ${CC} -o ${TARGET} ${OBJECTS} ${LIBINC} ${LIBS} ++ ++all:: ${TARGET} + + clean:: + for i in ${OBJECTS}; do if [ -e $$i ] ; then rm $$i; fi; done diff --git a/math/wmcalc/patches/patch-wmcalc_c b/math/wmcalc/patches/patch-wmcalc_c new file mode 100644 index 00000000000..0599eb08ead --- /dev/null +++ b/math/wmcalc/patches/patch-wmcalc_c @@ -0,0 +1,17 @@ +$OpenBSD: patch-wmcalc_c,v 1.1.1.1 2001/01/16 21:31:44 naddy Exp $ +--- wmcalc.c.orig Tue Oct 31 03:42:32 2000 ++++ wmcalc.c Fri Jan 12 11:53:28 2001 +@@ -89,10 +89,10 @@ int main( int argc, char **argv ) { + char Geometry_str[64] = "64x64+0+0"; + char Display_str[64] = ""; + +- strcpy(configfile, getenv("HOME")); // Added to wmbutton by Casey Harkin, 3/6/99 +- strcat(configfile, CONFFILENAME); // Fixed Bug - didn't look in home directory ++ strlcpy(configfile, getenv("HOME"), sizeof(configfile)); // Added to wmbutton by Casey Harkin, 3/6/99 ++ strlcat(configfile, CONFFILENAME, sizeof(configfile)); // Fixed Bug - didn't look in home directory + // but startup directory +- strcat(tempfile, CONFTEMPFILE); // Setup name for temp file ++ strlcat(tempfile, CONFTEMPFILE, sizeof(tempfile)); // Setup name for temp file + + /* Clear the Calculator Display */ + for(i=0; i<11; i++) DispString[i] = ' '; diff --git a/math/wmcalc/patches/patch-wmcalcswitch_c b/math/wmcalc/patches/patch-wmcalcswitch_c new file mode 100644 index 00000000000..d5c3ca67c0d --- /dev/null +++ b/math/wmcalc/patches/patch-wmcalcswitch_c @@ -0,0 +1,50 @@ +$OpenBSD: patch-wmcalcswitch_c,v 1.1.1.1 2001/01/16 21:31:44 naddy Exp $ +--- wmcalcswitch.c.orig Tue Oct 31 03:15:36 2000 ++++ wmcalcswitch.c Fri Jan 12 11:58:31 2001 +@@ -347,7 +347,7 @@ int write_config(void) { + extern int Verbose; + extern double MemArray[]; + extern char configfile[]; +- extern char tempfile[]; ++ extern char tempfile[CONFIGFILEMAX]; + extern char *CfgVarList[]; + FILE *fp, *fptmp; + char *line = NULL; +@@ -364,8 +364,8 @@ int write_config(void) { + /* Open Temporary File */ + if ((fptmp = fopen(tempfile, "w")) == NULL) { // Can't open file in /tmp + fprintf(stderr, "%s: Temporary File Open Failed\n", tempfile); +- strcpy(tempfile, getenv("HOME")); +- strcat(tempfile, "wmcalc.tmp"); ++ strlcpy(tempfile, getenv("HOME"), sizeof(tempfile)); ++ strlcat(tempfile, "wmcalc.tmp", sizeof(tempfile)); + if ((fptmp = fopen(tempfile, "w")) == NULL) { // Can't open file in HOME + fprintf(stderr, "%s: Temporary File Open Failed\n", tempfile); + return(BAD_FILE); +@@ -397,7 +397,7 @@ int write_config(void) { + + /* Copy temp file over original */ + /* Note: If changing command, make sure to adjust size of string above!! */ +- sprintf(movefilecmd, "mv -f %s %s\n", tempfile, configfile); ++ snprintf(movefilecmd, sizeof(movefilecmd), "mv -f %s %s", tempfile, configfile); + err_code = system(movefilecmd); + + if (err_code) { +@@ -418,7 +418,7 @@ int read_config(void) { + extern char *CfgVarList[]; + extern char ImagChar; + extern char configfile[]; +- extern char SysCalcCmd[]; ++ extern char SysCalcCmd[CALC_CMD_SIZE]; + FILE *fp; + int i = 0; + int err_code = OKAY; +@@ -507,7 +507,7 @@ int read_config(void) { + case CALC_LABEL: + if (Verbose) + fprintf(stderr, "Assign Calc Command:\n%s", cfg_var_ptr); +- strcpy(SysCalcCmd, cfg_var_ptr); ++ strlcpy(SysCalcCmd, cfg_var_ptr, sizeof(SysCalcCmd)); + break; + + default: diff --git a/math/wmcalc/pkg/COMMENT b/math/wmcalc/pkg/COMMENT new file mode 100644 index 00000000000..8730b931501 --- /dev/null +++ b/math/wmcalc/pkg/COMMENT @@ -0,0 +1 @@ +dockable simple four-function calculator diff --git a/math/wmcalc/pkg/DESCR b/math/wmcalc/pkg/DESCR new file mode 100644 index 00000000000..775599b7c3d --- /dev/null +++ b/math/wmcalc/pkg/DESCR @@ -0,0 +1,42 @@ +wmcalc is a program designed to act as a simple four-function +calculator. It is different from other calculator programs, +however in that it is designed to take up very little desktop +space. As such, it can be left running on the desktop at all +times. + +It is intended to placed in the WindowMaker dock, or in Wharf +under Afterstep, though it should run as well under any +window manager. + +You need a ~/.wmcalc file, copy a sample from ${SAMPLE_DIR}. + +wmcalc -h gives you usage info. + +Buttons are defined as: + ____________________ +| x99 | where: x = 1 for Left Mouse Button +| 0 1 2 3 4 5 6 7 8 9| x = 2 for Middle Mouse Button +|--------------------| x = 3 for Right Mouse Button +|x11 x07 x08 x09 x51 | +|x12 x04 x05 x06 x52 | Note: the numbers 0..9 are the +|x13 x01 x02 x03 x53 | indicators for memory cells +|x14 x00 x34 x44 x54 | 0..9 respectively. + -------------------- + +Button Functions: +199 Reinitialize the calculator, and both Registers + (Clear All). +299 Clear all the memory registers (0..10). +399 Clear the current number being entered only. +x13 Start a program defined by CalcStart variable in + config file. +1yy Perform function shown on button. +2yy Recall number from memory location [0-9] to display + for calculation, + if yy = 0,1,2,3,4,5,6,7,8,9. +3yy Store Displayed number in memory location [0-9], + if yy = 0,1,2,3,4,5,6,7,8,9. +1zz Hopefully the other functions are obvious from + their button graphics. + +WWW: ${HOMEPAGE} diff --git a/math/wmcalc/pkg/PLIST b/math/wmcalc/pkg/PLIST new file mode 100644 index 00000000000..845d5cef74a --- /dev/null +++ b/math/wmcalc/pkg/PLIST @@ -0,0 +1,4 @@ +@comment $OpenBSD: PLIST,v 1.1.1.1 2001/01/16 21:31:44 naddy Exp $ +bin/wmcalc +share/examples/wmcalc/dot.wmcalc.sample +@dirrm share/examples/wmcalc