Import mkcmd-8.14.

mkcmd lets us build a nifty command line option parser and some on-line
documentation in a snap.  It is a prerequisite for many of Kevin
Braunsdorf's tools.
This commit is contained in:
epg 2004-11-10 00:46:04 +00:00
parent 4e272c225b
commit bbb003924e
7 changed files with 374 additions and 0 deletions

3
devel/mkcmd/DESCR Normal file
View file

@ -0,0 +1,3 @@
mkcmd lets us build a nifty command line option parser and some on-line
documentation in a snap. It is a prerequisite for many of Kevin
Braunsdorf's tools.

32
devel/mkcmd/Makefile Normal file
View file

@ -0,0 +1,32 @@
# $NetBSD: Makefile,v 1.1.1.1 2004/11/10 00:46:04 epg Exp $
#
DISTNAME= mkcmd-8.14
CATEGORIES= mine
MASTER_SITES= http://archive.progeny.com/pundits/
EXTRACT_SUFX= .tgz
MAINTAINER= epg@NetBSD.org
COMMENT= Command-line parser and manual page generator
USE_BUILDLINK3= yes
INSTALLATION_DIRS= bin man/man1 man/man5
PKG_INSTALLATION_TYPES= overwrite pkgviews
do-build:
cd ${WRKSRC}/bin/mkcmd && HOSTTYPE= ${SH} ${FILESDIR}/makeme \
ROOT=${PREFIX} BIN=${PREFIX}/bin LIB=${PREFIX}/lib/mkcmd
do-install:
.for _mkcmd_dir in bin/mkcmd lib/mkcmd
cd ${WRKSRC}/${_mkcmd_dir} && HOSTTYPE= ${SH} ${FILESDIR}/makeme \
ROOT=${PREFIX} BIN=${PREFIX}/bin LIB=${PREFIX}/lib/mkcmd \
install
.endfor
${INSTALL_MAN} ${WRKSRC}/bin/mkcmd/mkcmd.man \
${PREFIX}/man/man1/mkcmd.1
${INSTALL_MAN} ${WRKSRC}/lib/mkcmd/mkcmd.man \
${PREFIX}/man/man5/mkcmd.5
.include "../../mk/bsd.pkg.mk"

237
devel/mkcmd/PLIST Normal file
View file

