# $Id: Portfile 65654 2010-03-29 23:53:34Z jmr@macports.org $

PortSystem 1.0
name		hsshellscript
version		2.1.0
revision	0
categories	devel
maintainers	nomaintainer
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:hs-haddock

patchfiles	patch-Makefile

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

build.target	{ }

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

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

