[Haskell-cafe] packaging a cgi binary using cabal

Rogan Creswick creswick at gmail.com
Wed Sep 22 18:17:47 EDT 2010


On Wed, Sep 22, 2010 at 7:53 AM, Pedro Baltazar Vasconcelos
<pbv at dcc.fc.up.pt> wrote:
>
> I wrote a simple interactive tableaux theorem prover as a cgi in
> Haskell (http://www.ncc.up.pt/~pbv/cgi/tableaux.cgi) and would like
> to submit to hackage but need some advice on how to package it using
> cabal. In particular, the binary, CSS and bitmap files need to be
> installed under the web server directory (public_html or alike) rather
> than system or user directories.
>
> Any thoughts on how to do this?

You could probably use a post-install (postInst) user hook to do it,
but that can get a little hairy.  (I'm not certain what modules you
can reasonably use from code invoked via Setup.hs, and you'll have to
worry about tracking down/detecting/creating a public_html directory)
To use user hooks with cabal-install, you will also have to set the
build-type to Custom.

The list of user hooks is here:
  http://hackage.haskell.org/packages/archive/Cabal/1.8.0.6/doc/html/Distribution-Simple-UserHooks.html

Ed Yang has a blog post that discusses using user hooks to do
relatively complex build tasks.  While the context and objective are a
bit different, his examples may help to understand the syntax and
interactions between the cabal file and Setup.hs:

  http://blog.ezyang.com/2010/06/setting-up-cabal-the-ffi-and-c2hs/

--Rogan

>
> Regards,
>
> Pedro Vasconcelos
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>


More information about the Haskell-Cafe mailing list