[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [Pkg-xen-devel] [patch] Packages ocaml libraries

On 31/08/2011 17:31, Thomas Goirand wrote:
> On 08/30/2011 09:44 PM, Ian Campbell wrote:
>> I still don't think this can be right. Surely every Ocaml packages 
>> doesn't open code a bunch of install runes like this (not to mention
>>  the corresponding "find ... -delete" like you have below). It'd be
>> a maintenance nightmare.
>> Looking at the ocaml-taglib source (picked at random) it appears that
>> at least one viable option for doing this properly is to use the
>> dh_install functionality which lets you specify a different target
>> directory to where the file is found in the staging dir. i.e. 
>> debian/libtaglib-ocaml.install.in contains: 
>> @OCamlStdlibDir@/taglib/dlltaglib_stubs.so @OCamlDllDir@

I think that his generated .install files are not that complex, but they
could look as complex because:
1) there are multiple subdirs there and we have to split files between the
-dev and non -dev packages.
2) usage of old dh style rules (no way to run with "--with ocaml")
3) the staging directory depends on variables $ARCH set in your
debian/rules. That's why you have to define a @XenBuildOcamlLibsDir@
substitution variable.

Some comments about the patch:

+	export OCAMLINIT_SED="-e
&& dh_ocamlinit

I think that the following is enough.

	OCAMLINIT_SED="…" dh_ocamlinit

+	dh_install
+	dh_strip
+	dh_shlibdeps
+	+$(MAKE_SELF) install-base
+install-lib-ocaml-dev_$(ARCH): DIR = $(BUILD_DIR)/install-utils_$(ARCH)
+install-lib-ocaml-dev_$(ARCH): PACKAGE_NAME = libxen-ocaml-dev
+install-lib-ocaml-dev_$(ARCH): DH_OPTIONS = -p$(PACKAGE_NAME)
+install-lib-ocaml-dev_$(ARCH): $(STAMPS_DIR)/install-utils_$(ARCH)
+	dh_testdir
+	dh_testroot
+	dh_prep
+	make -C $(BUILD_DIR)/build-utils_$(ARCH)/tools/ocaml/libs
+	export OCAMLINIT_SED="-e
&& dh_ocamlinit

Same here.

When I mentioned "export", it was in case you want to set that once and
for all in your debian/rules somewhere before those targets, and not to
use in every invocation.

+Package: libxen-ocaml-dev
+Architecture: any
+Section: ocaml
+Depends: libxen-ocaml (= ${binary:Version}), ${shlibs:Depends},
ocaml-findlib (>= 1.1), ${misc:Depends}, ${ocaml:Depends}
+Provides: ${ocaml:Provides}

I guess the dependency on "libxen-ocaml (= ${binary:Version})" is not
necessary since it will be detected by dh_ocaml.

diff -u -N -r old/xen-4.1.1/debian/templates/control.source.in
--- old/xen-4.1.1/debian/templates/control.source.in	2011-07-18
16:48:10.000000000 +0000
+++ new/xen-4.1.1/debian/templates/control.source.in	2011-08-30
15:40:22.000000000 +0000
@@ -15,7 +15,8 @@
- zlib1g-dev
+ zlib1g-dev,
+ ocaml-nox, dh-ocaml, ocaml-findlib

The build-dependency on dh-ocaml should be versioned since all those
dh_ocaml* scripts have been added in 0.9.0. I think you should turn that
into something like "dh-ocaml (>= 0.9~), ocaml-nox (>= 3.11.1-3~)".
Lintian should warn about that though.

(Disclaimer: I didn't try to use the package, nor complied it.)


Mehdi Dogguy مهدي الدڤي

Reply to: