diff --git a/cad/Makefile b/cad/Makefile new file mode 100644 index 00000000000..f59a09b15d2 --- /dev/null +++ b/cad/Makefile @@ -0,0 +1,6 @@ +# $OpenBSD: Makefile,v 1.1.1.1 1998/06/03 23:02:23 marc Exp $ +# + + SUBDIR += spice + +.include diff --git a/cad/spice/Makefile b/cad/spice/Makefile new file mode 100644 index 00000000000..c32a483f240 --- /dev/null +++ b/cad/spice/Makefile @@ -0,0 +1,52 @@ +# OpenBSD makefile for: spice +# Version required: 3f5 +# Date created: 1998-Jun-03 +# Whom: marc@OpenBSD.ORG +# +# $OpenBSD: Makefile,v 1.1.1.1 1998/06/03 23:02:24 marc Exp $ +# + +# What port/package will be created +# +DISTNAME= sp3f4.kit +PKGNAME= spice-3f5 +CATEGORIES= cad + +# where to send bitches about this port +# +MAINTAINER= marc@openbsd.org + +# where the source files and patches can be fetched +# +MASTER_SITES= ftp://ic.eecs.berkeley.edu/pub/Spice3/ +DISTFILES= sp3f4.kit.tar.Z sp3f4.patch.tar.Z + +# How to extract the sources +# +EXTRACT_SUFX= .tar.Z + +# build/configuration variables +# +USE_X11= yes + +# Things that we don't want to do for this port/package +# +NO_WRKSUBDIR= yes + +# Apply the patches that make this 3f5 +# +pre-patch: + @${ECHO_MSG} "===> Applying distribution patches"; +.if defined(PATCH_DEBUG) + @(cd ${WRKDIR}/3f4patches; \ + ${PATCH} -d ${WRKSRC}/src/lib/fte -E -p1 < grid.patch; \ + ${PATCH} -d ${WRKSRC}/src/lib/fte -E -p1 < newcoms.patch; \ + ${PATCH} -d ${WRKSRC}/src/lib/sparse -E -p1 < spsmp.patch) +.else + @(cd ${WRKDIR}/3f4patches; \ + ${PATCH} -d ${WRKSRC}/src/lib/fte -N -s -E -p1 < grid.patch; \ + ${PATCH} -d ${WRKSRC}/src/lib/fte -N -s -E -p1 < newcoms.patch; \ + ${PATCH} -d ${WRKSRC}/src/lib/sparse -N -s -E -p1 < spsmp.patch) +.endif + +.include diff --git a/cad/spice/files/Makefile b/cad/spice/files/Makefile new file mode 100644 index 00000000000..b600a128f20 --- /dev/null +++ b/cad/spice/files/Makefile @@ -0,0 +1,25 @@ +# $OpenBSD: Makefile,v 1.1.1.1 1998/06/03 23:02:24 marc Exp $ +# + +EXAMPLES= bjtnoise.cir ltra_1.cir mos6inv.cir pz2.cir \ + rtlinv.cir bsim1tst.cir ltra_2.cir mosamp2.cir \ + pzt.cir schmitt.cir bsim2tst.cir ltra_3.cir \ + mosmem.cir rc.cir simplepz.cir diffpair.cir \ + makedefs process.mod rca3040.cir diodisto.cir \ + mixdisto.cir process.pro resnoise.cir + +all: + util/build OpenBSD default + +install: + util/build OpenBSD install + ${BSD_INSTALL_MAN} man/man1/nutmeg.0 ${PREFIX}/man/cat1 + ${BSD_INSTALL_MAN} man/man1/sconvert.0 ${PREFIX}/man/cat1 + ${BSD_INSTALL_MAN} man/man1/spice.0 ${PREFIX}/man/cat1 + /bin/ln -sf spice.0 ${PREFIX}/man/cat1/spice3.0 + ${BSD_INSTALL_MAN} man/man3/mfb.0 ${PREFIX}/man/cat3 + ${BSD_INSTALL_MAN} man/man5/mfbcap.0 ${PREFIX}/man/cat5 + /bin/mkdir -p ${PREFIX}/share/examples/spice +.for ex in ${EXAMPLES} + ${BSD_INSTALL_DATA} examples/${ex} ${PREFIX}/share/examples/spice +.endfor diff --git a/cad/spice/files/OpenBSD b/cad/spice/files/OpenBSD new file mode 100644 index 00000000000..082ff965416 --- /dev/null +++ b/cad/spice/files/OpenBSD @@ -0,0 +1,15 @@ +# $OpenBSD: OpenBSD,v 1.1.1.1 1998/06/03 23:02:24 marc Exp $ +# +# Spice configuration file for OpenBSD + +MAKE = /usr/bin/make +DEFAULT_EDITOR = /usr/bin/vi +X_DIR = /usr/X11R6 +CC_OPT = -O2 +LDFLAGS = -lm -ltermlib -lcompat +SYS_CFLAGS = -Dbsd -DHAS_STDLIB +SYS_DIR = ${DIST_DIR}/OpenBSD +SPICE_DIR = ${PREFIX} +SPICE_LIB_DIR = ${PREFIX}/lib/spice +S_SPICE_DIR = ${PREFIX} +S_SPICE_LIB_DIR = ${PREFIX}/lib/spice diff --git a/cad/spice/files/md5 b/cad/spice/files/md5 new file mode 100644 index 00000000000..b3491d07f16 --- /dev/null +++ b/cad/spice/files/md5 @@ -0,0 +1,2 @@ +MD5 (sp3f4.kit.tar.Z) = d55eb08a7f523248b1b509092a444aeb +MD5 (sp3f4.patch.tar.Z) = 7ea64fb1ec9350cd10a7c90c08835f06 diff --git a/cad/spice/patches/patch-aa b/cad/spice/patches/patch-aa new file mode 100644 index 00000000000..65f15b0e8f3 --- /dev/null +++ b/cad/spice/patches/patch-aa @@ -0,0 +1,12 @@ +--- src/include/cpstd.h.~1~ Wed Apr 14 12:57:42 1993 ++++ src/include/cpstd.h Wed Jun 3 14:49:24 1998 +@@ -50,7 +50,9 @@ + extern char *printnum(); + extern int cp_numdgt; + extern void fatal(); ++#if ! defined( HAS_STDLIB ) + extern void setenv(); ++#endif + extern void cp_printword(); + + /* Externs from wlist.c */ diff --git a/cad/spice/patches/patch-ab b/cad/spice/patches/patch-ab new file mode 100644 index 00000000000..0c991039fa9 --- /dev/null +++ b/cad/spice/patches/patch-ab @@ -0,0 +1,62 @@ +--- src/bin/sconvert.c.~1~ Mon Sep 14 18:30:41 1992 ++++ src/bin/sconvert.c Tue Jun 2 22:06:32 1998 +@@ -42,6 +42,7 @@ + { + char *sf, *af; + char buf[BSIZE_SP]; ++ char *p; + char t, f; + struct plot *pl; + int i; +@@ -80,19 +81,47 @@ + + case 1: printf("Input file: "); + (void) fflush(stdout); +- (void) gets(buf); ++ if ( fgets(buf, sizeof buf, stdin) == 0 ) { ++ buf[ 0 ] = 0; ++ } else { ++ p = strchr( buf, '\n' ); ++ if ( p ) { ++ *p = 0; ++ } ++ } + sf = copy(buf); + printf("Input type: "); + (void) fflush(stdout); +- (void) gets(buf); ++ if ( fgets(buf, sizeof buf, stdin) == 0 ) { ++ buf[ 0 ] = 0; ++ } else { ++ p = strchr( buf, '\n' ); ++ if ( p ) { ++ *p = 0; ++ } ++ } + f = buf[0]; + printf("Output file: "); + (void) fflush(stdout); +- (void) gets(buf); ++ if ( fgets(buf, sizeof buf, stdin) == 0 ) { ++ buf[ 0 ] = 0; ++ } else { ++ p = strchr( buf, '\n' ); ++ if ( p ) { ++ *p = 0; ++ } ++ } + af = copy(buf); + printf("Output type: "); + (void) fflush(stdout); +- (void) gets(buf); ++ if ( fgets(buf, sizeof buf, stdin) == 0 ) { ++ buf[ 0 ] = 0; ++ } else { ++ p = strchr( buf, '\n' ); ++ if ( p ) { ++ *p = 0; ++ } ++ } + t = buf[0]; + break; + default: diff --git a/cad/spice/patches/patch-ac b/cad/spice/patches/patch-ac new file mode 100644 index 00000000000..3de0dbd69ba --- /dev/null +++ b/cad/spice/patches/patch-ac @@ -0,0 +1,11 @@ +--- src/lib/fte/inp.c.~1~ Thu Apr 29 16:06:28 1993 ++++ src/lib/fte/inp.c Tue Jun 2 22:07:46 1998 +@@ -666,7 +666,7 @@ + + fprintf(cp_out, "run circuit? "); + fflush(cp_out); +- (void) gets(buf); ++ (void) fgets(buf, sizeof buf, stdin); + if (buf[0] != 'n') { + fprintf(cp_out, "running circuit\n"); + com_run(NULL); diff --git a/cad/spice/patches/patch-ad b/cad/spice/patches/patch-ad new file mode 100644 index 00000000000..183a05cfb25 --- /dev/null +++ b/cad/spice/patches/patch-ad @@ -0,0 +1,12 @@ +--- src/lib/mfb/mfbgnc.c.orig Mon May 18 03:41:26 1998 ++++ src/lib/mfb/mfbgnc.c Tue May 19 00:52:27 1998 +@@ -25,7 +25,9 @@ + + /* Library routines */ + #ifdef HAS_FTIME ++#ifndef __OpenBSD__ + extern void ftime(); ++#endif /*__OpenBSD__*/ + #endif + + /* diff --git a/cad/spice/pkg/COMMENT b/cad/spice/pkg/COMMENT new file mode 100644 index 00000000000..0db132c0591 --- /dev/null +++ b/cad/spice/pkg/COMMENT @@ -0,0 +1 @@ +Simulation Program for Integrated Circuit Electronics diff --git a/cad/spice/pkg/DESCR b/cad/spice/pkg/DESCR new file mode 100644 index 00000000000..c963f4c5715 --- /dev/null +++ b/cad/spice/pkg/DESCR @@ -0,0 +1,15 @@ +The SPICE3 Version3f3 User's Manual, a postscript document available +at ftp://ic.eecs.berkeley.edu/pub/Spice3/um.3f3.ps says: + + SPICE is a general-purpose circuit simulation program for nonlinear dc, + nonlinear transient, and linear ac analyses. Circuits may contain resistors, + capacitors, inductors, mutual inductors, independent voltage and current + sources, four types of dependent sources, lossless and lossy transmission + lines (two separate implementations), switches, uniform distributed RC + lines, and the five most common semiconductor devices: diodes, BJTs, JFETs, + MESFETs, and MOSFETs. + +With this release, the University of California will no longer +be providing technical support for Spice3, and no plans have been made +for providing support any time in the future. Some work on Spice3 will +continue (notably the BSIM-3 model and perhaps other device models). diff --git a/cad/spice/pkg/PLIST b/cad/spice/pkg/PLIST new file mode 100644 index 00000000000..5d4d4bffb3d --- /dev/null +++ b/cad/spice/pkg/PLIST @@ -0,0 +1,46 @@ +bin/spice3 +bin/nutmeg +bin/sconvert +bin/help +bin/proc2mod +bin/multidec +lib/spice/helpdir/spice.txt +lib/spice/helpdir/spice.idx +lib/spice/scripts/setplot +lib/spice/scripts/spinit +lib/spice/mfbcap +lib/spice/news +man/cat1/nutmeg.0 +man/cat1/sconvert.0 +man/cat1/spice.0 +@exec ln -sf spice.0 %B/spice3.0 +@unexec rm -f %B/spice3.0 +man/cat3/mfb.0 +man/cat5/mfbcap.0 +share/examples/spice/bjtnoise.cir +share/examples/spice/ltra_1.cir +share/examples/spice/mos6inv.cir +share/examples/spice/pz2.cir +share/examples/spice/rtlinv.cir +share/examples/spice/bsim1tst.cir +share/examples/spice/ltra_2.cir +share/examples/spice/mosamp2.cir +share/examples/spice/pzt.cir +share/examples/spice/schmitt.cir +share/examples/spice/bsim2tst.cir +share/examples/spice/ltra_3.cir +share/examples/spice/mosmem.cir +share/examples/spice/rc.cir +share/examples/spice/simplepz.cir +share/examples/spice/diffpair.cir +share/examples/spice/makedefs +share/examples/spice/process.mod +share/examples/spice/rca3040.cir +share/examples/spice/diodisto.cir +share/examples/spice/mixdisto.cir +share/examples/spice/process.pro +share/examples/spice/resnoise.cir +@dirrm share/examples/spice +@dirrm lib/spice/helpdir +@dirrm lib/spice/scripts +@dirrm lib/spice diff --git a/cad/spice/scripts/configure b/cad/spice/scripts/configure new file mode 100644 index 00000000000..8184db73dc3 --- /dev/null +++ b/cad/spice/scripts/configure @@ -0,0 +1,6 @@ +#! /bin/sh +# +# $OpenBSD: configure,v 1.1.1.1 1998/06/03 23:02:25 marc Exp $ + +cp -f ${FILESDIR}/Makefile ${WRKSRC} +cp -f ${FILESDIR}/OpenBSD ${WRKSRC}/conf