# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	$DISTNAME
#	$DISTNAME/pkg
#	$DISTNAME/pkg/COMMENT
#	$DISTNAME/pkg/DESCR
#	$DISTNAME/pkg/PLIST
#	$DISTNAME/files
#	$DISTNAME/files/md5
#	$DISTNAME/Makefile
#
CATEGORIES=misc
#          ~~~~~
DISTNAME=xtimer
#        ~~~~~~~~~~~~~~~~~~~~~~ basename of the tar file
rm -f $DISTNAME-*port*.tar.gz
VERSION=`echo ${DISTNAME}*.tar.gz | sed 's/.*-\([^.]*\)\.tar\.gz.*/\1/'`
#       ~~~~~~~~~~~~~~~~~~~~~~~ version of the tar file
MAINTAINER=$USER@`hostname | sed 's/[^.]*\.//'`
#          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  my email address
#MASTER_SITES=http://www.vector.co.jp/authors/VA004959/$DISTNAME/
MASTER_SITES=http://spock.vector.co.jp/authors/VA004959/$DISTNAME/
#            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ end with a `/'
PKGNAME=$DISTNAME-$VERSION
WHOM=$MAINTAINER

COMMENT='A super simple digital timer for X11'
#       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  Comment in A line.
DESCR="\
$DISTNAME is a very simple timer for X11.
The best use is to display the connecting time of iij-ppp.
candy@fct.kgc.co.jp (Toshihiro Kanda)
"
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Descriptions

PLIST="\
bin/$DISTNAME
man/man1/$DISTNAME.1.gz
"
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Creation files

test ! -f $PKGNAME.tar.gz && { echo $PKGNAME not found. 1>&2 ; exit 1; }
mkdir -p $DISTNAME > /dev/null 2>&1
mkdir -p $DISTNAME/pkg > /dev/null 2>&1
mkdir -p $DISTNAME/files > /dev/null 2>&1
echo "$COMMENT" >$DISTNAME/pkg/COMMENT
echo -n "$DESCR" >$DISTNAME/pkg/DESCR
echo -n "$PLIST" >$DISTNAME/pkg/PLIST
md5 $PKGNAME.tar.gz >$DISTNAME/files/md5
sed 's/^X//' >$DISTNAME/Makefile << END-of-DISTNAME/Makefile
X# New ports collection makefile for:	$DISTNAME
X# Version required:	0.$VERSION
X# Date created:		`date '+%d %b %Y'`
X# Whom:			$WHOM
X#
X# \$Id\$
X#
X
XDISTNAME=	$PKGNAME
XCATEGORIES=	$CATEGORIES
XMASTER_SITES=	$MASTER_SITES
X
XMAINTAINER=	$MAINTAINER
X
XUSE_IMAKE=	yes
X
X.include <bsd.port.mk>
END-of-DISTNAME/Makefile
tar -czf $PKGNAME-port`date '+%y%m%d'`.tar.gz $DISTNAME
rm -r $DISTNAME
exit
