How to make .spec Requires for libXXX.so.VER
Sérgio Basto
sergio at serjux.com
Tue Sep 29 12:32:06 UTC 2015
Hi,
On Seg, 2015-09-28 at 09:11 +0200, Jan Kratochvil wrote:
> On Sat, 01 Aug 2015 21:48:24 +0200, Igor Gnatenko wrote:
> > On Sat, Aug 1, 2015 at 10:25 PM, Jan Kratochvil
> > <jan.kratochvil at redhat.com> wrote:
> > > (1) How to make a dependency on librpm.so.7?
> > >
> > > librpm.so.7 is in rpm-libs-4.12.90-3.fc24.x86_64 which --provides:
> > > librpm.so.7()(64bit)
> > > librpmio.so.7()(64bit)
> > > rpm-libs = 4.12.90-3.fc24
> > > rpm-libs(x86-64) = 4.12.90-3.fc24
> > > So there is no easy way to Requires: rpm-libs = NVRA
> > > I do not see which V introduced / deprecates .so library version 7.
> > >
> > > So I would like to: Requires: librpm.so.7
> > > But that does not work as I need there the '()(64bit)' suffix.
> > >
> > > %{?_isa} suffix does not work, that is '(x86-64)' and not '()(64bit)'.
> > >
> > > I could %ifarch explicitly all 64-bit Fedora archs to append '()(64bit)' for
> > > them but isn't there some better way how to generate the '()(64bit)' suffix?
> > >
> > > (2) The other possibility does work:
> > >
> > > BuildRequires: %{_libdir}/librpm.so.7
> > >
> > > But
> > > https://fedoraproject.org/wiki/Packaging:Guidelines#File_Dependencies
> > > says
> > > Whenever possible you should avoid file dependencies as they slow down
> > > dependency resolution and require the package manager to download file
> > > lists in addition to to regular dependency information.
> >
> > I'd propose to add something like:
> > %if %{__isa_bits} = 64
> > Requires: libFOO.so.X()(64bit)
> > %else
> > Requires: libFOO.so.X
> > %endif
>
> This works for Requires (or Recommends) but not for BuildRequires:
Sorry if it is off-topic ...
I got a similar question, I just tested and the following works in
copr :
%ifarch x86_64
BuildRequires: libstdc++-static(x86-32) glibc(x86-32) glibc-devel(x86-32) libgcc(x86-32)
BuildRequires: libstdc++-static(x86-64)
%else
BuildRequires: libstdc++-static
%endif
> I have found now by
> https://github.com/msimacek/koschei/issues/54
> there exists
> https://fedoraproject.org/wiki/Packaging:Guidelines#BuildRequires_and_.25.7B_isa.7D
> (I find this as a workaround of broken rpm/yum(/dnf?), this is why
> I was adding %{?_isa} to BuildRequires, but that is offtopic for this
> mail thread.)
>
> which talks only about forbidden %{?_isa} in BuildRequires but apparently it
> IMO applies also to ()(64bit) suffixes in BuildRequires.
>
> But using
> BuildRequires: libFOO.so.X
> without the ()(64bit) suffix does not work on 64-bit archs:
> error: Failed build dependencies:
> librpm.so.7 is needed by gdb-7.10-28.fc24.x86_64
>
> So I can only remove such BuildRequires completely but then it may quietly
> build a package (gdb) which has wrong librpm version dependency built in.
> I will have to add a manual %build-time shell check instead.
>
>
> Jan
--
Sérgio M. B.
More information about the devel
mailing list