# $Id: Portfile,v 1.3 2005/10/03 07:20:36 yeled Exp $

PortSystem 1.0
name		makeself
version		2.1.4
categories	archivers
maintainers	yeled@opendarwin.org
description	A small shell script that generates a self-extractable archives
long_description \
	makeself.sh is a small shell script that generates a \
	self-extractable tar.gz archive  from a directory. The \
	resulting file appears as a shell script (many of those have \
	a .run suffix), and can be launched as is. 

homepage	http://www.megastep.org/makeself/
platforms	darwin
master_sites	${homepage}

distname	${name}
extract.suffix	.run
checksums	md5 43289565b68c3490a6904c4aed004d51

patchfiles	patch-makeself.sh

worksrcdir	${name}

extract {
	file attributes "${distpath}/${distfiles}" -permissions a+x
	system "${distpath}/${distfiles} --nox11 --target ${worksrcpath}"
}

post-patch {
	reinplace s|@PREFIX@|${prefix}|g ${worksrcpath}/makeself.sh
}

configure {}

build {}

destroot {
	xinstall -m 755 -d ${destroot}/${prefix}/libexec/makeself
	xinstall "${worksrcpath}/makeself-header.sh" "${destroot}/${prefix}/libexec/makeself/"
	xinstall "${worksrcpath}/makeself.sh" "${destroot}/${prefix}/bin/makeself"
	xinstall "${worksrcpath}/makeself.1" "${destroot}/${prefix}/share/man/man1/"
}
