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]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux