# $Id: Portfile 57375 2009-09-10 08:16:41Z ryandesign@macports.org $

PortSystem 1.0
name			kermit
version			8.0.211
categories		comms
maintainers		nomaintainer
distname		cku[lindex [split ${version} .] end]
platforms		darwin freebsd
master_sites		ftp://kermit.columbia.edu/kermit/archives/ \
			ftp://ftp.icm.edu.pl/pub/kermit/archives/
checksums		md5 5767ec5e6ff0857cbfe2d3ec1ee0e2bc \
				sha1 cd5e0524d27fea0275a0938da2a5fc115e0978b8
homepage		http://www.kermit-project.org/
description		Serial and network communications package.
long_description	C-Kermit is a combined serial and network \
			communication software package offering \
			a consistent, medium-independent, \
			cross-platform approach to connection \
			establishment, terminal sessions, file \
			transfer, character-set translation, \
			numeric and alphanumeric paging, and \
			automation of communication tasks.

extract.mkdir   yes
build.target
patchfiles	patch-makefile patch-ckuus5.c

platform darwin {
	build.target		macosx103
}

platform freebsd {
	set major 		[ string index ${os.version} 0 ]
	set minor		[ string index ${os.version} 2 ]
	build.target		freebsd${major}${minor}
}

configure {
	reinplace "s|@@prefix@@|${prefix}|g"	${worksrcpath}/ckuus5.c ${worksrcpath}/makefile
	reinplace "s|CC= cc|CC= ${configure.cc}|g"	${worksrcpath}/makefile
	reinplace "s|CC2= cc|CC2= ${configure.cc}|g"	${worksrcpath}/makefile
}

pre-destroot { 
	file mkdir ${destroot}${prefix}/bin
	file mkdir ${destroot}${prefix}/share/doc/kermit
}

livecheck.type  regexm
livecheck.url   http://www.columbia.edu/kermit/ck80.html
livecheck.regex {<td><b>Version:</b></td>\n<td><b>([0-9\.]+)</b></td>}
