Documentation: Tutorial
This tutorial helps you to get started with OpenPKG by
guiding you through the first steps in software deployment with OpenPKG.
1. System Preparation (optional)
Before you start, the Unix system optionally should be prepared.
Here especially the necessary disk space requirements of OpenPKG
have to be taken into account.
$ mkdir /storage/openpkg
$ ln -s /storage/openpkg /openpkg
$ TMPDIR=/var/tmp
$ export TMPDIR
$ cd $TMPDIR
2. Instance Bootstrapping
The next step is to bootstrap the OpenPKG instance. Here we are using
the standard /openpkg filesystem prefix. An arbitrary prefix can
be used as long as at least the "Bootstrap From Source" approach is
used.
Bootstrap From Source
$ ftp ftp.openpkg.org
ftp> bin
ftp> cd /SRC/CORE
ftp> get openpkg--.src.sh
ftp> bye
$ sh openpkg--.src.sh \\
--prefix=/openpkg --tag=openpkg \\
--user=openpkg --group=openpkg
$ sh openpkg--.platform-openpkg.sh
$ echo "TAG=" >/openpkg/etc/openpkg/release
$ /openpkg/bin/openpkg build openpkg-tools | sh
Bootstrap From Binary (alternatively)
$ ftp ftp.openpkg.org
ftp> bin
ftp> cd /BIN/platform/CORE
ftp> mget openpkg-*.sh \\
make-*.rpm binutils-*.rpm gcc-*.rpm perl-[0-9]*.rpm \\
openpkg-tools-*.rpm
ftp> bye
$ sh openpkg-*.platform-openpkg.sh
$ /openpkg/bin/openpkg rpm -Uvh *.platform-openpkg.rpm
$ echo "TAG=" >/openpkg/etc/openpkg/release
$ /openpkg/bin/openpkg build -Ua | sh
3. Registration (optional)
In order to access all OpenPKG download resources a simple
one-time free-of-charge registration at the central OpenPKG Registry plus a simple
identification during download is required. This is still not required
for the simple software deployment which follows under "Software
Deployment". But if you want to perform larger deployments or use the
automated build tool (which automatically picks up update packages) you
need to perform the following two steps:
User Registration
Follow the simple one-time
free-of-charge registration procedure and register yourself
under your valid Email address (say foo@example.com, although
this example address is not a valid one ;-) at the central OpenPKG Registry. Registration
requires just a few minutes and supports the OpenPKG project.
As a result your Email address is now a valid download identification
and grants you access to all download resources.
Instance Registration
$ /openpkg/bin/openpkg register \\
--mode=post --user=foo@example.com
After this command the instance is still not approved for association
to your Email address. Please login to your
OpenPKG Registry account
and manually approve the association of the instance to your account.
If you want to just quickly test-drive OpenPKG anonymously, you can
alternatively register with a time-limited token which is valid for
registration within 7 days:
$ /openpkg/bin/openpkg register \\
--mode=post --user=
4. Software Deployment
Now you can install arbitrary OpenPKG software packages by either using
the lower-level OpenPKG RPM command or the higher-level OpenPKG tool
chain build command. As a simple illustration example the GNU Bash
package of OpenPKG is installed.
Manual Deployment
$ /openpkg/bin/openpkg rpm --rebuild \\
ftp://ftp.openpkg.org//SRC/CORE/bash--.src.rpm
$ /openpkg/bin/openpkg rpm -Uvh \\
/openpkg/RPM/PKG/bash--.platform-openpkg.rpm
Automated Deployment (alternatively)
$ /openpkg/bin/openpkg build bash | sh
5. Software Usage
Finally, you can use the deployed software. Either through explicit
paths (reasonable if leveraging OpenPKG's multiple-instance feature) or
implicitly by merging the OpenPKG instance into the local environment.
Explicit Usage
$ /openpkg/bin/bash --version
Implicit Usage (alternatively)
$ eval `/openpkg/bin/openpkg rc --eval all env`
$ bash --version
6. Go Ahead!
Want to know more now? Please read the manual pages of at least the
deployment commands and then proceed by deploying even more software
into your OpenPKG instance...
Read Manual Pages
$ /openpkg/bin/openpkg man rpm
$ /openpkg/bin/openpkg man build
Deploy Even More
$ /openpkg/bin/openpkg rpm \\
--rebuild [--with name] \\
ftp://ftp.openpkg.org//SRC/class/package-...
$ /openpkg/bin/openpkg rpm -Uvh \\
/openpkg/RPM/PKG/package-...
$ /openpkg/bin/openpkg build \\
[-Dpackage1::with_name] \\
[-Dpackage2::with_name] \\
package1 package2 ... | sh
7. Cleanup
OpenPKG has not convinced you? Well, it's a pity, but no problem. You
can easily get rid of anything you installed at once (both the OpenPKG
instance and any of its OpenPKG packages) with the following simple
command:
$ /openpkg/bin/openpkg rpm -e \\
`/openpkg/bin/openpkg rpm -qa`