Re: [Haskell-cafe] packaging a cgi binary using cabal

2010-09-23 Thread Joachim Breitner
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: m...@joachim-breitner.de | ICQ# 74513189 | GPG-Key: 4743206C
  JID: nome...@joachim-breitner.de | http://www.joachim-breitner.de/
  Debian Developer: nome...@debian.org


signature.asc
Description: This is a digitally signed message part
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] packaging a cgi binary using cabal

2010-09-23 Thread Joachim Breitner
Hi,

Am Donnerstag, den 23.09.2010, 11:19 +0100 schrieb Pedro Baltazar
Vasconcelos:
 On Thu, 23 Sep 2010 10:44:17 +0200
 Joachim Breitner m...@joachim-breitner.de wrote:
  
  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.
  
 
 OK, thanks for the suggestion. For my needs I think this will be very
 straightforward to do manually --- the CSS and image files a pretty
 short anyway.

for CSS, this is what I’m doing as well... but for binary image data?

Greetings,
Joachim

-- 
Joachim nomeata Breitner
  mail: m...@joachim-breitner.de | ICQ# 74513189 | GPG-Key: 4743206C
  JID: nome...@joachim-breitner.de | http://www.joachim-breitner.de/
  Debian Developer: nome...@debian.org


signature.asc
Description: This is a digitally signed message part
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] packaging a cgi binary using cabal

2010-09-23 Thread Diego Souza
Well, if you want you might use images inline as well:
http://en.wikipedia.org/wiki/Data_URI_scheme#Advantages

From my experience, this is supported by all major browser, including IE.

Regards,
~dsouza

On Thu, Sep 23, 2010 at 9:03 AM, Joachim Breitner
m...@joachim-breitner.dewrote:

 Hi,

 Am Donnerstag, den 23.09.2010, 11:19 +0100 schrieb Pedro Baltazar
 Vasconcelos:
  On Thu, 23 Sep 2010 10:44:17 +0200
  Joachim Breitner m...@joachim-breitner.de wrote:
  
   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.
  
 
  OK, thanks for the suggestion. For my needs I think this will be very
  straightforward to do manually --- the CSS and image files a pretty
  short anyway.

 for CSS, this is what I’m doing as well... but for binary image data?

 Greetings,
 Joachim

 --
 Joachim nomeata Breitner
  mail: m...@joachim-breitner.de | ICQ# 74513189 | GPG-Key: 4743206C
  JID: nome...@joachim-breitner.de | http://www.joachim-breitner.de/
  Debian Developer: nome...@debian.org

 ___
 Haskell-Cafe mailing list
 Haskell-Cafe@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell-cafe




-- 
~dsouza
yahoo!im: paravinicius
gpg key fingerprint: 71B8 CE21 3A6E F894 5B1B  9ECE F88E 067F E891 651E
gpg pub key: http://bitforest.org/~dsouza/pub/gpg-pubkey.txt
authorized_keys: http://bitforest.org/~dsouza/pub/authorized_keys.txt
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] packaging a cgi binary using cabal

2010-09-23 Thread Pedro Baltazar Vasconcelos

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
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] packaging a cgi binary using cabal

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

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe