debian/0000755000000000000000000000000012247301440007163 5ustar debian/camlmix.manpages0000644000000000000000000000002112167560631012335 0ustar debian/camlmix.1 debian/control0000644000000000000000000000171612167560631010605 0ustar Source: camlmix Section: ocaml Priority: optional Maintainer: Debian OCaml Maintainers Uploaders: Hendrik Tews Build-Depends: ocaml-nox (>= 4), ocaml-best-compilers, ocaml-findlib (>= 1.4), dh-ocaml (>= 0.9~), debhelper (>= 9) Standards-Version: 3.9.4 Homepage: http://mjambon.com/camlmix/ Vcs-Git: git://anonscm.debian.org/pkg-ocaml-maint/packages/camlmix.git Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-ocaml-maint/packages/camlmix.git Package: camlmix Architecture: any Depends: ${ocaml:Depends}, ${shlibs: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 '##= ... ##'. debian/source/0000755000000000000000000000000012167560631010475 5ustar debian/source/format0000644000000000000000000000001412167560631011703 0ustar 3.0 (quilt) debian/copyright0000644000000000000000000000473512167560631011141 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: Camlmix Upstream-Contact: Martin Jambon Source: http://mjambon.com/camlmix/ Files: * Copyright: 2004, 2005 Martin Jambon License: BSD-3-clause 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: 2010 Sylvain Le Gall 2013 Hendrik Tews License: GPL-3+ This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. . This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. . You should have received a copy of the GNU General Public License along with this program. If not, see . . On Debian systems, the full text of the GNU General Public License version 3 can be found in the file `/usr/share/common-licenses/GPL-3'. debian/camlmix.10000644000000000000000000001616512167560631010722 0ustar .\" groff -man -Tascii prooftree.1 .\" ========================================================================== .\" ============= Synopsis =================================================== .\" ========================================================================== .TH CAMLMIX 1 "May 2013" CAMLMIX "User Manuals" .SH NAME camlmix \- preprocessor which converts text with embedded OCaml .SH SYNOPSIS .B camlmix \fR[\fIOptions...\fR] \fIfiles\fR... .\" ========================================================================== .\" ============= Description ================================================ .\" ========================================================================== .SH DESCRIPTION .B camlmix processes text templates with embedded .B OCaml code to generate text again. From one or several input files it generates an .B OCaml text generation program and executes this to obtain the result. Using option .I -fun one can also convert the text template into an .B OCaml text generation function. .\" .\" ========================================================================== .\" ================ Options ================================================= .\" ========================================================================== .\" .SH OPTIONS .\" ===================== -o ================================================= .TP .B "-o output" write the generated text into file .I output .\" ===================== -c ================================================= .TP .B -c Only generate the text generation program, don't execute it. By default, the program is called .I lastfile.ml when .I lastfile is the last file argument. .\" ===================== -co ================================================ .TP .B "-co file" specify the name of the text generation program .\" ===================== -fun =============================================== .TP .B "-fun" generate .B OCaml code for text generation function from the input (see .B ADVANCED USAGE below) .\" ===================== -e ================================================= .TP .B "-e ocamlc" set the name of the OCaml executable .\" ===================== -clean ============================================= .TP .B "-clean" remove the text generation program after execution .\" ===================== -insert ============================================ .TP .B "-insert ocaml_code" insert .I ocaml_code at the beginning of the text generation program .\" ===================== -remix ============================================= .TP .B "-remix" try a conversion to the camlremix syntax .\" ===================== -a ================================================ .TP .B "-version" print version and exit .\" ===================== -help ================================================ .TP .B "-help | --help" print help and exit (this man page was written from the output of .I -help\fR) .\" .\" ========================================================================== .\" ================ Basic Usage ============================================= .\" ========================================================================== .\" .SH BASIC USAGE .\" ================ General rules =========================================== Text enclosed with .I ## markers is considered as a block of .B OCaml code. It can be any kind of toplevel expressions such as definitions or application of printing functions: .P .RS This is ocaml version ## print Sys.ocaml\_version ## .RE .P If the .B OCaml code starts with .I = then it is interpreted as an expression of type string that will printed like the rest of the text: .P .RS This is ocaml version ##= Sys.ocaml_version ## .RE .P The text block are printed together with the evaluated .B OCaml pieces using the .I print function. Include .I ### to print .I ##\fR. .\" ========================================================================== .P White space can be controlled with .I ##. and .I .##\fR: .TP .B ##. don't print white space occurring on the left .TP .B .## don't print white space up to and including the first newline, following to the right. .\" .\" ========================================================================== .\" ================ Advanced Usage ========================================== .\" ========================================================================== .\" .SH ADVANCED USAGE .\" ================ Directives ============================================== .SS Directives Blocks of code that start with the .I @ character (possibly preceded by spaces) are directives for Camlmix. There are two directives. .I include inserts a camlmix file, and .I skip skips the next block. For instance .P .RS Hello ## @include "world.mlx"; skip .## ## let x = 123 ##! .RE .P .\" ================ text gen function ======================================= .SS Conversion into a text generation function for dynamic rendering The .I -fun option, used in combination with .I -c and often .I -co produces an .B OCaml source file which provides a function .I render with the following signature: .P .RS val render : ?print:(string -> unit) -> 'a -> unit .RE .P The polymorphic argument is called .I param in the generated code and can be used to pass runtime arguments into the .I render function. The .I print function is used to set the initial value of Camlmix.printer (see below). It's default value is: .P .RS fun s -> print_string s; flush stdout .RE .P .\" ================ Runtime hooks ========================================== .SS Runtime hooks The text generation program, which .B camlmix generates, contains a module .I Camlmix at the beginning, which can be used in code blocks. This module has the following signature. .P .RS 4 module \fBCamlmix\fR : sig .RS 4 .TP val \fBsource\fR : string ref .TP val \fBline\fR : int ref .TP val \fBchar\fR : int ref Location of the first character of the current block in its source file. Line and character numbers count from 1. These references are updated by .B camlmix at the beginning of each block. .TP val \fBprinter\fR : (string -> unit) ref function for printing text blocks .TP val \fBprint_with\fR : (string -> unit) -> unit .I print_with f causes the next text block to be printed with .I f instead of the current printer. Its behavior is undefined if it is called several times in the same code block. .TP val \fBprint_if\fR : bool -> unit .I print_if cond prints the next text block only if condition .I cond is true. It uses .I print_with internally. .P .RE end .RE .P .\" .\" ========================================================================== .\" ================ SEE ALSO ================================================ .\" ========================================================================== .\" .SH SEE ALSO .TP The \fBcamlmix\fR web page, \fIhttp://mjambon.com/camlmix/\fR .\" .\" ========================================================================== .\" ================ Author ================================================== .\" ========================================================================== .\" .SH AUTHOR This manual page was written by Sylvain Le Gall and Hendrik Tews , specifically for the Debian project (and may be used by others). debian/watch0000644000000000000000000000017412167560631010230 0ustar version=3 http://mjambon.com/releases/camlmix \ .*/camlmix/camlmix[\-\._](\d\S*)\.(?:tar\.xz|txz|tar\.bz2|tbz2|tar\.gz|tgz) debian/compat0000644000000000000000000000000212167560631010373 0ustar 9 debian/camlmix.mkd0000644000000000000000000001020212167560631011317 0ustar % these are the old sources from which the man page was generated with % debian/camlmix.1: debian/camlmix.mkd % pandoc -s -w man $^ -o $@ % % 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 explicitly 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 debian/rules0000755000000000000000000000100512167560631010251 0ustar #!/usr/bin/make -f # -*- makefile -*- # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 #export DH_OPTIONS=-v DESTDIR=$(CURDIR)/debian/camlmix include /usr/share/ocaml/ocamlvars.mk %: dh $@ --with ocaml .PHONY: override_dh_auto_build override_dh_auto_build: ifeq ($(OCAML_HAVE_OCAMLOPT),yes) make OCAMLOPT=ocamlopt.opt OCAMLC=ocamlc.opt native else make byte endif .PHONY: override_dh_auto_install override_dh_auto_install: mkdir -p '$(DESTDIR)/usr/bin' make install 'PREFIX=$(DESTDIR)/usr' debian/gbp.conf0000644000000000000000000000003612167560631010613 0ustar [DEFAULT] pristine-tar = True debian/camlmix.examples0000644000000000000000000000001312167560631012361 0ustar examples/* debian/changelog0000644000000000000000000000271312247301440011040 0ustar camlmix (1.3.1-3) unstable; urgency=low * Team upload * Upload to unstable -- Stéphane Glondu Tue, 03 Dec 2013 08:05:17 +0100 camlmix (1.3.1-2) experimental; urgency=low [ Stéphane Glondu ] * Team upload * Compile with OCaml >= 4 [ Hendrik Tews ] * silent lintian canonical vcs info -- Stéphane Glondu Thu, 11 Jul 2013 18:46:58 +0200 camlmix (1.3.1-1) unstable; urgency=low [ Sylvain La Gall ] * Remove Sylvain Le Gall from uploaders [ Hendrik Tews ] * fix watch file * fix copyright file * added myself as uploader * import new upstream version * change to architecture any for native compilation and adapt rules and dependencies * bump standards version and debhelper compat level * add patch fix-lintian-spelling-error to fix a spelling error * rewrite man page from scatch -- Hendrik Tews Tue, 28 May 2013 11:18:37 +0200 camlmix (1.3.0-3) unstable; urgency=low * Team upload * Rebuild with OCaml 3.12.1 * Fix typo in manpage -- Stéphane Glondu Wed, 02 Nov 2011 07:08:49 +0100 camlmix (1.3.0-2) unstable; urgency=low * Team upload * Rebuild with OCaml 3.12.0 (no changes) * Add debian/watch -- Stéphane Glondu Mon, 18 Apr 2011 09:04:16 +0200 camlmix (1.3.0-1) unstable; urgency=low * Initial release. (Closes: #605674) -- Sylvain Le Gall Thu, 02 Dec 2010 16:33:44 +0100 debian/patches/0000755000000000000000000000000012167560631010624 5ustar debian/patches/fix-lintian-spelling-error.patch0000644000000000000000000000070012167560631017026 0ustar Description: fix a lintian spelling error Author: Hendrik Tews --- a/main.ml +++ b/main.ml @@ -43,7 +43,7 @@ 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. +updated automatically and may be used explicitly by the user. module Camlmix : sig debian/patches/series0000644000000000000000000000004112167560631012034 0ustar fix-lintian-spelling-error.patch