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

Re: Depends clause of control



skaller wrote:
> I have a package which says this:
> 
> Depends: ${shlibs:Depends}, g++, ocaml-nox-${F:OCamlABI}
> 
> however this is wrong. If the arch supports native
> code compiler, there is no dependency on Ocaml at all.
> If the arch only supports bytecode, then ocaml_run is required
> 
> What I think is needed here is something like:
> 
> Depends: ... ${F:OCaml_IF_BYTECODE}
> 
> which expands to nothing if the arch supports native code,
> or ocaml-nox-${F:OCamlABI} if it doesn't.

ocamlrun and the related libs are in ocaml-base-nox, not in ocaml-nox!

> It seems this is handled by:
> 
> OCAMLABI = $(shell ocamlc -version)
> 
> and
> 	dh_gencontrol -- -VF:OCamlABI="$(OCAMLABI)"
> 
> in the rules file. 
> 
> Would it be possible to use something like:
> 
> OCAML_HAS_NATIVE = shell negate "ocamlopt -version"

Actually, we usually use something along the lines of

if [ -e /usr/bin/ocamlopt ]; then ... else ... fi

> to detect whether we really need a dependence
> on Ocaml? 

Here is how it has been done in the mldonkey package:

* in the debian/control file:

Package: mldonkey-server
Architecture: any
Depends: ${shlibs:Depends}, ${interpreter:Depends}, ...

* in the binary-arch target of the debian/rules:

if [ -e /usr/bin/ocamlopt ]; then \
	echo "interpreter:Depends=" >> debian/mldonkey-server.substvars; \
	dh_strip; \
else \
	echo "interpreter:Depends=ocaml-base-nox-$(OCAMLABI)" >>
debian/mldonkey-server.substvars; \
fi

> I mean .. it certainly is possible, could this technique
> be fixed and put in the policy document?

Yes, I guess we should improve the policy on this point.

Cheers,

Samuel.



Reply to: