Thu, 08 Jan 2009 11:09:42 +0100
Import package vendor original specs for necessary manipulations.
2 OpenPKG Boostrap Package Source Tree
3 ====================================
5 This is the source code tree for the OpenPKG bootstrap package. What
6 you find here is rather complex and tricky stuff, so don't be confused
7 if you don't understand everything immediately.
9 The Files
10 ---------
12 README .................. this file ;-)
13 HISTORY ................. change history tracking of this package
15 openpkg.spec ............ the regular build procedure
16 openpkg.boot ............ the bootstrapping procedure
18 gzip-*.tar .............. untouched distribution tarball of the GNU gzip tool
19 make-*.tar.gz ........... untouched distribution tarball of the GNU make tool
20 patch-*.tar.gz .......... untouched distribution tarball of the GNU patch tool
21 bash-*.tar.gz ........... untouched distribution tarball of the GNU bash tool
22 tar-*.tar.gz ............ untouched distribution tarball of the GNU tar tool
23 uuid-*.tar.gz ........... untouched distribution tarball of the OSSP uuid tool
24 curl-*.tar.gz ........... untouched distribution tarball of the cURL tool
25 bzip2-*.tar.gz .......... untouched distribution tarball of the BZIP2 library
26 zlib-*.tar.gz ........... untouched distribution tarball of the ZLIB library
27 beecrypt-*.tar.gz ....... untouched distribution tarball of the BeeCrypt library
28 rpm-*.tar.gz ............ untouched distribution tarball of the RPM tool
29 config-*.tar.gz ......... untouched distribution tarball of the GNU config scripts
30 openpkg-registry-*.tar.gz untouched distribution tarball of the OpenPKG Registry
31 openpkg-tools-*.tar.gz .. untouched distribution tarball of the OpenPKG Tool Chain
32 openssl-*.tar.gz ........ untouched distribution tarball of the OpenSSL toolkit
33 perl-*-mini.tar.gz ...... stripped down distribution tarball of the Perl tool
35 make.patch .............. patch for GNU make
36 bash.patch .............. patch for GNU bash
37 tar.patch ............... patch for GNU tar
38 beecrypt.patch .......... patch for BeeCrypt
39 openssl.patch ........... patch for OpenSSL
40 perl.patch .............. patch for Perl
41 gzip.c .................. replacement file for GNU gzip
42 rpm.patch.bugfix ........ patch for RPM (bugfixing parts)
43 rpm.patch.feature ....... patch for RPM (new features parts)
44 rpm.patch.porting ....... patch for RPM (portability enhancement parts)
45 rpm.patch.regen ......... patch for RPM (re-generated files parts)
47 rpmpopt ................. replacements/extensions for RPM's POPT configuration
48 rpmmacros ............... replacements/extensions for RPM's macros
49 rpmrc ................... replacements for RPM's run-command configuration
51 root.README ............. the source for installed <prefix>/README
52 local.README ............ the source for installed <prefix>/local/README
53 dot.bashrc .............. the source for installed <prefix>/.bashrc
54 dot.bash_login .......... the source for installed <prefix>/.bash_login
55 dot.lsyncrc ............. the source for installed <prefix>/local/.lsyncrc
57 openpkg.c ............... the OpenPKG frontend (set-uid wrapper)
58 openpkg.sh .............. the OpenPKG frontend (main script)
59 openpkg.pod ............. the OpenPKG frontend manual page (source)
60 openpkg.1 ............... the OpenPKG frontend manual page (pre-generated output)
62 rc ...................... the OpenPKG run-command handling script
63 rc.func ................. the OpenPKG run-command function definitions
64 rc.conf ................. the OpenPKG run-command configuration template
65 rc.openpkg .............. the OpenPKG run-command script for the bootstrap package
66 rc.pod .................. the OpenPKG run-command script manual page (source)
67 rc.8 .................... the OpenPKG run-command script manual page (pre-generated output)
69 release.sh .............. the OpenPKG release information utility script
70 release.pod ............. the OpenPKG release information utility manual page (source)
71 release.8 ............... the OpenPKG release information utility manual page (pre-generated output)
73 uuid.sh ................. the OpenPKG UUID management utility script
74 uuid.pod ................ the OpenPKG UUID management utility manual page (source)
75 uuid.8 .................. the OpenPKG UUID management utility manual page (pre-generated output)
77 rpmdb ................... the OpenPKG RPM database management utility
79 rpmtool ................. the rpmtool tool (program source)
80 rpmtool.8 ............... the rpmtool tool (manual page)
81 rpmtool.pod ............. the rpmtool tool (manual page source)
82 shtool .................. the portable shell tool (GNU shtool)
84 rpm-config.sh ........... the RPM C API helper script
85 rpm-config.pod .......... the RPM C API helper manual page (source)
86 rpm-config.8 ............ the RPM C API helper manual page (pre-generated output)
88 lsync ................... the lsync tool (program source)
89 lsync.8 ................. the lsync tool (manual page)
90 lsync.pod ............... the lsync tool (manual page source)
92 aux.usrgrp.sh ........... user/group name/id determination script
93 aux.prereq.sh ........... prerequisite checking script
94 aux.wrapsrc.sh .......... wrapper script for generating openpkg-V-R.src.sh
95 aux.wrapbin.sh .......... wrapper script for generating openpkg-V-R.P-L.sh
97 pod2man.sh .............. helper script for pre-generating manual page outputs
98 man.sh .................. helper script for "openpkg man" command
99 install.sh .............. helper script for "openpkg install" command
101 openpkg.org.pgp ......... the OpenPGP public key "OpenPKG <openpkg@openpkg.org>"
102 openpkg.com.pgp ......... the OpenPGP public key "OpenPKG GmbH <openpkg@openpkg.com>"
103 openpkg.net.pgp ......... the OpenPGP public key "OpenPKG Foundation e.V. <openpkg@openpkg.net>"
105 The Bootstrapping Procedure
106 ---------------------------
108 The complexity of this OpenPKG RPM package results from the fact that
109 we force us to treat this bootstrapping package equal to every other
110 regular OpenPKG RPM package. First, this implies that the packaging
111 tool RPM is packaged with itself as an OpenPKG RPM package (means: its
112 build procedure is a real RPM .spec file and it can be installed and
113 upgraded through a binary or source RPM). Second, RPM is installed
114 into the same filesystem hierarchy as all other packages. Third, RPM
115 manages its own files. The reason for this approach should be obvious:
116 100% consistency for the whole OpenPKG software packaging facility!
118 The drawback is that this package requires a very tricky bootstrapping
119 procedure which had cost a lot of time to figure out and establish. If
120 you ever wanted to know the gory details, here they are...
122 The first step was that we wrote the regular openpkg.spec file for
123 building the bootstrap package with OpenPKG RPM under the assumption
124 that OpenPKG RPM is already available. This way we can provide OpenPKG
125 RPM as an RPM package. Just remains the problem how we actually
126 bootstrap in case where OpenPKG RPM is still not available, i.e.,
127 when we reach a new platform and have to build the package from
128 scratch. Here the "openpkg.boot" script comes into play. It executes
129 the "openpkg.spec" build procedure very similar to the way the real
130 OpenPKG RPM would do ("openpkg rpm -bb"). That is, "openpkg.boot"
131 partly emulates OpenPKG RPM -- just enough that "openpkg.spec" works.
132 As a result, "openpkg.spec" cannot use any fancy OpenPKG RPM features
133 or other things before "openpkg.boot" is able to emulate it, of
134 course.
136 After "openpkg.boot" executed the "%prep", "%build" and "%install"
137 scripts of "openpkg.spec", there is a fresh version of the target
138 filesystem hierarchy staying under a temporary "build root". The
139 "openpkg.boot" script then creates a very special temporary "openpkg
140 rpm" command which allows the installed "openpkg rpm" command inside
141 the "build root" to work (although it is built for the final target
142 filesystem path). Then the $RPM_BOOT variable is set and the package
143 is _again_ build via "openpkg.spec" -- but this time with the real
144 OpenPKG RPM. To avoid unneccessary re-compilation, the "openpkg.spec"
145 skips "%prep", "%build" and "%install" sections if $RPM_BOOT is
146 defined. So, on this second build phase, only the "%files" section is
147 executed, i.e., a binary OpenPKG RPM package "openpkg-V-R.P-T.rpm"
148 is rolled from the files in the "build root". Additionally, a source
149 OpenPKG RPM package "openpkg-V-R.src.rpm" is rolled for consistency
150 reasons.
152 Finally, we override the installation in the "build root"
153 again by installing the now rolled binary OpenPKG RPM package
154 "openpkg-V-R.P-T.rpm" by using the real OpenPKG RPM. This way
155 we achieve that OpenPKG RPM is remembered as a real OpenPKG RPM
156 package in the RPM database. We just have to make sure the package
157 is still relocated to the "build root" while installing. For this
158 we could use "--prefix=$RPM_BUILD_ROOT%{l_prefix}", but this would
159 create an incorrect file list for the package "openpkg" in the RPM
160 database. Instead we use the tricky "--justdb" option for "openpkg
161 rpm" which means "openpkg rpm" behaves as it would install into the
162 real location, but does not actually install anything. But as a
163 side-effect, the database inside the "build root" is now correct.
165 After this procedure, the "build root" contains the target filesystem
166 hierarchy with OpenPKG RPM installed with itself. What is now just
167 remaining is to roll a bootstrap package "openpkg" with this stuff for
168 initial installation without OpenPKG RPM. For this the "build root"
169 is packed into a "tarball", compressed, again wrapped into another
170 tarball together with the uncompression tools ("bzip2" and "tar"),
171 and finally wrapped into a self-extracting shell script by appending
172 "aux.wrapbin.sh" (padded to 64KB for easier unpacking of the attached
173 tarball) to its front.
175 The result is the binary bootstrap script "openpkg-V-R.P-T.sh" which
176 can be used to install the target hierarchy from scratch without any
177 pre-installed OpenPKG RPM. Nevetheless, the installed target hierarchy
178 looks _exactly_ as it would have been installed with OpenPKG RPM.
179 If one later wants to upgrade this hierarchy one can just use the
180 generated (or a newer) "openpkg-V-R.P-T.rpm".
182 To allow one to easily repeat this from-source bootstrapping procedure
183 on other machines, one can run "./openpkg.boot -s" which rolls
184 a "openpkg-V-R.src.sh" script which is a self-extracting script
185 containing an attached tarball of the sources of this directory. This
186 script contains the same contents like "openpkg-V-R.src.rpm", but
187 is intended for running the described bootstrapping procedure from
188 scratch without any OpenPKG RPM.