In addition to the dependencies manually specified by specfiles, RPM generates dependencies based on the output of ldd. For instance, if a binary in an RPM is dynamically linked to libc.so, the package will require libc.so. Thus in order to install RPM, it is necessary not only to install the RPM binaries, but also to inform RPM of all the shared libraries present on a system.
Each bootstrap script uses "virtual" packages to populate the RPM database. The virtual packages all have names prefixed by "vpkg-" and contain no files. Each virtual package, however, provides dependency information enabling the installation of RPMs which depend on files outside of RPM's control.
Each bootstrap script generates specfiles for virtual packages; they do build or install the resultant RPMs. However, since generating and building specfiles can be time-consuming, each script is set up to use a cache of virtual packages (in RPM, not specfile, form) located on rpm.rutgers.edu. Unless the use of the cache is disabled (with the "-c" switch), the scripts will download what they can into /usr/local/src/rpm-packages/RPMS/sparc (or /usr/local/src/rpm-packages/RPMS/sparc64, depending on the distribution being used) and build what they must in /usr/local/src/rpm-packages/VPKG-SPECS.
solaris-contents.pl populates the RPM database with the shared libraries provided by Sun packages. It can be used to build and download virtual packages for all Sun packages, build and download virtual packages for a list of Sun packages provided on the command line (with the "-p" switch, which must be the last on the command line), or build and download virtual packages for all Sun packages without corresponding virtual packages in the RPM installation on the machine (with the "-u" switch). The latter mode is used when updating the RPM database after installing new Sun packages.
shells.pl populates the RPM database with the shells available on the system. Similar to solaris-contents.pl, it can be used to build virtual packages for all shells or a list of shells (with the "-p" switch). It has no update mode.
Since shells.pl will check for perl, if you want to use Sun's perl, install it before running shells.pl. If you want to use our perl, uninstall Sun's perl before running shells.pl (or run "rpm -e vpkg-perl" before installing perl).
tint.pl adds dependency information for packages installed by tint. Similar to shells.pl, it can be used to build virtual packages for all tint packages or a list of tint packages (with the "-p" switch). It has no update mode.
RPM's dependency calculation is unfortunately not bulletproof; after generating all virtual packages, there may be "unsatisfied" requirements. missing.pl, when invoked with a list of RPMs, generates a final virtual package which shores up the database. Since the output of missing.pl differs from machine to machine, it does not use the cache.
Currently (August 22, 2001) there are 6 RPM distributions:
The choice of distribution determines the cache, location and extension of RPMS, and the initial packages installed during the bootstrap process. By default each bootstrap script guesses the distribution from the output of uname -r and isainfo -b (with the function guess_repository in Bootstrap.pm). From this, Bootstrap.pm sets the name of the rpmbuild command, the appropriate rpm and cache directories on rpm.rutgers.edu, the local rpm directory, and the extension to expect from rpm.
To override the default distribution, use the "-r" switch with the bootstrap scripts (except for missing.pl, which does not use the repository).
repository-data.pl prints information about the distributions available. If invoked with no arguments, it prints the output of guess_repository. If invoked with two arguments, it sets the distribution to the first argument and prints the value of the second argument for the specified distribution. For usage information, run "perl repository-data.pl info".
To add distributions to the bootstrap system you must edit the %repositories hash defined in Bootstrap.pm and, optionally, the guess_repositories function. Each entry in %repositories is specified by the name of the distribution and is associated with a reference to a hash with 5 keys:
| Key | Use |
|---|---|
| 'RPMBUILD' | This is the command used on the local machine to build RPMs. It should not include the "-b*" switch but should include any other switches, such as "--target". |
| 'RPMS' | This is the directory on rpm.rutgers.edu beneath $ftp_prefix where the distribution's RPMs are located. |
| 'LOCAL_RPMS' | This is the directory on the local machine where binary RPMs are installed by RPMBUILD -bb or RPMBUILD -ba. |
| 'CACHE' | This is the directory on rpm.rutgers.edu beneath $ftp_prefix where the appropriate cache is located. |
| 'EXTENSION' | This is the extension that RPM appends to %{name}-%{version}-%{release} when building RPMs. It should include the period at the beginning. |
| 'SOURCES_LIST' | This should be a valid sources.list entry (without the newline) for the distribution. |
To change the ftp information, edit the $ftp_server and $ftp_prefix variables. Do not change $rpm_spec_dir without changing the $LOCAL_SPECS variable in bootstrap.sh.
Since shell scripts in the bootstrap system need to download RPMs, grab_rpm.pl is provided. Given the names of RPMs without extensions, it downloads the RPMs from the appropriate distribution on rpm.rutgers.edu and places them in LOCAL_RPMS.
To bootstrap a machine, use bootstrap.sh. With the "-r" switch, you can force it to use a specific distribution with the "-t" switch, you can run tint.pl during the process.
bootstrap.sh downloads RPMs of RPM, apt, db, zlib, popt, bzip2, and libstdc++. It then installs them with rpm2cpio and makes the temporary directories needed by RPM. It runs solaris-contents.pl, shells.pl, and optionally tint.pl; and builds the associated binary virtual packages. It then runs missing.pl on the resultant RPMs to provide any outstanding requirements, builds the generated specfile, and installs all the binary RPMs built in the process. Finally, it uses rpm to install the packages downloaded at the start.
bootstrap.sh assumes that it is not installing RPM over a previous installation of RPM. If LOCAL_RPMS contains old binary virtual packages, bootstrap.sh will install them along with the new.
To upgrade RPM from 3.0.5 or 3.0.6 to 4.0.2, use upgrade-rpm.sh. It installs RPM 3.0.6, rebuilds the database, installs the newest version of Berkeley db, installs RPM 4.0.2, and rebuilds the database again (converting from db 1 to db 3 format). It also saves a tarball of the old RPM database in case an error occurs.
The bootstrap system requires a working perl. If perl is not available on the machine which is being bootstrapped, this perl is downloaded from rpm.rutgers.edu.
The perl script gen-bootstrap-dist.pl is included to facilitate building .cpio.Z snapshots of the bootstrap distribution. gen-bootstrap-dist.pl checks out the latest copy of the bootstrap software and then compresses it. It uses cpio(1) rather than tar(1) to generate the final distribution, because some of the filenames are too long for Sun tar. It uses compress because it is installed with Solaris.