[opensuse-packaging] Shared Library Policy
I was packaging a library in the build service, trying out the shared
library policy found here:
http://en.opensuse.org/Packaging/Shared_Library_Packaging_Policy
Some thoughts:
1) The "simple" example at the end does not take into account where %doc
files should go (AUTHORS, COPYING, README) etc.
Suggestion is we say this goes into the lib<whatever><major> package
number. Except I just ran into a case where the package had two
different .so names
2) No reference to .la files
Do we finally want to kill those as a matter of policy? If so, should we
write a macro to do it?
3) Separation of soname number from library name
We could always put the dash in for more consistency ie libz-1 instead
of libz1 so when the library name ends in a number its libwhatever2-7
and its easier for humans to parse (probably).
As well libssl is a horrible example to use because it does not follow
proper .so naming, it always reflects the version number rather than
incrementing based on ABI compatability
I'll update the wiki if we can agree on any changes.
-JP
--
JP Rosevear
On Aug 21 2007 16:27, JP Rosevear wrote:
3) Separation of soname number from library name
We could always put the dash in for more consistency ie libz-1 instead of libz1 so when the library name ends in a number its libwhatever2-7 and its easier for humans to parse (probably).
dbus-1-1.0.0-7. So many dashes. I'd even expect some people's tiny scripts breaking if they incorrectly parse numbers from left-to-right. Also, SUSE has had qt3-3.3.7-16, and not qt-3-3.3.7-16 so far :-) I am all for reducing dashes where possible. Jan -- --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
Hi, On Tue, 21 Aug 2007, JP Rosevear wrote:
1) The "simple" example at the end does not take into account where %doc files should go (AUTHORS, COPYING, README) etc.
Suggestion is we say this goes into the lib<whatever><major> package number.
Not if it would generate a file conflict between README of libbla3 and libbla4. The main theme for the whole policy is about packaging shared libraries. It does also provide some best practices, but in general it isn't concerned about where to package documentation. It can be either in the main package (bla), a special docu package (bla-doc), in the -devel package (libbla-devel), or somewhere else. If properly versioned it can theoretically also be placed into the libbla3 packages (e.g. under /usr/share/doc/libbla3/README), but for fear of people getting this wrong (namely placing the files into .../libbla/) I would not mention that in the policy. Currently the policy is quite simple: a libbla<number> rpm contains exactly lib*.so.* files, nothing else. There are already exceptions for this, and exception (3) would also apply to assorted documentation files, so I don't see a pressing need to say something explicit about them.
Except I just ran into a case where the package had two different .so names
Split the lib package so that each provides just one library (preferred). Otherwise both libs have to come together from upstream (same tarball for instance, or same CVS module). Then that collection presumably has a name and a version. You can use that as basename and number for the lib package. I would not do that except if they are bound together very tightly, and the version number is increased if one of the sonames is touched.
2) No reference to .la files
Do we finally want to kill those as a matter of policy? If so, should we write a macro to do it?
I read this about *.la files in the policy: Package Contents * Files needed to develop programs using shared libraries contained in lib$NAME$NUM.rpm are packaged in a -devel package (see (4a) and (4b) for cases that need to version this package). Those files include lib*.so, lib*.la and all headers. ... ... Best Practices ... - Avoid packaging libtool config files (.la files). In general they are not needed if you do not package a static library. If in doubt, ask. So, avoid them if you can (and want to do the work involved). If you don't, then package them into the -devel package. There are very peculiar reasons why sometimes .la files have to be in the libbla3 packages, but that's dealt with in exception (3).
3) Separation of soname number from library name
We could always put the dash in for more consistency ie libz-1 instead of libz1 so when the library name ends in a number its libwhatever2-7 and its easier for humans to parse (probably).
I find it easier without the dash actually. But that argument is all about aesthetics, so not a very good one. A better one is perhaps that we have already about 170 lib packages following the policy and most of them are written without the dash (when they can).
As well libssl is a horrible example to use because it does not follow proper .so naming, it always reflects the version number rather than incrementing based on ABI compatability
Have a better example? That example is supposed to show what needs to happen if the soname doesn't contain only one number, but several ones (i.e. to show the need for underscores). I fear all other examples doing that have an equally horrifying "scheme" of dealing with so-versions :-) Ciao, Michael. --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
On Tuesday, 21. August 2007, JP Rosevear wrote:
1) The "simple" example at the end does not take into account where %doc files should go (AUTHORS, COPYING, README) etc.
not into the library package, no.
2) No reference to .la files Do we finally want to kill those as a matter of policy? If so, should we write a macro to do it?
There is a build and a rpmlint check to discover unneccessary .la files, you can kill those. In general killing them is bad is it breaks static linking. Greetings, Dirk -- RPMLINT information under http://en.opensuse.org/Packaging/RpmLint --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
On Wed, 22 Aug 2007, Dirk Mueller wrote:
On Tuesday, 21. August 2007, JP Rosevear wrote:
2) No reference to .la files Do we finally want to kill those as a matter of policy? If so, should we write a macro to do it?
There is a build and a rpmlint check to discover unneccessary .la files, you can kill those. In general killing them is bad is it breaks static linking.
Though in general we do not want to ship static libraries, so .la files without a static library should be avoided. Richard. --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
On Wednesday, 22. August 2007, Richard Guenther wrote:
Though in general we do not want to ship static libraries, so .la files without a static library should be avoided.
its imho fine shipping them in the -devel subpackage *if* its not a security relevant package. Greetings, Dirk -- RPMLINT information under http://en.opensuse.org/Packaging/RpmLint --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
On Wed, 22 Aug 2007, Dirk Mueller wrote:
On Wednesday, 22. August 2007, Richard Guenther wrote:
Though in general we do not want to ship static libraries, so .la files without a static library should be avoided.
its imho fine shipping them in the -devel subpackage *if* its not a security relevant package.
Well "fine" as in if it doesn't only uselessly waste space. And which packages are _not_ security relevant... So as a rule of thumb don't package static libs unless the lib is a base library written in C (that is, it doesn't require other static libs to link a program static). Like for example I have on my 10.2 system static boost libraries installed which is pointless. Current stable has 959 static libs in /usr/lib including "interesting" stuff like libxml++-2.6.a. All in all 320MB worth of static libs. Ugh. Richard. --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
On Wednesday, 22. August 2007, Richard Guenther wrote:
Like for example I have on my 10.2 system static boost libraries installed which is pointless.
boost breaks every so often, its okay to link it statically for special purposes. Speaking generally. and the static libs are only in the -devel subpackage, which a normal user doesn`t have installed. of course it would be nicer if libzypp would only have a libboost_filesystem instead of dragging in all of boost, but given that I removed the 10MB regex dependency, its your job to file a bugreport about splitting boost ;) Greetings, Dirk -- RPMLINT information under http://en.opensuse.org/Packaging/RpmLint --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
On Wednesday, 22. August 2007, Richard Guenther wrote:
which is pointless. Current stable has 959 static libs in /usr/lib including "interesting" stuff like libxml++-2.6.a. All in all 320MB worth of static libs. Ugh.
sorry, forgot to followup: all of those are -devel subpackages, or should be if they`re not already. The only thing that matters is if its statically linked in any binary that we ship. I have some tools to dig that up, and its surprising how many deep sqlite copies we have (being in one package, not statically linked from the system package). It would be a lot better overall to work on that instead, because it makes maintenance easier, reduces the size of the distribution overall and actually has some benefit for users (aka those that are not developers). currently I don`t have rpmlint integration for the code duplication checker but I guess that would be a very nice feature to have to be able to point out easily which packages are broken. Greetings, Dirk -- RPMLINT information under http://en.opensuse.org/Packaging/RpmLint --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
Richard Guenther escribió:
Like for example I have on my 10.2 system static boost libraries installed which is pointless. Current stable has 959 static libs in /usr/lib including "interesting" stuff like libxml++-2.6.a. All in all 320MB worth of static libs. Ugh.
what you think about attempting something similar to this or the next version ? 1. determine what packages need static libraries 2. those needed static libraries are then packaged in an -static subpackage that requires -devel 3. otherwise, blacklist ( or give them a Badness : N ) in the rpmlint check. too much work maybe ;) -- WARNING: This bug is visible only to employees, You are allowed to be mad at them. --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
* Richard Guenther (rguenther@suse.de) [20070822 13:58]:
Like for example I have on my 10.2 system static boost libraries installed which is pointless.
Yep, and in 10.3 it'll still be so :( But the 1.34.1 which I'll check in after 10.3 goes GA will not have the static libs anymore. Philipp --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
On středa 22 srpen 2007, Dirk Mueller wrote:
On Tuesday, 21. August 2007, JP Rosevear wrote:
1) The "simple" example at the end does not take into account where %doc files should go (AUTHORS, COPYING, README) etc.
not into the library package, no.
Why not? These files would go into /usr/share/doc/<packname>. There should not be any conflict as long as there is no conflict in package names. IMHO having these files installed even if the library was pulled in by dependencies makes sense. Vladimir --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
On 22-08-2007 at 16:53, Vladimir Nadvornik
wrote: On středa 22 srpen 2007, Dirk Mueller wrote: On Tuesday, 21. August 2007, JP Rosevear wrote: 1) The "simple" example at the end does not take into account where %doc files should go (AUTHORS, COPYING, README) etc. not into the library package, no.
Why not?
These files would go into /usr/share/doc/<packname>. There should not be any conflict as long as there is no conflict in package names.
IMHO having these files installed even if the library was pulled in by dependencies makes sense.
I think so too, partially. Even the distribution of only the library underlies the GPL (in case the GPL is selected license) and having that file as %doc should not hurt (ok, space on the disk excluded) The readme, imho, is a bit trickier, as in many cases they contain not really information for the end user, but more for the packager / library builder or for developers. So having a readme in the libbla does not make to much sense. They will probably more go in a corresponding -devel package then. Dominique TMF is a global management and accounting outsourcing firm with 72 offices in 56 countries and over 2,000 professionals (2007). TMF is expanding rapidly throughout the world. Learn more about our unique network and our services and visit our website at www.tmf-group.com. The information contained in this e-mail communication is confidential and solely intended for the person to whom it is addressed. If someone other than the intended recipient should receive or come into possession of this e-mail communication, he/she will not be entitled to read, disseminate, disclose or duplicate it. If you are not the intended recipient, you are requested to notify the sender and to destroy the original e-mail communication. TMF is neither liable for the correct and complete transmission of the information contained in this e-mail communication nor for any delay in its receipt. This footnote also confirms that this email message has been checked for the presence of computer viruses. --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
On Wed, 22 Aug 2007, Vladimir Nadvornik wrote:
On st?eda 22 srpen 2007, Dirk Mueller wrote:
On Tuesday, 21. August 2007, JP Rosevear wrote:
1) The "simple" example at the end does not take into account where %doc files should go (AUTHORS, COPYING, README) etc.
not into the library package, no.
Why not?
These files would go into /usr/share/doc/<packname>. There should not be any conflict as long as there is no conflict in package names.
IMHO having these files installed even if the library was pulled in by dependencies makes sense.
It depends. At least we are very inconsistent here, both with respect
to licenses and other stuff. (At least Debian duplicates a set of
standard files including the license and the package changelog in every
sub-package)
Richard.
--
Richard Guenther
On Wednesday, 22. August 2007, Vladimir Nadvornik wrote:
not into the library package, no. Why not?
These files would go into /usr/share/doc/<packname>. There should not be any conflict as long as there is no conflict in package names.
where <packname> is the one following shared library policy? I guess thats okay, given that they cannot conflict. we probably even have to add the LICENSE file for legal reasons even. In general I would prefer library packages to be as small as possible, especially if they cannot be avoided. For example right now we have boost installed because of libzypp, and boost is not properly splitted. libzypp only requires boost_filesystem (a 71kb library), but the boost package itself is over 2MB. This 35:1 ratio isn't quite nice. Greetings, Dirk -- RPMLINT information under http://en.opensuse.org/Packaging/RpmLint --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
On Aug 22 2007 20:45, Dirk Mueller wrote:
In general I would prefer library packages to be as small as possible, especially if they cannot be avoided. For example right now we have boost installed because of libzypp, and boost is not properly splitted. libzypp only requires boost_filesystem (a 71kb library), but the boost package itself is over 2MB. This 35:1 ratio isn't quite nice.
On the other hand, you have to take into account the extra rpm db space needed by another package. Might be tiny, but as I just upgraded some 10.3alpha to today's snapshot, new packages like ConsoleKit drippled in and I ought to ask: what for does PolicyKit and ConsoleKit need to be split from hal.rpm if hal has a hard dependency on them? --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
participants (9)
-
Cristian Rodriguez
-
Dirk Mueller
-
Dominique Leuenberger
-
Jan Engelhardt
-
JP Rosevear
-
Michael Matz
-
Philipp Thomas
-
Richard Guenther
-
Vladimir Nadvornik