# $Id: Portfile,v 1.2 2004/12/01 17:42:15 gwright Exp $

PortSystem 1.0
name		hsshellscript
version		2.1.0
revision	0
categories	devel
maintainers	gwright@opendarwin.org
platforms	darwin

description	Haskell for Unix Shell Scripting
long_description	\
		HsShell allows the use of the Haskell programming	\
		language for tasks which are usually done by shell scripts.

homepage	http://www.volker-wysk.de/hsshellscript/
master_sites	${homepage}/dist/

checksums	md5 1d85645fdf43b1496be5767272220cf1

depends_build	bin:c2hs:c2hs		\
		bin:haddock:haddock

patchfiles	patch-Makefile

configure	{ cd ${worksrcpath}
		  set ghcversion [ exec ghc --version | sed "s|^.*version ||" ]
		  reinplace s|/usr/local/imports|${prefix}/lib/ghc-${ghcversion}/imports| Makefile
		  reinplace s|/usr/local|${prefix}|g Makefile
		}

build.target	{ }

post-destroot	{ system "ranlib ${destroot}${prefix}/lib/libhsshellscript.a" }

post-activate	{ cd ${worksrcpath}
		  set ghcversion [ exec ghc --version | sed "s|^.*version ||" ]
		  system "DEST_IMPORTS=${prefix}/lib/ghc-${ghcversion}/imports/hsshellscript \
			  DEST_LIB=${prefix}/lib \
			  ghc-pkg -i lib/hsshellscript.pkg --update-package --auto-ghci-libs"
		}

