diff --git a/.tmkproject b/.tmkproject new file mode 100644 index 0000000..6ef37a3 --- /dev/null +++ b/.tmkproject @@ -0,0 +1,35 @@ +# Configuration Data For 'mkproject' +# +# Copyright (c) 2012, TundraWare Inc., Des Plaines, IL 60018 USA +# All Rights Reserved. For Terms Of Use, See: mkproject-license.txt +# +# $Id: .tmkproject,v 1.1 2012/06/01 20:56:06 tundra Exp $ + +# NOTE: Any strings below that need the "/" in them - +# like the website URL - must escape them for +# the 'sed' substitutions to work in mkproject.sh. + +##### +# Vendor Specific Branding For 'mkproject' +##### + +AUTHOR="Tim Daneliuk" +COPYOWNER="TundraWare Inc., Des Plaines, IL 60018 USA" # Copyright owner +VENDORNAME="TundraWare Inc." # Full name of vendor +VENDORTAG="TundraWare" # Used as initial CVS tag +EMAILSUPPORT=${PROJECTNAME}@tundraware.com # Program support email +WEBSITE="http:\/\/www.tundraware.com\/Software\/${PROJECTNAME}" # Project website + + +##### +# Project Directory - Where New Projects Go +##### + +PROJECTSDIR="${HOME}/Dev" + +##### +# Editor Used For Creating The WHATSNEW.txt File +##### + +EDITOR="emacs" +EDITARGS="-nw" diff --git a/Old/manpage.1 b/Old/manpage.1 new file mode 100644 index 0000000..fadacce --- /dev/null +++ b/Old/manpage.1 @@ -0,0 +1,45 @@ +.ds CP __COPYDATE__ +.TH __PROJECTNAME__ 1 __VENDORNAME__ +.SH NAME +__PROJECTNAME__ \- Short Description + +.SH SYNOPSIS +__PROJECTNAME__.__TYPE__ [-hv] + +.SH DESCRIPTION +Long description + +.SH OPTIONS +.TP +.B -h +print help information + +.TP +.B -v +print detailed program version information + +.SH OTHER +You must have a reasonably current version of XXXXXXXXXXXXXXXXXXXX installed. + +.SH BUGS AND MISFEATURES +None known as of this release. + +.SH COPYRIGHT AND LICENSING +\fC__PROJECTNAME__\fP is __COPYRIGHT___ For terms of use, see +the __LICENSE__ file in the program distribution. If you +install \fC__PROJECTNAME__\fP on a FreeBSD system using the 'ports' mechanism, you +will also find this file in \fC/usr/local/share/doc/__PROJECTNAME__\fP. + +.SH AUTHOR +.ft C \" Courier +.nf + __AUTHOR__ + __EMAILSUPPORT__ +.fi +.ft \" revert + +.SH DOCUMENT REVISION INFORMATION +__ID__ + + + diff --git a/WHATSNEW.txt b/WHATSNEW.txt new file mode 100644 index 0000000..1901ba9 --- /dev/null +++ b/WHATSNEW.txt @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/common/WHATSNEW.txt b/common/WHATSNEW.txt new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/common/WHATSNEW.txt @@ -0,0 +1 @@ + diff --git a/common/license.txt b/common/license.txt new file mode 100644 index 0000000..40a33a7 --- /dev/null +++ b/common/license.txt @@ -0,0 +1,110 @@ +__ID__ + +In order to use, study, modify, or copy '__PROJECTNAME__', you must read +and agree to all the licensing terms below. If you do not agree with +or do not understand *ANYTHING* you see in this document, you are NOT +granted a license to use, study, modify, or copy '__PROJECTNAME__'. By +using, studying, modifying, or copying '__PROJECTNAME__', you are agreeing +to all the terms of the '__PROJECTNAME__' LICENSE below in their entirety. + + + '__PROJECTNAME__' LICENSE AGREEMENT + + +1) DEFINITIONS + +Throughout this Agreement, the term '__PROJECTNAME__' is used to mean: + +Anything included in the '__PROJECTNAME__' software distribution package +from __VENDORNAME__ This includes scripts, programs, documentation, +license text and all other files provided in that original software +distribution package. + +Throughout this Agreement the term "User" is used to mean any person +who is enagaged in any of the following activities: + + a) Uses any files found in the '__PROJECTNAME__' software distribution + in any way. + + b) Reads the '__PROJECTNAME__' documentation. + + c) Reads or studies the '__PROJECTNAME__' program source code or + supporting files. + + d) Makes use of any part of the '__PROJECTNAME__' software distribution + for any purpose. + + e) Duplicates and/or distributes the '__PROJECTNAME__' software distribution. + + +2) OWNERSHIP + +'__PROJECTNAME__' Is __COPYRIGHT__ +All Rights Reserved. + + +3) TERMS + +Permission is hereby granted to the User for the duplication and use +of '__PROJECTNAME__' so long as ALL the following conditions are met: + + a) There is no license fee for PERSONAL NON-COMMERCIAL use of + '__PROJECTNAME__'. This means use by an individual for personal + applications only, with no remuneration of any kind, direct or + indirect, from the use of '__PROJECTNAME__'. Voluntary donations + from such users are accepted and encouraged. A donation of + $__COST__ US per user is recommended. Information on how to + contribute can be obtained by contacting: + + __EMAILSUPPORT__ + + Use of '__PROJECTNAME__' in ANY OTHER SITUATION, including + for-profit organizations, non-profit organizations, + educational institutions, and government organizations, + requires payment of a licensing fee. For current pricing + information, contact: + + __EMAILSUPPORT__ + + + b) The User of '__PROJECTNAME__' understands and agrees that this is + EXPERIMENTAL SOFTWARE which is provided "AS-IS" with no + warranties expressed or implied by __VENDORNAME__ + + c) The User acknowledges '__PROJECTNAME__' has NOT been tested for: + + i) Correct operation + + ii) Freedom from unintended consequences + + iii) Any operation or condition which might cause damage, + compromise, or disruption to the User's or other: + hardware, software, networks, or data, or which might + cause any breach of system security of such systems, + software, and networks. + + d) By using '__PROJECTNAME__' in any way, the User does so at their + own risk and agrees to hold __VENDORNAME__ harmless for any + damage, direct or indirect, that this software may or does + cause to the User's computational environment, including, but + not limited to, the User's or others' hardware, software, + network, or data. THE USER FURTHER AGREES TO HOLD __VENDORNAME__ + INC. HARMLESS FOR ANY ECONOMIC DAMAGE OR ANY OTHER ADVERSE + CONSEQUENCE, DIRECT OR INDIRECT, CAUSED BY THE USE OF + '__PROJECTNAME__'. + + e) If duplicated and/or distributed, no fee beyond reasonable + duplication charges may be charged for '__PROJECTNAME__'. No + commercial use of '__PROJECTNAME__' which involves any + remuneration beyond these duplication charges is permitted. + + f) Any distributed copies of '__PROJECTNAME__' must include all the + originally provided software, documentation, and licensing + information in their original distribution format and + packaging without any modifications. + +By using any part or all of '__PROJECTNAME__', you are agreeing to be +bound by this license. + +IF YOU DO NOT UNDERSTAND, OR CANNOT ABIDE BY ANY OF THESE CONDITIONS, +DO NOT USE '__PROJECTNAME__'. diff --git a/common/makefile b/common/makefile new file mode 100644 index 0000000..4ea24b8 --- /dev/null +++ b/common/makefile @@ -0,0 +1,159 @@ +# Build a release of '__PROJECTNAME__' using 'make' +# Requires a modern 'make' like GNU. +# +# __COPYRIGHT__ +# __RESERVED__ +# +# __UPDATES__ +# +# __ID__ + + +# Uncomment One Of The Following For Early Releases + +#EARLY = Alpha +#EARLY = Beta +#EARLY = RC1 + +##### +# Definitions Relevant To This Program +##### + +PROGNAME = __PROJECTNAME__ +TYPE = __TYPE__ +PROGMAIN = __PROJECTNAME__.__TYPE__ + +PROGFILES = ${PROGMAIN} +PROGDOCS = ${PROGMAIN}.ps + +DOCS = __LICENSE__ \ + ${PROGNAME}.1.gz \ + ${PROGNAME}.html \ + ${PROGNAME}.pdf \ + ${PROGNAME}.ps \ + ${PROGNAME}.rst \ + ${PROGNAME}.txt \ + CHANGELOG.txt \ + Makefile \ + WHATSNEW.txt \ + + +##### +# Nothing Should Need To Change Below This Line +##### + + +DIR = ${PROGNAME}-${VERSION} +HEADER1 = "WHATSNEW For '${PROGNAME}' ${VERSION} (`date`)" +HEADER2 = "----------------------------------------------------------------------" +RELEASES = "Releases" +TARBALL = ${DIR}.tar.gz +TMPFILE = tmpfile +VERSION = $(shell cvs log ${PROGMAIN} | grep head | cut -f2 -d " ")${EARLY} + + +##### +# Pattern Rules +##### + +### +# Document Production +### + +2HTML = rst2html +2LATEX = rst2latex --stylesheet=parskip +2ODT = rst2odt +2MAN = rst2man + +DVIPS = dvips +PDFLATEX = pdflatex +LATEX = latex + +%.dvi : %.latex + ${LATEX} $*.latex + +%.html : %.rst + ${2HTML} <$*.rst >$*.html + +%.latex : %.rst + ${2LATEX} $*.rst >$*.latex + +%.1 : %.rst + ${2MAN} <$*.rst >$*.1 + +%.1.gz: %.1 + @gzip -c <$*.1 >$*.1.gz + +%.odt : %.rst + ${2ODT} <$*.rst >$*.odt + +%.pdf : %.latex + ${PDFLATEX} $*.latex + ${PDFLATEX} $*.latex + ${PDFLATEX} $*.latex + +%.ps : %.dvi + ${DVIPS} $*.dvi + +%.txt: %.1 + @groff -man -Tascii $< | col -xb >$@ + +### +# Pretty Print Programs & Scripts +### + +%.pl.ps: %.pl + @enscript -Eperl --color -fCourier8 -i2 -L77 -C --mark-wrapped-lines=arrow -p$@ $< + +%.py.ps: %.py + @enscript -Epython --color -fCourier8 -i2 -L77 -C --mark-wrapped-lines=arrow -p$@ $< + +%.sh.ps: %.sh + @enscript -Esh --color -fCourier8 -i2 -L77 -C --mark-wrapped-lines=arrow -p$@ $< + + +##### +# Actual Build Rules +##### + +FORCE: + +CHANGELOG.txt: FORCE + @cvs log ${PROGMAIN} >CHANGELOG.txt + +WHATSNEW.txt: FORCE + @printf "%s\n%s\n\n" ${HEADER1} ${HEADER2} | cat - $@ >${TMPFILE} + @mv ${TMPFILE} $@ + @__EDITOR__ __EDITARGS__ $@ + @cvs commit -m${HEADER1} $@ + +docs: ${DOCS} ${PROGDOCS} + @chmod 644 ${DOCS} ${PROGDOCS} + @chmod 644 *.gz *.txt + @flip -u *txt + +release: docs ${PROGFILES} + @mkdir ${DIR} + -@mkdir ${RELEASES} 2>&1 >/dev/null + @cp -pv ${PROGFILES} ${DOCS} ${PROGDOCS} ${DIR} + @tar -czvf ${TARBALL} --exclude CVS ${DIR} + @rm -rf ${DIR} + @mv ${DIR}.tar.gz ${RELEASES} + +##### +# Housekeeping +##### + +clean: + @rm -rf *~ *.1 *.1.gz *.aux *.core *.dvi *.latex *.log *.out tmpfile *.toc + +version: + @echo ${VERSION} + +scrub: clean + @rm -rf ${DIR} ${PROGFILES} ${DOCS} ${PROGDOCS} ${TARBALL} ${TMPFILE} + +init: scrub + cvs update + + diff --git a/common/manpage.rst b/common/manpage.rst new file mode 100644 index 0000000..0cfcfc2 --- /dev/null +++ b/common/manpage.rst @@ -0,0 +1,70 @@ +NAME +---- + +**__PROJECTNAME__** - __DESCRIPTION__ + + +SYNOPSIS +-------- + +__PROJECTNAME__.__TYPE__ [-hv] + + +DESCRIPTION +----------- + +Long description + + +OPTIONS +------- + + -h Print help information + -v Print detailed program version information and exit + + +OTHER +----- + +You must have a reasonably current version of ``__LANGUAGE__`` installed. + + +BUGS AND MISFEATURES +-------------------- + +None known as of this release. + + +COPYRIGHT AND LICENSING +----------------------- + +**__PROJECTNAME__** is __COPYRIGHT__ + +For terms of use, see the ``__LICENSE__`` file in the +program distribution. + +If you install **__PROJECTNAME__** on a FreeBSD system using the 'ports' +mechanism, you will also find this file in:: + + /usr/local/share/doc/__PROJECTNAME__ + +AUTHOR +------ + +:: + + __AUTHOR__ + __EMAILSUPPORT__ + + +DOCUMENT REVISION INFORMATION +----------------------------- + +:: + + __ID__ + +You can find the latest version of this program at: + + __WEBSITE__ + diff --git a/common/program_header b/common/program_header new file mode 100755 index 0000000..c3b565a --- /dev/null +++ b/common/program_header @@ -0,0 +1,14 @@ +#!__INTERPRETER__ +# __PROJECTNAME__.__TYPE__ - __DESCRIPTION__ +# +# __COPYRIGHT__ +# __RESERVED__ +# +# __UPDATES__ +# +# __ID__ + +# Embedd the source control ID string for use by program + +CVSID='__ID__' + diff --git a/makefile b/makefile new file mode 100644 index 0000000..d3b38ff --- /dev/null +++ b/makefile @@ -0,0 +1,163 @@ +# Build a release of 'mkproject' using 'make' +# Requires a modern 'make' like GNU. +# +# Copyright (c) 2012 TundraWare Inc., Des Plaines, IL 60018 USA +# All Rights Reserved. For Terms Of Use See: mkproject-license.txt +# +# For Program Updates See: http://www.tundraware.com/Software/mkproject +# +# $Id: makefile,v 1.1 2012/06/01 20:56:06 tundra Exp $ + +CVSID='$Id: makefile,v 1.1 2012/06/01 20:56:06 tundra Exp $' + +# Uncomment One Of The Following For Early Releases + +#EARLY = Alpha +#EARLY = Beta +#EARLY = RC1 + +##### +# Definitions Relevant To This Program +##### + +PROGNAME = mkproject +TYPE = sh +PROGMAIN = mkproject.sh + +PROGFILES = ${PROGMAIN} .mkprojectrc +PROGDOCS = ${PROGMAIN}.ps + +SUPPDIRS = ./common ./pl ./py ./sh +PROGSUPP = $(shell find ${SUPPDIRS} | grep -v CVS) + +DOCS = ${PROGNAME}.1.gz \ + ${PROGNAME}.html \ + ${PROGNAME}.pdf \ + ${PROGNAME}.ps \ + ${PROGNAME}.rst \ + ${PROGNAME}.txt \ + CHANGELOG.txt \ + WHATSNEW.txt \ + makefile \ + mkproject-license.txt \ + + +##### +# Nothing Should Need To Change Below This Line +##### + + +DIR = ${PROGNAME}-${VERSION} +HEADER1 = "WHATSNEW For '${PROGNAME}' ${VERSION} (`date`)" +HEADER2 = "----------------------------------------------------------------------" +RELEASES = "Releases" +TARBALL = ${DIR}.tar.gz +TMPFILE = tmpfile +VERSION = $(shell cvs log ${PROGMAIN} | grep head | cut -f2 -d " ")${EARLY} + + +##### +# Pattern Rules +##### + +### +# Document Production +### + +2HTML = rst2html +2LATEX = rst2latex --stylesheet=parskip +2ODT = rst2odt +2MAN = rst2man + +DVIPS = dvips +PDFLATEX = pdflatex +LATEX = latex + +%.dvi : %.latex + ${LATEX} $*.latex + +%.html : %.rst + ${2HTML} <$*.rst >$*.html + +%.latex : %.rst + ${2LATEX} $*.rst >$*.latex + +%.1 : %.rst + ${2MAN} <$*.rst >$*.1 + +%.1.gz: %.1 + @gzip -c <$*.1 >$*.1.gz + +%.odt : %.rst + ${2ODT} <$*.rst >$*.odt + +%.pdf : %.latex + ${PDFLATEX} $*.latex + ${PDFLATEX} $*.latex + ${PDFLATEX} $*.latex + +%.ps : %.dvi + ${DVIPS} $*.dvi + +%.txt: %.1 + @groff -man -Tascii $< | col -xb >$@ + +### +# Pretty Print Programs & Scripts +### + +%.pl.ps: %.pl + @enscript -Eperl --color -fCourier8 -i2 -L77 -C --mark-wrapped-lines=arrow -p$@ $< + +%.py.ps: %.py + @enscript -Epython --color -fCourier8 -i2 -L77 -C --mark-wrapped-lines=arrow -p$@ $< + +%.sh.ps: %.sh + @enscript -Esh --color -fCourier8 -i2 -L77 -C --mark-wrapped-lines=arrow -p$@ $< + + +##### +# Actual Build Rules +##### + +FORCE: + +CHANGELOG.txt: FORCE + @cvs log ${PROGMAIN} >CHANGELOG.txt + +WHATSNEW.txt: FORCE + @printf "%s\n%s\n\n" ${HEADER1} ${HEADER2} | cat - $@ >${TMPFILE} + @mv ${TMPFILE} $@ + @emacs -nw $@ + @cvs commit -m${HEADER1} $@ + +docs: ${DOCS} ${PROGDOCS} + @chmod 644 ${DOCS} ${PROGDOCS} + @chmod 644 *.gz *.txt + @flip -u *txt + +release: docs ${PROGFILES} ${PROGSUPP} + @mkdir ${DIR} + -@mkdir ${RELEASES} 2>&1 >/dev/null + @cp -pvR ${PROGFILES} ${SUPPDIRS} ${DOCS} ${PROGDOCS} ${DIR} + @tar -czvf ${TARBALL} --exclude CVS ${DIR} + @rm -rf ${DIR} + @mv ${DIR}.tar.gz ${RELEASES} + +##### +# Housekeeping +##### + +clean: + @rm -rf *~ *.1 *.1.gz *.aux *.core *.dvi *.latex *.log *.out tmpfile *.toc + +version: + @echo ${VERSION} + +scrub: clean + @rm -rf ${DIR} ${PROGFILES} ${DOCS} ${PROGDOCS} ${TARBALL} ${TMPFILE} + +init: scrub + cvs update + + diff --git a/pl/Makefile b/pl/Makefile new file mode 100644 index 0000000..64bef03 --- /dev/null +++ b/pl/Makefile @@ -0,0 +1,8 @@ +# FreeBSD Ports Makefile For '__PROJECTNAME__' +# __ID__ + +all: # Nothing to do, it's a perl program + +install: + ${BSD_INSTALL_SCRIPT} __PROJECTNAME__.pl ${PREFIX}/bin + ${BSD_INSTALL_MAN} __PROJECTNAME__.1.gz ${PREFIX}/man/man1 diff --git a/pl/program.pl b/pl/program.pl new file mode 100755 index 0000000..e69de29 --- /dev/null +++ b/pl/program.pl diff --git a/py/Makefile b/py/Makefile new file mode 100644 index 0000000..8b0c8d5 --- /dev/null +++ b/py/Makefile @@ -0,0 +1,9 @@ +# FreeBSD Ports Makefile For '__PROJECTNAME__' +# __ID__ + +all: # Just need to create the compiled image + @python -OOOO -c"import py_compile;py_compile.compile('__PROJECTNAME__.py')" + +install: + ${BSD_INSTALL_SCRIPT} __PROJECTNAME__.py ${PREFIX}/bin + ${BSD_INSTALL_MAN} __PROJECTNAME__.1.gz ${PREFIX}/man/man1 diff --git a/py/program.py b/py/program.py new file mode 100755 index 0000000..a3d9ce4 --- /dev/null +++ b/py/program.py @@ -0,0 +1,262 @@ +##### +# Program Information +##### + +PROGNAME = "__PROJECTNAME__" +PROGENV = PROGNAME.upper() +VERSION = CVSID.split()[2] + +##### +# Copyright Information +##### + +COPYRIGHT = "__COPYRIGHT__" + + +PROGVER = PROGNAME + " " + VERSION + (" - %s" % COPYRIGHT) +HOMEPAGE = "__WEBSITE__" + + +#----------------------------------------------------------# +# Variables User Might Change # +#----------------------------------------------------------# + + + +#------------------- Nothing Below Here Should Need Changing ------------------# + + +#----------------------------------------------------------# +# Imports # +#----------------------------------------------------------# + +import getopt +import os +import sys +import tconfpy + + +#----------------------------------------------------------# +# Aliases & Redefinitions # +#----------------------------------------------------------# + + + +#----------------------------------------------------------# +# Constants & Literals # +#----------------------------------------------------------# + + + +##### +# Constants +##### + + + +##### +# Literals +##### + + + +#----------------------------------------------------------# +# Prompts, & Application Strings # +#----------------------------------------------------------# + + +##### +# Debug Messages +##### + +##### +# Debug Messages +##### + +DEBUGFLAG = "-d" +dDEBUG = "DEBUG" +dPROGENV = "$" + PROGENV + +##### +# Error Messages +##### + +eBADARG = "Invalid command line: %s!" +eERROR = "ERROR" + + +##### +# Informational Messages +##### + +iINFO = "INFO" + + +##### +# Usage Prompts +##### + +uTable = [PROGVER, + HOMEPAGE, + "usage: " + PROGNAME + " [-fhv]", + " where,", + " -f file configuration file to use", + " -h print this help information", + " -v print detailed version information", + ] + + +#----------------------------------------------------------# +# Global Variables & Data Structures # +#----------------------------------------------------------# + +CFGFILE = os.path.join(os.getenv("HOME"), "." + PROGNAME) # conf file + + +#--------------------------- Code Begins Here ---------------------------------# + + +#----------------------------------------------------------# +# Object Base Class Definitions # +#----------------------------------------------------------# + + + +#----------------------------------------------------------# +# Supporting Function Definitions # +#----------------------------------------------------------# + + +def ColumnPad(list, padchar=" ", padwidth=20): + + retval = "" + for l in list: + l = str(l) + retval += l + ((padwidth - len(l)) * padchar) + + return retval.strip() + +# End of 'ColumnPad()' + + +##### +# Print A Debug Message +##### + +def DebugMsg(msg): + PrintStderr(PROGNAME + " " + dDEBUG + ": " + msg) + +# End of 'DebugMsg()' + + +##### +# Dump The State Of The Program +##### + +def DumpState(): + + # Dump the command line + DebugMsg(ColumnPad(["Command Line", sys.argv])) + + # Names of all the state variables we want dumped + state = [ + ] + + for k in state: + DebugMsg(ColumnPad([k, eval(k)])) + +# End of 'DumpState()' + + +##### +# Print An Error Message +##### + +def ErrorMsg(emsg): + PrintStderr(PROGNAME + " " + eERROR + ": " + emsg) + +# End of 'ErrorMsg()' + + +##### +# Print An Info Message +##### + +def InfoMsg(imsg): + PrintStderr(PROGNAME + " " + iINFO + ": " + imsg) + +# End of 'InfoMsg()' + + +##### +# Print To stderr +##### + +def PrintStderr(msg, trailing="\n"): + sys.stderr.write(msg + trailing) + +# End of 'PrintStderr()' + + +##### +# Print To stdout +##### + +def PrintStdout(msg, trailing="\n"): + sys.stdout.write(msg + trailing) + +# End of 'PrintStdout' + + +##### +# Print Usage Information +##### + +def Usage(): + for line in uTable: + PrintStdout(line) + +# End of 'Usage()' + + +#----------------------------------------------------------# +# Program Entry Point # +#----------------------------------------------------------# + +# Command line processing - Process any options set in the +# environment first, and then those given on the command line + +OPTIONS = sys.argv[1:] +envopt = os.getenv(PROGENV) +if envopt: + OPTIONS = envopt.split() + OPTIONS + +try: + opts, args = getopt.getopt(OPTIONS, '-f:hv') +except getopt.GetoptError as e: + ErrorMsg(eBADARG % e.args[0]) + sys.exit(1) + +for opt, val in opts: + if opt == "-f": + CFGFILE=val + if opt == "-h": + Usage() + sys.exit(0) + if opt == "-v": + print CVSID + sys.exit(0) + +# Process the configuration file + +retval = tconfpy.ParseConfig(CFGFILE, CallingProgram="%s %s " % (PROGNAME, VERSION)) + +# Print any errors or warning generated by the parse + +for x in (retval.ErrMsgs, retval.WarnMsgs): + for y in x: + print y + +# If there were any errors, we're done +if retval.ErrMsgs: + sys.exit(0) diff --git a/py/setup.py b/py/setup.py new file mode 100644 index 0000000..177655b --- /dev/null +++ b/py/setup.py @@ -0,0 +1,5 @@ +# Install __PROJECTNAME__ as a Python Module +# __ID__ + +from distutils.core import setup +setup(name="__PROJECTNAME__", py_modules=["__PROJECTNAME__"]) diff --git a/sh/Makefile b/sh/Makefile new file mode 100644 index 0000000..d5e7f43 --- /dev/null +++ b/sh/Makefile @@ -0,0 +1,8 @@ +# FreeBSD Ports Makefile For '__PROJECTNAME__' +# __ID__ + +all: # Nothing to do, it's a shell script + +install: + ${BSD_INSTALL_SCRIPT} -o root -g wheel -m 755 __PROJECTNAME__.sh ${PREFIX}/bin + ${BSD_INSTALL_MAN} __PROJECTNAME__.1.gz ${PREFIX}/man/man1 diff --git a/sh/program.sh b/sh/program.sh new file mode 100755 index 0000000..413e686 --- /dev/null +++ b/sh/program.sh @@ -0,0 +1,248 @@ +##### +# Program Information +##### + +COPYRIGHT="__COPYRIGHT__" +PROGNAME="__PROJECTNAME__" + +##### +# Script Interface Definition +#### + +# +# Inputs And Command Line Arguments +# + +# -h Prints help information +# -v Prints program version information + +# +# Outputs +# + +# - Error output is written to stderr + + +# +# Side Effects +# + + +##### +# Variables, Constants, Literals, And Strings +##### + +# +# Program Related Stuff +# + +HELPTEXT="${CVSID} \n\ + Usage: ${PROGNAME} -XYZh \n\ + where, \n\ + \n\ + -X Option X \n\ + -Y Option Y \n\ + -Z Option Z \n\ + -h Print Help Information \n\ + -v Print Version Information \n\ +" + + +# +# Error Messages +# + +eBADARGS="Invalid Command Line Argument!" + +# +# Stuff Needed By promptuser() Function Below +# + +ORIGIFS=$IFS # Save current field separator +DL=';' # Prompt field delimiter +YN="Y y N n Yes yes No no YES NO" + + +# Prompt Records + +# Layout Of Fields In Prompt Record: +# +# PromptDefault Response (If user just hits Enter)Legal Answers (space separated) +# Notes: +# +# 1) An empty Prompt field means there will be no prompt displayed +# +# 2) An empty Default Response field means that, if the user hits enter, +# the response is blank +# +# 3) An empty Legal Answers field mean the routine will accept *any* input +# +# 4) It's up to you to make sure the Default Response is a legit answer. +# It is NOT checked against the Legal Answers list. + + +# Examples + +foo="Would you like to foo?${DL}Y${DL}" # Empty last field means accept anything +bar="Would you like to bar?${DL}\!${DL}${YN}" +baz="Would you like to baz?${DL}n${DL}${YN} yup" +bat="Would you like to bat?${DL}${DL}nope" + + +PROMPTLIST="foo bar baz bat" + + +# +# Common Program Locations +# + +AWK="/usr/bin/awk" +ECHO="/usr/bin/echo" +LS="/usr/bin/ls" +PERL="/usr/bin/perl" +PRINTF="/usr/bin/printf" +PYTHON="/usr/bin/python" +SED="/usr/bin/sed" + + +##### +# Function Definitions +##### + +# +# Print An Error Message +# + +ErrorMsg() +{ + ${PRINTF} "${*}\n" >&2 +} + +# End of 'ErrorMsg()' + + +# +# Print An Informative Message +# + +PrintMsg() +{ + ${PRINTF} "${*}\n" +} + +# End of 'PrintMsg()' + + +# +# PromptUser() - Shell Function To Prompt And Validate User Input +# + +# From: promptuser.sh,v 1.104 2010/10/07 19:27:37 tdaneli Exp + +PromptUser() + +{ + + for x in $PROMPTLIST + do + eval record=\$$x # Get the prompt record + IFS=$DL # Get individual fields + read prompt default answers <`basename $F` +done + + +# Combine the generic program template and the +# language-specific program template + +cat program_header program.${TYPE} >tmpfile +cat tmpfile >program.${TYPE} +rm tmpfile program_header + +# Set the project file names correctly + +tren.py -r program=${PROJECTNAME} -r license=${PROJECTNAME}-license -r manpage=${PROJECTNAME} * + +# Get everything under CVS control + +cvs import -m "${DESCRIPTION}" ${PROJECTNAME} ${VENDORTAG} start +cd .. +rm -rf ${PROJECTNAME} + +# Instantiate the project in the projects directory + +cd ${PROJECTSDIR} +cvs co ${PROJECTNAME} +cd ${PROJECTNAME} +cvs commit -r1.100 -m 'Initial CVS checkin to initialize version number' + +# Get rid of sticky tags + +for f in `find ./ -type f | grep -v CVS` +do + cvs update -A $f +done + +# Reminders + +echo +echo +echo +echo +echo +echo "------------------------------------------------------------------------" +echo "Don't Forget To Manually Add Any Additional Files And Update makefile!!!" +echo "------------------------------------------------------------------------" +echo +echo +echo "--------------------------------------------------------------------" +echo "Don't Forget To Setup The Mail Alias: ${EMAILSUPPORT}!!!" +echo "--------------------------------------------------------------------"