Dan Track writes:
Hi I hope someone can help. Basically I want to access an environment variable and place it in my macro in my spec file. If I try to define a macro like the following: %define oracle_home $ORACLE_HOME and then try to build it "rpmbuild -ba perl-DBD-Oracle" I get the following error: error: line 18: Dependency tokens must begin with alpha-numeric, '_' or '/': BuildRequires: $ORACLE_HOME/lib/libclntsh.so On line 18 I have the following: BuildRequires: %{oracle_home}/lib/libclntsh.so Any ideas how I can resolve this?
%{expand:%%define oracle_home %(echo $ORACLE_HOME)}However, this is considered to be bad practice. RPM build specs should not depend on the parent environment, because they won't be reproducible. The correct way to do this is:
1) You should install Oracle via rpm. Create an rpm package for Oracle, if necessary
2) Then, your BuildRequires becomes simply "BuildRequires: oracle"3) Then, your %prep, %build, and %install sections would initialize ORACLE_HOME accordingly (use the same snippet in all three cases).
Attachment:
pgpsVUvY4VPRJ.pgp
Description: PGP signature