# $Id: Portfile 82086 2011-08-07 16:38:28Z rmstonecipher@macports.org $

PortSystem		1.0
PortGroup		xcode 1.0

name			Platypus
version			4.4
categories		aqua devel
maintainers		me.com:tsupplis
description		Program for creating application wrappers around scripts.

long_description	Platypus is a program for creating application \
			wrappers around scripts, i.e. creating Mac OS X \
			applications that execute a script they are bundled \
			with. Scripts can thus be run transparently from the \
			graphical window environment without having to \
			resort to using the command line interface. It \
			supports drag and drop on created apps, running as \
			root using Authentication Manager and more.

homepage		http://www.sveinbjorn.org/platypus/
master_sites		http://www.sveinbjorn.org/files/software/platypus/
distname		platypus${version}.src
use_zip			yes

checksums           md5     e6fe23f7037a873394b70bcc62843940 \
                    sha1    31faa5ea5e3e266a213aa3dd3c1fa1173e611110 \
                    rmd160  0708e489de457d79cecb8192f1747459df8402c8

worksrcdir		"${name}-${version}-Source"

supported_archs i386 ppc

build.target platypus ScriptExec Platypus
destroot.target Platypus

if {"darwin" == ${os.platform} && ${os.major} >= 10} {
    universal_variant   no
}

post-destroot {
	reinplace "s|/usr/local|${destroot}${prefix}|g" ${worksrcpath}/Scripts/InstallCommandLineTool.sh

	# there is no English.lproj when building on Tiger and Leopard but there is one on SL
	if {"darwin" == ${os.platform} && 10 > ${os.major}} {
		reinplace "s|English.lproj/||g" ${worksrcpath}/Scripts/InstallCommandLineTool.sh
	}

	exec /bin/bash ${worksrcpath}/Scripts/InstallCommandLineTool.sh ${destroot}${applications_dir}/Platypus.app/Contents/Resources
}

livecheck.type	regex
livecheck.url	${homepage}
livecheck.regex	"${name} (\\d+(?:\\.\\d+)*)"

