# $Id: Portfile 54313 2009-07-24 19:05:01Z toby@macports.org $

PortSystem 1.0
PortGroup xcode 1.0

name			Smultron
version			3.5.1
categories		aqua editors
platforms		darwin
maintainers		bfulgham
homepage		http://smultron.sourceforge.net/
description		Cocoa text editor with syntax colouring

long_description	Smultron is an open-source text editor written in Cocoa \
			for Mac OS X Panther with many of the features that you \
			might need. It features easy selection of the opened documents, \
			line numbers, support for syntax colouring for many different \
			languages, support for text encodings, code snippets, a toolbar, \
			a status bar, HTML preview, multi-document find and replace with \
			regular expressions, possibility to show invisible characters, \
			authenticated saves, command-line utility, .Mac synchronisation \
			of preferences and many more features.
			
			
master_sites		sourceforge:smultron
checksums           md5     08af90e57f58c4b2c99b376815ddfc43 \
                    sha1    b559ac4f83f4f14ee86d1695c12a05c106b04930 \
                    rmd160  414b3e41b9902f8f2bcfb22ac507a9c7fb9637d1


use_zip			yes
distname		${name}Source-${version}

pre-fetch {
    if {[variant_isset darwin_7] || [variant_isset darwin_8]} {
        return -code error "${name} ${version} only builds on Mac OS X Leopard (10.5.x). Sorry."
    }
}

use_configure		no

platform darwin 7 { }
platform darwin 8 { }

platform darwin 9 {
	if {$xcodeversion == "2.1"} {
		set xcodebuilddir	build/Deployment
	}
}

build.type		pbx
build.dir		${workpath}/${name}Source

destroot	{
	xinstall -m 755 -d ${destroot}/Applications/MacPorts
	file copy ${workpath}/${name}Source/build/Release/Smultron.app \
		${destroot}/Applications/MacPorts
}

post-activate {
	system "ln -sf /Applications/MacPorts/Smultron.app/Contents/Resources/smultron ${prefix}/bin/smultron"
	system "ln -sf /Applications/MacPorts/Smultron.app/Contents/Resources/smultron.1 ${prefix}/share/man/man1/smultron.1"
}

# post-uninstall {
# 	file delete -force ${prefix}/bin/smultron
# 	file delete -force ${prefix}/bin/smultron.1
#}

