# $Id: Portfile 45354 2009-01-14 09:44:50Z blb@macports.org $

PortSystem 1.0

name		hs-binary
set canonicalname	binary
version		0.4.4
categories	devel haskell
maintainers	nomaintainer
platforms	darwin

description	Binary serialisation for Haskell values using lazy ByteStrings
long_description	\
		Efficient, pure binary serialisation using lazy ByteStrings.	\
		Haskell values may be encoded to and from binary formats,	\
		written to disk as binary, or sent over the network.		\
		Serialisation speeds of over 1 G/sec have been observed,	\
		so this library should be suitable for high performance		\
		scenarios.

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

checksums	md5     48fc6454e82e0aec7f648be107bfc0b8 \
		sha1    45a58bb317bd946301ef6ab17d966891f73b72c5 \
		rmd160  63a3f68587023a29226ce42a1aa37a4af906d8a2

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