@ -0,0 +1,237 @@
@comment $NetBSD: PLIST,v 1.1.1.1 2004/11/10 00:46:04 epg Exp $
bin/mkcmd
lib/mkcmd/cmd/add.m
lib/mkcmd/cmd/add.mc
lib/mkcmd/cmd/cd.m
lib/mkcmd/cmd/cd.mc
lib/mkcmd/cmd/dl.m
lib/mkcmd/cmd/dl.mc
lib/mkcmd/cmd/echo.m
lib/mkcmd/cmd/exec.m
lib/mkcmd/cmd/exec.mc
lib/mkcmd/cmd/exit.m
lib/mkcmd/cmd/help.m
lib/mkcmd/cmd/help.mc
lib/mkcmd/cmd/macro.m
lib/mkcmd/cmd/merge.m
lib/mkcmd/cmd/parse.m
lib/mkcmd/cmd/parse.mc
lib/mkcmd/cmd/shell.m
lib/mkcmd/cmd/shell.mc
lib/mkcmd/cmd/source.m
lib/mkcmd/cmd/source.mc
lib/mkcmd/cmd/umask.m
lib/mkcmd/cmd/umask.mc
lib/mkcmd/cmd/version.m
lib/mkcmd/dir/check.m
lib/mkcmd/dir/check.mc
lib/mkcmd/enum.info
lib/mkcmd/example/cgi.m
lib/mkcmd/example/cmd.m
lib/mkcmd/example/date.m
lib/mkcmd/example/dir.m
lib/mkcmd/example/dl.m
lib/mkcmd/example/dumpdates.m
lib/mkcmd/example/enum.m
lib/mkcmd/example/filter.m
lib/mkcmd/example/fts.m
lib/mkcmd/example/glob.m
lib/mkcmd/example/lex.m
lib/mkcmd/example/macro.m
lib/mkcmd/example/mult.m
lib/mkcmd/example/nettime.m
lib/mkcmd/example/ppm.m
lib/mkcmd/example/rc.m
lib/mkcmd/example/rls.m
lib/mkcmd/example/rls.x
lib/mkcmd/example/rlsd.m
lib/mkcmd/example/server.m
lib/mkcmd/example/time.m
lib/mkcmd/example/timebox.m
lib/mkcmd/getopt/key.m
lib/mkcmd/glob/ieee.m
lib/mkcmd/glob/ieee.mc
lib/mkcmd/rpc/client.m
lib/mkcmd/rpc/server.m
lib/mkcmd/rpc/server.mc
lib/mkcmd/std/control.m
lib/mkcmd/std/datehdr.m
lib/mkcmd/std/filter.m
lib/mkcmd/std/fts.m
lib/mkcmd/std/help.m
lib/mkcmd/std/lex.m
lib/mkcmd/std/lex.mc
lib/mkcmd/std/macro.m
lib/mkcmd/std/macro.mc
lib/mkcmd/std/macro.mh
lib/mkcmd/std/macro.mi
lib/mkcmd/std/noargs.m
lib/mkcmd/std/targets.m
lib/mkcmd/std/version.m
lib/mkcmd/std/xdev.m
lib/mkcmd/tftp/client.m
lib/mkcmd/tftp/client.mc
lib/mkcmd/tftp/client.mh
lib/mkcmd/tftp/client.mi
lib/mkcmd/tftp/server.m
lib/mkcmd/tftp/server.mc
lib/mkcmd/tftp/server.mh
lib/mkcmd/tftp/server.mi
lib/mkcmd/time/tz.m
lib/mkcmd/type/Template.m
lib/mkcmd/type/bsd.m
lib/mkcmd/type/bytes.m
lib/mkcmd/type/bytes.mi
lib/mkcmd/type/client.m
lib/mkcmd/type/client.mi
lib/mkcmd/type/cmd.m
lib/mkcmd/type/cmd.mc
lib/mkcmd/type/cmd.mi
lib/mkcmd/type/date.m
lib/mkcmd/type/dir.m
lib/mkcmd/type/enum.m
lib/mkcmd/type/enum.mc
lib/mkcmd/type/enum.mh
lib/mkcmd/type/enum.mi
lib/mkcmd/type/filesystem.m
lib/mkcmd/type/filesystem.mc
lib/mkcmd/type/filesystem.mi
lib/mkcmd/type/getopt.m
lib/mkcmd/type/getopt.mc
lib/mkcmd/type/getopt.mi
lib/mkcmd/type/group.m
lib/mkcmd/type/group.mc
lib/mkcmd/type/host.m
lib/mkcmd/type/host.mc
lib/mkcmd/type/host.mi
lib/mkcmd/type/hosttype.m
lib/mkcmd/type/hosttype.mh
lib/mkcmd/type/inches.m
lib/mkcmd/type/inches.mi
lib/mkcmd/type/login.m
lib/mkcmd/type/login.mc
lib/mkcmd/type/protocol.m
lib/mkcmd/type/protocol.mc
lib/mkcmd/type/rc.m
lib/mkcmd/type/seconds.m
lib/mkcmd/type/seconds.mi
lib/mkcmd/type/server.m
lib/mkcmd/type/server.mi
lib/mkcmd/type/service.m
lib/mkcmd/type/service.mc
lib/mkcmd/type/shared.m
lib/mkcmd/type/shared.mi
lib/mkcmd/type/socket.m
lib/mkcmd/type/socket.mh
lib/mkcmd/type/socket.mi
lib/mkcmd/type/time.m
lib/mkcmd/type/timebox.m
lib/mkcmd/util/by.m
lib/mkcmd/util/cgi.m
lib/mkcmd/util/cgi.mc
lib/mkcmd/util/client.m
lib/mkcmd/util/client.mc
lib/mkcmd/util/client.mi
lib/mkcmd/util/daemon.m
lib/mkcmd/util/daemon.mc
lib/mkcmd/util/daemon.mh
lib/mkcmd/util/date.m
lib/mkcmd/util/date.mc
lib/mkcmd/util/date.mi
lib/mkcmd/util/dl.m
lib/mkcmd/util/dl.mc
lib/mkcmd/util/editor.m
lib/mkcmd/util/editor.mc
lib/mkcmd/util/editor.mh
lib/mkcmd/util/editor.mi
lib/mkcmd/util/errno.m
lib/mkcmd/util/fgetln.m
lib/mkcmd/util/fgetln.mc
lib/mkcmd/util/fsearch.m
lib/mkcmd/util/fsearch.mc
lib/mkcmd/util/fsearch.mh
lib/mkcmd/util/fsearch.mi
lib/mkcmd/util/fts.m
lib/mkcmd/util/fts.mc
lib/mkcmd/util/getlogingr.m
lib/mkcmd/util/getlogingr.mc
lib/mkcmd/util/getlogingr.mi
lib/mkcmd/util/glob.m
lib/mkcmd/util/herror.m
lib/mkcmd/util/home.m
lib/mkcmd/util/home.mc
lib/mkcmd/util/home.mh
lib/mkcmd/util/home.mi
lib/mkcmd/util/mult.m
lib/mkcmd/util/mult.mc
lib/mkcmd/util/mult.mi
lib/mkcmd/util/ppm.m
lib/mkcmd/util/rc.m
lib/mkcmd/util/rc.mc
lib/mkcmd/util/rc.mi
lib/mkcmd/util/savegrent.m
lib/mkcmd/util/savegrent.mc
lib/mkcmd/util/savegrent.mh
lib/mkcmd/util/savegrent.mi
lib/mkcmd/util/savehostent.m
lib/mkcmd/util/savehostent.mc
lib/mkcmd/util/savehostent.mi
lib/mkcmd/util/savepwent.m
lib/mkcmd/util/savepwent.mc
lib/mkcmd/util/savepwent.mh
lib/mkcmd/util/savepwent.mi
lib/mkcmd/util/saveservent.m
lib/mkcmd/util/saveservent.mc
lib/mkcmd/util/saveservent.mi
lib/mkcmd/util/server.m
lib/mkcmd/util/server.mc
lib/mkcmd/util/sigret.m
lib/mkcmd/util/sigret.mi
lib/mkcmd/util/socket.m
lib/mkcmd/util/socket.mc
lib/mkcmd/util/socket.mi
lib/mkcmd/util/tftp.m
lib/mkcmd/util/tftp.mc
lib/mkcmd/util/tftp.mh
lib/mkcmd/util/tftp.mi
lib/mkcmd/util/time.m
lib/mkcmd/util/time.mc
lib/mkcmd/util/time.mh
lib/mkcmd/util/time.mi
lib/mkcmd/util/timebox.m
lib/mkcmd/util/timebox.mc
lib/mkcmd/util/timebox.mi
lib/mkcmd/util/tmp.m
lib/mkcmd/util/unity.m
lib/mkcmd/util/unity.mc
lib/mkcmd/util/unity.mh
lib/mkcmd/util/unity.mi
lib/mkcmd/util/username.m
lib/mkcmd/util/username.mc
lib/mkcmd/util/username.mh
lib/mkcmd/util/username.mi
lib/mkcmd/util/whittle.m
lib/mkcmd/util/zombie.m
lib/mkcmd/util/zombie.mc
lib/mkcmd/xdr/Cargv.m
lib/mkcmd/xdr/Cargv.mc
lib/mkcmd/xdr/Cargv.mh
lib/mkcmd/xdr/Cargv.mi
lib/mkcmd/xdr/Cstring.m
lib/mkcmd/xdr/Cstring.mc
lib/mkcmd/xdr/Cstring.mh
lib/mkcmd/xdr/Cstring.mi
man/man1/mkcmd.1
man/man5/mkcmd.5@dirrm lib/mkcmd/xdr
@dirrm lib/mkcmd/util
@dirrm lib/mkcmd/type
@dirrm lib/mkcmd/time
@dirrm lib/mkcmd/tftp
@dirrm lib/mkcmd/std
@dirrm lib/mkcmd/rpc
@dirrm lib/mkcmd/glob
@dirrm lib/mkcmd/getopt
@dirrm lib/mkcmd/example
@dirrm lib/mkcmd/dir
@dirrm lib/mkcmd/cmd
@dirrm lib/mkcmd

