[Pkg-ocaml-maint-commits] [SCM] dh-ocaml packaging branch, master, updated. debian/0.1-13-g564232e

Stephane Glondu steph at glondu.net
Mon Feb 16 15:55:46 UTC 2009


The following commit has been merged in the master branch:
commit e7893c903b3ab47408bf7e26bf483615322d6c6b
Author: Stephane Glondu <steph at glondu.net>
Date:   Mon Feb 16 16:06:40 2009 +0100

    Provide ocamlinit snippet in a CDBS rules file
    
    Rationale: this allows people to benefit from a common handling of
    substitutions in *.in files without having to switch entirely to CDBS
    (this might be inappropriate in some cases).

diff --git a/cdbs/2/rules/ocamlinit.mk b/cdbs/2/rules/ocamlinit.mk
new file mode 100644
index 0000000..44e5193
--- /dev/null
+++ b/cdbs/2/rules/ocamlinit.mk
@@ -0,0 +1,62 @@
+#
+# Description: Useful CDBS rules for OCaml related packages
+#
+# Copyright © 2009 Stéphane Glondu <steph at glondu.net>
+#
+# 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 2, 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, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301 USA.
+#
+
+_cdbs_scripts_path ?= /usr/lib/cdbs
+_cdbs_rules_path ?= /usr/share/cdbs/2/rules
+_cdbs_class_path ?= /usr/share/cdbs/2/class
+
+ifndef _cdbs_rules_ocamlinit
+_cdbs_rules_ocamlinit = 1
+
+include $(_cdbs_rules_path)/ocamlvars.mk$(_cdbs_makefile_suffix)
+
+# list of .in files contained (non-recursively) in debian/ that requires
+# pre-build filling.
+# debian/rules writers might need to add stuff to this list:
+#  e.g.: OCAML_IN_FILES += debian/patches/foo	# (no .in extension)
+OCAML_IN_FILES := $(filter-out debian/control,$(patsubst %.in,%,$(wildcard debian/*.in)))
+
+# WARNING: there are currently duplications with ocamlvars.mk and
+# ocaml.mk, but hopefully they will be removed at some point in the
+# future
+
+OCAMLINIT_SED := -e 's%^ \+%%' \
+  -e 's%@OCamlABI@%$(OCAML_ABI)%' \
+  -e 's%@OCamlStdlibDir@%$(OCAML_STDLIB_DIR)%' \
+  -e 's%@OCamlDllDir@%$(OCAML_DLL_DIR)%'
+ifeq ($(OCAML_HAVE_OCAMLOPT),yes)
+  OCAMLINIT_SED += -e '/^OPT: /d'
+else
+  OCAMLINIT_SED += -e 's/^OPT: //'
+endif
+
+ocamlinit-stamp:
+	for t in $(OCAML_IN_FILES); do \
+	  sed $(OCAMLINIT_SED) $$t.in > $$t; \
+	done
+	touch $@
+
+ocamlinit-clean:
+	rm -f $(OCAML_IN_FILES)
+
+.PHONY: ocamlinit-clean
+
+endif

-- 
dh-ocaml packaging



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