diff -Nru clearsilver-0.9.2/Makefile clearsilver-0.9.3/Makefile --- clearsilver-0.9.2/Makefile Mon Aug 18 13:24:45 2003 +++ clearsilver-0.9.3/Makefile Sun Aug 31 12:10:37 2003 @@ -105,9 +105,9 @@ mkdir -p $$mdir; \ done -CS_DISTDIR = clearsilver-0.9.2 -CS_LABEL = CLEARSILVER-0_9_2 -CS_FILES = LICENSE CS_LICENSE rules.mk.in Makefile util cs cgi python scripts mod_ecs imd java-jni perl ruby acconfig.h autogen.sh config.guess config.sub configure.in cs_config.h.in mkinstalldirs install-sh ClearSilver.h ports +CS_DISTDIR = clearsilver-0.9.3 +CS_LABEL = CLEARSILVER-0_9_3 +CS_FILES = README README.python INSTALL LICENSE CS_LICENSE rules.mk.in Makefile util cs cgi python scripts mod_ecs imd java-jni perl ruby dso csharp acconfig.h autogen.sh config.guess config.sub configure.in cs_config.h.in mkinstalldirs install-sh ClearSilver.h ports contrib cs_dist: rm -rf $(CS_DISTDIR) cvs -q tag -F $(CS_LABEL) $(CS_FILES) diff -Nru clearsilver-0.9.2/README clearsilver-0.9.3/README --- clearsilver-0.9.2/README Wed Dec 31 16:00:00 1969 +++ clearsilver-0.9.3/README Mon Aug 11 14:59:30 2003 @@ -0,0 +1,66 @@ +************************************ +* Clearsilver README +************************************ + +For more information, see the website: + + http://www.clearsilver.net/ + +This package includes Clearsilver, the CGI kit and HTML templating +system. For information about building and installing, see the +included INSTALL file. This package also includes tools which +help you use Clearsilver, as well as a few examples. + +************************************************************ +*** Clearsilver + +* Clearsilver - This is our html template system and cgi kit. + +There are too many great things about clearsilver to list them all +here, but here are some of the salient points: + + * get the html out of your code + * loops, conditionals, macros, and stuff + * cgi kit unifies query variable and cookie handling + * super-easy to go from static mockup to dynamic page + * run multiple front-ends on the same application code + * super-fast C-library + * unifies Query variable and cookie handling + * language neutral (C,C++,Python,Ruby,Perl,Java,C#) + * nice iterative page debugging/development features + * generate static-data-driven page content without using any code + * did I mention super-fast? + +Supported language information: + + README.python + +************************************************************* +*** Tools + +* trans.py + +This is our transparent translation system. It's based on how we did +translation at Yahoo!. You leave all the english strings right in the +clearsilver templates. trans parses the html and extracts your +language strings into a translation database. You can then translate +the strings using any means. (it includes tools for dump and loading +per-language files for shipping to translators). Occasionally trans +isn't smart enough to find your language strings, in this case you can +manually extract them into static language string files and trans will +automatically pick them up. When it comes time to ship, trans +generates language-independent templates, and a set of language files +from your database. + +************************************************************* +*** Examples + +* static.cgi + +This is a standalone binary which handles Clearsilver rendering of +static content. This is a great way to play with clearsilver syntax +before you start writing dynamic CGIs with it. This is also a great +way to do webpage mockups with much more power than server side +includes. See the INSTALL file for information about configuring +this for use with apache. + diff -Nru clearsilver-0.9.2/README.python clearsilver-0.9.3/README.python --- clearsilver-0.9.2/README.python Wed Dec 31 16:00:00 1969 +++ clearsilver-0.9.3/README.python Mon Aug 11 14:56:55 2003 @@ -0,0 +1,65 @@ + + +************************************************************ +*** Python Environment Information + +* Python - we know it and love it +* Apache - the defacto standard + +* PyApache/mod_python + +Either one is fine, the goal is to load all Python code once, before +Apache forks. Then, for every web-request, Apache just makes a +function call into the Python environment which serves the page. This +is "really fast" as it gets rid of all of the parsing and loading of +Python. Various versions of PyApache and mod_python have gained and +lost and gained again the ability to do this well. We used a hacked +version of PyApache way back when, I think mod_python does this out of +the box today. + + + +************************************************************ +*** Python Tools + +* CSPage.py + +This is our "page rendering superclass". It's pretty simple and has +nice machinery for some of the stuff talked about on this list. For +example, it has nice debugging and redirect support, and it has a +mechanism for mapping form submit buttons to method names. Here is an +example of how the form stuff works: + +
+ + class MyPage(CSPage): + def setup(self): + # this runs before everything else + pass + def display(self): + # this is a regular non-submission render + pass + def Action_Foo(self): + # this is run automatically when the Foo submit button is clicked + pass + +* odb.py + +This is an object to relational database mapping tool. It makes +interacting with SQL databases really easy. It gives you a place to +put all your SQL code. It also could be changed to work with flat +files as well. We have some nice hooks to connect this to Clearsilver, +so rendering database data into webpages is really easy. Here is an +example: + +rows = mydb.mytable.fetchAllRows() # fetch all rows +rows.hdfExport("CGI.tabledata",ncgi.hdf) # export them into the dataset + +# it is also really easy to change rows: + +row = mydb.mytable.fetchRow( ('user', 'jeske') ) +row.email = 'jeske at chat.net' +row.save() + diff -Nru clearsilver-0.9.2/configure.in clearsilver-0.9.3/configure.in --- clearsilver-0.9.2/configure.in Mon Aug 18 13:24:45 2003 +++ clearsilver-0.9.3/configure.in Sun Aug 31 10:33:24 2003 @@ -235,15 +235,19 @@ cs_cv_python=no; AC_MSG_RESULT(Disabling python module) fi]) -AC_ARG_WITH(python, [ --with-python=path Set location of Python Includes], [cs_cv_python_path="$withval"], [cs_cv_python_path=no]) +AC_ARG_WITH(python, [ --with-python=path Set location of Python Interpreter], [cs_cv_python_path="$withval"], [cs_cv_python_path=no]) if test $cs_cv_python = yes; then AC_MSG_CHECKING(for python includes) python_inc=no python_search_path="/neo/opt /usr/local /usr /c" python_versions="2.2 2.1 2.0 1.5 22 21 20 15" - if test $cs_cv_python_path != "no" -a -d $cs_cv_python_path; then - python_path=$cs_cv_python_path + if test $cs_cv_python_path != "no" -a -x $cs_cv_python_path; then + python_bin=$cs_cv_python_path + vers=`$python_bin -c "import sys; print sys.version[[:3]]"` + py_inst_dir=`$python_bin -c "import sys; print sys.exec_prefix"` + python_inc=$py_inst_dir/include/python$vers + python_lib="-L$py_inst_dir/lib/python$vers/config -lpython$vers" else for vers in $python_versions; do for path in $python_search_path; do @@ -253,7 +257,6 @@ if test -f $path/include/python$vers/Python.h; then python_inc=$path/include/python$vers python_lib="-L$path/lib/python$vers/config -lpython$vers" - python_site=$path/lib/python$vers/site-packages break 2 fi dnl This is currently special cased mostly for Windows @@ -261,7 +264,6 @@ if test -f $path/python$vers/include/Python.h; then python_inc=$path/python$vers/include python_lib="-L$path/python$vers/libs -lpython$vers" - python_site=$path/python$vers/lib/site-packages break 2 fi done @@ -278,7 +280,7 @@ PYTHON=$python_bin PYTHON_INC="-I$python_inc" PYTHON_LIB=$python_lib - PYTHON_SITE=$python_site + PYTHON_SITE=`$python_bin -c "import site; print site.sitedirs[[0]]"` BUILD_WRAPPERS="$BUILD_WRAPPERS python" fi fi diff -Nru clearsilver-0.9.2/contrib/cs-mode.el clearsilver-0.9.3/contrib/cs-mode.el --- clearsilver-0.9.2/contrib/cs-mode.el Wed Dec 31 16:00:00 1969 +++ clearsilver-0.9.3/contrib/cs-mode.el Mon Aug 18 13:00:30 2003 @@ -0,0 +1,50 @@ +(defvar cs-font-lock-keywords + (list + '("<\\?cs[^\\?]*\\?>" 0 font-lock-keyword-face t) + '("<\\?cs +\\(call\\|each\\|if\\|alt\\|var\\|include\\)" 1 font-lock-keyword-face t) + '("<\\?cs +\\(/each\\|/if\\|/alt\\|/var\\|/include\\)" 1 font-lock-keyword-face t) + + ; variable names + '("<\\?cs +var:\\([_0-9a-zA-Z\.]+\\)[^\\?]+\\?>" 1 font-lock-variable-name-face t) + '("<\\?cs +alt:\\([_0-9a-zA-Z\.]+\\)[^\\?]+\\?>" 1 font-lock-variable-name-face t) + '("<\\?cs +each:\\([_0-9a-zA-Z\.]+\\)[^\\?]+\\?>" 1 font-lock-variable-name-face t) + + ; string + '("<\\?cs[^\"\\?]+\\(\"[^\"]+\"\\)[^\\?]+\\?>" 1 font-lock-string-face t) + +)) + +(defvar cs-mode-map ()) + +(if (not cs-mode-map) + (progn + (setq cs-mode-map (make-sparse-keymap)) + (define-key cs-mode-map "\C-c\C-i" 'cs-insert-tag) + )) + +(defun cs-mode nil + "ClearSilver mode" + + (interactive) + (setq major-mode 'cs-mode) + (setq mode-name "CS") + (use-local-map cs-mode-map) + + (make-local-variable 'font-lock-defaults) + (setq font-lock-defaults + '((cs-font-lock-keywords) t)) + + (setq font-lock-keywords cs-font-lock-keywords) + + (font-lock-mode 1) + + (run-hooks 'cs-mode-hook) + +) + +(defun cs-insert-tag () + (interactive) + (insert "") + (backward-char 3) +) + diff -Nru clearsilver-0.9.2/ports/rpm/clearsilver.spec clearsilver-0.9.3/ports/rpm/clearsilver.spec --- clearsilver-0.9.2/ports/rpm/clearsilver.spec Mon Aug 11 15:11:32 2003 +++ clearsilver-0.9.3/ports/rpm/clearsilver.spec Sun Aug 31 12:07:39 2003 @@ -1,24 +1,78 @@ # # spec file for ClearSilver Linux RPM (based on RedHat installs) # - -%define python_sitepath %(eval `python -c 'import sys; print "%%s/lib/python%%s/site-packages" %% (sys.exec_prefix, sys.version[:3])'`) -%define perl_sitearch %(eval "`perl -V:installsitearch`"; echo %$installsitearch) +# Caveats: There is some difficulty getting this file to sync with the +# actual information discovered by configure. In theory, some of this +# stuff in here could be driven off of configure.. except that configure +# is supposed to be driven off this file... +# +# * PREFIX vs perl/python PREFIX: where the perl/python modules get +# installed is actually defined by the installation of perl/python you +# are using to build the module. For that reason, we need to use a +# different PREFIX for the python/perl modules. For python, we just +# override PYTHON_SITE during install, for perl we have to run make +# install again with a new PREFIX. This means the perl module might be +# installed in two different locations, but we just package the second +# one. +# +# * The perl suggestions for rpms: +# http://archive.develooper.com/perl-dist@perl.org/msg00055.html +# suggest using find to get all of the files for the perl module. I'm +# currently hard coding them since we're not just building the perl +# module. In particular, the file path of the ClearSilver.3pm.gz +# manpage is probably wrong on some platforms. +# +# * The apache/java/ruby/csharp packages are not yet finished. For one, +# all of my machines are redhat 7.3 or later, and don't have rpms +# installed for java/ruby/csharp, and my apache installation is Neotonic +# specific and therefore not much help to the rest of you. + +########################################################################## +## Edit these settings +%define __prefix /usr/local +%define __python /usr/bin/python +%define with_python_subpackage 1 %{nil} +%define with_perl_subpackage 1 %{nil} + +# These packages aren't tested at all and probably won't build +%define with_apache_subpackage 0 +%define with_java_subpackage 0 +%define with_ruby_subpackage 0 +%define with_csharp_subpackage 0 + +########################################################################## +## All of the rest of this should work correctly based on the top... +## maybe +%define python_sitepath %(%{__python} -c "import site; print site.sitedirs[0]") +%define perl_sitearch %(eval "`perl -V:installsitearch`"; echo $installsitearch) +%define perl_prefix %(eval "`perl -V:prefix`"; echo $prefix) +%define ruby_sitepath %(echo "i dunno") +%define ruby_version %(echo "i dunno") +%define ruby_arch %(echo "i dunno") %define apache_libexec %(eval `/httpd/bin/apxs -q LIBEXECDIR`) Summary: Neotonic ClearSilver Name: clearsilver -Version: 0.9.2 +Version: 0.9.3 Release: 1 Copyright: Open Source - Neotonic ClearSilver License (Apache 1.1 based) Group: Development/Libraries -Source: http://www.clearsilver.net/downloads/clearsilver-0.9.2.tar.gz +Source: http://www.clearsilver.net/downloads/clearsilver-0.9.3.tar.gz URL: http://www.clearsilver.net/ Vendor: Neotonic Software Corporation, Inc. Packager: Brandon Long