# $Id: Portfile 40781 2008-10-14 22:23:54Z tommyd@macports.org $

PortSystem 1.0

name		hs-hinstaller
set canonicalname	hinstaller
version		2008.2.16
categories	devel haskell
maintainers	nomaintainer
platforms	darwin

description	The hinstaller library for Haskell
long_description	\
	This module allows you to incorporate arbitrary files into \
	a haskell module during compilation. The files are then \
	available to you through functions which allows you to \
	write installer-type applications which write out the \
	files when run. Thus this can be considered in the same \
	model as Java .jar files or executable zip or other \
	file archives.

homepage	http://www.wellquite.org/hinstaller/
master_sites	http://hackage.haskell.org/packages/archive/hinstaller/${version}/
distname	${canonicalname}-${version}

checksums	md5     0bcb6b537f50b5f980747880d492906d		\
		sha1    5890d7752ad9bf57972dc968ae96c90292645c32	\
		rmd160  4af29721a7820c7a198217064921e1305a5908ec

depends_build	port:ghc

configure       { system "cd ${worksrcpath} && runhaskell Setup configure --ghc --prefix=${prefix} --with-compiler=${prefix}/bin/ghc --enable-library-profiling"
                }

build           { system "cd ${worksrcpath} && runhaskell Setup build -v"
                }

destroot        { system "cd ${worksrcpath} && runhaskell Setup copy --copy-prefix=${destroot}${prefix}"
	          system "cd ${worksrcpath} && runhaskell Setup register   --gen-script"
		  system "cd ${worksrcpath} && runhaskell Setup unregister --gen-script"

                  file mkdir ${destroot}${prefix}/libexec/${name}
                  file copy ${worksrcpath}/register.sh \
                            ${destroot}${prefix}/libexec/${name}
                  file copy ${worksrcpath}/unregister.sh \
                            ${destroot}${prefix}/libexec/${name}
                }

post-activate   { system "${prefix}/libexec/${name}/register.sh" }

#pre-deactivate { system "${prefix}/libexec/${name}/unregister.sh" }