6
devel/mkcmd/distinfo Normal file
View file

@ -0,0 +1,6 @@
$NetBSD: distinfo,v 1.1.1.1 2004/11/10 00:46:04 epg Exp $
SHA1 (mkcmd-8.14.tgz) = 33342afc845db84a040f116202b880d37b9f626f
Size (mkcmd-8.14.tgz) = 295120 bytes
SHA1 (patch-aa) = f9d297a7d3cf807163a53ba9d69d81e9dd83cd72
SHA1 (patch-ab) = 72c1a8800491c967f402a1fa9038bab7a5cd3b11

69
devel/mkcmd/files/makeme Normal file
View file

@ -0,0 +1,69 @@
#!/bin/sh
# $Id: makeme,v 1.1.1.1 2004/11/10 00:46:04 epg Exp $
# This hack won't work for every trick you can play with /usr/msrc.
# If the Distfile sends different files to the various platforms, or
# builds a file on the meta source machine with a special tool or
# database you are toast. {N.B. mk's lib, rdist, mkcmd have issues.}
# if we have a local.defs read it for umask, PATH, and such.
[ -f /usr/local/lib/distrib/local.defs ] && . /usr/local/lib/distrib/local.defs
# It does work for the tools that build the meta source system itself,
# of course (mkcmd, distrib, rcsvg, and the like). You can use it to
# process the Make.host file through m4 for localhost.
#
# Check for the mandatory Make.host file...
if [ ! -f Make.host ] ; then
echo 1>&2 "$0: not in a meta source directory, no Make.host"
exit 126
fi
# distrib: default column headers: %HOST SHORTHOST HOSTTYPE HOSTOS HASSRC
if [ -z "$HOST" ] ; then
HOST=`uname -n || hostname`
fi
if [ -z "$SHORTHOST" ] ; then
SHORTHOST=`expr $HOST : '\([^.]*\)\..*' \| $HOST`
fi
if [ -z "$HOSTTYPE" ] ; then
case `uname -sr || uname -a` in
HP-UX*7.*)
HOSTTYPE="HPUX9" ;;
HP-UX*8.*)
HOSTTYPE="HPUX9" ;;
HP-UX*9.*)
HOSTTYPE="HPUX9" ;;
HP-UX*10.*)
HOSTTYPE="HPUX10" ;;
*NEXT*)
HOSTTYPE="NEXT2" ;;
*Solaris*|*[Ss]un[Oo][Ss]*)
HOSTTYPE="SUN5" ;;
*BSD*)
HOSTTYPE="FREEBSD" ;;
BSDI*)
HOSTTYPE="BSDI" ;;
Linux*|LINUX*)
HOSTTYPE="LINUX" ;;
*)
echo 1>&2 "$0: set HOSTTYPE and export it by hand."
exit 2 ;;
esac
fi
if [ -z "$HOSTOS" ] ; then
HOSTOS=`uname -r | sed -e 's/^[A-Za-z .]*//' -e 's/-[A-Za-z]*//' -e 's/\.\([0-9][0-9]\)/\1/g' -e 'y/./0/' -e 's/^0*//'`
fi
# Now fake the Distrib @file@ expansion and hope the rest works out.
# Some make's mistakenly think you must call fork() to get a SIG-child...
# so they barf out errors for this -- they should learn UNIX.
m4 - Make.host <<! |make -f - ${1:+"$@"}
define(\`HOST',\`$HOST')dnl
define(\`SHORTHOST',\`$SHORTHOST')dnl
define(\`HOSTTYPE',\`$HOSTTYPE')dnl
define(\`MYTYPE',\`$HOSTTYPE')dnl
define(\`HOSTOS',\`$HOSTOS')dnl
define(\`MYOS',\`$HOSTOS')dnl
define(\`HASSRC',\`yes')dnl
define(\`MSRC_BOOT',\`${MSRC_BOOT-yes}')dnl
!

View file

@ -0,0 +1,15 @@
$NetBSD: patch-aa,v 1.1.1.1 2004/11/10 00:46:04 epg Exp $
--- bin/mkcmd/main.c.orig 2000-07-30 17:56:23.000000000 -0400
+++ bin/mkcmd/main.c
@@ -36,9 +36,7 @@ static char rcsid[] =
* do the hard work. mkcmd rembers how it was built and builds all
* subsequent parsers that way...
*/
-#if !defined(MSDOS)
-extern int errno;
-#endif
+#include <errno.h>
#if USE_STRINGS

View file

@ -0,0 +1,12 @@
$NetBSD: patch-ab,v 1.1.1.1 2004/11/10 00:46:04 epg Exp $
--- bin/mkcmd/parser.c.orig 2000-07-30 17:56:23.000000000 -0400
+++ bin/mkcmd/parser.c
@@ -6,6 +6,7 @@
#include <ctype.h>
#include <sys/param.h>
#include <sys/stat.h>
+#include <errno.h>
#include "machine.h"
#include "type.h"