README 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. OpenPKG Source Code Tree
  2. ========================
  3. This is the source code tree for the OpenPKG bootstrap package. What
  4. you find here is rather complex and tricky stuff, so don't be confused
  5. if you don't understand everything immediately.
  6. The Files
  7. ---------
  8. README .................. this file ;)
  9. openpkg.boot ............ the bootstrapping procedure
  10. openpkg.spec ............ the build procedure
  11. gzip-1.3.tar ............ untouched distribution tarball of the GNU gzip tool
  12. make-3.79.1.tar.gz ...... untouched distribution tarball of the GNU make tool
  13. patch-2.5.4.tar.gz ...... untouched distribution tarball of the GNU patch tool
  14. bash-2.05a.tar.gz ....... untouched distribution tarball of the GNU bash tool
  15. rpm-4.0.2.tar.gz ........ distribution tarball of the RPM tool
  16. rpm-4.0.2.patch.bugfix .. patch for RPM (bugfixing parts)
  17. rpm-4.0.2.patch.feature . patch for RPM (new features parts)
  18. rpm-4.0.2.patch.porting . patch for RPM (portability enhancement parts)
  19. rpm-4.0.2.patch.regen ... patch for RPM (re-generated files parts)
  20. db-3.2.9.tar.gz ......... untouched distribution tarball of the Berkeley-DB library
  21. db-3.2.9.patch .......... patch for Berkeley-DB library
  22. bzip2-1.0.1.tar.gz ...... untouched distribution tarball of the BZIP2 library
  23. zlib-1.1.3.tar.gz ....... untouched distribution tarball of the ZLIB library
  24. curl-7.9.1.tar.gz ....... untouched distribution tarball of the cURL tool
  25. rpmpopt ................. extensions for RPM's popt configuration
  26. rpmrc ................... replacements for RPM's run-commands
  27. rpmmacros ............... replacements for RPM's macros
  28. root.README ............. the <root>/README file for the installation area
  29. local.README ............ the <root>/local/README file for the installation area
  30. dot.bashrc .............. the <root>/.bashrc file
  31. dot.bash_login .......... the <root>/.bash_login file
  32. dot.lsyncrc ............. the <root>/local/.lsyncrc file
  33. rc ...................... the run-command handling script
  34. rc.func ................. the run-command function definitions
  35. rc.conf ................. the run-command configuration template
  36. rc.openpkg .............. the run-command script for the OpenPKG hierarchy
  37. rpmtool ................. the rpmtool tool (program source)
  38. rpmtool.8 ............... the rpmtool tool (manual page)
  39. rpmtool.pod ............. the rpmtool tool (manual page source)
  40. lsync ................... the lsync tool (program source)
  41. lsync.8 ................. the lsync tool (manual page)
  42. lsync.pod ............... the lsync tool (manual page source)
  43. wrap1.sh ................ wrapper script for generating openpkg-X.X-X.src.sh
  44. wrap2.sh ................ wrapper script for generating openpkg-X.X-X.YYY-YYYY-ZZ.sh
  45. openpkg.pgp ............. the OpenPGP public key of "The OpenPKG Project"
  46. shtool .................. the pre-generated GNU shtool program
  47. rpmx.sh ................. RPM eXtension (Shell wrapper)
  48. rpmx.pl ................. RPM eXtension (Perl program)
  49. The Bootstrapping Procedure
  50. ---------------------------
  51. The complexity of this RPM package results from the fact that we force
  52. us to treat RPM equal to every other package. This implies first that
  53. RPM itself is an RPM package (means: its build procedure is a RPM
  54. spec-file and it can be installed and upgraded through a binary or
  55. source RPM), second that RPM is installed into the same filesystem
  56. hierarchy as all other packages and third that RPM manages its own
  57. files. The reason for this should be obvious: 100% consistency for the
  58. whole software package facility!
  59. The drawback is that the RPM package requires a very tricky
  60. bootstrapping procedure which had cost a lot of time to figure out
  61. and establish. If you ever wanted to know the gory details, here they
  62. are...
  63. The first step was that we wrote the regular openpkg.spec file for
  64. building RPM with the assumption that RPM is already available. This
  65. way we can provide RPM as an RPM package. Remains the problem how we
  66. actually bootstrap in the case where RPM is still not available, i.e.,
  67. when we reach a new platform. Here the openpkg.boot script comes into
  68. play. It executes the openpkg.spec build procedure very similar to the way
  69. RPM would do it. That is, openpkg.boot partly emulates RPM -- just enough
  70. that openpkg.spec works. As a result, openpkg.spec cannot use any fancy RPM
  71. features or other things before openpkg.boot is able to emulate it, of
  72. course.
  73. After openpkg.boot executed the %prep, %build and %install scripts of
  74. openpkg.spec, there is a fresh version of the target filesystem hierarchy
  75. staying under a temporary build root. The openpkg.boot script then creates
  76. a very special temporary "rpm" command which allows the installed
  77. "rpm" command inside the build root to work (although it is built for
  78. the final target filesystem path). Then the RPM_BOOT variable is set
  79. and the RPM package is again "built" via openpkg.spec -- but this time
  80. with the real RPM tool. To avoid unneccessary re-compilation, the
  81. openpkg.spec skips %prep, %build and %install if RPM_BOOT is defined, so
  82. on this second build phase, only %files is executed, i.e., a binary
  83. RPM openpkg-X.X-X.YYYY-YYYYYY-ZZ.rpm is rolled from the files in the
  84. build root. Additionally a source RPM openpkg-X.X-X.src.rpm is rolled
  85. for consistency reasons.
  86. Finally we override the installation in the build root again by
  87. installing the now rolled binary RPM -- again by using the real RPM
  88. tool. This way we achieve that RPM is remembered as an RPM package
  89. in its own database. We just have to make sure the package is still
  90. relocated to the build root while installing. For this we could
  91. use --prefix=$RPM_BUILD_ROOT/%{l_prefix}, but this would create an
  92. incorrect filelist for "rpm" in the database. Instead we use the
  93. tricky --justdb option for "rpm" which means "rpm" behaves as it
  94. would install into the real location, but does not actually install
  95. anything. But as a side-effect, the database inside the build root is
  96. now correct.
  97. After this procedure, the build root contains the target filesystem
  98. hierarchy with RPM installed with itself. What is now remaining is to
  99. roll a bootstrap package with this stuff for initial installation. For
  100. this the build root is packed into a tarball, compressed, uuencoded,
  101. and finally wrapped into a self-extracting shell script. The result
  102. is the binary bootstrap script openpkg-X.X-X.YYYY-YYYYYYY-ZZ.sh
  103. which can be used to bootstrap the target hierarchy from
  104. scratch. If one later wants to upgrade this hierarchy one uses
  105. openpkg-X.X-X.YYYY-YYYYYYY-ZZ.rpm.
  106. To allow one to easily repeat this from-source bootstrapping procedure
  107. on other machines, one can run "./openpkg.boot -s" which rolls a
  108. openpkg-X.X-X.src.sh script which is a self-extracting script containing a
  109. tarball of this directory. This script is like openpkg-X.X-X.src.rpm, but
  110. for bootstrapping situations.
  111. Supported Platforms
  112. -------------------
  113. Currently the following platforms are supported:
  114. _______ Supported ________
  115. Operating System Still Official Already
  116. ----------------- -------- -------- --------
  117. FreeBSD 4.[0-2] 4.3-S 5.0-C
  118. Debian GNU/Linux - 2.2 3.0
  119. Solaris 2.[67] 2.8 -
  120. ----------------- -------- -------- --------
  121. NetBSD 1.5 1.5.1 -
  122. OpenBSD - 2.9 -
  123. Tru64 - 5.0A 5.1A