Re: RPM build spec help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 3/5/07, Sam Varshavchik <mrsam@xxxxxxxxxxxxxxx> wrote:
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).


--
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list



Hi

Thanks for the tip, it helped. Sadly I can't make the oracle install
into an rpm as the local DBA is a bit conservative in his approach and
doesn't want to do something different from his normal installation
method.

I having a problem though. If I include the following

BuildRequires: %{oracle_home}/lib/libclntsh.so.10.1

Then try to build it I get:

rpmbuild -ba perl-DBD-Oracle.spec
error: Failed build dependencies:
       /opt/app/oracle/product/10.2.0/lib/libclntsh.so is needed by
perl-DBD-Oracle-1.16-4

although the file is there

ls -l /opt/app/oracle/product/10.2.0/lib/libclntsh.so
lrwxrwxrwx  1 oracle oinstall 17 Jul 20  2006
/opt/app/oracle/product/10.2.0/lib/libclntsh.so -> libclntsh.so.10.1

Any ideas why this would be happening?

Thanks in advance
Dan


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux