# $Id: Portfile 53548 2009-07-08 01:53:57Z ryandesign@macports.org $

PortSystem 1.0

name		hs-NewBinary
set canonicalname	NewBinary
epoch		20081014
version		0.1.1
categories	devel haskell
maintainers	nomaintainer
platforms	darwin

description	The New Binary library for Haskell.
long_description	\
		An older haskell library for fast binary I/O.  New projects \
		should consider using hs-binary.

set hackage	http://hackage.haskell.org/packages/archive
homepage	${hackage}/pkg-list.html
master_sites	${hackage}/${canonicalname}/${version}
distname	${canonicalname}-${version}

checksums	md5     20860c26d5a6f13a2b0a4bd3da77b8c7		\
		sha1    4035efa53938a964c698ad90793fd3926e4f4350	\
		rmd160  a21366c16fcf186c921ef5b670e3e87f7bd51ccd

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

