[CentOS] rpmbuild: definition of the %prep script

Tue Apr 19 11:08:00 UTC 2011
Johnny Hughes <johnny at centos.org>

On 04/18/2011 12:09 PM, Volker Poplawski wrote:
> On 04/18/2011 06:52 PM, Joseph L. Casale wrote:
>>> Actually I'm trying to figure out where these lines originate from
>>
>> I see
>>
>>> Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.86989
>>> + umask 022
>>> + cd /home/user/rpmbuild/BUILD
>>> + LANG=C
>>> + export LANG
>>>
>>> The setting of LANG messes up my build, which relies on Utf8.
>>
>> So export this in the build environments shell, afaik if its previously
>> it will not redefine it.
>>
>> export LANG=en_US.UTF-8
>> rpmbuild<...>
>>
>> Try that out.
> 
> LANG=en_US.UTF-8
> is already set on Centos 5.
> 
> What does help is to put export LANG=en_US.UTF-8 first line in the 
> %prep, %build... sections
> 
> Afaik UTF-8 is default for most linux distributions nowadays (not sure 
> about debian). I wonder why (and where) rpmbuild on centos sets LANG to 
> something different. I can tell that OpenSuse 11.x does not modify LANG 
> in rpmbuild as I'm porting a package from there.

All RPMs are built with LANG=C ... you will need to set it yourself if
you want something else.

Several packages need LANG=C to build correct, which is why utf8 is
overridden.

It is done in CentOS because it is done in RHEL.

See Ned Slider's post earlier in this thread.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 253 bytes
Desc: OpenPGP digital signature
URL: <http://lists.centos.org/pipermail/centos/attachments/20110419/3c31c7bd/attachment-0005.sig>