# $Id: Portfile,v 1.20 2003/12/16 22:06:24 ssen Exp $

PortSystem 1.0
name		netcat
version		1.10
revision	2
categories	net
maintainers 	opendarwin.org@darkart.com	
description	Utility for managing network connections
long_description	Netcat is a simple Unix utility which reads and writes data across \
			network connections using TCP or UDP protocol.  It is designed to be a \
			reliable "back-end" tool that can be used directly or easily driven by \
			other programs and scripts.  At the same time it is a feature-rich \
			network debugging and exploration tool, since it can create almost any \
			kind of connection you would need and has several interesting built-in \
			capabilities.
platforms	darwin freebsd
master_sites	ftp://coast.cs.purdue.edu/pub/tools/unix/netutils/netcat/ \
		ftp://ftp.cuhk.edu.hk/pub/packages/security/purdue/netutils/netcat/ \
		 http://public.www.planetmirror.com/pub/lprng/TOOLS/
##
## build the version string to match how netcat is distributed
regsub -all	"\\." ${portversion} "" num
## and appropriately name the distfile
distfiles	nc${num}.tgz

checksums	md5 402632f2fe01c169ff19a0ad6e9d608c
## The problem here is that nc110.tgz (at least) doesn't have a
## directory in the tarball.  So we need some way to extract things
## into a named directory rather than just into the work/ directory.
pre-extract     { system "mkdir -p ${worksrcpath}" }
extract.dir     ${worksrcpath}

platform darwin 6 {
# Some version of Darwin 6 don't understand -s when linking
	patchfiles-append	patch-Makefile
}

configure	{}
build.target	generic

destroot  { cd ${workpath}/${worksrcdir}
              system "install -m 755 -d ${destroot}/${prefix}/bin"
              system "install -m 755 -d ${destroot}/${prefix}/share/doc/netcat"
              system "install -m 755 -s -c nc ${destroot}/${prefix}/bin"
              system "install -m 644 -c README ${destroot}/${prefix}/share/doc/netcat" }

