OpenPKG Project
OpenPKG ProjectDocumentationTutorial

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.
optionally direct /openpkg to at least 150MB free disk space:
$ mkdir /storage/openpkg
$ ln -s /storage/openpkg /openpkg

optionally direct temporary directory to at least 250MB free disk space:
$ TMPDIR=/var/tmp
$ export TMPDIR

switch to temporary directory:
$ 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

download bootstrap source shell package:
$ wget http://openpkg.org/go/download/openpkg.src.sh

build bootstrap binary shell package from source shell package:
$ sh openpkg.src.sh \
  --prefix=/openpkg --tag=openpkg \
  --user=openpkg --group=openpkg 

install bootstrap binary script package:
$ sh openpkg-*-*.*-openpkg.sh

3. 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.
build and install GNU Bash:
$ /openpkg/bin/openpkg build bash | sh
4. 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

5. 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 build \
  [-Dpackage1::with_name] \
  [-Dpackage2::with_name] \
  package1 package2 … | sh

6. 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`
100% Painless Tryout!

Creating an OpenPKG instance (including installing arbitrary packages into it) is totally non-intrusive to the underlying Unix operating system (OS)!

OpenPKG uses just six small OS connection points (a presence file /etc/openpkg, three entries in the system passwd database, three entries in the system group database, entries in the root cron table, a single run-command script and the top-level directory of the OpenPKG instance).

Beside those six connection points, OpenPKG does not touch anything else on the underlying OS. Everything touched is below the chosen filesystem prefix only.

Notice also that an OpenPKG installation at any time can be residue-freely removed with the command "openpkg rpm -e `openpkg rpm -qa`".

Validation: XHTML | CSS