Erez Zilber
2008-08-11 07:46:23 UTC
Hi,
I have a problem with an env variable while running rpmbuild --rebuild
/usr/src/redhat/SRPMS/mypackage-0-0.1.src.rpm:
before running rpmbuild, I run the following commands:
[***@klab002:~/work/]$ sudo bash -c 'export MY_ENV_VAR=some_val'
[***@klab002:~/work/]$ sudo echo $MY_ENV_VAR
some_val
In the spec file, I print this env var:
%build
echo "MY_ENV_VAR = $MY_ENV_VAR"
but when I run rpmbuild --rebuild
/usr/src/redhat/SRPMS/mypackage-0-0.1.src.rpm, I get:
+ LANG=C
+ export LANG
+ unset DISPLAY
+ echo 'MY_ENV_VAR = '
MY_ENV_VAR =
I guess that it opens another shell in which the env var is not
defined. How can I solve that (without adding the env var to .bashrc
which is not a possible solution for me).
Thanks,
Erez
I have a problem with an env variable while running rpmbuild --rebuild
/usr/src/redhat/SRPMS/mypackage-0-0.1.src.rpm:
before running rpmbuild, I run the following commands:
[***@klab002:~/work/]$ sudo bash -c 'export MY_ENV_VAR=some_val'
[***@klab002:~/work/]$ sudo echo $MY_ENV_VAR
some_val
In the spec file, I print this env var:
%build
echo "MY_ENV_VAR = $MY_ENV_VAR"
but when I run rpmbuild --rebuild
/usr/src/redhat/SRPMS/mypackage-0-0.1.src.rpm, I get:
+ LANG=C
+ export LANG
+ unset DISPLAY
+ echo 'MY_ENV_VAR = '
MY_ENV_VAR =
I guess that it opens another shell in which the env var is not
defined. How can I solve that (without adding the env var to .bashrc
which is not a possible solution for me).
Thanks,
Erez