michael@13: michael@428: OpenPKG Framework Bootstrap Package, Source Tree michael@428: ================================================ michael@13: michael@428: This is the source tree for the OpenPKG Framework "bootstrap" package. michael@428: What you find here is rather complex and tricky stuff, so don't be michael@428: confused if you don't understand everything immediately. michael@13: michael@13: The Files michael@13: --------- michael@13: michael@13: README .................. this file ;-) michael@13: michael@13: openpkg.spec ............ the regular build procedure michael@13: openpkg.boot ............ the bootstrapping procedure michael@13: michael@13: patch-*.tar.gz .......... untouched distribution tarball of the GNU patch tool michael@13: bash-*.tar.gz ........... untouched distribution tarball of the GNU bash tool michael@428: make-*.tar.gz ........... untouched distribution tarball of the GNU make tool michael@13: tar-*.tar.gz ............ untouched distribution tarball of the GNU tar tool michael@428: config-*.tar.gz ......... untouched distribution tarball of the GNU config scripts michael@445: gzip-*.tar .............. preunpacked distribution tarball of the GNU gzip tool michael@445: gzip-*-openpkg-r*.tar ... prepatched distribution files of the GNU gzip tool michael@428: perl-*-mini.tar.gz ...... stripped down distribution tarball of the Perl tool michael@428: rpm-*.tar.gz ............ untouched distribution tarball of the RPM tool michael@428: openssl-*.tar.gz ........ untouched distribution tarball of the OpenSSL toolkit michael@13: uuid-*.tar.gz ........... untouched distribution tarball of the OSSP uuid tool michael@13: curl-*.tar.gz ........... untouched distribution tarball of the cURL tool michael@428: beecrypt-*.tar.gz ....... untouched distribution tarball of the BeeCrypt library michael@13: bzip2-*.tar.gz .......... untouched distribution tarball of the BZIP2 library michael@13: zlib-*.tar.gz ........... untouched distribution tarball of the ZLIB library michael@428: popt-*.tar.gz ........... untouched distribution tarball of the POPT library michael@428: sqlite-*.tar.gz ......... untouched distribution tarball of the SQLite library michael@428: pcre-*.tar.gz ........... untouched distribution tarball of the SQLite library michael@428: diffutils-*.tar.gz ...... untouched distribution tarball of the GNU diffutils toolkit michael@428: svs-*.tar.gz ............ untouched distribution tarball of the OSSP svs tool michael@428: xz-*.tar.gz ............. untouched distribution tarball of the XZ tool michael@13: michael@428: bash.patch .............. patch for GNU bash tool michael@428: bash.patch.vendor ....... patch for GNU bash tool (upstream vendor only) michael@428: bash.patch.vendor.sh .... patch for GNU bash tool (generation utility, NOT BUNDLED) michael@428: beecrypt.patch .......... patch for BeeCrypt library michael@428: make.patch .............. patch for GNU make tool michael@428: openssl.patch ........... patch for OpenSSL toolkit michael@428: perl.patch .............. patch for Perl tool michael@428: tar.patch ............... patch for GNU tar tool michael@428: rpm.patch ............... patch for RPM tool michael@428: popt.patch .............. patch for POPT library michael@428: sqlite.patch ............ patch for SQLite library michael@428: curl.patch .............. patch for cURL library michael@428: diffutils.patch ......... patch for GNU diffutils tool michael@428: libarchive.patch ........ patch for BSD libarchive tool michael@428: pcre.patch .............. patch for PCRE library michael@428: xz.patch ................ patch for XZ tool michael@13: michael@13: rpmpopt ................. replacements/extensions for RPM's POPT configuration michael@13: rpmmacros ............... replacements/extensions for RPM's macros michael@13: michael@13: root.README ............. the source for installed /README michael@13: local.README ............ the source for installed /local/README michael@13: dot.bashrc .............. the source for installed /.bashrc michael@13: dot.bash_login .......... the source for installed /.bash_login michael@13: dot.lsyncrc ............. the source for installed /local/.lsyncrc michael@13: michael@445: openpkg.c ............... the OpenPKG frontend (setuid wrapper) michael@428: openpkg.mk .............. the OpenPKG frontend (build procedure) michael@13: openpkg.sh .............. the OpenPKG frontend (main script) michael@13: openpkg.pod ............. the OpenPKG frontend manual page (source) michael@445: openpkg.1 ............... the OpenPKG frontend manual page (pregenerated output) michael@13: michael@445: rc ...................... the OpenPKG runcommand handling script michael@445: rc.func ................. the OpenPKG runcommand function definitions michael@445: rc.conf ................. the OpenPKG runcommand configuration template michael@445: rc.openpkg .............. the OpenPKG runcommand script for the bootstrap package michael@445: rc.pod .................. the OpenPKG runcommand script manual page (source) michael@445: rc.8 .................... the OpenPKG runcommand script manual page (pregenerated output) michael@13: michael@13: release.sh .............. the OpenPKG release information utility script michael@13: release.pod ............. the OpenPKG release information utility manual page (source) michael@445: release.8 ............... the OpenPKG release information utility manual page (pregenerated output) michael@13: michael@13: uuid.sh ................. the OpenPKG UUID management utility script michael@13: uuid.pod ................ the OpenPKG UUID management utility manual page (source) michael@445: uuid.8 .................. the OpenPKG UUID management utility manual page (pregenerated output) michael@13: michael@13: rpmdb ................... the OpenPKG RPM database management utility michael@13: michael@13: rpmtool ................. the rpmtool tool (program source) michael@13: rpmtool.8 ............... the rpmtool tool (manual page) michael@13: rpmtool.pod ............. the rpmtool tool (manual page source) michael@13: shtool .................. the portable shell tool (GNU shtool) michael@13: michael@13: rpm-config.sh ........... the RPM C API helper script michael@13: rpm-config.pod .......... the RPM C API helper manual page (source) michael@445: rpm-config.8 ............ the RPM C API helper manual page (pregenerated output) michael@13: michael@13: lsync ................... the lsync tool (program source) michael@13: lsync.8 ................. the lsync tool (manual page) michael@13: lsync.pod ............... the lsync tool (manual page source) michael@13: michael@428: etc.usrgrp.sh ........... user/group name/id determination script michael@428: etc.prereq.sh ........... prerequisite checking script michael@428: etc.wrapsrc.sh .......... wrapper script for generating openpkg-V-R.src.sh michael@428: etc.wrapbin.sh .......... wrapper script for generating openpkg-V-R.P-L.sh michael@13: michael@13: man.sh .................. helper script for "openpkg man" command michael@428: michael@428: rpm.sh .................. wrapper for RPM michael@428: curl.sh ................. wrapper for cURL michael@428: michael@428: dev.pl .................. the OpenPKG package development utility script michael@428: dev.pod ................. the OpenPKG package development utility manual page (source) michael@445: dev.8 ................... the OpenPKG package development utility manual page (pregenerated output) michael@428: michael@428: index.pl ................ the OpenPKG package indexing utility script michael@428: index.pod ............... the OpenPKG package indexing utility manual page (source) michael@445: index.8 ................. the OpenPKG package indexing utility manual page (pregenerated output) michael@428: michael@428: search.pl ............... the OpenPKG package searching utility script michael@428: search.pod .............. the OpenPKG package searching utility manual page (source) michael@445: search.8 ................ the OpenPKG package searching utility manual page (pregenerated output) michael@428: michael@428: sea.sh .................. the OpenPKG shell execution archive utility script michael@428: sea.pod ................. the OpenPKG shell execution archive utility manual page (source) michael@445: sea.8 ................... the OpenPKG shell execution archive utility manual page (pregenerated output) michael@428: michael@428: mirror.pl ............... the OpenPKG package mirroing utility script michael@428: mirror.pod .............. the OpenPKG package mirroing utility manual page (source) michael@445: mirror.8 ................ the OpenPKG package mirroing utility manual page (pregenerated output) michael@428: michael@428: build.pl ................ the OpenPKG package building utility script michael@428: build.pod ............... the OpenPKG package building utility manual page (source) michael@445: build.8 ................. the OpenPKG package building utility manual page (pregenerated output) michael@428: michael@428: makeproxy.pl ............ the OpenPKG proxy package building utility script michael@428: makeproxy.pod ........... the OpenPKG proxy package building utility manual page (source) michael@445: makeproxy.8 ............. the OpenPKG proxy package building utility manual page (pregenerated output) michael@13: michael@13: openpkg.org.pgp ......... the OpenPGP public key "OpenPKG " michael@13: openpkg.com.pgp ......... the OpenPGP public key "OpenPKG GmbH " michael@13: openpkg.net.pgp ......... the OpenPGP public key "OpenPKG Foundation e.V. " michael@13: michael@428: license.sh .............. the OpenPKG license management utility script michael@428: license.pod ............. the OpenPKG license management utility manual page (source) michael@445: license.8 ............... the OpenPKG license management utility manual page (pregenerated output) michael@428: license-BOOT.txt ........ the OpenPKG Framework Bootstrapping License michael@428: license-COMMUNITY.txt ... the OpenPKG Framework Community License michael@428: license-EVAL.txt ........ the OpenPKG Framework Evaluation License michael@428: license-EXAMPLE.txt ..... the OpenPKG Framework Example License michael@428: license-PROMO.txt ....... the OpenPKG Framework Promotion License michael@428: license-RECOVERY.txt .... the OpenPKG Framework Recovery License michael@428: license.lua ............. the OpenPKG Framework license processor script michael@428: michael@428: Makefile ................ development build procedures michael@428: michael@13: The Bootstrapping Procedure michael@13: --------------------------- michael@13: michael@13: The complexity of this OpenPKG RPM package results from the fact that michael@13: we force us to treat this bootstrapping package equal to every other michael@13: regular OpenPKG RPM package. First, this implies that the packaging michael@428: tool RPM is packaged with itself as an OpenPKG RPM package -- which michael@428: means that its build procedure is a real RPM .spec file and it can be michael@428: installed and upgraded through a binary or source RPM. Second, RPM is michael@428: installed into the same filesystem hierarchy as all other packages. michael@428: Third, RPM manages its own files. The reason for this approach should michael@428: be obvious: 100% consistency for the whole OpenPKG software packaging michael@428: facility! michael@13: michael@13: The drawback is that this package requires a very tricky bootstrapping michael@13: procedure which had cost a lot of time to figure out and establish. If michael@13: you ever wanted to know the gory details, here they are... michael@13: michael@13: The first step was that we wrote the regular openpkg.spec file for michael@13: building the bootstrap package with OpenPKG RPM under the assumption michael@13: that OpenPKG RPM is already available. This way we can provide OpenPKG michael@13: RPM as an RPM package. Just remains the problem how we actually michael@13: bootstrap in case where OpenPKG RPM is still not available, i.e., michael@13: when we reach a new platform and have to build the package from michael@13: scratch. Here the "openpkg.boot" script comes into play. It executes michael@13: the "openpkg.spec" build procedure very similar to the way the real michael@13: OpenPKG RPM would do ("openpkg rpm -bb"). That is, "openpkg.boot" michael@13: partly emulates OpenPKG RPM -- just enough that "openpkg.spec" works. michael@13: As a result, "openpkg.spec" cannot use any fancy OpenPKG RPM features michael@13: or other things before "openpkg.boot" is able to emulate it, of michael@13: course. michael@13: michael@13: After "openpkg.boot" executed the "%prep", "%build" and "%install" michael@13: scripts of "openpkg.spec", there is a fresh version of the target michael@13: filesystem hierarchy staying under a temporary "build root". The michael@13: "openpkg.boot" script then creates a very special temporary "openpkg michael@428: rpm" command which allows the installed "openpkg rpm" command michael@428: inside the "build root" to work (although it is built for the michael@428: final target filesystem path). Then the $OPENPKG_BOOT variable michael@428: is set and the package is _again_ build via "openpkg.spec" -- michael@428: but this time with the real OpenPKG RPM. To avoid unneccessary michael@445: recompilation, the "openpkg.spec" skips "%prep", "%build" and michael@428: "%install" sections if $OPENPKG_BOOT is defined. So, on this second michael@428: build phase, only the "%files" section is effectively executed, i.e., michael@428: a binary OpenPKG RPM package "openpkg-V-R.P-T.rpm" is rolled from the michael@428: files in the "build root". Additionally, a source OpenPKG RPM package michael@428: "openpkg-V-R.src.rpm" is rolled for consistency reasons, too. michael@13: michael@13: Finally, we override the installation in the "build root" michael@13: again by installing the now rolled binary OpenPKG RPM package michael@13: "openpkg-V-R.P-T.rpm" by using the real OpenPKG RPM. This way michael@13: we achieve that OpenPKG RPM is remembered as a real OpenPKG RPM michael@13: package in the RPM database. We just have to make sure the package michael@13: is still relocated to the "build root" while installing. For this michael@13: we could use "--prefix=$RPM_BUILD_ROOT%{l_prefix}", but this would michael@13: create an incorrect file list for the package "openpkg" in the RPM michael@13: database. Instead we use the tricky "--justdb" option for "openpkg michael@13: rpm" which means "openpkg rpm" behaves as it would install into the michael@13: real location, but does not actually install anything. But as a michael@445: side effect, the database inside the "build root" is now correct. michael@13: michael@13: After this procedure, the "build root" contains the target filesystem michael@13: hierarchy with OpenPKG RPM installed with itself. What is now just michael@13: remaining is to roll a bootstrap package "openpkg" with this stuff for michael@13: initial installation without OpenPKG RPM. For this the "build root" michael@13: is packed into a "tarball", compressed, again wrapped into another michael@13: tarball together with the uncompression tools ("bzip2" and "tar"), michael@13: and finally wrapped into a self-extracting shell script by appending michael@428: "etc.wrapbin.sh" (padded to 64KB for easier unpacking of the attached michael@13: tarball) to its front. michael@13: michael@13: The result is the binary bootstrap script "openpkg-V-R.P-T.sh" which michael@428: can be used to install the target hierarchy from scratch without michael@445: any preinstalled OpenPKG RPM. Nevertheless, the installed target michael@428: hierarchy looks _exactly_ as it would have been installed with OpenPKG michael@428: RPM. If one later wants to upgrade this hierarchy one can just use the michael@13: generated (or a newer) "openpkg-V-R.P-T.rpm". michael@13: michael@445: To allow one to easily repeat this from source bootstrapping procedure michael@13: on other machines, one can run "./openpkg.boot -s" which rolls michael@13: a "openpkg-V-R.src.sh" script which is a self-extracting script michael@13: containing an attached tarball of the sources of this directory. This michael@13: script contains the same contents like "openpkg-V-R.src.rpm", but michael@13: is intended for running the described bootstrapping procedure from michael@13: scratch without any OpenPKG RPM. michael@13: