openpkg/README

Mon, 28 Jan 2013 17:37:18 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Mon, 28 Jan 2013 17:37:18 +0100
changeset 758
a2c6460cfb16
parent 428
f880f219c566
permissions
-rw-r--r--

Correct socket error reporting improvement with IPv6 portable code,
after helpful recommendation by Saúl Ibarra Corretgé on OSips devlist.

     2   OpenPKG Framework Bootstrap Package, Source Tree
     3   ================================================
     5   This is the source tree for the OpenPKG Framework "bootstrap" package.
     6   What you find here is rather complex and tricky stuff, so don't be
     7   confused if you don't understand everything immediately.
     9   The Files
    10   ---------
    12   README .................. this file ;-)
    14   openpkg.spec ............ the regular build procedure
    15   openpkg.boot ............ the bootstrapping procedure
    17   patch-*.tar.gz .......... untouched distribution tarball of the GNU patch tool
    18   bash-*.tar.gz ........... untouched distribution tarball of the GNU bash tool
    19   make-*.tar.gz ........... untouched distribution tarball of the GNU make tool
    20   tar-*.tar.gz ............ untouched distribution tarball of the GNU tar tool
    21   config-*.tar.gz ......... untouched distribution tarball of the GNU config scripts
    22   gzip-*.tar .............. preunpacked distribution tarball of the GNU gzip tool
    23   gzip-*-openpkg-r*.tar ... prepatched distribution files of the GNU gzip tool
    24   perl-*-mini.tar.gz ...... stripped down distribution tarball of the Perl tool
    25   rpm-*.tar.gz ............ untouched distribution tarball of the RPM tool
    26   openssl-*.tar.gz ........ untouched distribution tarball of the OpenSSL toolkit
    27   uuid-*.tar.gz ........... untouched distribution tarball of the OSSP uuid tool
    28   curl-*.tar.gz ........... untouched distribution tarball of the cURL tool
    29   beecrypt-*.tar.gz ....... untouched distribution tarball of the BeeCrypt library
    30   bzip2-*.tar.gz .......... untouched distribution tarball of the BZIP2 library
    31   zlib-*.tar.gz ........... untouched distribution tarball of the ZLIB library
    32   popt-*.tar.gz ........... untouched distribution tarball of the POPT library
    33   sqlite-*.tar.gz ......... untouched distribution tarball of the SQLite library
    34   pcre-*.tar.gz ........... untouched distribution tarball of the SQLite library
    35   diffutils-*.tar.gz ...... untouched distribution tarball of the GNU diffutils toolkit
    36   svs-*.tar.gz ............ untouched distribution tarball of the OSSP svs tool
    37   xz-*.tar.gz ............. untouched distribution tarball of the XZ tool
    39   bash.patch .............. patch for GNU bash tool
    40   bash.patch.vendor ....... patch for GNU bash tool (upstream vendor only)
    41   bash.patch.vendor.sh .... patch for GNU bash tool (generation utility, NOT BUNDLED)
    42   beecrypt.patch .......... patch for BeeCrypt library
    43   make.patch .............. patch for GNU make tool
    44   openssl.patch ........... patch for OpenSSL toolkit
    45   perl.patch .............. patch for Perl tool
    46   tar.patch ............... patch for GNU tar tool
    47   rpm.patch ............... patch for RPM tool
    48   popt.patch .............. patch for POPT library
    49   sqlite.patch ............ patch for SQLite library
    50   curl.patch .............. patch for cURL library
    51   diffutils.patch ......... patch for GNU diffutils tool
    52   libarchive.patch ........ patch for BSD libarchive tool
    53   pcre.patch .............. patch for PCRE library
    54   xz.patch ................ patch for XZ tool
    56   rpmpopt ................. replacements/extensions for RPM's POPT configuration
    57   rpmmacros ............... replacements/extensions for RPM's macros
    59   root.README ............. the source for installed <prefix>/README
    60   local.README ............ the source for installed <prefix>/local/README
    61   dot.bashrc .............. the source for installed <prefix>/.bashrc
    62   dot.bash_login .......... the source for installed <prefix>/.bash_login
    63   dot.lsyncrc ............. the source for installed <prefix>/local/.lsyncrc
    65   openpkg.c ............... the OpenPKG frontend (setuid wrapper)
    66   openpkg.mk .............. the OpenPKG frontend (build procedure)
    67   openpkg.sh .............. the OpenPKG frontend (main script)
    68   openpkg.pod ............. the OpenPKG frontend manual page (source)
    69   openpkg.1 ............... the OpenPKG frontend manual page (pregenerated output)
    71   rc ...................... the OpenPKG runcommand handling script
    72   rc.func ................. the OpenPKG runcommand function definitions
    73   rc.conf ................. the OpenPKG runcommand configuration template
    74   rc.openpkg .............. the OpenPKG runcommand script for the bootstrap package
    75   rc.pod .................. the OpenPKG runcommand script manual page (source)
    76   rc.8 .................... the OpenPKG runcommand script manual page (pregenerated output)
    78   release.sh .............. the OpenPKG release information utility script
    79   release.pod ............. the OpenPKG release information utility manual page (source)
    80   release.8 ............... the OpenPKG release information utility manual page (pregenerated output)
    82   uuid.sh ................. the OpenPKG UUID management utility script
    83   uuid.pod ................ the OpenPKG UUID management utility manual page (source)
    84   uuid.8 .................. the OpenPKG UUID management utility manual page (pregenerated output)
    86   rpmdb ................... the OpenPKG RPM database management utility
    88   rpmtool ................. the rpmtool tool (program source)
    89   rpmtool.8 ............... the rpmtool tool (manual page)
    90   rpmtool.pod ............. the rpmtool tool (manual page source)
    91   shtool .................. the portable shell tool (GNU shtool)
    93   rpm-config.sh ........... the RPM C API helper script
    94   rpm-config.pod .......... the RPM C API helper manual page (source)
    95   rpm-config.8 ............ the RPM C API helper manual page (pregenerated output)
    97   lsync ................... the lsync tool (program source)
    98   lsync.8 ................. the lsync tool (manual page)
    99   lsync.pod ............... the lsync tool (manual page source)
   101   etc.usrgrp.sh ........... user/group name/id determination script
   102   etc.prereq.sh ........... prerequisite checking script
   103   etc.wrapsrc.sh .......... wrapper script for generating openpkg-V-R.src.sh
   104   etc.wrapbin.sh .......... wrapper script for generating openpkg-V-R.P-L.sh
   106   man.sh .................. helper script for "openpkg man" command
   108   rpm.sh .................. wrapper for RPM
   109   curl.sh ................. wrapper for cURL
   111   dev.pl .................. the OpenPKG package development utility script
   112   dev.pod ................. the OpenPKG package development utility manual page (source)
   113   dev.8 ................... the OpenPKG package development utility manual page (pregenerated output)
   115   index.pl ................ the OpenPKG package indexing utility script
   116   index.pod ............... the OpenPKG package indexing utility manual page (source)
   117   index.8 ................. the OpenPKG package indexing utility manual page (pregenerated output)
   119   search.pl ............... the OpenPKG package searching utility script
   120   search.pod .............. the OpenPKG package searching utility manual page (source)
   121   search.8 ................ the OpenPKG package searching utility manual page (pregenerated output)
   123   sea.sh .................. the OpenPKG shell execution archive utility script
   124   sea.pod ................. the OpenPKG shell execution archive utility manual page (source)
   125   sea.8 ................... the OpenPKG shell execution archive utility manual page (pregenerated output)
   127   mirror.pl ............... the OpenPKG package mirroing utility script
   128   mirror.pod .............. the OpenPKG package mirroing utility manual page (source)
   129   mirror.8 ................ the OpenPKG package mirroing utility manual page (pregenerated output)
   131   build.pl ................ the OpenPKG package building utility script
   132   build.pod ............... the OpenPKG package building utility manual page (source)
   133   build.8 ................. the OpenPKG package building utility manual page (pregenerated output)
   135   makeproxy.pl ............ the OpenPKG proxy package building utility script
   136   makeproxy.pod ........... the OpenPKG proxy package building utility manual page (source)
   137   makeproxy.8 ............. the OpenPKG proxy package building utility manual page (pregenerated output)
   139   openpkg.org.pgp ......... the OpenPGP public key "OpenPKG <openpkg@openpkg.org>"
   140   openpkg.com.pgp ......... the OpenPGP public key "OpenPKG GmbH <openpkg@openpkg.com>"
   141   openpkg.net.pgp ......... the OpenPGP public key "OpenPKG Foundation e.V. <openpkg@openpkg.net>"
   143   license.sh .............. the OpenPKG license management utility script
   144   license.pod ............. the OpenPKG license management utility manual page (source)
   145   license.8 ............... the OpenPKG license management utility manual page (pregenerated output)
   146   license-BOOT.txt ........ the OpenPKG Framework Bootstrapping License
   147   license-COMMUNITY.txt ... the OpenPKG Framework Community License
   148   license-EVAL.txt ........ the OpenPKG Framework Evaluation License
   149   license-EXAMPLE.txt ..... the OpenPKG Framework Example License
   150   license-PROMO.txt ....... the OpenPKG Framework Promotion License
   151   license-RECOVERY.txt .... the OpenPKG Framework Recovery License
   152   license.lua ............. the OpenPKG Framework license processor script
   154   Makefile ................ development build procedures
   156   The Bootstrapping Procedure
   157   ---------------------------
   159   The complexity of this OpenPKG RPM package results from the fact that
   160   we force us to treat this bootstrapping package equal to every other
   161   regular OpenPKG RPM package. First, this implies that the packaging
   162   tool RPM is packaged with itself as an OpenPKG RPM package -- which
   163   means that its build procedure is a real RPM .spec file and it can be
   164   installed and upgraded through a binary or source RPM. Second, RPM is
   165   installed into the same filesystem hierarchy as all other packages.
   166   Third, RPM manages its own files. The reason for this approach should
   167   be obvious: 100% consistency for the whole OpenPKG software packaging
   168   facility!
   170   The drawback is that this package requires a very tricky bootstrapping
   171   procedure which had cost a lot of time to figure out and establish. If
   172   you ever wanted to know the gory details, here they are...
   174   The first step was that we wrote the regular openpkg.spec file for
   175   building the bootstrap package with OpenPKG RPM under the assumption
   176   that OpenPKG RPM is already available. This way we can provide OpenPKG
   177   RPM as an RPM package. Just remains the problem how we actually
   178   bootstrap in case where OpenPKG RPM is still not available, i.e.,
   179   when we reach a new platform and have to build the package from
   180   scratch. Here the "openpkg.boot" script comes into play. It executes
   181   the "openpkg.spec" build procedure very similar to the way the real
   182   OpenPKG RPM would do ("openpkg rpm -bb"). That is, "openpkg.boot"
   183   partly emulates OpenPKG RPM -- just enough that "openpkg.spec" works.
   184   As a result, "openpkg.spec" cannot use any fancy OpenPKG RPM features
   185   or other things before "openpkg.boot" is able to emulate it, of
   186   course.
   188   After "openpkg.boot" executed the "%prep", "%build" and "%install"
   189   scripts of "openpkg.spec", there is a fresh version of the target
   190   filesystem hierarchy staying under a temporary "build root". The
   191   "openpkg.boot" script then creates a very special temporary "openpkg
   192   rpm" command which allows the installed "openpkg rpm" command
   193   inside the "build root" to work (although it is built for the
   194   final target filesystem path). Then the $OPENPKG_BOOT variable
   195   is set and the package is _again_ build via "openpkg.spec" --
   196   but this time with the real OpenPKG RPM. To avoid unneccessary
   197   recompilation, the "openpkg.spec" skips "%prep", "%build" and
   198   "%install" sections if $OPENPKG_BOOT is defined. So, on this second
   199   build phase, only the "%files" section is effectively executed, i.e.,
   200   a binary OpenPKG RPM package "openpkg-V-R.P-T.rpm" is rolled from the
   201   files in the "build root". Additionally, a source OpenPKG RPM package
   202   "openpkg-V-R.src.rpm" is rolled for consistency reasons, too.
   204   Finally, we override the installation in the "build root"
   205   again by installing the now rolled binary OpenPKG RPM package
   206   "openpkg-V-R.P-T.rpm" by using the real OpenPKG RPM. This way
   207   we achieve that OpenPKG RPM is remembered as a real OpenPKG RPM
   208   package in the RPM database. We just have to make sure the package
   209   is still relocated to the "build root" while installing. For this
   210   we could use "--prefix=$RPM_BUILD_ROOT%{l_prefix}", but this would
   211   create an incorrect file list for the package "openpkg" in the RPM
   212   database. Instead we use the tricky "--justdb" option for "openpkg
   213   rpm" which means "openpkg rpm" behaves as it would install into the
   214   real location, but does not actually install anything. But as a
   215   side effect, the database inside the "build root" is now correct.
   217   After this procedure, the "build root" contains the target filesystem
   218   hierarchy with OpenPKG RPM installed with itself. What is now just
   219   remaining is to roll a bootstrap package "openpkg" with this stuff for
   220   initial installation without OpenPKG RPM. For this the "build root"
   221   is packed into a "tarball", compressed, again wrapped into another
   222   tarball together with the uncompression tools ("bzip2" and "tar"),
   223   and finally wrapped into a self-extracting shell script by appending
   224   "etc.wrapbin.sh" (padded to 64KB for easier unpacking of the attached
   225   tarball) to its front.
   227   The result is the binary bootstrap script "openpkg-V-R.P-T.sh" which
   228   can be used to install the target hierarchy from scratch without
   229   any preinstalled OpenPKG RPM. Nevertheless, the installed target
   230   hierarchy looks _exactly_ as it would have been installed with OpenPKG
   231   RPM. If one later wants to upgrade this hierarchy one can just use the
   232   generated (or a newer) "openpkg-V-R.P-T.rpm".
   234   To allow one to easily repeat this from source bootstrapping procedure
   235   on other machines, one can run "./openpkg.boot -s" which rolls
   236   a "openpkg-V-R.src.sh" script which is a self-extracting script
   237   containing an attached tarball of the sources of this directory. This
   238   script contains the same contents like "openpkg-V-R.src.rpm", but
   239   is intended for running the described bootstrapping procedure from
   240   scratch without any OpenPKG RPM.

mercurial