The Shoes of the Fisherman's Wife Are Some Jive-Ass Slippers

tpot (at) frungy . org

rss

2004
Months
May

Fri, 21 May 2004

Building RPMs with SCons

One of the features of SCons is a guaranteed repeatable build regardless of the environment variables set at the time scons is invoked. As such, only the following environment variables are set in the default construction environment:

PATH=/usr/local/bin:/bin:/usr/bin
PWD=/net/proforma/data/wbem/hp.com-wbem-providers/trunk
SHLVL=1
_=/usr/bin/printenv
RPM, and probably a number of other tools likely to be execed by SCons, behaves badly when the $HOME environment variable is not defined. Specifically it doesn't read the contents of ~/.rpmmacros presumably because it tries to substitute $HOME for ~ and fails since it this isn't present in the default SCons construction environment. The solution is to propagate the value of $HOME by hand:
base_env = Environment(
    CPPPATH = [Dir('include')],
    CCFLAGS = '-W -Wall -ggdb')

base_env.Append(ENV = {"HOME": os.environ['HOME']})
Setting the ENV dictionary directly in the definition of base_env makes things even worse as it replaces the already sparse environment with the data specified. posted at: 11:34 | path: /software/scons | permanent link to this entry