The solution as suggested by @devnull was indeed to make changes in pyinstaller's script. The script had the temporary location hardcoded so I made changes there. So here are the steps followed:
- Under the pyinstaller folder, look for the
launch.c
file under/path/to/pyinstaller/sources/common
- Look for a function called
int getTempPath(char *buff)
- Under it, delete references to the
static const char *envname[]
(which are, it's declaration and onefor
loop within the same function) - Change the values for
static const char *dirname[]
to to the values which you want.
The function thus, looks like so:
int getTempPath(char *buff)
{
static const char *dirname[] = {
"/usr/local/src/temp", "/usr/local/src", "/usr/src", 0
};
int i;
char *p;
for ( i=0; dirname[i]; i++ ) {
strcpy(buff, dirname[i]);
if (testTempPath(buff))
return 1;
}
return 0;
}
Recompile the pyinstaller sources
using the following command:
python ./waf configure --no-lsb build install
To run this, first install python-devel
packages (yum install python-devel -y
) else it throws and error that Python.h isn't found
Now when we run the python script through pyinstaller, the new temp local is used. Thanks to @devnull for pointing me in the right direction.