ATTN: Changes to OCaml dependency generator for RPM 4.8 in Rawhide

Panu Matilainen pmatilai at laiskiainen.org
Wed Dec 16 16:34:09 UTC 2009


On Wed, 16 Dec 2009, Richard W.M. Jones wrote:

> Since RPM 4.8 (now in Rawhide / Fedora 13), the external dependency
> generator that we used to ship with OCaml has now gone upstream into
> RPM.  This is a Good Thing, thanks to the RPM maintainers for adding
> this.
>
> If you own an OCaml library package, then there are some simple
> adjustments you need to make to your OCaml spec files _in Rawhide_.
>
> First of all, remove any lines that are exactly like any of these:
>
>  %define _use_internal_dependency_generator 0
>  %global _use_internal_dependency_generator 0
>  %define __find_requires /usr/lib/rpm/ocaml-find-requires.sh
>  %global __find_requires /usr/lib/rpm/ocaml-find-requires.sh
>  %define __find_provides /usr/lib/rpm/ocaml-find-provides.sh
>  %global __find_provides /usr/lib/rpm/ocaml-find-provides.sh
>
> Any remaining calls to ocaml-find-{requires,provides}.sh must be ones
> which take parameters, and these need to be modified.
>
> Change:
>
>  %define __find_requires /usr/lib/rpm/ocaml-find-requires.sh <params...>
> or:
>  %global __find_requires /usr/lib/rpm/ocaml-find-requires.sh <params...>
>
> to:
>
>  %global __ocaml_requires %{_rpmconfigdir}/ocaml-find-requires.sh <params...>

Better yet, instead of overriding the __ocaml_requires (and _provides) 
macros, use the new option passing mechanism. See below...

>
> and the same for "provides" instead of "requires".
>
> For example, if your original spec files contained this block:
>
>  %define _use_internal_dependency_generator 0
>  %define __find_requires /usr/lib/rpm/ocaml-find-requires.sh -i Asttypes -i Parsetree
>  %define __find_provides /usr/lib/rpm/ocaml-find-provides.sh
>
> then following the rules above it would become:
>
>  %global __ocaml_requires %{_rpmconfigdir}/ocaml-find-requires.sh -i Asttypes -i Parsetree

With the new rpm, all you need to have in the spec for this case is:

%global __ocaml_requires_opts -i Asttypes -i Parsetree

These will get passed to __ocaml_requires automatically when it runs, 
and similarly to pass options to provides script, define 
__ocaml_provides_opts macro to your liking.

Oh and this is not ocaml-specific, any of the __foo_requires / 
__foo_provides helpers accept options in the same manner.

 	- Panu -




More information about the fedora-devel-list mailing list