[Pkg-ocaml-maint-commits] [SCM] alt-ergo packaging branch, master, updated. debian/0.8-1-6-g615b397

Mehdi Dogguy dogguy at pps.jussieu.fr
Tue Feb 24 09:45:16 UTC 2009


The following commit has been merged in the master branch:
commit 0c06064fa63e953d0aeec988569fdf52aadbddb0
Author: Mehdi Dogguy <dogguy at pps.jussieu.fr>
Date:   Tue Feb 24 10:34:43 2009 +0100

    Use dh-ocaml predefined variables

diff --git a/debian/rules b/debian/rules
index 561cd07..ae58f80 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,24 +1,14 @@
 #!/usr/bin/make -f
 # -*- makefile -*-
-# Sample debian/rules that uses debhelper.
-# This file was originally written by Joey Hess and Craig Small.
-# As a special exception, when this file is copied by dh-make into a
-# dh-make output file, you may use that output file without restriction.
-# This special exception was added by Craig Small in version 0.37 of dh-make.
 
-# Uncomment this to turn on verbose mode.
-#export DH_VERBOSE=1
+export DH_VERBOSE=1
 
 include /usr/share/dpatch/dpatch.make
+include /usr/share/ocaml/ocamlvars.mk
 
-DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
-DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
-
-OCAMLABI  = $(shell ocamlc -version)
-BYTECODE  = $(shell [ -x /usr/bin/ocamlopt ] || echo yes)
-OCAMLRUN  = $(if $(BYTECODE),ocaml-base-nox-$(OCAMLABI),)
-OCAMLBEST = $(if $(BYTECODE),byte,opt)
-MAKEOPTS  = OCAMLC=ocamlc OCAMLOPT=ocamlopt OCAMLLEX=ocamllex OCAMLLIB=/usr/lib/ocaml/$(OCAMLABI) OCAMLVERSION=$(OCAMLABI)
+OCAMLRUN  = $(if $(OCAML_OPT_ARCH),,ocaml-base-nox-$(OCAMLABI))
+MAKEOPTS  = OCAMLC=ocamlc OCAMLOPT=ocamlopt OCAMLLEX=ocamllex OCAMLLIB=$(OCAML_STDLIB_DIR) OCAMLVERSION=$(OCAML_ABI)
+BACKUP    = version.ml .depend
 
 config.status: 
 	dh_testdir
@@ -36,9 +26,10 @@ build-indep-stamp:
 build-arch: build-arch-stamp
 build-arch-stamp: config.status
 	dh_testdir
-	cp -ax version.ml version.ml.debian
-	cp -ax .depend .depend.debian
-	$(MAKE) $(OCAMLBEST)
+	for i in $(BACKUP); do \
+		cp -ax $$i $$i.debian; \
+	fi
+	$(MAKE) $(OCAML_BEST)
 	touch $@
 
 clean: unpatch
@@ -47,17 +38,17 @@ clean: unpatch
 	if [ -f Makefile ]; then \
 		$(MAKE) clean;   \
 	fi
-	[ ! -f version.ml.debian ] || mv version.ml.debian version.ml
-	[ ! -f .depend.debian    ] || mv .depend.debian .depend
+	for i in $(BACKUP); do \
+		[ ! -f $$i.debian ] || mv $$i.debian $$i; \
+	fi
 	dh_clean 
 
 install: build
 	dh_testdir
 	dh_testroot
-	dh_clean -k 
+	dh_prep
 	dh_installdirs
-	cp -f alt-ergo.$(OCAMLBEST) $(CURDIR)/debian/alt-ergo/usr/bin/alt-ergo
-	cp -f smt_prelude.mlw $(CURDIR)/debian/alt-ergo/usr/lib/alt-ergo/
+	cp -f alt-ergo.$(OCAML_BEST) alt-ergo
 
 binary-indep: build install
 
@@ -68,9 +59,9 @@ binary-arch: build install
 	dh_installdocs
 	dh_installman
 	dh_link
-	if [ "$(OCAMLBEST)" = "opt" ]; then \
-		dh_strip;                   \
-	fi
+ifdef $(OCAML_OPT_ARCH)
+	dh_strip
+endif
 	dh_compress
 	dh_fixperms
 	dh_installdeb

-- 
alt-ergo packaging



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