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

Matching mono architectures in d/control



All,

On Mon, Jan 30, 2012 at 4:18 PM, Mirco Bauer <meebey@debian.org> wrote:
> On 01/30/2012 03:04 PM, Mathieu Malaterre wrote:
>> Quick question, gdcm is setup the following way:
>>
>> $ cat control
>> ...
>> Package: libgdcm-cil
>> Section: cli-mono
>> Architecture: i386 lpia kfreebsd-i386 powerpc amd64 kfreebsd-amd64
>> ia64 arm armeb armel sparc s390
>> ...
>>
>> Isn't there something easier such as ${mono:Architecture} ? Or do I
>> need a source upload each time there is a change in mono source ?
>
> Since mono 2.10.1-2 there is /usr/share/mono/mono-archs.make which
> includes 2 variables:
> DEB_MONO_ARCHS and DEB_MONO_SGEN_ARCHS which can be used to get a list
> of all mono arches.
>
> If you can pass that directly to debian/control and use it, I haven't
> tried that, but dh_gencontrol allows to pass
> custom variables, see debian/rules of the mono source package
> (mono:upversion).

Well my evil plan did not work quite as I expected, so I am posting
the results. Here is the answer from Jakub Wilk (on
debian-mentors@d.o)

...
If you're trying to use ${mono:Archs} in the Architecture field, then
no, you can't do this:

"While variable substitution is done on all control fields, some of
those fields are used and needed during the build when the
substitution did not yet occur. That's why you can't use variables in
the Package, Source and Architecture fields." (from deb-substvars
manpage)
...

So here is what I ended up doing:

$ cat rules
...
override_dh_auto_configure: check-mono-archs
...
mono_archs=$(DEB_MONO_ARCHS)
gdcm_archs="$(shell grep -2 libvtkgdcm-cil debian/control | grep
Architecture | cut -d: -f2 | tr " " "\n" | sort -g)"
mono_sorted="$(shell echo ' $(mono_archs)' | tr ' ' '\n' | sort -g)"
check-mono-archs:
	if [ $(gdcm_archs) != $(mono_sorted) ]; then echo "Incompatible arch,
should be $(mono_archs)"; exit 1; fi



Hope this is helpful to others.

ref:
http://lists.debian.org/debian-mentors/2012/01/msg00797.html

Cheers
-- 
Mathieu


Reply to: