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

Re: [Debian-med-packaging] Bug#775302: [fis-gtm] UTF-8 libgtmutils.so in fis-gtm-6.2-000 is missing routines (fwd)



On Fri, Apr 24, 2015 at 09:59:23AM +0200, Paul Gevers wrote:
> Hi
> 
> On 24-04-15 06:02, Amul Shah wrote:
> > While this fix works, it strikes me as not completely correct because
> >      21 # Set up locale support in the pbuilder environment
> >      22 override_dh_auto_build:
> >      23         mkdir -p debian/tmp/locale/
> >      24         localedef -f UTF-8 -i en_US ./debian/tmp/locale/en_US.UTF-8/
> >      25         export LOCPATH=$(CURDIR)/debian/tmp/locale/ && \
> >      26         export LC_ALL=en_US.UTF-8 && \
> >      27         dh_auto_build
> > 
> > I played around with attempting to use the LOCPATH and LC_ALL settings
> > from override_dh_auto_build in override_dh_auto_install, but
> > $(CURDIR)/debian/tmp/locale does not exist at override_dh_auto_install.
> > 
> > I can either repeat the steps from override_dh_auto_build to generate
> > the locale in override_dh_auto_build or I can use my fix as is because
> > all fis-gtm needs is a valid Unicode locale to proceed with compilation.
> > 
> > Thoughts? Do I need to go read the manual(s) again?
> 
> I may be completely wrong, but I think the exports need to happen before
> any of the targets in the general section of the makefile (debian/rules
> is a plain makefile).

Well, since these "export" statements are indented with a tab, that
makes them shell commands for the target, not directives for make(1)
itself.  Thus, the quoted lines are basically equivalent to:

override_dh_auto_build:
	...
	sh -c "export LOCPATH=...; export LC_ALL=...; dh_auto_build"

I hope that this makes it a bit more clear that these export statements
are handled by the shell, not by make(1) itself, and their purpose is to
modify the values of the LOCPATH and LC_ALL variables *only* during the
execution of the dh_auto_build command itself.  Thus, the syntax seems
correct, although (personal preference) I would use env(1) instead -
something like:

override_dh_auto_build:
	...
	env LOCPATH="..." \
		LC_ALL="..." \
		dh_auto_build

To Amul Shah: unfortunately, "locale -a" doesn't work in this way - it
does not pay any attention to the LOCPATH setting, even though LOCPATH
is indeed honored by other utilities like date(1) and even make(1) :(
So, hm, my advice would be to modify the tool that checks for the
en_US.UTF-8 locale and make it do something like:

utflocale=`(printenv LANG LC_ALL || true; locale -a) | grep -i en_us...`

Of course, if the script does not set -e or something similar, you don't
need the || true bit, so:

utflocale=`(printenv LANG LC_ALL; locale -a) | grep -i en_us...`

Yes, it's a bit ugly, but, well, it might work.

Hope that helps!

G'luck,
Peter

-- 
Peter Pentchev  roam@ringlet.net roam@FreeBSD.org p.penchev@storpool.com
PGP key:        http://people.FreeBSD.org/~roam/roam.key.asc
Key fingerprint 2EE7 A7A5 17FC 124C F115  C354 651E EFB0 2527 DF13

Attachment: signature.asc
Description: Digital signature


Reply to: