# $Id: Portfile 116136 2014-01-19 06:47:18Z jmr@macports.org $

PortSystem 	1.0

name		rc
version		1.7.2
revision	1
categories	shells
maintainers	nomaintainer
description	A Plan 9 shell
license		Permissive

long_description	\
	This is a reimplementation for Unix, by Byron Rakitzis, \
	of the Plan 9 shell. rc offers much the same capabilities \
	as a traditional Bourne shell, but with a much cleaner syntax.

homepage	http://paganbooks.eu/software/article/rc
platforms	darwin

master_sites	ftp://rc.quanstro.net/pub/
use_bzip2	yes
extract.suffix	.tbz

checksums	rmd160  e245de754a6ada3f99e243acd7f87da9fce864d0 \
		sha256  d4b552b6652a2f85400b61b970c9034b17fcb59b74a0f242bbea12959e8939c7

patchfiles	Makefile.in.patch

configure.args	--mandir=${prefix}/share/man --with-history

test.run	yes
test.target	check

variant	readline description {use readline} {
	depends_lib port:readline
	configure.args-append  --with-readline
}

variant editline description {use libedit} {
	depends_lib port:libedit
	configure.args-append  --with-editline
}

pre-activate {
    foreach f {- -- -p --p} {
        set path ${prefix}/bin/${f}
        if {![catch {file type $path} ftype] && ($ftype eq "file" || $ftype eq "link") && [registry_file_registered $path] eq "0"} {
            file delete -force $path
        }
    }
}
