Bug 133389

Summary: RFE: add __soext macro
Product: [Fedora] Fedora Reporter: Anders F Björklund <afb>
Component: rpmAssignee: Paul Nasrat <nobody+pnasrat>
Status: CLOSED UPSTREAM QA Contact: Mike McLean <mikem>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: nobody+pnasrat
Target Milestone: ---Keywords: FutureFeature
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-10-25 22:14:27 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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.