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

Re: Multiarch: how to get arch in runtime?



On Tue, Jun 04, 2013 at 09:26:35AM +0200, Olе Streicher wrote:
> I am currently creating a package [1] that I want to have Multiarch
> enabled. The program is started via a link to a shell script (for
> historic reasons, this is C shell):
> 
> /usr/bin/iraf-cl -> /usr/share/iraf/unix/hlib/cl.csh
> 
> where the shell script contains some environmental settings, and then
> shall finish with execing the "raw" binary:
> 
> [...]
> setenv iraf_b /usr/lib/x86_64-linux-gnu/iraf/
> exec ${iraf_b}bin/cl.e
> 
> (${iraf_b} is also used internally to find other libraries and
> executables) My problem is now, how to find out the path here? I could
> do a 
> 
> setenv iraf_b /usr/lib/`dpkg-architecture -qDEB_HOST_MULTIARCH`/iraf/
> 
> but, I thought dpkg-architecture to be a development helper and not a
> common-user tool.

dpkg-architecture can't be used here, indeed.  It will tell you what
architecture dpkg uses, not what iraf-cl wants.

Ie, if you have dpkg:x32 and iraf-cl:amd64, dpkg-architecture will answer
"x32" even though you need "amd64".

But, what is the reason you want the executable to be multiarched for? 
Unlike libraries, -dev and so on, the user doesn't really care[1].  Thus,
perhaps things you put into /usr/bin should be arch:any but not
co-installable.  It can then know the architecture it has been built for.

Placing files in /usr/bin/ is an interface meant to be used with exec()
rather than something that cares about multiarch, only the binaries
themselves may care about it but that's expressed with dependencies.


[1]. Beyond preferring stuff that can be run efficiently rather than through
qemu-user.

-- 
ᛊᚨᚾᛁᛏᚣ᛫ᛁᛊ᛫ᚠᛟᚱ᛫ᚦᛖ᛫ᚹᛖᚨᚲ


Reply to: