1******************************************** 2* 3* Clearsilver INSTALL 4* 5* http://www.clearsilver.net 6* 7* Brandon Long, David Jeske 8* 9******************************************** 10 111) Compile ------------------------------------------------ 12 13Simplest case: 14 15# ./configure 16# make 17 18Options to configure: 19 --disable-compression Disables HTML Compression support 20 --enable-remote-debugger Enables remote X CGI debugging 21 --disable-apache Disables building of apache 1.3.x module 22 --with-apache=path Set location of Apache installation 23 --disable-python Disables building of python module 24 --with-python=path Set location of Python Includes 25 --disable-perl Disables building of perl module 26 --with-perl=path Set location of Perl binary 27 --disable-ruby Disables building of ruby module 28 --with-ruby=path Set location of Ruby binary 29 --disable-java Disables building of java module 30 --with-java=path Set location of J2SDK 31 --disable-csharp Disables building of csharp module 32 --with-csharp=path Set location of csharp 33 --enable-gettext Enable gettext message translation 34 35--disable-compression: Currently, the CGI output code in the cgi 36kit automatically attempts to detect whether the remote browser can 37handle compressed data, and if it does, compresses the output for 38text/html. This is run-time configurable via Config.CompressionEnabled. 39Disabling it at compile time eliminates the dependency on libz. 40 41--enable-remote-debugger: The CGI kit contains code for remotely 42debuggin CGI programs by launching an X based debugger (such as xxgdb or 43ddd) at the X display you specify in the HTTP request. There are 44controls such as a configurable list of allowed displays, but remote 45debugging is disabled by default. 46 47--enable-gettext: Enables gettext message translation. Once enabled 48you have a new builtin function "_(<message>)". This function calls the 49function gettext (man 3 gettext). 50 51The rest of the --disable/--with either disable a specific module, or 52point ClearSilver at the right program to enable it. The configure 53script will simple not build any module it can't find the right versions 54of programs to build against. Alternatively, if you are making 55ClearSilver part of your build environment, you can simple delete 56whichever module directory you don't want, and the build will ignore it. 57 58For information about compiling on Windows under MingW and MSYS, see 59python/README.txt 60 61The csharp wrapper was built with Mono (www.go-mono.com) and should work 62with v0.24 and later (give or take). In theory, it should be fairly 63simple to get this working on MS.Net as well. 64 652) Install ------------------------------------------------ 66 67# make install 68 69The make install is relatively new, and just installs the 70libraries/header files (and probably the perl and python modules, but 71that's a guess) 72 733) Example 1, Apache static.cgi ---------------------------------- 74 75"static.cgi" is a simple binary which will allow you to write static 76HDF files, static ClearSilver templates, and render them. This is a 77good way to get started and learn the clearsilver model and 78syntax. Follow the steps below to install static.cgi into your Apache 79configuration and then read the documentation while playing with 80static files. 81 82 http://www.clearsilver.net/docs/man_hdf.hdf 83 84Add the following to your Apache configuration and copy the 85Clearsilver static.cgi binary from cgi/static.cgi into your Apache 86cgi-bin directory. 87 88 AddHandler cgi-script .cgi 89 Action cs-handler /cgi-bin/static.cgi 90 AddHandler cs-handler .cs 91 92Since any html file is a valid CS file, I also run with: 93 94 AddHandler cs-handler .html 95 96* About static.cgi: 97 98static.cgi works by assuming that whatever file it was pointed at is a 99CS template. It first tries to load common.hdf in the same directory, 100then it tries to load some other hdf files, and then it parses and 101displays the template file. 102 103Ie, if its pointed at foo.cs, it will load common.hdf, try to load 104foo.cs.hdf, if that fails, it tries foo.hdf. If the hdf defines 105CGI.StaticContent, it will assume that's the real template file (which 106is how we use it on www.clearsilver.net, we just point at he .hdf files, 107which define StaticContent as a wrapper.cs, which includes another file 108defined in the .hdf file). 109 1104) Example 2, imd image server ------------------------------------ 111 112"imd" is a simple image server written with C and clearsilver. The imd 113directory has a README on how to set up imd with Apache. 114 1155) Example 3, using with Python ----------------------------------- 116 117The clearsilver python wrapper comes with CSPage.py. This file 118contains the CSPage superclass, and this file gives some pointers on 119how to use the cs handler via python. A much more thorough example 120is Scott Hassan's image_server, available from 121 122 http://www.dotfunk.com/projects/image_server 123 124 125