From: Stephane Glondu Date: Mon, 16 Feb 2009 15:49:07 +0000 (+0100) Subject: Use ocamlinit snippet provided by dh-ocaml X-Git-Tag: archive/raspbian/4.08.1-4+rpi1~3^2~447 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=16150b8471d34f2362bcb746cf6b05f9b75319ab;p=ocaml.git Use ocamlinit snippet provided by dh-ocaml --- diff --git a/debian/changelog b/debian/changelog index 0f8dbc6f..3965e09c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -7,6 +7,7 @@ ocaml (3.11.0-2) UNRELEASED; urgency=low - more extensive use of debhelper 7 - do no longer use deprecated dh_movefiles and *.files - get closer to CDBS API + - use ocamlinit snippet provided by dh-ocaml - add a build cache (for Debian debugging) - ship labltk examples in a tarball - reflect original locations of camlp4 *.mli files in binary packages @@ -17,7 +18,7 @@ ocaml (3.11.0-2) UNRELEASED; urgency=low * Build and install dumpapprox, and provide a manpage * Discriminate *-nox packages in short descriptions (thanks Lintian) - -- Stephane Glondu Mon, 16 Feb 2009 00:27:36 +0100 + -- Stephane Glondu Mon, 16 Feb 2009 16:49:39 +0100 ocaml (3.11.0-1) experimental; urgency=low diff --git a/debian/control b/debian/control index 99103233..12fc2b94 100644 --- a/debian/control +++ b/debian/control @@ -10,7 +10,17 @@ Uploaders: Ralf Treinen , Stephane Glondu DM-Upload-Allowed: yes -Build-Depends: debhelper (>= 7), tcl8.4-dev, tk8.4-dev, libncurses5-dev, libgdbm-dev, dpatch, bzip2, docbook-xml, docbook-utils +Build-Depends: + debhelper (>= 7), + tcl8.4-dev, + tk8.4-dev, + libncurses5-dev, + libgdbm-dev, + dpatch, + bzip2, + docbook-xml, + docbook-utils, + dh-ocaml Standards-Version: 3.8.0 Vcs-Git: git://git.debian.org/git/pkg-ocaml-maint/packages/ocaml.git Vcs-Browser: http://git.debian.org/?p=pkg-ocaml-maint/packages/ocaml.git diff --git a/debian/rules b/debian/rules index 13535789..2b1e4816 100755 --- a/debian/rules +++ b/debian/rules @@ -6,14 +6,26 @@ ALL_PACKAGES := $(shell sed -ne 's/^Package: //p' debian/control) OCAMLMAJOR := 3.11 OCAMLMINOR := 0 +# These are used for cross-compiling and for saving the configure script +# from having to guess our platform (since we know it already) +DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) +DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) +DEB_BUILD_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH) +OCAML_OPT_ARCH ?= $(findstring $(DEB_BUILD_ARCH),$(OCAML_NATIVE_ARCHS)) + # Build cache (for Debian debugging) BUILDCACHE := $(wildcard ../ocaml.cache) -# These are also in CDBS +# These are defined in ocamlvars.mk, but we redefine it since ocaml is not installed OCAML_ABI := $(OCAMLMAJOR).$(OCAMLMINOR) OCAML_STDLIB_DIR := /usr/lib/ocaml/$(OCAML_ABI) OCAML_DLL_DIR = $(OCAML_STDLIB_DIR)/stublibs OCAML_NATIVE_ARCHS := $(shell cat debian/native-archs) +OCAML_HAVE_OCAMLOPT := $(if $(OCAML_OPT_ARCH),yes,no) + +# We do not want ocamlvars.mk to be sourced again +_cdbs_class_ocaml_vars = 1 +include /usr/share/cdbs/2/rules/ocamlinit.mk MD5SUMSDIR = /var/lib/ocaml/md5sums INSTDIR = $(CURDIR)/debian/tmp/usr @@ -26,13 +38,6 @@ SRCTARBALL = $(PACKAGE)-source-$(OCAML_ABI).tar.bz2 # This has to be exported to make some magic below work. export DH_OPTIONS -# These are used for cross-compiling and for saving the configure script -# from having to guess our platform (since we know it already) -DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) -DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) -DEB_BUILD_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH) -OCAML_OPT_ARCH ?= $(findstring $(DEB_BUILD_ARCH),$(OCAML_NATIVE_ARCHS)) - CFLAGS = -Wall -g ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) @@ -56,25 +61,9 @@ CONFIGURE_SED := \ -e "s%LIBDIR=.*$$%LIBDIR=\$$(PREFIX)/lib/ocaml/$(OCAML_ABI)%g" \ -e "s%STUBLIBDIR=.*$$%STUBLIBDIR=\$$(PREFIX)/lib/ocaml/$(OCAML_ABI)/stublibs%g" -# These are also in CDBS -OCAML_IN_FILES := $(filter-out debian/control,$(patsubst %.in,%,$(wildcard debian/*.in))) -OCAMLINIT_SED := -e 's%^ \+%%' \ - -e 's%@OCamlABI@%$(OCAML_ABI)%' \ - -e 's%@OCamlStdlibDir@%$(OCAML_STDLIB_DIR)%' \ - -e 's%@OCamlDllDir@%$(OCAML_DLL_DIR)%' -ifeq (,$(OCAML_OPT_ARCH)) - OCAMLINIT_SED += -e '/^OPT: /d' -else - OCAMLINIT_SED += -e 's/^OPT: //' -endif patch-stamp: debian/$(SRCTARBALL) - ocamlinit-stamp: debian/$(SRCTARBALL) - for t in $(OCAML_IN_FILES); do \ - sed $(OCAMLINIT_SED) $$t.in > $$t; \ - done - touch $@ # Generate ocaml-native-compilers' Architecture field. # Should never be called automatically. @@ -140,7 +129,7 @@ endif dh build --after dh_auto_test touch $@ -clean: unpatch +clean: unpatch ocamlinit-clean dh clean --before dh_auto_clean ifneq ($(wildcard $(CURDIR)/config/Makefile),) $(MAKE) clean @@ -160,7 +149,7 @@ endif sed -i 1d emacs/ocamltags.in; \ fi # Remaining stuff - -rm -Rf debian/$(SRCTARBALL) $(OCAML_IN_FILES) + -rm -Rf debian/$(SRCTARBALL) dh clean --after dh_auto_clean install: install-stamp