[Pkg-ocaml-maint-commits] [SCM] mldonkey packaging branch, master, updated. debian/2.9.5-2-73-g65f75c2

Mehdi Dogguy dogguy at pps.jussieu.fr
Fri Mar 13 10:47:54 UTC 2009


The following commit has been merged in the master branch:
commit 6f355ee80e83f7a838c6b8c8f0083584d32ce714
Author: Mehdi Dogguy <dogguy at pps.jussieu.fr>
Date:   Wed Mar 11 22:18:17 2009 +0100

    Use dh-ocaml predefined variables.

diff --git a/debian/control b/debian/control
index d3076f7..a8c4a8e 100644
--- a/debian/control
+++ b/debian/control
@@ -11,6 +11,7 @@ Homepage: http://mldonkey.sourceforge.net/
 Build-Depends: autoconf, autotools-dev,
  ocaml-nox (>= 3.10.1),
  ocaml-best-compilers | ocaml-nox,
+ dh-ocaml (>= 0.4.1),
  camlp4,
  debhelper (>= 7),
  po-debconf,
diff --git a/debian/rules b/debian/rules
index e528cc3..2102bd4 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,13 +1,10 @@
 #!/usr/bin/make -f
 
-# Uncomment this to turn on verbose mode.
 #export DH_VERBOSE=1
 
-# 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)
+include /usr/share/dpatch/dpatch.make
+include /usr/share/ocaml/ocamlvars.mk
+include /usr/share/ocaml/ocamlinit.mk
 
 ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
   confflags += --build $(DEB_HOST_GNU_TYPE)
@@ -27,10 +24,7 @@ else
         CFLAGS += -O2
 endif
 
-include /usr/share/dpatch/dpatch.make
-
 MANCHECK=mlnet mlgui mlguistarter
-OCAMLABI=$(shell ocamlc -version)
 IS_NATIVE:= $(wildcard /usr/bin/ocamlopt)
 TARGET   := $(if $(IS_NATIVE),opt,byte)
 
@@ -80,19 +74,19 @@ configure-stamp:
 build: build-stamp
 build-stamp: patch-stamp configure-stamp
 	dh_testdir
-	$(MAKE) utils.$(TARGET) $(TARGET)
-	if [ "$(TARGET)" = "byte" ]; then \
-		cp mlnet.byte mlnet; \
-		cp mlgui.byte mlgui; \
-		cp mlguistarter.byte mlguistarter; \
-	fi
+	$(MAKE) utils.$(OCAML_BEST) $(OCAML_BEST)
+ifeq ($(OCAML_BEST),byte)
+	cp mlnet.byte mlnet
+	cp mlgui.byte mlgui
+	cp mlguistarter.byte mlguistarter
+endif
 # Check that the compilation has succeeded
 	test -x mlnet
 	test -x mlgui
 # Make manpages
 	$(MAKE) -C debian/xml-man all
 # Build utilities
-	make -C debian/utils TARGET=$(TARGET)
+	make -C debian/utils TARGET=$(OCAML_BEST)
 	touch build-stamp
 
 install: build install-stamp
@@ -112,16 +106,15 @@ binary-arch: build install-stamp
 	dh binary-arch --after=installdocs --before=installinit
 	dh_installinit -a -pmldonkey-server --error-handler=init_error -- start 98 2 3 4 5 . stop 20 0 1 6 .
 	dh binary-arch --after=installinit --before=strip
-	if [ "$(TARGET)" = "opt" ]; then \
-		echo "interpreter:Depends=" >> debian/mldonkey-server.substvars; \
-		echo "interpreter:Depends=" >> debian/mldonkey-gui.substvars; \
-		dh_strip -a; \
-	else \
-		echo "interpreter:Depends=ocaml-base-nox-$(OCAMLABI)" >> debian/mldonkey-server.substvars; \
-		echo "interpreter:Depends=ocaml-base-nox-$(OCAMLABI)" >> debian/mldonkey-gui.substvars; \
-	fi
+ifeq ($(OCAML_BEST),opt)
+	echo "interpreter:Depends=" >> debian/mldonkey-server.substvars
+	echo "interpreter:Depends=" >> debian/mldonkey-gui.substvars
+	dh_strip -a
+else
+	echo "interpreter:Depends=ocaml-base-nox-$(OCAML_ABI)" >> debian/mldonkey-server.substvars
+	echo "interpreter:Depends=ocaml-base-nox-$(OCAML_ABI)" >> debian/mldonkey-gui.substvars
+endif
 	dh binary-arch --after=strip
 
-# For now we have no binary-indep
 binary: binary-arch
 .PHONY: build clean binary-indep binary-arch binary install

-- 
mldonkey packaging



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