[Pkg-ocaml-maint-commits] [camldbm] 01/02: Fix package build on bytecode architectures

Stéphane Glondu glondu at moszumanska.debian.org
Sat Dec 7 20:13:47 UTC 2013


This is an automated email from the git hooks/post-receive script.

glondu pushed a commit to branch master
in repository camldbm.

commit 2bf1a181506f3931390d661766b168295d845fd7
Author: Stephane Glondu <steph at glondu.net>
Date:   Sat Dec 7 20:49:30 2013 +0100

    Fix package build on bytecode architectures
---
 debian/control                             |  1 +
 debian/libdbm-ocaml-dev.install.in         | 10 ++--
 debian/libdbm-ocaml.install.in             |  8 +--
 debian/patches/0001-Improve-Makefile.patch | 82 ++++++++++++++++++++++++++++++
 debian/patches/series                      |  1 +
 debian/rules                               | 10 ++--
 6 files changed, 99 insertions(+), 13 deletions(-)

diff --git a/debian/control b/debian/control
index 94bce59..df86341 100644
--- a/debian/control
+++ b/debian/control
@@ -8,6 +8,7 @@ Build-Depends:
  debhelper (>= 9),
  libgdbm-dev,
  ocaml-nox,
+ ocaml-findlib,
  dh-ocaml
 Homepage: https://forge.ocamlcore.org/projects/camldbm/
 Standards-Version: 3.9.5
