[opensuse-packaging] lib prefix considered harmful
Hi all, I would like to point to quite common anti-pattern when packaging shared libraries. It is great that most of people are aware about our Shared Library Policy[1]. However it is written in some confusing way, where some people (and I made it as well) think it mandate the name of **source** package. It does not, because noone wants to change source package name on each SONAME bump. For source package name there is a naming policy [2], which says package name should be according upstream project or tarball name (there are exceptions for python, perl, ruby, go, ... stuff). And it is legal to omit the %files section for source package (but not for subpackage). Therefor I have fixed and extended the zlib example[3], which should make that more clear. Source package name is zlib, because that is how both upstream and tarballs are named. But shared library package is libz1 according SONAME, where devel files are in zlib-devel. The name libz-devel might be acceptable as well, but it is confusing to me. But as long as pkgconfig(zlib) is the prefered form, the name of devel package is less important nowadays. [1] http://en.opensuse.org/openSUSE:Shared_library_packaging_policy [2] http://en.opensuse.org/openSUSE:Package_naming_guidelines#General_Naming [3] http://en.opensuse.org/openSUSE:Shared_library_packaging_policy#Examples Any objections? Regards Michal Vyskocil
Michal Vyskocil <mvyskocil@suse.cz> writes:
And it is legal to omit the %files section for source package (but not for subpackage).
Even for a subpackage, in case it is needed only conditionally. Andreas. -- Andreas Schwab, SUSE Labs, schwab@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different." -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
On Tue, Nov 26, 2013 at 10:36:36AM +0100, Andreas Schwab wrote:
Michal Vyskocil <mvyskocil@suse.cz> writes:
And it is legal to omit the %files section for source package (but not for subpackage).
Even for a subpackage, in case it is needed only conditionally.
Did not know that, thanks! Regards Michal Vyskocil
Andreas.
-- Andreas Schwab, SUSE Labs, schwab@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different." -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
On Tuesday 2013-11-26 10:08, Michal Vyskocil wrote:
I would like to point to quite common anti-pattern when packaging shared libraries. It is great that most of people are aware about our Shared Library Policy[1]. However it is written in some confusing way, where some people (and I made it as well) think it mandate the name of **source** package.
The omission of a statement "this applies to a subpackage, not the source package" produces a certain ambiguity (and that should be fixed - thanks that you take the time), but other than that, is it really "confusing"? -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
On Tuesday 26 November 2013 10:08:02 Michal Vyskocil wrote:
Hi all,
I would like to point to quite common anti-pattern when packaging shared libraries. It is great that most of people are aware about our Shared Library Policy[1]. However it is written in some confusing way, where some people (and I made it as well) think it mandate the name of **source** package.
It does not, because noone wants to change source package name on each SONAME bump. For source package name there is a naming policy [2], which says package name should be according upstream project or tarball name (there are exceptions for python, perl, ruby, go, ... stuff). And it is legal to omit the %files section for source package (but not for subpackage).
Therefor I have fixed and extended the zlib example[3], which should make that more clear. Source package name is zlib, because that is how both upstream and tarballs are named. But shared library package is libz1 according SONAME, where devel files are in zlib-devel. The name libz-devel might be acceptable as well, but it is confusing to me. But as long as pkgconfig(zlib) is the prefered form, the name of devel package is less important nowadays.
[1] http://en.opensuse.org/openSUSE:Shared_library_packaging_policy [2] http://en.opensuse.org/openSUSE:Package_naming_guidelines#General_Naming [3] http://en.opensuse.org/openSUSE:Shared_library_packaging_policy#Examples
Any objections? Nope,
thank you Michal for addressing this in the documentation. I think it now better matches what we have been recommending to packagers in the past anyway. Just stating the obvious, we have plenty of those in Factory and I don't think we'll enforce they have to be fixed with the next submit. It will only be a requirement for new packages. -- With kind regards, Sascha Peilicke SUSE Linux GmbH, Maxfeldstr. 5, D-90409 Nuernberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer HRB 16746 (AG Nürnberg)
Michal Vyskocil wrote:
Therefor I have fixed and extended the zlib example[3], which should make that more clear. Source package name is zlib, because that is how both upstream and tarballs are named. But shared library package is libz1 according SONAME, where devel files are in zlib-devel. The name libz-devel might be acceptable as well, but it is confusing to me. But as long as pkgconfig(zlib) is the prefered form, the name of devel package is less important nowadays.
Less important for the build system maybe. I still have a hard time getting used to things like libSDL-devel or worse libopenssl-devel when there isn't even a libopenssl. So I agree, it feels counter intuitive to me too. Naming devel packages according to the shared library only makes sense if the package contains multiple independent shared libraries that have distinct header files. So IMO "%package devel" should be preferred over "%package -n $something-devel"
[1] http://en.opensuse.org/openSUSE:Shared_library_packaging_policy [2] http://en.opensuse.org/openSUSE:Package_naming_guidelines#General_Naming [3] http://en.opensuse.org/openSUSE:Shared_library_packaging_policy#Examples
Any objections?
+1 cu Ludwig -- (o_ Ludwig Nussel //\ V_/_ http://www.suse.de/ SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg) -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
On Fri, Nov 29, 2013 at 09:00:30AM +0100, Ludwig Nussel wrote:
Michal Vyskocil wrote:
Therefor I have fixed and extended the zlib example[3], which should make that more clear. Source package name is zlib, because that is how both upstream and tarballs are named. But shared library package is libz1 according SONAME, where devel files are in zlib-devel. The name libz-devel might be acceptable as well, but it is confusing to me. But as long as pkgconfig(zlib) is the prefered form, the name of devel package is less important nowadays.
Less important for the build system maybe. I still have a hard time getting used to things like libSDL-devel or worse libopenssl-devel when there isn't even a libopenssl. So I agree, it feels counter
or libqt4 - unfortunatelly I did not catch up libqt5 :-/
intuitive to me too. Naming devel packages according to the shared library only makes sense if the package contains multiple independent shared libraries that have distinct header files. So IMO "%package devel" should be preferred over "%package -n $something-devel"
ack from me - in that case, can you update a wiki page? IOW remove the libz-devel and most prefferably to add an another example, where devel package should be named according shared library? Regards Michal Vyskocil
[1] http://en.opensuse.org/openSUSE:Shared_library_packaging_policy [2] http://en.opensuse.org/openSUSE:Package_naming_guidelines#General_Naming [3] http://en.opensuse.org/openSUSE:Shared_library_packaging_policy#Examples
Any objections?
+1
cu Ludwig
-- (o_ Ludwig Nussel //\ V_/_ http://www.suse.de/ SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg) -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
participants (5)
-
Andreas Schwab
-
Jan Engelhardt
-
Ludwig Nussel
-
Michal Vyskocil
-
Sascha Peilicke