Bug 133389 - RFE: add __soext macro
Summary: RFE: add __soext macro
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: rpm
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Paul Nasrat
QA Contact: Mike McLean
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-09-23 17:49 UTC by Anders F Björklund
Modified: 2007-11-30 22:10 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2005-10-25 22:14:27 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Anders F Björklund 2004-09-23 17:49:10 UTC
Description of problem:

Not all platforms have .so as the dynamic library suffix.
For instance, Mac OS X and Darwin uses .dylib instead...

Here is a macro to help with writing portable spec files:

%ifnos darwin
%define __soext so
%else
%define __soext dylib
%endif

But it would be better if I didn't have to add this macro
to all of my own specfiles (or in any custom .rpmmacros) ?


Another problem is the versioning, but there there is no
choice but to modify the specfile %files with %ifos tags:

%ifnos darwin
%{_libdir}/libz.%{__soext}.*
%else
%{_libdir}/libz.*.%{__soext}
%endif

Darwin has the version inbetween the library and the suffix,
which makes it possible to specify which version to link to.

But it also makes constructs like "*.so" to match the developer
libraries only fail, since it will match all library versions...


To make matters worse, some of the things such as perl or python
modules are not dynamic libraries but loadable bundles, so they
use a .bundle suffix instead... But that is a whole other story.

Comment 1 Jeff Johnson 2004-09-23 23:52:31 UTC
Something like this is needed, and not only for mac os x; both
hpux and aix have other than *.so markers for shared libraries
iirc.

I'd probably go with the shorter %{so} if/when the time comes.
Note: current restrictions on macro definitions prevent
defining 2 character macros iirc, that is intentional ;-)

Comment 2 Anders F Björklund 2004-09-24 07:13:54 UTC
I thought a cool feature would be to have a %{__sover} macro
(or something), that would expand to versioned libraries ext:

%ifnos darwin
%define __sover    %{__soext}.*
%else
%define __sover    *.%{__soext}
%endif

But one still needs to change the spec files from the current
*.so, to listing both libfoo.%{__soext} and libbar.%{__soext}

Since otherwise the wild card matches the runtime libraries too,
not only the developer library symlinks (like it does on Linux)


Comment 3 Jeff Johnson 2005-10-25 22:14:27 UTC
This is added as the macro %__so since (at least) rpm-4.4.2.


Note You need to log in before you can comment on or make changes to this bug.