[Pkg-ocaml-maint-commits] r3877 - /trunk/packages/mod-caml/trunk/debian/patches/18_apache2.dpatch

munga-guest at users.alioth.debian.org munga-guest at users.alioth.debian.org
Thu Jun 28 15:33:53 UTC 2007


Author: munga-guest
Date: Thu Jun 28 15:33:53 2007
New Revision: 3877

URL: http://svn.debian.org/wsvn/pkg-ocaml-maint/?sc=1&rev=3877
Log:
experimental libapache2-mod-caml package (the patch)

Added:
    trunk/packages/mod-caml/trunk/debian/patches/18_apache2.dpatch   (with props)

Added: trunk/packages/mod-caml/trunk/debian/patches/18_apache2.dpatch
URL: http://svn.debian.org/wsvn/pkg-ocaml-maint/trunk/packages/mod-caml/trunk/debian/patches/18_apache2.dpatch?rev=3877&op=file
==============================================================================
--- trunk/packages/mod-caml/trunk/debian/patches/18_apache2.dpatch (added)
+++ trunk/packages/mod-caml/trunk/debian/patches/18_apache2.dpatch Thu Jun 28 15:33:53 2007
@@ -1,0 +1,331 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## apache2.dpatch by  <root@>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: No description.
+
+ at DPATCH@
+diff -urNad mod-caml-1.3.8~/Makefile mod-caml-1.3.8/Makefile
+--- mod-caml-1.3.8~/Makefile	2007-06-28 13:35:46.000000000 +0000
++++ mod-caml-1.3.8/Makefile	2007-06-28 13:35:46.000000000 +0000
+@@ -17,7 +17,8 @@
+ #
+ # $Id: Makefile,v 1.68 2005/08/24 12:47:11 ChriS Exp $
+ 
+-include Makefile.config
++include Makefile.conf
++include Makefile.distrib
+ 
+ TMPDIR ?= /tmp
+ export TMPDIR
+@@ -225,18 +226,23 @@
+ install-doc:
+ 	$(INSTALL)    -m 0755 -d $(DESTDIR)$(DOCDIR)
+ 	$(INSTALL) -c -m 0644 AUTHORS FAQ README TODO $(DESTDIR)$(DOCDIR)
+-	$(INSTALL)    -m 0755 -d $(DESTDIR)$(DOCDIR)/examples
++	$(INSTALL) -c -m 0644 modcaml.conf $(DESTDIR)$(DOCDIR)
+ 	$(INSTALL) -c -m 0644 \
+ 	  examples/simple-scripts/*.ml \
+-	  $(DESTDIR)$(DOCDIR)/examples
++	  $(DESTDIR)$(DOCDIR)
+ 
+ install-html:
+ 	$(INSTALL)    -m 0755 -d $(DESTDIR)$(DOCDIR)/html
+ 	$(INSTALL) -c -m 0644 html/*.html $(DESTDIR)$(DOCDIR)/html
+ 
++ifeq ($(APACHE_MAJOR),2)
+ install-conf:
+-	$(INSTALL)    -m 0755 -d $(DESTDIR)$(DOCDIR)/examples
+-	$(INSTALL) -c -m 0644 modcaml-example.conf $(DESTDIR)$(DOCDIR)/examples
++	$(INSTALL)    -m 0755 -d $(DESTDIR)$(APACHECONFDIR)
++	$(INSTALL)    -m 0755 -d $(DESTDIR)$(APACHECONFDIR)/mods-available/
++	$(INSTALL) -c -m 0644 modcaml.load $(DESTDIR)$(APACHECONFDIR)/mods-available/
++else
++install-conf:
++endif
+ 
+ dist:
+ 	$(MAKE) check-manifest
+diff -urNad mod-caml-1.3.8~/Makefile.distrib mod-caml-1.3.8/Makefile.distrib
+--- mod-caml-1.3.8~/Makefile.distrib	1970-01-01 00:00:00.000000000 +0000
++++ mod-caml-1.3.8/Makefile.distrib	2007-06-28 13:35:46.000000000 +0000
+@@ -0,0 +1,26 @@
++OCAMLC := ocamlc
++OCAMLOPT := ocamlopt
++OCAMLDOC := ocamldoc
++OCAMLLIBDIR := $(shell $(OCAMLC) -where)
++
++OCAMLLIBS := -lcamlrun -ltermcap -lunix -lstr
++OCAMLAPACHEDIR := $(OCAMLLIBDIR)/apache
++OCAMLINCDIR := $(OCAMLLIBDIR)
++
++APACHELIBDIR := $(shell $(APXS) -q LIBEXECDIR)
++APACHEINCDIR := $(shell $(APXS) -q INCLUDEDIR)
++APACHECONFDIR := $(shell $(APXS) -q SYSCONFDIR)
++CC      := $(shell $(APXS) -q CC)
++CFLAGS  := -I$(OCAMLLIBDIR) -I$(APACHEINCDIR) $(shell $(APXS) -q CFLAGS) \
++           $(shell $(APXS) -q CFLAGS_SHLIB)
++#LDFLAGS_SHLIB := $(shell $(APXS) -q LDFLAGS_SHLIB)
++LDFLAGS_SHLIB := -shared
++
++# this is the only dependency to ocamlfind...
++HAVE_POSTGRES := $(shell ocamlfind query postgres >/dev/null 2>&1 && echo 1)
++PCRELIBDIR := $(shell ocamlfind query pcre)
++
++INSTALL := install
++
++MAILER_PATH := /usr/sbin/sendmail
++MAILER_ARGS := -t -i
+diff -urNad mod-caml-1.3.8~/apache_c.c mod-caml-1.3.8/apache_c.c
+--- mod-caml-1.3.8~/apache_c.c	2005-11-15 16:34:30.000000000 +0000
++++ mod-caml-1.3.8/apache_c.c	2007-06-28 13:35:46.000000000 +0000
+@@ -45,7 +45,7 @@
+ #if APACHE2
+ #define ap_pstrdup apr_pstrdup
+ #define ap_palloc apr_palloc
+-#define ap_clear_table apr_clear_table
++#define ap_clear_table apr_table_clear
+ #define ap_table_get apr_table_get
+ #define ap_table_set apr_table_set
+ #define ap_table_unset apr_table_unset
+@@ -233,10 +233,22 @@
+     raise_not_found ();                         \
+ }
+ 
++#define NOTIMPLEMENTED(field) \
++CAMLprim value                                  \
++mod_caml_connection_ ## field (value cv)        \
++{                                               \
++    raise_not_found ();                         \
++}
++
+ CONNECTION(remote_ip)
+-CONNECTION(ap_auth_type)
+ CONNECTION(remote_host)
++#if APACHE2
++NOTIMPLEMENTED(user)
++NOTIMPLEMENTED(ap_auth_type)
++#else
+ CONNECTION(user)
++CONNECTION(ap_auth_type)
++#endif
+ 
+ /*----- Request structure. -----*/
+ 
+diff -urNad mod-caml-1.3.8~/configure.log mod-caml-1.3.8/configure.log
+--- mod-caml-1.3.8~/configure.log	1970-01-01 00:00:00.000000000 +0000
++++ mod-caml-1.3.8/configure.log	2007-06-28 13:35:46.000000000 +0000
+@@ -0,0 +1,3 @@
++Linux compile 2.6.18-4-xen-vserver-686 #1 SMP Thu May 10 04:02:17 UTC 2007 i686 GNU/Linux
++==> ocamlfind ocamlopt
++==> ocamlfind ocamlopt -package pcre -linkpkg -o configure.try && rm -f configure.try
+diff -urNad mod-caml-1.3.8~/configure.ml mod-caml-1.3.8/configure.ml
+--- mod-caml-1.3.8~/configure.ml	1970-01-01 00:00:00.000000000 +0000
++++ mod-caml-1.3.8/configure.ml	2007-06-28 13:35:46.000000000 +0000
+@@ -0,0 +1,162 @@
++open Printf
++
++let version = "1.3.8"
++
++(*
++ --bindir=DIR          install user executables in DIR [PREFIX/bin]
++ --libdir=DIR          install libraries in DIR [PREFIX/lib/ocaml]
++ --mandir=DIR          install man documentation in DIR [PREFIX/man]
++*)
++
++let usage () =
++  print_string "\
++Installation directories:
++ --prefix=PREFIX       install files in PREFIX [/usr/local]
++ --docdir=DIR          install the rest of the doc in DIR [PREFIX/share/doc/mod_caml]
++ --modcamllibdir=DIR   install default mod_caml handlers [PREFIX/share/mod_caml]
++
++Apache Options:
++ --apr-includes=DIR    [PREFIX/include/apr-1.0]
++ --apxs=BIN            [PREFIX/bin/apxs2]
++
++Additional Features:
++ --with-postgres    
++"
++
++let features : (string * [ `auto | `no | `yes ] ref) list =
++  [ 
++      "ocamlopt", ref `auto;
++      "postgres", ref `no;
++      "pcre",     ref `yes;
++  ]
++
++let vars =
++  [ "prefix", ref "/usr/local";
++    "bindir", ref "";
++    "mandir", ref "";
++    "docdir", ref "";
++    "modcamllibdir", ref "";
++    "apxs"  , ref "/usr/bin/apxs2";
++    "aprdir", ref "";
++  ]
++
++
++let fatal s = printf "*** Fatal error: %s\n" s; exit 1
++let warning s = printf "* Warning: %s\n" s
++
++let log s =
++  let oc = open_out_gen [ Open_append; Open_creat ] 0o600 "configure.log" in
++  output_string oc s;
++  output_char oc '\n';
++  close_out oc;
++  flush stdout
++
++let command s =
++  log ("==> " ^ s);
++  Sys.command (sprintf "%s 2>> configure.log" s) = 0
++
++let start_with s p =
++  let ls = String.length s and lp = String.length p in
++  if (ls >= lp) && (String.sub s 0 lp = p)
++  then Some (String.sub s lp (ls - lp)) else None
++
++let parse_arg s =
++  if s = "--help" then (usage (); exit 0)
++  else
++    match start_with s "--with-" with
++      | Some f -> (List.assoc f features) := `yes
++      | None ->
++    match start_with s "--without-" with
++      | Some f -> (List.assoc f features) := `no
++      | None ->
++    let i = String.index s '=' in
++    if i < 2 then raise Not_found;
++    let n = String.sub s 2 (i - 2) in
++    let v = String.sub s (succ i) (String.length s - i - 1) in
++    (List.assoc n vars) := v
++
++let () =
++  print_endline "Configuring mod_caml for compilation...\n";
++  (try for i = 1 to Array.length Sys.argv - 1 do parse_arg Sys.argv.(i) done
++  with Not_found -> usage (); fatal "Incorrect command line");
++  (try Sys.remove "configure.log" with Sys_error _ -> ());
++  ignore (Sys.command "uname -a >> configure.log")
++
++let print s = print_string s; flush stdout
++
++let check_feature f p =
++  printf "%s: " f;
++  match !(List.assoc f features) with
++    | `no ->
++        print "disabled\n"; false
++    | `yes ->
++        print "checking... ";
++        if p ()
++        then (print "ok\n"; true)
++        else (print "failed !\n"; fatal "Required feature is not available")
++    | `auto ->
++        print "autodetecting... ";
++        if p ()
++        then (print "enabled\n"; true)
++        else (print "disabled\n"; false)
++
++let native =
++  check_feature "ocamlopt" (fun () -> command "ocamlfind ocamlopt")
++
++let check_pkg p () =
++  try
++    command
++      (sprintf
++         "ocamlfind ocaml%s -package %s -linkpkg -o configure.try && rm -f configure.try"
++         (if native then "opt" else "c")
++         p)
++  with Not_found -> false
++
++let need_pkg p =
++  printf "Checking for package %s... " p; flush stdout;
++  if not (check_pkg p ())
++  then (print "failed !\n"; fatal "Required package is not available")
++  else (print "ok\n")
++
++let dir ?def d =
++  let s = !(List.assoc d vars) in
++  if s <> "" then s
++  else match def with
++    | Some x -> x
++    | None -> fatal (sprintf "%s cannot be empty" d)
++
++let prefix = dir "prefix"
++let bindir = dir ~def:(prefix^"/bin") "bindir"
++let mandir = dir ~def:(prefix^"/man") "mandir"
++let docdir = dir ~def:(prefix^"/share/doc/mod_caml") "docdir"
++let modcamllibdir = dir ~def:(prefix^"/share/mod_caml") "modcamllibdir"
++let apxs   = dir ~def:(prefix^"/bin/apxs") "apxs"
++let aprdir  = dir ~def:(prefix^"/include/apr-1.0") "aprdir"
++
++let postgres = check_feature "postgres" (check_pkg "postgres")
++let required_packages = ["pcre"]
++let apache =
++    match Filename.basename !(List.assoc "apxs" vars) with
++    |"apxs2" -> "2"
++    |"apxs"  -> "1"
++    |_ -> fatal("must be either apxs2 or apxs")
++
++let () =
++  List.iter need_pkg required_packages;
++  print "Creating Makefile.conf...\n";
++
++  let out = open_out "Makefile.conf" in
++  fprintf out "# This file has been generated by the configure script\n";
++  fprintf out "BINDIR=%s\n" bindir;
++  fprintf out "MANDIR=%s\n" mandir;
++  fprintf out "DOCDIR=%s\n" docdir;
++  fprintf out "MODCAMLLIBDIR=%s\n" modcamllibdir;
++
++(*  fprintf out "PCRELIBDIR=%s\n" pcre; *)
++
++  fprintf out "APACHE_MAJOR=%s\n" apache;
++  fprintf out "APXS=%s\n" apxs;
++
++(*  fprintf out "HAVE_POSTGRES=%s\n" postgres; *)
++  close_out out
++
+diff -urNad mod-caml-1.3.8~/modcaml-example.conf mod-caml-1.3.8/modcaml-example.conf
+--- mod-caml-1.3.8~/modcaml-example.conf	2005-10-28 10:02:48.000000000 +0000
++++ mod-caml-1.3.8/modcaml-example.conf	1970-01-01 00:00:00.000000000 +0000
+@@ -1,18 +0,0 @@
+-# This is an example configuration file for mod_caml.  It assumes that
+-# mod_caml has been installed at the paths shown below.
+-#
+-# To check it all works, restart Apache and visit:
+-#
+-# http://your.server/caml-bin/hello.cmo
+-
+-CamlLoad /usr/share/mod_caml/registry.cmo
+-
+-Alias /caml-icons/ /usr/share/mod_caml/caml-icons/
+-Alias /caml-bin/ /usr/share/mod_caml/caml-bin/
+-
+-<Location /caml-bin>
+-        SetHandler ocaml-bytecode
+-        CamlHandler Registry.handler
+-        Options ExecCGI
+-        Allow from all
+-</Location>
+diff -urNad mod-caml-1.3.8~/modcaml.conf mod-caml-1.3.8/modcaml.conf
+--- mod-caml-1.3.8~/modcaml.conf	1970-01-01 00:00:00.000000000 +0000
++++ mod-caml-1.3.8/modcaml.conf	2007-06-28 13:35:46.000000000 +0000
+@@ -0,0 +1,12 @@
++
++CamlLoad /usr/share/mod_caml/registry.cmo
++
++Alias /caml-icons/ /usr/share/mod_caml/caml-icons/
++Alias /caml-bin/ /usr/share/mod_caml/caml-bin/
++
++<Location /caml-bin>
++        SetHandler ocaml-bytecode
++        CamlHandler Registry.handler
++        Options ExecCGI
++        Allow from all
++</Location>
+diff -urNad mod-caml-1.3.8~/modcaml.load mod-caml-1.3.8/modcaml.load
+--- mod-caml-1.3.8~/modcaml.load	1970-01-01 00:00:00.000000000 +0000
++++ mod-caml-1.3.8/modcaml.load	2007-06-28 13:35:46.000000000 +0000
+@@ -0,0 +1,2 @@
++
++LoadModule caml_module  /usr/lib/apache2/modules/mod_caml.so

Propchange: trunk/packages/mod-caml/trunk/debian/patches/18_apache2.dpatch
------------------------------------------------------------------------------
    svn:executable = *




More information about the Pkg-ocaml-maint-commits mailing list