[Pkg-ocaml-maint-commits] [SCM] OCaml packaging branch, master, updated. debian/3.11.1-2-17-gd53febe

Stephane Glondu steph at glondu.net
Wed Sep 23 00:05:23 UTC 2009


The following commit has been merged in the master branch:
commit 184d79210636a71ca7715379c50314ceae8d551c
Author: Stephane Glondu <steph at glondu.net>
Date:   Wed Sep 23 00:07:29 2009 +0200

    Add dh-ocaml's old ocamlinit.mk since ocaml itself cannot use dh_ocamlinit

diff --git a/debian/ocamlinit.mk b/debian/ocamlinit.mk
new file mode 100644
index 0000000..5db3412
--- /dev/null
+++ b/debian/ocamlinit.mk
@@ -0,0 +1,61 @@
+#
+# Description: Useful Makefile 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.
+#
+
+_ocaml_share_path ?= /usr/share/ocaml
+
+ifndef _ocaml_share_ocamlinit
+_ocaml_share_ocamlinit = 1
+
+include $(_ocaml_share_path)/ocamlvars.mk
+
+# 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%@OCamlABI@%$(OCAML_ABI)%g' \
+  -e 's%@OCamlStdlibDir@%$(OCAML_STDLIB_DIR)%g' \
+  -e 's%@OCamlDllDir@%$(OCAML_DLL_DIR)%g'
+ifeq ($(OCAML_HAVE_OCAMLOPT),yes)
+  OCAMLINIT_SED += -e 's/^OPT: //' -e '/^BYTE: /d'
+else
+  OCAMLINIT_SED += -e '/^OPT: /d' -e 's/^BYTE: //'
+endif
+
+ocamlinit: ocamlinit-stamp
+ocamlinit-stamp:
+	for t in $(OCAML_IN_FILES); do \
+	  sed $(OCAMLINIT_SED) $$t.in > $$t; \
+	done
+	touch $@
+
+ocamlinit-clean:
+	rm -f ocamlinit-stamp $(OCAML_IN_FILES)
+
+.PHONY: ocamlinit ocamlinit-clean
+
+endif
diff --git a/debian/rules b/debian/rules
index 0ef05b6..811cd4c 100755
--- a/debian/rules
+++ b/debian/rules
@@ -17,14 +17,16 @@ DEB_BUILD_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)
 OCAML_OPT_ARCH := $(findstring $(DEB_BUILD_ARCH),$(OCAML_NATIVE_ARCHS))
 OCAML_HAVE_OCAMLOPT := $(if $(OCAML_OPT_ARCH),yes,no)
 OCAML_OCAMLDOC_DESTDIR_HTML =
-include /usr/share/ocaml/ocamlinit.mk
+
+# dh_ocamlinit cannot be used for ocaml itself
+include debian/ocamlinit.mk
 
 MD5SUMSDIR = /var/lib/ocaml/md5sums
 INSTDIR = $(CURDIR)/debian/tmp/usr
 DISTDIR = $(PACKAGE)-$(OCAML_ABI)
 SRCTARBALL = $(PACKAGE)-source-$(OCAML_ABI).tar.bz2
 
-# Environment variable for dh_ocaml 
+# Environment variable for dh_ocaml
 OCAMLBYTEINFO = boot/ocamlrun debian/ocamlbyteinfo/ocamlbyteinfo
 OCAMLPLUGININFO = debian/ocamlbyteinfo/ocamlplugininfo
 OCAMLDUMPAPPROX = boot/ocamlrun tools/dumpapprox

-- 
OCaml packaging



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