From: Stephane Glondu Date: Tue, 22 Sep 2009 22:07:29 +0000 (+0200) Subject: Add dh-ocaml's old ocamlinit.mk since ocaml itself cannot use dh_ocamlinit X-Git-Tag: archive/raspbian/4.08.1-4+rpi1~3^2~383 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=184d79210636a71ca7715379c50314ceae8d551c;p=ocaml.git 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 00000000..5db34126 --- /dev/null +++ b/debian/ocamlinit.mk @@ -0,0 +1,61 @@ +# +# Description: Useful Makefile rules for OCaml related packages +# +# Copyright © 2009 Stéphane Glondu +# +# 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 0ef05b6b..811cd4c1 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