diff --git a/debian/libdbm-ocaml-dev.install.in b/debian/libdbm-ocaml-dev.install.in
index 17e1959..c32e9bb 100644
--- a/debian/libdbm-ocaml-dev.install.in
+++ b/debian/libdbm-ocaml-dev.install.in
@@ -1,5 +1,5 @@
- at OCamlStdlibDir@/*.mli
- at OCamlStdlibDir@/*.cmi
- at OCamlStdlibDir@/*.a
-OPT: dbm.cmx @OCamlStdlibDir@
-OPT: @OCamlStdlibDir@/*.cmxa
+ at OCamlStdlibDir@/dbm/*.mli
+ at OCamlStdlibDir@/dbm/*.cmi
+ at OCamlStdlibDir@/dbm/*.a
+OPT: @OCamlStdlibDir@/dbm/*.cmx
+OPT: @OCamlStdlibDir@/dbm/*.cmxa
diff --git a/debian/libdbm-ocaml.install.in b/debian/libdbm-ocaml.install.in
index 2e86669..402b4b6 100644
--- a/debian/libdbm-ocaml.install.in
+++ b/debian/libdbm-ocaml.install.in
@@ -1,4 +1,4 @@
- at OCamlDllDir@
- at OCamlStdlibDir@/METAS
- at OCamlStdlibDir@/*.cma
-DYN: @OCamlStdlibDir@/*.cmxs
+ at OCamlDllDir@/*.so
+ at OCamlStdlibDir@/dbm/META
+ at OCamlStdlibDir@/dbm/*.cma
+DYN: @OCamlStdlibDir@/dbm/*.cmxs
diff --git a/debian/patches/0001-Improve-Makefile.patch b/debian/patches/0001-Improve-Makefile.patch
new file mode 100644
index 0000000..a10ba01
--- /dev/null
+++ b/debian/patches/0001-Improve-Makefile.patch
@@ -0,0 +1,82 @@
+From: Stephane Glondu <steph at glondu.net>
+Date: Sat, 7 Dec 2013 20:49:16 +0100
+Subject: Improve Makefile
+
+ * fix build when ocamlopt is missing
+ * simplify installation (and its customization) with ocamlfind
+ * install dbm.cmx
+ * do not fail if Makefile.config is missing
+---
+ Makefile | 31 ++++++++++++++++++-------------
+ 1 file changed, 18 insertions(+), 13 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 8c42364..1b329fb 100644
+--- a/Makefile
++++ b/Makefile
+@@ -11,7 +11,7 @@
+ #                                                                       #
+ #########################################################################
+ 
+-include Makefile.config
++-include Makefile.config
+ 
+ OCAMLC=ocamlc
+ OCAMLOPT=ocamlopt
+@@ -21,11 +21,18 @@ OCAMLRUN=ocamlrun
+ O=o
+ A=a
+ SO=so
+-LIBDIR=`ocamlc -where`
+-STUBLIBDIR=$(LIBDIR)/stublibs
+ 
++HAS_OCAMLOPT := $(shell if which ocamlopt >/dev/null; then echo yes; else echo no; fi)
+ 
+-all: libcamldbm.$(A) dbm.cma dbm.cmxa dbm.cmxs 
++TARGETS := libcamldbm.$(A) dbm.cma
++FILES := META dllcamldbm.$(SO) libcamldbm.$(A) dbm.cma dbm.cmi dbm.mli
++
++ifeq ($(HAS_OCAMLOPT),yes)
++  TARGETS += dbm.cmxa dbm.cmxs
++  FILES += dbm.cmxa dbm.cmxs dbm.cmx dbm.$(A)
++endif
++
++all: $(TARGETS)
+ 
+ dbm.cma: dbm.cmo
+ 	$(OCAMLMKLIB) -o dbm -oc camldbm -linkall dbm.cmo $(DBM_LINK)
+@@ -57,13 +64,7 @@ depend:
+ 	$(OCAMLDEP) *.ml *.mli > .depend
+ 
+ install::
+-	if test -f dllcamldbm.$(SO); then cp dllcamldbm.$(SO) $(STUBLIBDIR)/; fi 
+-	cp libcamldbm.$(A) $(LIBDIR)/
+-	cd $(LIBDIR) && ranlib libcamldbm.$(A)
+-	cp dbm.cma dbm.cmxa dbm.cmi dbm.mli $(LIBDIR)/
+-	cp dbm.$(A) $(LIBDIR)/
+-	cd $(LIBDIR) && ranlib dbm.$(A)
+-	if test -f dbm.cmxs; then cp dbm.cmxs $(LIBDIR)/; fi
++	ocamlfind install dbm $(FILES)
+ 
+ clean::
+ 	rm -f *.cm* *.$(O) *.$(A) *.$(SO)
+@@ -77,12 +78,16 @@ testdbm.opt: dbm.cmxa testdbm.ml
+ clean::
+ 	rm -f testdbm.byte testdbm.opt testdatabase.*
+ 
+-test: testdbm.byte testdbm.opt
++test:: testdbm.byte
+ 	rm -f testdatabase.*
+ 	ocamlrun -I . ./testdbm.byte
+ 	rm -f testdatabase.*
++
++ifeq ($(HAS_OCAMLOPT),yes)
++test:: testdbm.opt
++	rm -f testdatabase.*
+ 	./testdbm.opt
+ 	rm -f testdatabase.*
+-	
++endif
+ 
+ include .depend
+-- 
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..6849f4b
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+0001-Improve-Makefile.patch
diff --git a/debian/rules b/debian/rules
index 20243ef..3ecd7eb 100755
--- a/debian/rules
+++ b/debian/rules
@@ -2,18 +2,20 @@
 
 include /usr/share/ocaml/ocamlvars.mk
 
+export OCAMLFIND_DESTDIR=debian/tmp$(OCAML_STDLIB_DIR)
+export OCAMLFIND_LDCONF=ignore
+
 %:
 	dh $@ --with ocaml
 
 .PHONY: override_dh_install
 override_dh_install:
-	dh_install --fail-missing
+	dh_install --fail-missing -X.so.owner
 
 .PHONY: override_dh_auto_install
 override_dh_auto_install:
-	mkdir -p debian/tmp$(OCAML_DLL_DIR) debian/tmp$(OCAML_STDLIB_DIR)/METAS
-	make LIBDIR=debian/tmp/$(OCAML_STDLIB_DIR) install
-	cp META debian/tmp/$(OCAML_STDLIB_DIR)/METAS/META.dbm
+	mkdir -p debian/tmp$(OCAML_STDLIB_DIR) debian/tmp$(OCAML_DLL_DIR)
+	dh_auto_install
 
 .PHONY: override_dh_auto_clean
 override_dh_auto_clean:

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ocaml-maint/packages/camldbm.git



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