Commit fb696b3e authored by Pietro Abate's avatar Pietro Abate
Browse files

[r2003-05-18 17:53:07 by cvscast] Empty log message

Original author: cvscast
Date: 2003-05-18 17:58:00+00:00
parent 42c0e76f
Installation notes
==================
[In case of problems refer to the installation notes of each
package]
- ocaml 3.06
(http://caml.inria.fr/ocaml/distrib.html)
(
We used at some point in CDuce development a patched
version of the file nat_stubs.c in OCaml distribution;
this patch should no longer be necessary.
If someone gets the error "Abstract value", please report it to
<Alain.Frisch@ens.fr>
and try to replace the file in the OCaml source with the one that
can be retrieved at http://www.cduce.org/nat_stubs.c)
Follow normal instructions in the INSTALL file; typically:
./configure && make world && make opt && make install.
)
- ocamlfind
(http://www.ocaml-programming.de/packages/findlib-0.8.1.tar.gz)
Usually it suffices to do:
......@@ -80,7 +64,7 @@ package]
WEB SITE INSTALATION
WEB SITE INSTALLATION
====================
If you want to install CDuce site, with its online demo and tutorial
......@@ -95,4 +79,4 @@ directives of the directory you installed the files the following:
Options MultiViews
# if .php is not in mime-types then also add:
MultiviewsMatch Any
</Directory>
\ No newline at end of file
</Directory>
......@@ -74,7 +74,6 @@ clean:
for i in $(CLEAN_DIRS); do \
(cd $$i; rm -f *.cmi *.cmo *.cma *.cmx *.o *~); \
done
rm -f parser/wlexer.ml
rm -f *.cmi *.cmo *.cma *.cmx *.a *.cmxa *.o *~
rm -f cduce cduce.opt webiface.opt ocamlprof.dump
rm -f dtd2cduce pool webiface
......@@ -101,7 +100,7 @@ driver/examples.ml: cduce.opt web/examples/build.cd web/examples/examples.xml
(cd web/examples; ../../cduce.opt -quiet build.cd)
web/files: cduce.opt web/site.cd
(cd web; ../cduce.opt -quiet site.cd -- site.xml)
(cd web; ../cduce.opt -quiet site.cd -- -php site.xml)
# Packaging
......@@ -142,18 +141,18 @@ profile:
(cd prepro; make cduce OCAMLCP="ocamlcp -p a" SYNTAX_PARSER=)
# Site-specific installation
build_web:
rsh cedre ". .env; cd IMPLEM/CDUCE; make webiface.opt"
cedre_build:
rsh cedre ". .env; cd IMPLEM/CDUCE; make webiface.opt; make web/files"
install_web:
ssh cduce@iris.ens.fr "cp ~frisch/IMPLEM/CDUCE/webiface.opt cgi-bin/cduce; chmod +s cgi-bin/cduce"
scp web/*.php web/cduce.css cduce@iris:public_html/
scp webiface.opt cduce@iris:cgi-bin/cduce
ssh cduce@iris "chmod +s cgi-bin/cduce"
install_web_local:
ssh root@localhost "cp -f ~beppe/IMPLEM/CDUCE/webiface.opt /var/www/cgi-bin/cduce; cp -f ~beppe/IMPLEM/CDUCE/web/*.php /var/www/html/; chmod +s /var/www/cgi-bin/cduce;"
build_website:
rsh cedre ". .env; cd IMPLEM/CDUCE; make web/files"
scp web/*.php web/cduce.css cduce@iris:public_html/
build_website_local: web/files
website: web/files
scp web/*.php web/cduce.css cduce@iris:public_html/
# Distribution
......
(* This CDuce script produces CDuce web site. *)
(** Command line **)
let (input, php) =
match argv with
| [ "-php" s ] -> (s, `true)
| [ s ] -> (s, `false)
| _ -> raise "Please specify an input file on the command line";;
(** Output types **)
include "xhtml-strict.cd";; (* XHTML 1 Strict DTD *)
......@@ -83,24 +92,23 @@ let fun split_comma (String -> [String*])
The function patch_css search for the textual representation of this
element and replace it with the PHP code. **)
let css : String =
['<link rel="stylesheet" href="cduce.css" type="text/css">'];;
let fun protect_quote (s : String) : String =
transform s with '"' -> [ '\\"' ] | c -> [c];;
let php_css : String =
[' <?php
$browser = getenv("HTTP_USER_AGENT");
if (preg_match("/MSIE/i", "$browser")) {
$css = "<link rel=\\"stylesheet\\" href=\\"cduce.css\\"
type=\\"text/css\\">";
} elseif (preg_match("/Mozilla/i", "$browser")) {
$css = "<blink>For better presentation use a more recent version
of your browser, like Netscape 6</blink>";
} if (preg_match("/Mozilla\\/5.0/i", "$browser")) {
$css = "<link rel=\\"stylesheet\\" href=\\"cduce.css\\"
type=\\"text/css\\">";
} elseif (preg_match("/opera/i", "$browser")) {
$css = "<link rel=\\"stylesheet\\" href=\\"cduce.css\\"
type=\\"text/css\\">";
if php then
[' <?php $browser = getenv("HTTP_USER_AGENT");
if (preg_match("/Mozilla/i", "$browser") && !preg_match("/Mozilla\\/5.0/i", "$browser"))
{
echo "<blink>For better presentation use a more recent version of
your browser, like Netscape 6</blink>";
}
echo "$css";
?> '];;
else { echo "' !(protect_quote css) '"; }
?> ']
else css;;
let fun patch_css (String -> String)
......@@ -278,9 +286,7 @@ let fun gen_page_seq
(* Entry point *)
match argv with
| [ s ] ->
(match load_include s with
| [ Page & p ] -> gen_page ([],p,[], [], compute_sitemap p)
| _ -> raise ("Invalid input document " @ s))
| _ -> raise "Please specify an input file on the command line";;
match load_include input with
| [ Page & p ] -> gen_page ([],p,[], [], compute_sitemap p)
| _ -> raise ("Invalid input document " @ input);;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment