[csw-devel] SF.net SVN: gar:[16784] csw/mgar/pkg/opencsw-policy/trunk
wahwah at users.sourceforge.net
wahwah at users.sourceforge.net
Tue Jan 17 01:02:37 CET 2012
Revision: 16784
http://gar.svn.sourceforge.net/gar/?rev=16784&view=rev
Author: wahwah
Date: 2012-01-17 00:02:37 +0000 (Tue, 17 Jan 2012)
Log Message:
-----------
opencsw-policy/trunk: a sphinx version
Modified Paths:
--------------
csw/mgar/pkg/opencsw-policy/trunk/Makefile
Added Paths:
-----------
csw/mgar/pkg/opencsw-policy/trunk/files/Makefile
csw/mgar/pkg/opencsw-policy/trunk/files/conf.py
csw/mgar/pkg/opencsw-policy/trunk/files/filesystem-layout.rst
csw/mgar/pkg/opencsw-policy/trunk/files/index.rst
csw/mgar/pkg/opencsw-policy/trunk/files/shared-libraries.rst
Removed Paths:
-------------
csw/mgar/pkg/opencsw-policy/trunk/files/index.txt
Modified: csw/mgar/pkg/opencsw-policy/trunk/Makefile
===================================================================
--- csw/mgar/pkg/opencsw-policy/trunk/Makefile 2012-01-16 22:00:22 UTC (rev 16783)
+++ csw/mgar/pkg/opencsw-policy/trunk/Makefile 2012-01-17 00:02:37 UTC (rev 16784)
@@ -19,28 +19,31 @@
CATALOGNAME_CSWopencsw-policy = opencsw_policy
LICENSE = fdl-1.3.txt
-BUILD_DEP_PKGS = CSWasciidoc
+BUILD_DEP_PKGS += CSWpy-sphinx
+BUILD_DEP_PKGS += CSWrsync
+BUILD_DEP_PKGS += CSWpysetuptools
include gar/category.mk
-%.html: %.txt
- asciidoc -o $@ $<
+post-extract-modulated:
+ rsync -r $(FILEDIR)/ $(WORKSRC)
+ @$(MAKECOOKIE)
-build-policy: \
- copy-asciidoc \
- $(WORKSRC)/index.html
+build-policy:
+ (cd $(WORKSRC); gmake html)
-copy-asciidoc:
- gcp -v $(FILEDIR)/*.txt $(WORKSRC)
-
install-policy:
ginstall -m 755 -d $(PKGROOT)$(docdir)/$(CATALOGNAME_CSWopencsw-policy)
- for f in $(WORKSRC)/*.html $(WORKSRC)/*.txt; do \
- ginstall $${f} $(PKGROOT)$(docdir)/$(CATALOGNAME_CSWopencsw-policy); \
- done
+ rsync -rv $(WORKSRC)/_build/html/ $(PKGROOT)$(docdir)/$(CATALOGNAME_CSWopencsw-policy)
@$(MAKECOOKIE)
-post-merge:
+post-install-modulated: copy-to-web
+ @$(MAKECOOKIE)
+
+copy-to-web: $(PKGROOT)$(docdir)/$(CATALOGNAME_CSWopencsw-policy)/index.html
if [ -d $(HOME)/public_html/policy ]; then \
- cp $(PKGROOT)/opt/csw/share/doc/opencsw_policy/index.html $(HOME)/public_html/policy; \
+ rsync -r $(PKGROOT)$(docdir)/$(CATALOGNAME_CSWopencsw-policy)/ \
+ $(HOME)/public_html/policy; \
fi
+
+.PHONY: copy-to-web
Added: csw/mgar/pkg/opencsw-policy/trunk/files/Makefile
===================================================================
--- csw/mgar/pkg/opencsw-policy/trunk/files/Makefile (rev 0)
+++ csw/mgar/pkg/opencsw-policy/trunk/files/Makefile 2012-01-17 00:02:37 UTC (rev 16784)
@@ -0,0 +1,130 @@
+# Makefile for Sphinx documentation
+#
+
+# You can set these variables from the command line.
+SPHINXOPTS =
+SPHINXBUILD = sphinx-build
+PAPER =
+BUILDDIR = _build
+
+# Internal variables.
+PAPEROPT_a4 = -D latex_paper_size=a4
+PAPEROPT_letter = -D latex_paper_size=letter
+ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
+
+.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest
+
+help:
+ @echo "Please use \`make <target>' where <target> is one of"
+ @echo " html to make standalone HTML files"
+ @echo " dirhtml to make HTML files named index.html in directories"
+ @echo " singlehtml to make a single large HTML file"
+ @echo " pickle to make pickle files"
+ @echo " json to make JSON files"
+ @echo " htmlhelp to make HTML files and a HTML help project"
+ @echo " qthelp to make HTML files and a qthelp project"
+ @echo " devhelp to make HTML files and a Devhelp project"
+ @echo " epub to make an epub"
+ @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
+ @echo " latexpdf to make LaTeX files and run them through pdflatex"
+ @echo " text to make text files"
+ @echo " man to make manual pages"
+ @echo " changes to make an overview of all changed/added/deprecated items"
+ @echo " linkcheck to check all external links for integrity"
+ @echo " doctest to run all doctests embedded in the documentation (if enabled)"
+
+clean:
+ -rm -rf $(BUILDDIR)/*
+
+html:
+ $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
+ @echo
+ @echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
+
+dirhtml:
+ $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
+ @echo
+ @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
+
+singlehtml:
+ $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
+ @echo
+ @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
+
+pickle:
+ $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
+ @echo
+ @echo "Build finished; now you can process the pickle files."
+
+json:
+ $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
+ @echo
+ @echo "Build finished; now you can process the JSON files."
+
+htmlhelp:
+ $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
+ @echo
+ @echo "Build finished; now you can run HTML Help Workshop with the" \
+ ".hhp project file in $(BUILDDIR)/htmlhelp."
+
+qthelp:
+ $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
+ @echo
+ @echo "Build finished; now you can run "qcollectiongenerator" with the" \
+ ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
+ @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/OpenCSW.qhcp"
+ @echo "To view the help file:"
+ @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/OpenCSW.qhc"
+
+devhelp:
+ $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
+ @echo
+ @echo "Build finished."
+ @echo "To view the help file:"
+ @echo "# mkdir -p $$HOME/.local/share/devhelp/OpenCSW"
+ @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/OpenCSW"
+ @echo "# devhelp"
+
+epub:
+ $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
+ @echo
+ @echo "Build finished. The epub file is in $(BUILDDIR)/epub."
+
+latex:
+ $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+ @echo
+ @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
+ @echo "Run \`make' in that directory to run these through (pdf)latex" \
+ "(use \`make latexpdf' here to do that automatically)."
+
+latexpdf:
+ $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+ @echo "Running LaTeX files through pdflatex..."
+ make -C $(BUILDDIR)/latex all-pdf
+ @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
+
+text:
+ $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
+ @echo
+ @echo "Build finished. The text files are in $(BUILDDIR)/text."
+
+man:
+ $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
+ @echo
+ @echo "Build finished. The manual pages are in $(BUILDDIR)/man."
+
+changes:
+ $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
+ @echo
+ @echo "The overview file is in $(BUILDDIR)/changes."
+
+linkcheck:
+ $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
+ @echo
+ @echo "Link check complete; look for any errors in the above output " \
+ "or in $(BUILDDIR)/linkcheck/output.txt."
+
+doctest:
+ $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
+ @echo "Testing of doctests in the sources finished, look at the " \
+ "results in $(BUILDDIR)/doctest/output.txt."
Added: csw/mgar/pkg/opencsw-policy/trunk/files/conf.py
===================================================================
--- csw/mgar/pkg/opencsw-policy/trunk/files/conf.py (rev 0)
+++ csw/mgar/pkg/opencsw-policy/trunk/files/conf.py 2012-01-17 00:02:37 UTC (rev 16784)
@@ -0,0 +1,263 @@
+# -*- coding: utf-8 -*-
+#
+# OpenCSW documentation build configuration file, created by
+# sphinx-quickstart on Mon Mar 21 23:48:09 2011.
+#
+# This file is execfile()d with the current directory set to its containing dir.
+#
+# Note that not all possible configuration values are present in this
+# autogenerated file.
+#
+# All configuration values have a default; values that are commented out
+# serve to show the default.
+
+import sys, os
+
+# If extensions (or modules to document with autodoc) are in another directory,
+# add these directories to sys.path here. If the directory is relative to the
+# documentation root, use os.path.abspath to make it absolute, like shown here.
+#sys.path.insert(0, os.path.abspath('.'))
+
+# -- General configuration -----------------------------------------------------
+
+# If your documentation needs a minimal Sphinx version, state it here.
+#needs_sphinx = '1.0'
+
+# Add any Sphinx extension module names here, as strings. They can be extensions
+# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
+extensions = ['sphinx.ext.pngmath']
+
+# Add any paths that contain templates here, relative to this directory.
+templates_path = ['_templates']
+
+# The suffix of source filenames.
+source_suffix = '.rst'
+
+# The encoding of source files.
+#source_encoding = 'utf-8-sig'
+
+# The master toctree document.
+master_doc = 'index'
+
+# General information about the project.
+project = u'OpenCSW'
+copyright = u'2012, OpenCSW'
+
+# The version info for the project you're documenting, acts as replacement for
+# |version| and |release|, also used in various other places throughout the
+# built documents.
+#
+# The short X.Y version.
+version = '1.0'
+# The full version, including alpha/beta/rc tags.
+release = '1.0'
+
+# The language for content autogenerated by Sphinx. Refer to documentation
+# for a list of supported languages.
+#language = None
+
+# There are two options for replacing |today|: either, you set today to some
+# non-false value, then it is used:
+#today = ''
+# Else, today_fmt is used as the format for a strftime call.
+#today_fmt = '%B %d, %Y'
+
+# List of patterns, relative to source directory, that match files and
+# directories to ignore when looking for source files.
+exclude_patterns = ['_build']
+
+# The reST default role (used for this markup: `text`) to use for all documents.
+#default_role = None
+
+# If true, '()' will be appended to :func: etc. cross-reference text.
+#add_function_parentheses = True
+
+# If true, the current module name will be prepended to all description
+# unit titles (such as .. function::).
+#add_module_names = True
+
+# If true, sectionauthor and moduleauthor directives will be shown in the
+# output. They are ignored by default.
+#show_authors = False
+
+# The name of the Pygments (syntax highlighting) style to use.
+pygments_style = 'sphinx'
+
+# A list of ignored prefixes for module index sorting.
+#modindex_common_prefix = []
+
+
+# -- Options for HTML output ---------------------------------------------------
+
+# The theme to use for HTML and HTML Help pages. See the documentation for
+# a list of builtin themes.
+html_theme = 'default'
+# html_theme = 'traditional'
+# html_theme = 'haiku'
+# html_theme = 'scrolls'
+# html_theme = 'agogo'
+
+# Theme options are theme-specific and customize the look and feel of a theme
+# further. For a list of options available for each theme, see the
+# documentation.
+#html_theme_options = {}
+html_theme_options = {
+ # "rightsidebar": "true",
+}
+
+# Add any paths that contain custom themes here, relative to this directory.
+#html_theme_path = []
+
+# The name for this set of Sphinx documents. If None, it defaults to
+# "<project> v<release> documentation".
+#html_title = None
+
+# A shorter title for the navigation bar. Default is the same as html_title.
+#html_short_title = None
+
+# The name of an image file (relative to this directory) to place at the top
+# of the sidebar.
+#html_logo = None
+
+# The name of an image file (within the static path) to use as favicon of the
+# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
+# pixels large.
+#html_favicon = None
+
+# Add any paths that contain custom static files (such as style sheets) here,
+# relative to this directory. They are copied after the builtin static files,
+# so a file named "default.css" will overwrite the builtin "default.css".
+html_static_path = ['_static']
+
+# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
+# using the given strftime format.
+#html_last_updated_fmt = '%b %d, %Y'
+
+# If true, SmartyPants will be used to convert quotes and dashes to
+# typographically correct entities.
+#html_use_smartypants = True
+
+# Custom sidebar templates, maps document names to template names.
+#html_sidebars = {}
+
+# Additional templates that should be rendered to pages, maps page names to
+# template names.
+#html_additional_pages = {}
+
+# If false, no module index is generated.
+#html_domain_indices = True
+
+# If false, no index is generated.
+#html_use_index = True
+
+# If true, the index is split into individual pages for each letter.
+#html_split_index = False
+
+# If true, links to the reST sources are added to the pages.
+#html_show_sourcelink = True
+
+# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
+#html_show_sphinx = True
+
+# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
+#html_show_copyright = True
+
+# If true, an OpenSearch description file will be output, and all pages will
+# contain a <link> tag referring to it. The value of this option must be the
+# base URL from which the finished HTML is served.
+#html_use_opensearch = ''
+
+# This is the file name suffix for HTML files (e.g. ".xhtml").
+#html_file_suffix = None
+
+# Output file base name for HTML help builder.
+htmlhelp_basename = 'OpenCSWdoc'
+
+
+# -- Options for LaTeX output --------------------------------------------------
+
+# The paper size ('letter' or 'a4').
+#latex_paper_size = 'letter'
+
+# The font size ('10pt', '11pt' or '12pt').
+#latex_font_size = '10pt'
+
+# Grouping the document tree into LaTeX files. List of tuples
+# (source start file, target name, title, author, documentclass [howto/manual]).
+latex_documents = [
+ ('index', 'OpenCSW.tex', u'OpenCSW Documentation',
+ u'OpenCSW', 'manual'),
+]
+
+# The name of an image file (relative to this directory) to place at the top of
+# the title page.
+#latex_logo = None
+
+# For "manual" documents, if this is true, then toplevel headings are parts,
+# not chapters.
+#latex_use_parts = False
+
+# If true, show page references after internal links.
+#latex_show_pagerefs = False
+
+# If true, show URL addresses after external links.
+#latex_show_urls = False
+
+# Additional stuff for the LaTeX preamble.
+#latex_preamble = ''
+
+# Documents to append as an appendix to all manuals.
+#latex_appendices = []
+
+# If false, no module index is generated.
+#latex_domain_indices = True
+
+
+# -- Options for manual page output --------------------------------------------
+
+# One entry per manual page. List of tuples
+# (source start file, name, description, authors, manual section).
+man_pages = [
+ ('index', 'opencsw', u'OpenCSW Documentation',
+ [u'OpenCSW'], 1)
+]
+
+
+# -- Options for Epub output ---------------------------------------------------
+
+# Bibliographic Dublin Core info.
+epub_title = u'OpenCSW'
+epub_author = u'OpenCSW'
+epub_publisher = u'OpenCSW'
+epub_copyright = u'2012, OpenCSW'
+
+# The language of the text. It defaults to the language option
+# or en if the language is not set.
+#epub_language = ''
+
+# The scheme of the identifier. Typical schemes are ISBN or URL.
+#epub_scheme = ''
+
+# The unique identifier of the text. This can be a ISBN number
+# or the project homepage.
+#epub_identifier = ''
+
+# A unique identification for the text.
+#epub_uid = ''
+
+# HTML files that should be inserted before the pages created by sphinx.
+# The format is a list of tuples containing the path and title.
+#epub_pre_files = []
+
+# HTML files shat should be inserted after the pages created by sphinx.
+# The format is a list of tuples containing the path and title.
+#epub_post_files = []
+
+# A list of files that should not be packed into the epub file.
+#epub_exclude_files = []
+
+# The depth of the table of contents in toc.ncx.
+#epub_tocdepth = 3
+
+# Allow duplicate toc entries.
+#epub_tocdup = True
Added: csw/mgar/pkg/opencsw-policy/trunk/files/filesystem-layout.rst
===================================================================
--- csw/mgar/pkg/opencsw-policy/trunk/files/filesystem-layout.rst (rev 0)
+++ csw/mgar/pkg/opencsw-policy/trunk/files/filesystem-layout.rst 2012-01-17 00:02:37 UTC (rev 16784)
@@ -0,0 +1,17 @@
+OpenCSW filesystem layout
+=========================
+
+.. contents::
+
+.. highlight:: text
+
+Introduction
+------------
+
+OpenCSW installs over an already installed Solaris system, and follows
+the general rule of not conflicting with existing Solaris files.
+
+* /opt/csw
+* /etc/opt/csw
+* /var/opt/csw
+
Added: csw/mgar/pkg/opencsw-policy/trunk/files/index.rst
===================================================================
--- csw/mgar/pkg/opencsw-policy/trunk/files/index.rst (rev 0)
+++ csw/mgar/pkg/opencsw-policy/trunk/files/index.rst 2012-01-17 00:02:37 UTC (rev 16784)
@@ -0,0 +1,23 @@
+.. OpenCSW documentation master file, created by
+ sphinx-quickstart on Mon Mar 21 23:48:09 2011.
+ You can adapt this file completely to your liking, but it should at least
+ contain the root `toctree` directive.
+
+Welcome to OpenCSW's documentation!
+===================================
+
+Contents:
+
+.. toctree::
+ :maxdepth: 2
+
+ filesystem-layout.rst
+ shared-libraries.rst
+
+.. Indices and tables
+ ==================
+ * :ref:`genindex`
+ * :ref:`modindex`
+ * :ref:`search`
+
+
Deleted: csw/mgar/pkg/opencsw-policy/trunk/files/index.txt
===================================================================
--- csw/mgar/pkg/opencsw-policy/trunk/files/index.txt 2012-01-16 22:00:22 UTC (rev 16783)
+++ csw/mgar/pkg/opencsw-policy/trunk/files/index.txt 2012-01-17 00:02:37 UTC (rev 16784)
@@ -1,7 +0,0 @@
-OpenCSW packaging policy
-========================
-$Id: Makefile 11888 2010-12-12 12:43:48Z skayser $
-:toc:
-:website: http://www.opencsw.org
-
-:leveloffset: 1
Added: csw/mgar/pkg/opencsw-policy/trunk/files/shared-libraries.rst
===================================================================
--- csw/mgar/pkg/opencsw-policy/trunk/files/shared-libraries.rst (rev 0)
+++ csw/mgar/pkg/opencsw-policy/trunk/files/shared-libraries.rst 2012-01-17 00:02:37 UTC (rev 16784)
@@ -0,0 +1,300 @@
+Shared libraries
+================
+
+Background
+----------
+
+Some packages are providing shared libraries. When binaries start
+linking to them, the updates to packages with shared libraries must be
+done in a way that doesn't break existing binaries.
+
+Life cycle of a shared library can be summarized in the following way:
+
+1. A SONAME appears
+2. We decide to distribute it
+3. Binaries start linking to it
+4. Time passes, new version of the same library comes along
+5. Binaries stop linking to it
+6. SONAME goes away
+
+Historically, shared libraries were packaged either together with base
+packages, or split off to their own packages. However, once updated
+shared libraries became available upstream, updated packages included
+both old and new versions of shared libraries. This required package
+builds to download and compile multiple versions of the same project.
+Notable examples are curl and neon libraries, where CSWcurlrt contained
+all three libcurl.so.2, libcurl.so.3 and libcurl.so.4.
+
+Phasing out of shared libraries was difficult. To phase out a shared
+library, it is required to verify that no binaries link to it. All
+dependent packages need to be recompiled against the newest version of
+the library, and once this is done, old versions can be removed.
+However, even when all dependent packages are already recompiled against
+libcurl.so.4, there are no useful indicators that libcurl.so.2 is no
+longer linked to. To verify this, all dependent packages have to be
+unpacked, and examined using /usr/ccs/bin/dump that the no longer list
+libcurl.so.2 in their NEEDED field.
+
+Once the detection problem is solved, removing the old version of
+a library is not as simple as it could be; The whole CSWcurlrt has to be
+rebuilt and re-released in a new version which no longer includes
+libcurl.so.2.
+
+Goals
+-----
+
+* Simplification of handling of shared library life cycles
+* Allowing to determine whether a specific shared library is no longer
+ linked to, by looking at package dependencies (This avoids potential
+ problem of our keeping "legacy binary libs" in a more modern package
+ for longer than is neccessary. It also avoids having to keep coping
+ the binary into future packages)
+
+Non-goals
+---------
+
+* Providing a reliable mechanism to determine whether a given pkgname
+ contains a shared library
+* Keeping package names short and pretty as a priority
+
+Overview
+--------
+
+As a general rule, each soname shall be packaged in a separate package.
+This way, it's easy to track dependencies on specific sonames, detect
+and phase out sonames that are no longer in use. It also avoids the
+need to rebuild all the versions of software in question if one of the
+versions needs an update.
+
+This idea is based on the Debian shared libraries packaging policy
+[#debian-policy]_ and has been discussed [#discussion]_ on the mailing
+list.
+
+Advantages:
+
+* easy and complete lifecycle of shared libraries
+
+* phasing out of shared libraries can become part of standard catalog
+ update procedures
+* simpler packages, simpler builds (no need for version modulations and
+ complex merges, good for new maintainers)
+* isolation of old non-fixable files with issues (if there's an old
+ library mentioning /export/medusa, you don't have to worry about it
+ being stopped during release after you push it once)
+* no re-pushing of old files
+* more packages overall (good for stats!)
+* number of packages released per software upgrade remains the same. If
+ there were, say, 4 packages to release with each Python update, the
+ number remains: 4 per release. There will be one new CSWlibpython*
+ package, and the old CSWlibpython library won't be upgraded.
+
+
+Disadvantages:
+
+* maintainers need to make more decisions when packaging
+* there's some amount of work to be done to do the transition, such as
+ creation of new packages and dependencies
+* some package names become long and complex (however, they are only
+ dependencies; users don't need to type these in)
+
+Implementation details
+----------------------
+
+Package naming
+~~~~~~~~~~~~~~
+
+Names of packages shall be derived from sonames, and from sonames only.
+They shall not depend on project name, or project version. If a project
+is named foo, and contains libbar.so.0, the package name shall be based
+on libbar, not foo.
+
+A table listing examples of sonames and corresponding package
+names. [#soname-pkgname-unit-test]_
+
+========================= ======================= =========================
+soname pkgname catalogname
+========================= ======================= =========================
+libfoo.so.0 CSWlibfoo0 libfoo0
+libfoo-0.so CSWlibfoo0 libfoo0
+libfoo.so.0.1 CSWlibfoo0-1 libfoo0_1
+libapr-1.so.0 CSWlibapr1-0 libapr1_0
+libbabl-0.1.so.0 CSWlibbabl0-1-0 libbabl0_1_0
+libgettextlib-0.14.1.so CSWlibgettextlib0-14-1 libgettextlib0_14_1
+libapr-1.so.10 CSWlibapr-1-10 libapr_1_10
+libstdc++.so.6 CSWlibstdc++6 libstdc++6
+libdnet.1 CSWlibdnet1 libdnet1
+libUpperCase.so.1 CSWlibuppercase1 libuppercase1
+libpyglib-2.0-python.so.0 CSWlibpyglib2-0python0 libpyglib2_0python0
+libpython3.1.so.1.0 CSWlibpython3-1-1-0 libpython3_1_1_0
+libapr-1.so.10.0.0 CSWlibapr1-10-0-0 libapr1_10_0_0
+========================= ======================= =========================
+
+Separators
+^^^^^^^^^^
+
+Separators are added between two adjacent numbers, and removed if a number and a letter are next to each other. For example, ``libfoo.so.0`` becomes ``CSWlibfoo0``, and ``libfoo-1.so.0`` becomes ``CSWlibfoo1-0``.
+
+Linkable shared objects
+~~~~~~~~~~~~~~~~~~~~~~~
+
+The policy or recommendation shall refer to libraries which are //linkable,// meaning other binaries can link against them. Shared objects in private directories, such as /opt/csw/lib/someproject/foo.so (think Python modules) are not shared libraries which other projects can link to, and therefore there is no benefit in placing them in separate packages.
+
+Special cases
+^^^^^^^^^^^^^
+
+Some packages (e.g. Kerberos libraries) put private shared libraries into /opt/csw/lib. They don't expose any public API, and only own Kerberos binaries link to them. Private shared libraries can be bundled with the main package, without splitting them off.
+
+Examples
+^^^^^^^^
+
+============================================================================== ============
+file linkable?
+============================================================================== ============
+/opt/csw/lib/libfoo.so.0.2 Yes
+/opt/csw/lib/sparcv9/libfoo.so.0.2 Yes
+/opt/csw/lib/sparcv8plus+vis/libfoo.so.0.2 Yes
+/opt/csw/lib/amd64/libfoo.so.0.2 Yes
+/opt/csw/libexec/bar No
+/opt/csw/share/bar No
+/opt/csw/lib/gnucash/libgncmod-stylesheets.so.0.0.0 No
+/opt/csw/lib/erlang/lib/megaco-3.6.0.1/priv/lib/megaco_flex_scanner_drv_mt.so No
+/opt/csw/share/Adobe/Reader8/Reader/sparcsolaris/lib/libcrypto.so.0.9.6 No
+/opt/csw/customprefix/lib/libfoo.so.0.2 Yes
+/opt/csw/boost-gcc/lib/libboost_wserialization.so.1.44.0 Yes
+============================================================================== ============
+
+Example implementation and its unit tests can be found in checkpkg
+sources [#is-library-linkable-implementation]_ and corresponding unit
+tests. [#is-library-linkable-unit-tests]_
+
+Private shared libraries
+^^^^^^^^^^^^^^^^^^^^^^^^
+
+Some software projects install private (non-linkable) shared libraries
+into libdir (e.g. ``/opt/csw/lib``) by default. To ensure that they are
+private, they need to be moved to a subdirectory, e.g.
+``/opt/csw/lib/<project>``.
+
+To create a private library and install 32 and 64-bit libraries, they
+need to be laid out as follows:
+
+On sparc::
+
+ /opt/csw/lib/foo
+ /opt/csw/lib/foo/32 --> .
+ /opt/csw/lib/foo/64 --> sparcv9
+
+On i386::
+
+ /opt/csw/lib/foo
+ /opt/csw/lib/foo/32 --> .
+ /opt/csw/lib/foo/64 --> amd64
+
+In GAR, it can be simplified by symlinking:
+
+* 32 to ``$(ISA_DEFAULT)``
+* 64 to ``$(ISA_DEFAULT64)``
+
+The runpath needs to be set to ``/opt/csw/lib/foo/64``, e.g. ``-R/opt/csw/lib/foo/64``.
+
+Grouping shared libraries
+-------------------------
+
+There can be cases in which a set of shared libraries is likely to be
+upgraded together. Considering the following set of libraries:
+
+* libfoo.so.0
+* libfoo_bar.so.0
+* libfoo_baz.so.0
+
+It's possible that all the following libraries will be updated together.
+In such a case, all these shared objects can be put in a single package.
+The decision shall be made by the maintainer.
+
+If versions of shared libraries don't match, chances are that their API
+will not be changing together, and it's a good idea not to package them
+together. For example, the following three libraries are best kept in
+separate packages.
+
+* libfoo.so.0
+* libfoo_bar.so.1
+* libfoo_baz.so.0
+
+When making the decision, the question a maintainer should ask, should
+be: "Are all these shared libraries going to be retired together?" If
+the answer is positive, shared libraries shall be in a single package.
+However, in the face of uncertainty (it's hard to predict the future),
+placing each file in a separate package is always a safe choice.
+
+Transitioning of the existing packages
+--------------------------------------
+
+Consists of moving the shared library to own package, and making the
+original package an empty, transitional one. The phasing out of
+transitional packages follows the same rules as any other packages: when
+nothing depends on them, they can be removed.
+
+A simple example:
+
+* Before
+
+ - CSWlibfoo (libfoo.so.1)
+
+* After
+
+ - CSWlibfoo (empty) → CSWlibfoo1 (libfoo.so.1)
+
+For an existing more complex package, with already existing two versions
+of a library:
+
+* Before
+
+ - CSWlibfoo (libfoo.so.1, libfoo.so.2)
+
+* After
+
+ - CSWlibfoo (empty) → CSWlibfoo1 (libfoo.so.1)
+ - CSWlibfoo (empty) → CSWlibfoo2 (libfoo.so.2)
+
+Potential problems
+==================
+
+Potential collisions in package naming would include libfoo.so.1 and
+libfoo-1.so both resolving to CSWlibfoo1. If this case ever occurs, the
+naming conflict needs to be resolved manually. However, to this time,
+such a case has been never observed.
+
+Certain sonames are long enough that the corresponding package names are
+over 29 characters long. However, it affects a small percent of
+libraries, roughly about 98% SONAMEs generate package names within
+limits.
+
+Footnotes
+=========
+
+.. [#discussion] `An idea for a shared libraries policy`_ -
+ mailing list discussion
+.. [#debian-policy]
+ `Debian shared libraries packaging policy`_
+.. [#is-library-linkable-implementation]
+ `IsLibraryLinkable implementation`_
+.. [#is-library-linkable-unit-tests]
+ `IsLibraryLinkable unit tests`_
+.. [#soname-pkgname-unit-test]
+ checkpkg unit tests with
+ `examples of mappings between SONAMEs, pkgnames and catalognames`_
+.. _Debian shared libraries packaging policy:
+ http://www.debian.org/doc/debian-policy/
+ ch-sharedlibs.html#s-sharedlibs-runtime
+.. _An idea for a shared libraries policy:
+ http://lists.opencsw.org/pipermail/maintainers/2010-September/
+ 012752.html
+.. _IsLibraryLinkable implementation:
+ http://sourceforge.net/apps/trac/gar/browser/csw/mgar/gar/v2/
+ lib/python/sharedlib_utils.py#L24
+.. _IsLibraryLinkable unit tests:
+ http://sourceforge.net/apps/trac/gar/browser/csw/mgar/gar/v2/
+ lib/python/sharedlib_utils_test.py#L13
+.. _examples of mappings between SONAMEs, pkgnames and catalognames:
+ http://sourceforge.net/apps/trac/gar/browser/csw/mgar/gar/v2/
+ lib/python/sharedlib_utils_test.py#L68
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the devel
mailing list