Bug 133389 - RFE: add __soext macro
RFE: add __soext macro
Product: Fedora
Classification: Fedora
Component: rpm (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Paul Nasrat
Mike McLean
: FutureFeature
Depends On:
  Show dependency treegraph
Reported: 2004-09-23 13:49 EDT by Anders F Björklund
Modified: 2007-11-30 17:10 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-10-25 18:14:27 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Anders F Björklund 2004-09-23 13:49:10 EDT
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
%define __soext dylib

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

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 19:52:31 EDT
Something like this is needed, and not only for mac os x; both
hpux and aix have other than *.so markers for shared libraries

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 03:13:54 EDT
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}.*
%define __sover    *.%{__soext}

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 18:14:27 EDT
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.