[Pkg-ocaml-maint-commits] [SCM] camlmix packaging branch, master, updated. debian/1.3.0-1
Sylvain Le Gall
gildor at debian.org
Thu Dec 2 15:36:40 UTC 2010
The following commit has been merged in the master branch:
commit e19287b44539769b6246ab39d6bd1c07fffb10d3
Author: Sylvain Le Gall <gildor at debian.org>
Date: Thu Dec 2 16:34:00 2010 +0100
Initial packaging
diff --git a/debian/camlmix.1 b/debian/camlmix.1
new file mode 100644
index 0000000..8e9f9c0
--- /dev/null
+++ b/debian/camlmix.1
@@ -0,0 +1,164 @@
+.TH CAMLMIX 1 "December 2, 2010" "camlmix User Manual"
+.SH NAME
+.PP
+camlmix - preprocessor which converts text with embedded OCaml.
+.SH SYNOPSIS
+.PP
+camlmix [options] file1 file2 \&... fileN
+.PP
+A temporary file \[lq]fileN.ml\[rq] is created and then executed
+with ocaml.
+.SH DESCRIPTION
+.SS General rules
+.PP
+Text between ## and ## is considered as a block of code.
+A block of code is normally some OCaml code.
+It can be any kind of toplevel expressions such as definitions or
+application of printing functions:
+.PP
+\f[CR]
+ This\ is\ ocaml\ version\ ##\ print\ Sys.ocaml\\_version\ ##
+\f[]
+.PP
+If it starts with = the OCaml code is interpreted as an expression
+of type string that will printed like the rest of the text:
+.PP
+This is ocaml version ##= Sys.ocaml_version ##
+.PP
+The document blocks are printed by default on stdout using the
+\[lq]print\[rq] function.
+For ## to be printed, ### should be used.
+.PP
+White space introduced by OCaml can be controlled by ##.
+and \&.## symbols:
+.PP
+\f[CR]
+ \ \ ##.\ causes\ any\ white\ space\ to\ the\ left\ of\ the\ symbol
+ \ \ \ \ \ \ to\ be\ omitted\ from\ the\ output.\ Similarly
+ \ \ .##\ causes\ any\ white\ space\ followed\ by\ one\ newline
+ \ \ \ \ \ \ to\ be\ omitted\ from\ the\ output.
+\f[]
+.SS \ Directives
+.PP
+Blocks of code that start with the \@ character (possibly preceded
+by spaces) are directives for Camlmix.
+The following directives are available:
+.PP
+\f[CR]
+ include\ "somefile.mlx";\ (*\ inserts\ a\ camlmix\ file\ *)
+ skip;\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (*\ ignores\ the\ next\ block\ of\ text\ *)
+\f[]
+.PP
+e.g.:
+.PP
+\f[CR]
+ Hello\ ##\ \@include\ "world.mlx";\ skip\ .##\ ##\ let\ x\ =\ 123\ ##!
+\f[]
+.SS Conversion into a \[lq]render\[rq] function for dynamic rendering
+.PP
+The -fun option, used in combination with -c and often -co produces
+an OCaml source file which provides a function with the following
+signature:
+.PP
+val render : ?print:(string -> unit) -> ANYTYPE -> unit
+.PP
+where ANYTYPE is the type the \[lq]param\[rq] object which is
+available in the template.
+\[lq]param\[rq] can be used to pass runtime arguments, such as CGI
+parameters if you are serving dynamic web pages.
+The \[lq]print\[rq] function is used to set the initial value of
+Camlmix.printer (see below) and should be used if you want to be
+able to put the output into some other container than stdout.
+It's default value is:
+.PP
+fun s -> print_string s; flush stdout
+.SS Advanced usage
+.PP
+The OCaml program that is generated from the Camlmix files first
+defines a module called Camlmix.
+This module contains several variables that are updated
+automatically and may be used explicitely by the user.
+.PP
+\f[CR]
+ module\ Camlmix\ :
+ \ \ sig
+ \ \ \ \ val\ source\ :\ string\ ref
+ \ \ \ \ val\ line\ \ \ :\ int\ ref
+ \ \ \ \ val\ char\ \ \ :\ int\ ref\ \ \ \ \ \ \ \
+ \ \ \ \ \ \ \ \ (*\ source,\ line\ and\ char\ refer\ to\ the\ location\ of\ the\
+ \ \ \ \ \ \ \ \ \ \ \ first\ character\ of\ the\ current\ block\ in\ its\ source\ file
+ \ \ \ \ \ \ \ \ \ \ \ (source\ file,\ line\ number\ starting\ from\ 1,\ position\ in
+ \ \ \ \ \ \ \ \ \ \ \ the\ line\ starting\ from\ 1).\ They\ are\ updated
+ \ \ \ \ \ \ \ \ \ \ \ automatically\ at\ the\ beginning\ of\ each\ (code\ or\ text)
+ \ \ \ \ \ \ \ \ \ \ \ block.\ *)
+
+ \ \ \ \ val\ printer\ :\ (string\ ->\ unit)\ ref\
+ \ \ \ \ \ \ \ \ (*\ the\ function\ that\ prints\ text\ blocks.\ It\ is\ initialized
+ \ \ \ \ \ \ \ \ \ \ \ with\ the\ "print"\ function\ *)
+
+ \ \ \ \ val\ print_with\ :\ (string\ ->\ unit)\ ->\ unit
+ \ \ \ \ \ \ \ \ (*\ print_with\ f\ prints\ the\ next\ block\ of\ text\ using\ f
+ \ \ \ \ \ \ \ \ \ \ \ instead\ of\ the\ current\ printer.\ Its\ behavior\ is
+ \ \ \ \ \ \ \ \ \ \ \ undefined\ if\ it\ is\ called\ several\ times\ in\ the\ same
+ \ \ \ \ \ \ \ \ \ \ \ OCaml\ block.\ *)
+
+ \ \ \ \ val\ print_if\ :\ bool\ ->\ unit
+ \ \ \ \ \ \ \ \ (*\ print_if\ cond\ prints\ the\ next\ block\ of\ text\ only\
+ \ \ \ \ \ \ \ \ \ \ \ if\ cond\ is\ true.\ It\ uses\ print_with.\ *)
+ \ \ end
+\f[]
+.SH OPTIONS
+.TP
+.B -c
+only generate the \&.ml file
+.RS
+.RE
+.TP
+.B -co \f[B]filename\f[]
+specify a name for the \&.ml file or \[lq]-\[rq] for stdout
+.RS
+.RE
+.TP
+.B -fun
+make it the body of a function named \[lq]render\[rq], using a
+single argument named \[lq]param\[rq]
+.RS
+.RE
+.TP
+.B -e \f[B]ocaml\f[]
+specify ocaml executable
+.RS
+.RE
+.TP
+.B -o \f[B]file\f[]
+specify an output file
+.RS
+.RE
+.TP
+.B -clean
+remove the temporary \&.ml file after execution
+.RS
+.RE
+.TP
+.B -insert \f[I]ocaml code\f[]
+insert this code first
+.RS
+.RE
+.TP
+.B -remix
+try a conversion to the camlremix syntax
+.RS
+.RE
+.TP
+.B -version
+prints the version of Camlmix and exits
+.RS
+.RE
+.TP
+.B -help|--help
+Display this list of options
+.RS
+.RE
+.SH AUTHORS
+Sylvain Le Gall.
+
diff --git a/debian/camlmix.examples b/debian/camlmix.examples
new file mode 100644
index 0000000..e39721e
--- /dev/null
+++ b/debian/camlmix.examples
@@ -0,0 +1 @@
+examples/*
diff --git a/debian/camlmix.manpages b/debian/camlmix.manpages
new file mode 100644
index 0000000..bdcc2f9
--- /dev/null
+++ b/debian/camlmix.manpages
@@ -0,0 +1 @@
+debian/camlmix.1
diff --git a/debian/camlmix.mkd b/debian/camlmix.mkd
new file mode 100644
index 0000000..af7111c
--- /dev/null
+++ b/debian/camlmix.mkd
@@ -0,0 +1,142 @@
+% CAMLMIX(1) camlmix User Manual
+% Sylvain Le Gall
+% December 2, 2010
+
+# NAME
+
+camlmix - preprocessor which converts text with embedded OCaml.
+
+# SYNOPSIS
+
+camlmix [options] file1 file2 ... fileN
+
+A temporary file "fileN.ml" is created and then executed
+with ocaml.
+
+# DESCRIPTION
+
+## General rules
+
+Text between ## and ## is considered as a block of code.
+A block of code is normally some OCaml code. It can be any
+kind of toplevel expressions such as definitions or application
+of printing functions:
+
+ This is ocaml version ## print Sys.ocaml\_version ##
+
+If it starts with = the OCaml code is interpreted as an expression
+of type string that will printed like the rest of the text:
+
+ This is ocaml version ##= Sys.ocaml\_version ##
+
+
+The document blocks are printed by default on stdout using the "print"
+function.
+For ## to be printed, ### should be used.
+
+White space introduced by OCaml can be controlled
+by ##. and .## symbols:
+
+ ##. causes any white space to the left of the symbol
+ to be omitted from the output. Similarly
+ .## causes any white space followed by one newline
+ to be omitted from the output.
+
+## Directives
+
+Blocks of code that start with the @ character (possibly preceded
+by spaces) are directives for Camlmix.
+The following directives are available:
+
+ include "somefile.mlx"; (* inserts a camlmix file *)
+ skip; (* ignores the next block of text *)
+
+e.g.:
+
+ Hello ## @include "world.mlx"; skip .## ## let x = 123 ##!
+
+
+## Conversion into a "render" function for dynamic rendering
+
+The -fun option, used in combination with -c and often -co produces
+an OCaml source file which provides a function with the following signature:
+
+ val render : ?print:(string -> unit) -> ANYTYPE -> unit
+
+where ANYTYPE is the type the "param" object which is available in
+the template. "param" can be used to pass runtime arguments, such
+as CGI parameters if you are serving dynamic web pages.
+The "print" function is used to set the initial value of Camlmix.printer
+(see below) and should be used if you want to be able to put the output
+into some other container than stdout. It's default value is:
+
+ fun s -> print\_string s; flush stdout
+
+
+## Advanced usage
+
+The OCaml program that is generated from the Camlmix files first defines
+a module called Camlmix. This module contains several variables that are
+updated automatically and may be used explicitely by the user.
+
+ module Camlmix :
+ sig
+ val source : string ref
+ val line : int ref
+ val char : int ref
+ (* source, line and char refer to the location of the
+ first character of the current block in its source file
+ (source file, line number starting from 1, position in
+ the line starting from 1). They are updated
+ automatically at the beginning of each (code or text)
+ block. *)
+
+ val printer : (string -> unit) ref
+ (* the function that prints text blocks. It is initialized
+ with the "print" function *)
+
+ val print_with : (string -> unit) -> unit
+ (* print_with f prints the next block of text using f
+ instead of the current printer. Its behavior is
+ undefined if it is called several times in the same
+ OCaml block. *)
+
+ val print_if : bool -> unit
+ (* print_if cond prints the next block of text only
+ if cond is true. It uses print_with. *)
+ end
+
+
+# OPTIONS
+
+-c
+: only generate the .ml file
+
+-co `filename`
+: specify a name for the .ml file or "-" for stdout
+
+-fun
+: make it the body of a function named "render", using a single argument
+ named "param"
+
+-e `ocaml`
+: specify ocaml executable
+
+-o `file`
+: specify an output file
+
+-clean
+: remove the temporary .ml file after execution
+
+-insert *ocaml code*
+: insert this code first
+
+-remix
+: try a conversion to the camlremix syntax
+
+-version
+: prints the version of Camlmix and exits
+
+-help|\--help
+: Display this list of options
+
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..3a388df
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,5 @@
+camlmix (1.3.0-1) unstable; urgency=low
+
+ * Initial release. (Closes: #605674)
+
+ -- Sylvain Le Gall <gildor at debian.org> Thu, 02 Dec 2010 16:33:44 +0100
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 0000000..7f8f011
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+7
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..37492a0
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,24 @@
+Source: camlmix
+Section: ocaml
+Priority: optional
+Maintainer: Debian OCaml Maintainers <debian-ocaml-maint at lists.debian.org>
+Uploaders:
+ Sylvain Le Gall <gildor at debian.org>
+Build-Depends-Indep:
+ ocaml-nox (>= 3.11.1-3~),
+ ocaml-findlib,
+ dh-ocaml (>= 0.9~),
+ debhelper (>= 7.0.50~)
+Standards-Version: 3.9.1
+Homepage: http://martin.jambon.free.fr/camlmix/
+Vcs-Git: git://git.debian.org/git/pkg-ocaml-maint/packages/camlmix.git
+Vcs-Browser: http://git.debian.org/?p=pkg-ocaml-maint/packages/camlmix.git
+
+Package: camlmix
+Architecture: all
+Depends: ${ocaml:Depends}, ${misc:Depends}
+Description: preprocessor which converts text with embedded OCaml
+ Camlmix is a generic preprocessor which converts text with embedded OCaml into
+ an OCaml program with embedded text. It produces text documents from one or
+ several templates. OCaml toplevel statements are inserted between '## ... ##',
+ and OCaml string expressions between '##= ... ##'.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..0ebaef2
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,35 @@
+Format-Specification: http://svn.debian.org/wsvn/dep/web/deps/dep5.mdwn?op=file&rev=135
+Name: mikmatch
+Maintainer: Sylvain Le Gall <gildor at debian.org>
+
+Files: *
+Copyright: Copyright (c) 2004, 2005 Martin Jambon
+License: BSD3
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ 3. The name of the author may not be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+Files: debian/*
+Copyright: (C) 2010 Sylvain Le Gall <gildor at debian.org>
+License: GPL-3+
+
+ See '/usr/share/common-licenses/GPL-3' for the full text.
diff --git a/debian/gbp.conf b/debian/gbp.conf
new file mode 100644
index 0000000..cec628c
--- /dev/null
+++ b/debian/gbp.conf
@@ -0,0 +1,2 @@
+[DEFAULT]
+pristine-tar = True
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..84f41ac
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,25 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+DESTDIR=$(CURDIR)/debian/camlmix
+
+include /usr/share/ocaml/ocamlvars.mk
+
+%:
+ dh --with ocaml $@
+
+.PHONY: override_dh_auto_build
+override_dh_auto_build:
+ make all
+
+.PHONY: override_dh_auto_install
+override_dh_auto_install:
+ mkdir -p '$(DESTDIR)/usr/bin'
+ make install 'PREFIX=$(DESTDIR)/usr'
+
+debian/camlmix.1: debian/camlmix.mkd
+ pandoc -s -w man $^ -o $@
+
diff --git a/debian/source/format b/debian/source/format
new file mode 100644
index 0000000..163aaf8
--- /dev/null
+++ b/debian/source/format
@@ -0,0 +1 @@
+3.0 (quilt)
--
camlmix packaging
More information about the Pkg-ocaml-maint-commits
mailing list