packaging a cgi binary using cabal

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? Regards, Pedro Vasconcelos

On Wed, Sep 22, 2010 at 7:53 AM, Pedro Baltazar Vasconcelos
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/Distribut... 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@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Hi, Am Mittwoch, den 22.09.2010, 15:53 +0100 schrieb Pedro Baltazar Vasconcelos:
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?
In case of such research programs, where ease of installability is usually more important than performance, I just include the data files into the program. For example, in http://darcs.nomeata.de/sem_syn/ the JQuery library and the file BUtils.hs are turned into Haskell string literals using http://github.com/jgm/hsb2hs This way, the resulting binary is really stand-alone and can be just moved to the appropriate place on the web server. Greetings, Joachim -- Joachim "nomeata" Breitner mail: mail@joachim-breitner.de | ICQ# 74513189 | GPG-Key: 4743206C JID: nomeata@joachim-breitner.de | http://www.joachim-breitner.de/ Debian Developer: nomeata@debian.org

Hello list, Thanks for all suggestions. If you're interested, I've uploaded a first version of the theorem prover to hackagedb (tableaux-0.1). Best regards, Pedro
participants (3)
-
Joachim Breitner
-
Pedro Baltazar Vasconcelos
-
Rogan Creswick