# $Id: Portfile 40783 2008-10-14 22:27:30Z tommyd@macports.org $

PortSystem 1.0

name		hs-chunks
version		2007.4.18
distname	chunks-${version}
categories	devel haskell
maintainers	nomaintainer
platforms	darwin

description	The chunks library for Haskell
long_description	\
		This library supports templates inspired by the Perl \
		HTML::Chunks module, but this Haskell implementation \
		checks at compile time that the templates used exist and \
		are used correctly. The templates are combined within the \
		compiled Haskell, removing the dependency on the external \
		template file.

homepage	http://www.wellquite.org/chunks/
master_sites	http://hackage.haskell.org/packages/archive/chunks/${version}
checksums	md5 783cd887026c2a096aac448ce8bd714b

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" }

