head 1.32; access; symbols INITIAL:1.1.1.1 VENDOR:1.1.1; locks; strict; comment @# @; 1.32 date 2005.10.19.09.20.04; author openpkg; state Exp; branches; next 1.31; 1.31 date 2005.06.22.08.37.54; author thl; state Exp; branches; next 1.30; 1.30 date 2005.02.24.16.03.19; author rse; state Exp; branches; next 1.29; 1.29 date 2005.02.24.15.55.52; author rse; state Exp; branches; next 1.28; 1.28 date 2004.10.20.08.06.07; author thl; state Exp; branches; next 1.27; 1.27 date 2004.07.20.07.59.16; author thl; state Exp; branches; next 1.26; 1.26 date 2004.04.15.18.09.41; author rse; state Exp; branches; next 1.25; 1.25 date 2004.02.27.14.59.50; author thl; state Exp; branches; next 1.24; 1.24 date 2004.02.25.15.39.00; author thl; state Exp; branches; next 1.23; 1.23 date 2004.02.25.09.26.00; author thl; state Exp; branches; next 1.22; 1.22 date 2004.02.23.17.37.34; author cs; state Exp; branches; next 1.21; 1.21 date 2003.08.07.14.46.09; author thl; state Exp; branches; next 1.20; 1.20 date 2003.08.04.07.32.36; author thl; state Exp; branches; next 1.19; 1.19 date 2003.08.01.20.08.18; author thl; state Exp; branches; next 1.18; 1.18 date 2003.01.22.13.12.54; author rse; state Exp; branches; next 1.17; 1.17 date 2003.01.21.12.57.31; author ms; state Exp; branches; next 1.16; 1.16 date 2003.01.15.11.12.26; author ms; state Exp; branches; next 1.15; 1.15 date 2002.10.04.15.42.12; author ms; state Exp; branches; next 1.14; 1.14 date 2002.08.28.14.51.24; author thl; state Exp; branches; next 1.13; 1.13 date 2001.12.14.13.50.31; author rse; state Exp; branches; next 1.12; 1.12 date 2001.12.06.10.16.11; author rse; state Exp; branches; next 1.11; 1.11 date 2001.12.06.08.15.34; author rse; state Exp; branches; next 1.10; 1.10 date 2001.12.05.15.28.10; author rse; state Exp; branches; next 1.9; 1.9 date 2001.12.05.10.50.18; author rse; state Exp; branches; next 1.8; 1.8 date 2001.11.30.16.48.26; author rse; state Exp; branches; next 1.7; 1.7 date 2001.11.29.19.51.07; author rse; state Exp; branches; next 1.6; 1.6 date 2001.11.29.19.48.17; author rse; state Exp; branches; next 1.5; 1.5 date 2001.11.27.15.18.13; author rse; state Exp; branches; next 1.4; 1.4 date 2001.11.27.13.32.46; author rse; state Exp; branches; next 1.3; 1.3 date 2001.11.27.12.18.34; author rse; state Exp; branches; next 1.2; 1.2 date 2001.11.22.15.57.49; author rse; state Exp; branches; next 1.1; 1.1 date 2001.08.28.12.57.50; author rse; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 2001.08.28.12.57.50; author rse; state Exp; branches; next ; desc @@ 1.32 log @update website for OpenPKG 2.5 @ text @ #use "page.inc" page=tutorial 2.5 3.0.16 User Tutorial

User Tutorial

This tutorial guides you on your way into the world of OpenPKG. It explains some essential cornerstones, shows you how to bootstrap OpenPKG and shows you how to use OpenPKG to install a common and useful example application, GNU bash.

Cornerstones

Platform Support

By design minimal assumptions about the underlying Unix flavor are made. Nevertheless it is quixotic to assume every operating system receives equal support. Some platforms are fully supported, some are supported and the remainder might work.

Package Types

Two types of packages exist, source and binary. A source package usually contains all files necessary to build a binary package. This includes the pristine vendor sources, patches, fake syslog library configuration and run commands. It also contains a spec file which is the heart of OpenPKG. Inside are instructions how to unpack, modify, patch, build, install and otherwise transform into a installable binary package. The source package can be thought of being a clonogenic cell which adapts to the target machine and a arbitrary prefix when being transformed into a binary package. A source package might have options which will further augment the number of binary packages by creating variants. Only binaries build for one single prefix /openpkg and using the default options are availabe for download. The OpenPKG way of deployment is to use source packages with build binary once, deploy to across many equal machines being a common scenario.

Package Classes

Packages are classified so the user can assess what quality and support level to expect. CORE packages are tweaked to work on all supported platforms and binary packages are provided. BASE packages build on all fully supported platforms and binaries are provided, too. PLUS packages are available as source packages only. They have been tested to work on all fully supported and most supported platforms.

Source packages

Source packages of CORE+BASE+PLUS packages are availabe for download. They apply to all supported platforms.

Binary packages

Binary packages prebuild for /openpkg prefix using openpkg tag are availabe for download. They apply only for the specific platform they were built for. CORE packages are available for all supported platforms. BASE packages are availbale for all fully supported platforms. No binaries are provided for PLUS packages.

While we strongly recommend using source packages whenever possible, the absence of development tools and mass rollouts are reasons which enforce the use of binaries. Let's make a quick'n'dirty but mostly useful check:

$ which gcc cc || echo "bad luck, no development tools"
The matrix below tells you about all four combinations of bootstrapping or regular installing/upgrading a package from source or binary. For the tutorial, please select the bootstrap method you prefer or require. Then come back and continue below.

Security Updates

Security updates and bugfixes are available for CORE+BASE packages. They are availabe for download as source packages.

Download Area

The following table lists platforms, support level and available source and binary packages available from the OpenPKG download area. Please note that PLUS/ is a subdirectory.

source packages  class
complete release  CORE+BASE+PLUS
security udpates  CORE+BASE
binary packages (arch-os class
amd64-freebsd5.4  CORE+BASE
ix86-debian3.1  CORE+BASE
ix86-fedora4  CORE+BASE
ix86-freebsd5.4  CORE+BASE
ix86-freebsd6.0  CORE+BASE
ix86-netbsd2.0.2  CORE+BASE
ix86-rhel4  CORE+BASE
ix86-solaris10  CORE+BASE
ix86-solaris9  CORE+BASE
ix86-suse10.0  CORE+BASE
sparc64-solaris10  CORE+BASE
sparc64-solaris9  CORE+BASE
ia64-freebsd5.4  CORE
ix86-freebsd7.0  CORE
ix86-gentoo1.12.0  CORE
ix86-mandriva10.2  CORE
ix86-freebsd4.11  CORE
ix86-suse9.3  CORE
sparc64-solaris8  CORE

The portable nature enables additional platforms to leverage portions of OpenPKG technology on other Unix platforms. Some unofficial binaries for such platforms can be found on ZfOS.

Privileges

OpenPKG does not require root privileges to build packages. In addition, many packages including the bootstrap can be installed without root privileges but functionality might be limited. This example uses $ to indicate a user prompt and # to indicate a root prompt.

Storage

Make sure you have approximately 250MB free disk space on the filesystem were OpenPKG should be loaded. The installation procedure creates a directory for the OpenPKG instance but it also accepts a pre-existing directory or a symlink to a pre-existing directory. The downloadable binary packages use the prefix /openpkg and so does this tutorial. However, using source packages it is possible to use an arbitrary prefix and in fact the OpenPKG architecture places no artifical limit on the number of parallel and simultaneous instances on a single system.
$ mkdir  /storage/with/250MB/free
$ ln -s  /storage/with/250MB/free /openpkg

Workspace

Build processes sometimes take large amounts of temporary disk space. For our example you should have approximately 250MB of temporary disk space available somewhere. OpenPKG reads the environment variable TMPDIR to locate a large workspace.
$ TMPDIR= /var/tmp/with/250MB/free
$ export TMPDIR

System tools

We assume a Unix system with minimal toolset for binaries. Sources require development tools like make and [g]cc as well. There is no ultimate standard that tells what a minimal toolset is, so we have to traverse some fog here. The bootstrap process needs a little help and require sh and tar in PATH. Also if you want to install a compiler package from source you need a compiler. Solve this chicken-egg problem using any exising binary compiler package from the vendor, OpenPKG or a third party. Tell OpenPKG about your favorite CFLAGS and CC, see the FAQ.

Release Engineering

Those who have installed unreleased packages from CURRENT, STABLE or SNAPSHOTs should be aware of the principles behind OpenPKG release engineering. Note that the version numbers of these packages are formatted as timestamps rather than what is expected a release number. Decoding such version numbers yields very large integers. Any release package will clearly have a lower number even if it is a more mature version of the same package! Switching from a unpublished package to a released package is considered a 'downgrade' by RPM. This works by design according to the OpenPKG standards of release engineering. To easily upgrade or downgrade such uncooperative packages in general, RPM offers the options --oldpackage and --nodeps to be added to --rebuild and -Uvh instructions.

Build/Install Matrix

bootstrap from source bootstrap from binary regular from source regular from binary

Example Installation

See below a video recording of a Bootstrap from source on a FreeBSD machine as a unprivileged user installing onto a NFS home directory. After bootstrap, the bash package is rebuild, installed and the bash is run.

Showcase (animated gif)

More Information

Fine tuning

Do you want your shell to use the new OpenPKG environment so that you have the /openpkg/bin in your PATH, can read the man pages using the correct MANPATH etc.? There's a single command that does all of this for you. Place it in your favorite shell's profile.
$ eval `/openpkg/bin/openpkg rc --eval all env`
Enter these command examples to understand what 'eval' did for you.
$ set | grep /openpkg/
$ which rpm
$ man rpm

additional resources

Download Area

Browse the download area.

Bootstrap from source

A warning is due for all who decide to bootstrap OpenPKG with existing OpenPKG installations, because bootstrapping into an existing OpenPKG hierarchy (such as /openpkg) discards the contents of its internal RPM database! When learning OpenPKG, it is safest to bootstrap into an empty directory which OpenPKG will automatically create for you if not existing.

Should an upgrade of the actual OpenPKG itself be desired, this is not carried out by bootstrapping again. Rather, install the next OpenPKG version just as any other package. Go back to the matrix to see the upgrade options again.

$ cd $TMPDIR
$ ftp ftp.openpkg.org
Connected to ftp.openpkg.org.
220 ftp.openpkg.org OpenPKG Anonymous FTP Server ready.
Name (ftp.openpkg.org): anonymous
331 Anonymous login ok, send your email address as your password.
Password: you@@example.com
230- [...] Welcome to OpenPKG.org! [...]
230 Anonymous access granted, restrictions apply.
ftp> bin
200 Type set to I.
ftp> cd release//SRC
ftp> get openpkg-.0-.0.src.sh
ftp> bye
221 Goodbye.

Choose the prefix, tag, user and group of your choice. You can omit all but prefix. Unprivileged users must choose their login and primary group which is their default anyway.

$ sh openpkg-.0-.0.src.sh \\ --prefix=/openpkg --tag=openpkg --user=openpkg --group=openpkg $ su \# cd $TMPDIR \# sh openpkg-.0-.0.arch-os-openpkg.sh \# exit $

Back to the matrix.

Bootstrap from binary

A warning is due for all who decide to bootstrap OpenPKG with existing OpenPKG installations, because bootstrapping into an existing OpenPKG hierarchy (such as /openpkg) discards the contents of its internal RPM database! When learning OpenPKG, it is safest to bootstrap into an empty directory which OpenPKG will automatically create for you if not existing.

Should an upgrade of the actual OpenPKG itself be desired, this is not carried out by bootstrapping again. Rather, install the next OpenPKG version just as any other package. Go back to the matrix to see the upgrade options again.

$ cd $TMPDIR
$ ftp ftp.openpkg.org
Connected to ftp.openpkg.org.
220 ftp.openpkg.org OpenPKG Anonymous FTP Server ready.
Name (ftp.openpkg.org): anonymous
331 Anonymous login ok, send your email address as your password.
Password: you@@example.com
230- [...] Welcome to OpenPKG.org! [...]
230 Anonymous access granted, restrictions apply.
ftp> bin
200 Type set to I.
ftp> cd release//BIN
ftp> get arch-os/openpkg-.0-.0.arch-os-openpkg.sh
ftp> bye
221 Goodbye.
$ su
\# cd $TMPDIR
\# sh openpkg-.0-.0.arch-os-openpkg.sh
\# exit
$
Back to the matrix.

Regular installation/update from source

$ /openpkg/bin/openpkg rpm --rebuild \\
    ftp://ftp.openpkg.org/release//SRC/foo-X.Y-.0.src.rpm
$ su
\# /openpkg/bin/openpkg rpm -Uvh \\
    /openpkg/RPM/PKG/foo-X.Y-.0.arch-os-openpkg.rpm

Example URL

    ftp://ftp.openpkg.org/release//SRC/bash--.0.src.rpm

Example PKG paths

    /openpkg/RPM/PKG/ ...
    ... bash--.0.hppa-hpux11.11
    ... bash--.0.ix86-debian3.0
    ... bash--.0.ix86-debian3.1
    ... bash--.0.ix86-fedora2
    ... bash--.0.ix86-freebsd4.10
    ... bash--.0.ix86-freebsd5.3
    ... bash--.0.ix86-gentoo1.5.3
    ... bash--.0.ix86-mandrake10.0
    ... bash--.0.ix86-netbsd1.6.2
    ... bash--.0.ix86-rhel3
    ... bash--.0.ix86-solaris10
    ... bash--.0.ix86-solaris9
    ... bash--.0.ix86-suse9.2
    ... bash--.0.ix86-suse9
    ... bash--.0.sparc64-solaris10
    ... bash--.0.sparc64-solaris2.6
    ... bash--.0.sparc64-solaris8
    ... bash--.0.sparc64-solaris9
Back to the matrix.

Regular installation/update from binary

$ su
\# /openpkg/bin/openpkg rpm -Uvh \\
    ftp://ftp.openpkg.org/release//BIN/platform/foo-X.Y-.0.arch-os-openpkg.rpm

Example URLs

    ftp://ftp.openpkg.org/release//BIN/ ...
    ... hppa-hpux11.11/bash--.0.hppa-hpux11.11
    ... ix86-debian3.0/bash--.0.ix86-debian3.0
    ... ix86-debian3.1/bash--.0.ix86-debian3.1
    ... ix86-fedora3/bash--.0.ix86-fedora3
    ... ix86-freebsd4.11/bash--.0.ix86-freebsd4.11
    ... ix86-freebsd5.3/bash--.0.ix86-freebsd5.3
    ... ix86-gentoo1.6.9/bash--.0.ix86-gentoo1.6.9
    ... ix86-mandrake10.2/bash--.0.ix86-mandrake10.1
    ... ix86-netbsd2.0/bash--.0.ix86-netbsd2.0
    ... ix86-rhel3/bash--.0.ix86-rhel3
    ... ix86-solaris10/bash--.0.ix86-solaris10
    ... ix86-solaris9/bash--.0.ix86-solaris9
    ... ix86-suse9.2/bash--.0.ix86-suse9.2
    ... ix86-suse9.1/bash--.0.ix86-suse9.1
    ... sparc64-solaris10/bash--.0.sparc64-solaris10
    ... sparc64-solaris8/bash--.0.sparc64-solaris8
    ... sparc64-solaris9/bash--.0.sparc64-solaris9
Back to the matrix. @ 1.31 log @uprev tutorial @ text @d3 1 a3 1 2.4 d92 8 a99 5 ix86-debian3.0  CORE+BASE ix86-fedora3  CORE+BASE ix86-freebsd4.11  CORE+BASE ix86-freebsd5.3  CORE+BASE ix86-rhel3  CORE+BASE d101 2 a102 4 ix86-solaris10  CORE+BASE ix86-suse9.2  CORE+BASE ix86-suse9  CORE+BASE sparc64-solaris8  CORE+BASE d104 7 a110 10 sparc64-solaris10  CORE hppa-hpux11.11  CORE ix86-debian3.1  CORE ix86-gentoo1.6.9  CORE ix86-mandrake10.1  CORE ix86-netbsd2.0  CORE ix86-freebsd6.0  CORE ia64-freebsd5.3  CORE sparc64-freebsd5.3  CORE ppc-darwin7.8.0  CORE @ 1.30 log @more fixes for release @ text @d3 2 a4 2 2.3 3.0.13 @ 1.29 log @update website for OpenPKG 2.3 release @ text @a110 1 amd64-freebsd5.3  CORE @ 1.28 log @update tutorial for OpenPKG 2.2, fix typo, mention ZfOS, update rc example using new 2.x @ text @d3 1 a3 1 2.2 d93 2 a94 2 ix86-fedora2  CORE+BASE ix86-freebsd4.10  CORE+BASE a95 1 ix86-gentoo1.5.3  CORE+BASE d98 3 a100 1 ix86-suse9.1  CORE+BASE d103 1 d106 8 a113 8 ix86-mandrake10.0  CORE ix86-netbsd1.6.2  CORE ix86-solaris10  CORE ix86-suse9.0  CORE sparc64-solaris10  CORE sparc64-solaris2.6  CORE sparc64-solaris8  CORE sparc64-solaris9  CORE d118 1 a118 1 portions of OpenPKG technology on NetBSD, OpenBSD and Tru64. d355 2 a356 2     ... bash--.0.ix86-suse9.0     ... bash--.0.ix86-suse9.1 d380 2 a381 2     ... ix86-fedora2/bash--.0.ix86-fedora2     ... ix86-freebsd4.10/bash--.0.ix86-freebsd4.10 d383 3 a385 3     ... ix86-gentoo1.5.3/bash--.0.ix86-gentoo1.5.3     ... ix86-mandrake10.0/bash--.0.ix86-mandrake10.0     ... ix86-netbsd1.6.2/bash--.0.ix86-netbsd1.6.2 d389 1 a389 1     ... ix86-suse9.0/bash--.0.ix86-suse9.0 a391 1     ... sparc64-solaris2.6/bash--.0.sparc64-solaris2.6 @ 1.27 log @small and/or cosmetic changes to web site @ text @d3 2 a4 2 2.0 2.05b a91 2 ix86-freebsd4.9  CORE+BASE ix86-freebsd5.2  CORE+BASE d93 4 a96 2 ix86-debian3.1  CORE+BASE ix86-fedora1  CORE+BASE a97 1 ix86-suse9.0  CORE+BASE d99 1 d102 7 a108 5 ix86-solaris10  CORE+BASE ix86-debian2.2  CORE ix86-rhl9  CORE ix86-suse8.2  CORE ix86-gentoo1.4.3  CORE d110 2 d115 4 a118 2 The portable nature enables additional platforms to leverage portions of OpenPKG technolgy on NetBSD, OpenBSD and Tru64. d210 1 a210 1 $ eval `/openpkg/etc/rc --eval all env` d341 18 a358 16     ... bash--.0.ix86-freebsd4.9-openpkg.rpm     ... bash--.0.ix86-freebsd5.2-openpkg.rpm     ... bash--.0.ix86-debian2.2-openpkg.rpm     ... bash--.0.ix86-debian3.0-openpkg.rpm     ... bash--.0.ix86-debian3.1-openpkg.rpm     ... bash--.0.ix86-fedora1-openpkg.rpm     ... bash--.0.ix86-rhel3-openpkg.rpm     ... bash--.0.ix86-rhl9-openpkg.rpm     ... bash--.0.ix86-suse8.2-openpkg.rpm     ... bash--.0.ix86-suse9.0-openpkg.rpm     ... bash--.0.ix86-gentoo1.4.3-openpkg.rpm     ... bash--.0.ix86-solaris10-openpkg.rpm     ... bash--.0.ix86-solaris9-openpkg.rpm     ... bash--.0.sparc64-solaris9-openpkg.rpm     ... bash--.0.sparc64-solaris8-openpkg.rpm     ... bash--.0.sparc64-solaris2.6-openpkg.rpm d375 18 a392 16     ... ix86-freebsd4.9/bash-2.05b-2.0.0.ix86-freebsd4.9-openpkg.rpm     ... ix86-freebsd5.2/bash-2.05b-2.0.0.ix86-freebsd5.2-openpkg.rpm     ... ix86-debian2.2/bash-2.05b-2.0.0.ix86-debian2.2-openpkg.rpm     ... ix86-debian3.0/bash-2.05b-2.0.0.ix86-debian3.0-openpkg.rpm     ... ix86-debian3.1/bash-2.05b-2.0.0.ix86-debian3.1-openpkg.rpm     ... ix86-fedora1/bash-2.05b-2.0.0.ix86-fedora1-openpkg.rpm     ... ix86-rhel3/bash-2.05b-2.0.0.ix86-rhel3-openpkg.rpm     ... ix86-rhl9/bash-2.05b-2.0.0.ix86-rhl9-openpkg.rpm     ... ix86-suse8.2/bash-2.05b-2.0.0.ix86-suse8.2-openpkg.rpm     ... ix86-suse9.0/bash-2.05b-2.0.0.ix86-suse9.0-openpkg.rpm     ... ix86-gentoo1.4.3/bash-2.05b-2.0.0.ix86-gentoo1.4.3-openpkg.rpm     ... ix86-solaris10/bash-2.05b-2.0.0.ix86-solaris10-openpkg.rpm     ... ix86-solaris9/bash-2.05b-2.0.0.ix86-solaris9-openpkg.rpm     ... sparc64-solaris9/bash-2.05b-2.0.0.sparc64-solaris9-openpkg.rpm     ... sparc64-solaris8/bash-2.05b-2.0.0.sparc64-solaris8-openpkg.rpm     ... sparc64-solaris2.6/bash-2.05b-2.0.0.sparc64-solaris2.6-openpkg.rpm @ 1.26 log @link new slideset into website @ text @d112 1 a112 2 OpenPKG technolgy on NetBSD, OpenBSD and Mandrake Linux [FIXME HP Tru64, SCO UnixWare and QNX] @ 1.25 log @cosmetics @ text @d220 1 a220 1
  • OpenPKG Introduction Slideset
  • @ 1.24 log @move big animated gif into new showcase page @ text @d87 1 a87 1 @ 1.23 log @flush pending updates for OpenPKG 2.0 @ text @d193 2 a194 1 @ 1.22 log @updated grid.png @ text @d3 1 a3 1 1.3 d9 60 d70 15 a84 22 This tutorial guides you on your way into the world of OpenPKG. It shows you how to bootstrap OpenPKG and use it to install a common and useful example application, GNU bash. For details about the commands being used in this document, see the OpenPKG Quick Reference, refer to the OpenPKG Handbook to dive deeper, or take off and have a look at the OpenPKG Introduction Slideset for a bird's eye view.

    Prerequisites

    OpenPKG by design makes minimal assumptions about the underlying operating system, but some basic things need to be checked.

    Platform

    The less you know about OpenPKG the more important is that you are using a supported primary or at least secondary [*] platform. The following table uses a row for each supported platform and gives three names for it in different columns. You will find that OpenPKG software uses arch-os to create filenames and the same ones are used on the ftp download site. Humans and documentation use what is shown below platform. To ensure that we really talk about the same thing, enter the uname command in a shell and find the output of the rightmost column. d88 20 a107 12 d111 10 a120 13 If your platform is not part of this list, don't panic. OpenPKG runs well on many other Unix platforms. There is a high probability that your particular platform will work, especially if it is a recent version of a major Unix platform such as NetBSD, OpenBSD, Gentoo Linux, HP Tru64, SCO UnixWare or QNX. For more details of see OpenPKG handbook

    Permission

    Additionally make sure you have root access to your system. Although it is not necessary to work out the whole stuff as root, we do need this in the later stages of our example installation. Keep in mind that OpenPKG can be used in a limited way without having root access but this is not discussed here. d123 9 a131 9 Also make sure you have approximately 250MB free disk space on the filesystem were OpenPKG should be loaded. The installation procedure creates a directory for the OpenPKG instance but it also accepts a pre-existing directory or a symlink to a pre-existing directory and will use it. The downloadable binary packages use the prefix /cw and so does this tutorial. However, using source packages it is possible to use an arbitrary prefix and in fact the OpenPKG architecture allows any number of parallel and simultaneous instances on a single system - until a critical resource is exhausted. d135 1 a135 1 $ ln -s /storage/with/250MB/free/cw d140 3 a142 3 For our example you should have approximately 250MB of temporary disk space available somewhere. OpenPKG reads the environment variable TMPDIR to locate an hopefully large workspace. d145 1 a145 1 $ TMPDIR=/tmp/with/250MB/free d151 8 a158 11 require development tools like make and [g]cc as well. There is no ultimate standard that tells what a minimal toolset is, so we have to traverse some fog here. For regular installations with an existing OpenPKG bootstrap, indicated by an executable prefix/bin/rpm, there are nearly zero additional system requirements. However, the bootstrap process needs a little help and requires sh, tar, ftp and uudecode (Attention: United Linux seems to have moved this into a optional sharutils system package) in the PATH. Also if you want to install a compiler package from source, you need a vendor compiler first. To tell OpenPKG about your favorite Source or Binary While we strongly recommend you to use source packages whenever possible, the absence of development tools is the number one reason which enforces the use of binaries for deployment. Let's make a quick'n'dirty but mostly useful check:
    $ which gcc cc || echo "bad luck, no development tools"
    
    The matrix below tells you about all four combinations of bootstrapping or regular installing/upgrading a package from source or binary. For the tutorial, please select the bootstrap method you prefer or require. Then come back and
    continue below.

    Release Engineering

    Those who have installed unreleased packages from CURRENT, STABLE or SNAPSHOTs should be aware of the principles behind OpenPKG release engineering. Note that the version numbers of these packages are formatted as timestamps rather than what is expected from a released package. Decoding such version numbers yields very large integers. Any RELEASE package will clearly have a lower number even if it is a more mature version of the same package!

    For this reason, switching from a unpublished package to a official released package is considered a 'downgrade' by RPM. This works by design according to the OpenPKG standards of release engineering. To easily upgrade or downgrade such uncooperative packages in general, RPM offers the options --oldpackage and --nodeps to be added to d178 1 a178 1

    Matrix

    d188 14 a201 2 Select one of the four installation examples in the matrix above to begin the tutorial and make a regular installation of bash--.0.src.rpm. d204 1 a204 11 $ /cw/bin/bash

    Fine tuning

    Do you want your shell to use the new OpenPKG environment so that you have the /cw/bin in your PATH, can read the man pages using the correct MANPATH etc.? There's a single command that does all of this for you. Place it in your favourite shell's profile.
    $ eval `/cw/etc/rc --eval all env`
    d210 1
    a210 1
    $ set | grep /cw/
    d215 12
    a226 1
    

    Want more packages?

    d232 1 a232 1

    Bootstrap from source

    d234 6 a239 5 A warning is due for all who decide to bootstrap OpenPKG with existing OpenPKG installations, because bootstrapping into an existing OpenPKG hierarchy (such as /cw) discards the contents of its internal RPM database! When learning OpenPKG, it is safest to bootstrap into an empty directory which OpenPKG will automatically create for you if not existing. d241 4 a244 4 Should an upgrade of the actual OpenPKG itself be desired, this is not carried out by bootstrapping again. Rather, install the next OpenPKG version just as any other package. Go back to the matrix to see the upgrade options again. d261 7 a267 1 $ sh openpkg-.0-.0.src.sh --prefix=/cw --user=cw --group=cw d270 1 a270 1 \# sh openpkg-.0-.0.arch-os-cw.sh d276 2 d279 1 a279 1

    Bootstrap from binary

    d281 6 a286 5 A warning is due for all who decide to boostrap OpenPKG with existing OpenPKG installations, because bootstrapping into an existing OpenPKG hierarchy (such as /cw) discards the contents of its internal RPM database! When learning OpenPKG, it is safest to bootstrap into an empty directory which OpenPKG will automatically create for you if not existing. d288 4 a291 4 Should an upgrade of the actual OpenPKG itself be desired, this is not carried out by bootstrapping again. Rather, install the next OpenPKG version just as any other package. Go back to the matrix to see the upgrade options again. d305 1 a305 1 ftp> get arch-os/openpkg-.0-.0.arch-os-cw.sh d310 1 a310 1 \# sh openpkg-.0-.0.arch-os-cw.sh d316 2 d319 1 a319 1

    Regular installation/update from source

    d322 1 a322 1 $ /cw/bin/rpm --rebuild \\ d325 2 a326 2 \# /cw/bin/rpm -Uvh \\     /cw/RPM/PKG/foo-X.Y-.0.arch-os-cw.rpm d334 17 a350 7     /cw/RPM/PKG/bash--.0.ix86-freebsd4.8-cw.rpm     /cw/RPM/PKG/bash--.0.ix86-freebsd5.1-cw.rpm     /cw/RPM/PKG/bash--.0.ix86-linux2.2-cw.rpm     /cw/RPM/PKG/bash--.0.ix86-linux2.4-cw.rpm     /cw/RPM/PKG/bash--.0.sparc64-solaris2.8-cw.rpm     /cw/RPM/PKG/bash--.0.sparc64-solaris2.9-cw.rpm     /cw/RPM/PKG/bash--.0.ix86-solaris2.9-cw.rpm d354 2 d357 1 a357 1

    Regular installation/update from binary

    d361 2 a362 2 \# /cw/bin/rpm -Uvh \\     ftp://ftp.openpkg.org/release//BIN/platform/foo-X.Y-.0.arch-os-cw.rpm d366 17 a382 9     ftp://ftp.openpkg.org/release//BIN/ix86-freebsd4.8/bash--.0.ix86-freebsd4.8-cw.rpm     ftp://ftp.openpkg.org/release//BIN/ix86-freebsd5.1/bash--.0.ix86-freebsd5.1-cw.rpm     ftp://ftp.openpkg.org/release//BIN/ix86-debian2.2/bash--.0.ix86-linux2.2-cw.rpm     ftp://ftp.openpkg.org/release//BIN/ix86-debian3.0/bash--.0.ix86-linux2.4-cw.rpm     ftp://ftp.openpkg.org/release//BIN/ix86-redhat9/bash--.0.ix86-linux2.4-cw.rpm     ftp://ftp.openpkg.org/release//BIN/ix86-suse8.2/bash--.0.ix86-linux2.4-cw.rpm     ftp://ftp.openpkg.org/release//BIN/sparc64-solaris8/bash--.0.sparc64-solaris2.8-cw.rpm     ftp://ftp.openpkg.org/release//BIN/sparc64-solaris9/bash--.0.sparc64-solaris2.9-cw.rpm     ftp://ftp.openpkg.org/release//BIN/ix86-solaris9/bash--.0.ix86-solaris2.9-cw.rpm @ 1.21 log @spell checking and correcting @ text @d141 4 a144 4 bootstrap from source bootstrap from binary regular from source regular from binary @ 1.20 log @more infos about both tables; improve download URL @ text @d71 1 a71 1 use an arbitrary prefix and in fact the OpenPKG architecture allowes any d103 1 a103 1 first. To tell OpenPKG about your favourite get platform/openpkg-.0-.0.arch-os-cw.sh
    @ 1.18 log @flush everything prepared for OpenPKG 1.2 @ text @d3 1 a3 1 1.1 d10 4 a13 4 This tutorial guides you on your way into the world of OpenPKG showing you how to bootstrap OpenPKG and install GNU Bash as an example. For more details about the commands used, see the OpenPKG Quick Reference or refer to the d19 2 d22 4 a25 2 Ensure that your system is one of the fully supported platforms: d30 6 a35 2
    d38 3 a40 2 a41 1

    a42 1 d47 1 a47 1 platform such as BSD, Linux, Solaris, Tru64, or HP-UX. For more details of d52 21 a72 6

    Additionally make sure you have root access to your system. Although not always necessary, we do need this in the later stages of our example installation. Also make sure you have approximately 300MB free disk space on the / filesystem. You can move and symlink to some better places afterwards. d74 5 a78 1

    Source or Binary?

    d80 6 d87 2 a88 2 absence of development tools is the number one reason to be forced to use binaries. Let's make a quick'n'dirty but mostly useful check: d91 1 a91 1 $ which gcc cc || echo "you don't have a compiler, so must use binaries" d94 1 a94 1 The following matrix tells you about all combinations of bootstrapping or d99 2 a100 2

    Those who have installed unreleased packages from CURRENT or SNAPSHOTs should a106 1 d109 1 a109 1 one is considered a 'downgrade' by RPM. This works by design according to the d111 3 a113 3 upgrade or downgrade such uncooperative packages in general, RPM makes available the options --oldpackage and --nodeps. It is neccessary to use only one of these RPM command line options, or sometimes both. d115 1 a115 1

    d124 1 a124 2

    Example Installation

    d132 1 a132 2

    Environment

    d151 1 a151 2 see the Package Repository. d169 1 a169 1 $ cd /tmp d186 1 a186 1 \# cd /tmp d207 1 a207 1 $ cd /tmp d223 1 a223 1 \# cd /tmp d246 2 a247 1     /cw/RPM/PKG/bash--.0.ix86-freebsd4.6-cw.rpm d252 1 d266 9 a274 6     ftp://ftp.openpkg.org/release//BIN/freebsd-4.6/bash--.0.ix86-freebsd4.6-cw.rpm    ftp://ftp.openpkg.org/release//BIN/debian-2.2/bash--.0.ix86-linux2.2-cw.rpm    ftp://ftp.openpkg.org/release//BIN/debian-3.0/bash--.0.ix86-linux2.4-cw.rpm    ftp://ftp.openpkg.org/release//BIN/redhat-7.2/bash--.0.ix86-linux2.4-cw.rpm    ftp://ftp.openpkg.org/release//BIN/solaris-8/bash--.0.sparc64-solaris2.8-cw.rpm    ftp://ftp.openpkg.org/release//BIN/solaris-9/bash--.0.sparc64-solaris2.9-cw.rpm @ 1.17 log @Updated to reflect current platform requirements that are fully supported. @ text @d22 3 a24 1

    arch-os platform uname -m -r -s 
    ix86-freebsd4.8 FreeBSD 4.8 FreeBSD 4.8-STABLE i386 
    ix86-freebsd5.1 FreeBSD 5.1 FreeBSD 5.1-CURRENT i386 
    ix86-linux2.2 Debian GNU/Linux 2.2 Linux 2.2.22 i686 
    ix86-linux2.4 Debian GNU/Linux 3.0 Linux 2.4.21 i686 
    ix86-linux2.4 RedHat Linux 9 Linux 2.4.20-18.9 i686 
    ix86-linux2.4 SuSE Linux 8.2 Linux 2.4.20-4GB i686 
    sparc64-solaris2.8 Sun Solaris 8 SunOS 5.8 sun4u 
    sparc64-solaris2.9 Sun Solaris 9 SunOS 5.9 sun4u 
    ix86-solaris9 Sun Solaris 9/x86 SunOS 5.9 i86pc 
    alpha-freebsd5.1 FreeBSD 5.1 [*] FreeBSD 5.1-CURRENT alpha 
    sparc64-solaris2.6 Sun Solaris 2.6 [*] SunOS 5.6 sun4u 
    ix86-freebsd4.7 FreeBSD 4.7 FreeBSD 4.7-STABLE i386 
    ix86-freebsd5.0 FreeBSD 5.0 FreeBSD 5.0-RELEASE i386 
    ix86-linux2.2 Debian GNU/Linux 2.2 Linux 2.2.22 i686 
    ix86-linux2.4 Debian GNU/Linux 3.0 Linux 2.4.19 i686 
    d32 3 a34 1

    d36 1 @ 1.16 log @Update supported platforms, correcting conflicting information. @ text @d20 1 a20 1 Ensure your system is running one of the officially supported platforms: d25 2 d28 1 a29 1 ix86-linux2.4 RedHat 7.2 Linux 2.4.9-21 i686  d32 7 a38 5 If your platform is not part of this list, don't panic. OpenPKG was successfully ported and tested on many other Unix platforms. There is a high probability that your particular platform is also supported, especially if yours is a recent version of a major Unix platform such as BSD, Linux, Solaris, Tru64, or HP-UX. @ 1.15 log @Fixed typo. @ text @d24 1 a24 2 ix86-freebsd4.6 FreeBSD 4.6 FreeBSD 4.6-STABLE i386  sparc64-solaris2.8 Sun Solaris 8 SunOS 5.8 sun4u  a25 1 ix86-linux2.2 Debian GNU/Linux 2.2 Linux 2.2.20 i686  d34 1 a34 1 Tru64, or HP/UX. @ 1.14 log @update for OpenPKG v1.1 @ text @d209 1 a209 1

    Example PKG pathes

    @ 1.13 log @Corrections, clarifications, and rewording. @ text @d3 2 a4 1 1.0 d23 4 a26 2 arch-os Operating System uname -m -r -s  ix86-freebsd4.4 FreeBSD 4.4 FreeBSD 4.4-STABLE i386  d28 2 a29 1 sparc64-solaris2.8 Sun Solaris 2.8 SunOS 5.8 sun4u  d41 1 a41 1 installation. Also make sure you have approximately 150MB free disk d89 1 a89 1 tutorial and make a regular installation of bash-2.05a-1.0.0.src.rpm. d184 1 a184 1 ftp> get openpkg-.0-.0.arch-os-cw.sh d207 1 a207 1     ftp://ftp.openpkg.org/release//SRC/bash-2.05a-.0.src.rpm d211 5 a215 3     /cw/RPM/PKG/bash-2.05a-.0.ix86-freebsd4.4-cw.rpm     /cw/RPM/PKG/bash-2.05a-.0.ix86-linux2.2-cw.rpm     /cw/RPM/PKG/bash-2.05a-.0.sparc64-solaris2.8-cw.rpm d225 1 a225 1     ftp://ftp.openpkg.org/release//BIN/foo-X.Y-.0.arch-os-cw.rpm d229 6 a234 3     ftp://ftp.openpkg.org/release//BIN/bash-2.05a-.0.ix86-freebsd4.4-cw.rpm     ftp://ftp.openpkg.org/release//BIN/bash-2.05a-.0.ix86-linux2.2-cw.rpm     ftp://ftp.openpkg.org/release//BIN/bash-2.05a-.0.sparc64-solaris2.8-cw.rpm @ 1.12 log @improved tutorial examples for easy copy and paste @ text @d10 4 a13 4 to bootstrap OpenPKG and install GNU Bash as an example package. For more details about the commands being used here see the OpenPKG Quick Reference or refer to the OpenPKG Handbook to dive deeper or take d15 1 a15 1 Introduction Slideset for a birds' eye view. d29 4 a32 4 successfully ported and tested on a lot more Unix platforms, so the chance is high that your particular platform is supported, too. At least if your platform is a recent version of the major Unix platforms (BSD, Linux, Solaris, Tru64, HP/UX, etc.). d35 3 a37 2 Additionally make sure you have root access to your system, we need this later but not all the time. Also make sure you have approximately 150MB free disk d52 1 a52 1 regular installing/ upgrading a package from source or binary. For the d57 15 a71 7 Vanguards previously having installed unreleased packages from CURRENT or SNAPSHOTs, please note these packages have timestamps as version numbers leading to very large integers. Any offical release will have a lower number. Switching from a unpublished package to a official release is considered a "downgrade" by RPM. This works as designed by release engineering. Make yourself familiar with the options --oldpackage and --nodeps and add (one of) them to the RPM command line. d84 2 a85 2 Use the matrix above and make a regular installation of bash-2.05a-1.0.0.src.rpm. d93 4 a96 4 Now you want your shell using the OpenPKG environment so you have the /cw/bin in your PATH, can read the man pages using the correct MANPATH etc.? There's a single command doing all this for you. Place it in your favourite shell's profile. d102 1 a102 1 Examples to understand what it did for you. d112 1 a112 1 see Package Repository. d119 10 a128 4 Double check you really want to bootstrap from scratch and /cw does not exist or is empty. Bootstraping into an existing hierarchy discards the contents of the RPM database! Upgrade the "openpkg" package like any other package. Go back to the matrix to see the upgrade options. d152 1 a152 1 Back to matrix. d157 10 a166 4 Double check you really want to bootstrap from scratch and /cw does not exist or is empty. Bootstraping into an existing hierarchy discards the contents of the RPM database! Upgrade the "openpkg" package like any other package. Go back to the matrix to see the upgrade options. d189 1 a189 1 Back to matrix. d211 1 a211 1 Back to matrix. d227 1 a227 1 Back to matrix. @ 1.11 log @fixed broken links @ text @d110 4 d132 4 a135 1 \# sh openpkg-.0-.0.arch-os-cw.sh d142 4 d159 1 a159 1 ftp> get openpkg-.0-.0.arch-os-cw.sh d163 4 a166 1 \# sh openpkg-.0-.0.arch-os-cw.sh d174 2 a175 2 $ /cw/bin/rpm --rebuild ftp://ftp.openpkg.org/release//SRC/foo-X.Y-.0.src.rpm d178 11 a188 1     /cw/RPM/PKG/foo-X.Y-.0.arch-os-cw.rpm d198 7 a204 1     ftp://ftp.openpkg.org/release//BIN/foo-X.Y-.0.arch-os-cw.rpm @ 1.10 log @major rewrite @ text @d12 2 a13 2 href="quickref/doc/openpkg.txt">OpenPKG Quick Reference or refer to the OpenPKG Handbook to dive deeper or take @ 1.9 log @fixes and vanguard downgrade info @ text @d3 1 d50 4 a53 98 This guide assumes that your decision whether preferring source or binary is valid for both bootstrapping and the GNU Bash example. OpenPKG does not enforce an ultimate decision. You can mix and match binaries and source.

    Bootstrapping/Upgrading

    First, we need to fetch some material.
    $ cd /tmp
    $ ftp ftp.openpkg.org
    Connected to ftp.openpkg.org.
    220 ftp.openpkg.org OpenPKG Anonymous FTP Server ready.
    Name (ftp.openpkg.org): anonymous
    331 Anonymous login ok, send your complete email address as your password.
    Password: you@@example.com
    230- [...] Welcome to OpenPKG.org! [...]
    230 Anonymous access granted, restrictions apply.
    ftp> bin
    200 Type set to I.
    

    Do you need binaries and have a vanilla machine without any previous instance of OpenPKG? Then do this:

    ftp> cd release/1.0/BIN
    ftp> get openpkg-1.0.0-1.0.0.arch-os-cw.sh
    ftp> get bash-2.05a-1.0.0-arch-os-cw.rpm
    

    Do you need binaries, already bootstrapped your machine and want to upgrade OpenPKG? Then do this:

    ftp> cd release/1.0/BIN
    ftp> get openpkg-1.0.0-1.0.0-arch-os-cw.rpm
    ftp> get bash-2.05a-1.0.0-arch-os-cw.rpm
    

    Do you want source and have a vanilla machine without any previous instance of OpenPKG? Do this:

    ftp> cd release/1.0/SRC
    ftp> get openpkg-1.0.0-1.0.0.src.sh
    ftp> get bash-2.05a-1.0.0.src.rpm
    

    Do you want source, already bootstrapped your machine and want to upgrade OpenPKG? Do this:

    ftp> cd release/1.0/SRC
    ftp> get openpkg-1.0.0-1.0.0.src.rpm
    ftp> get bash-2.05a-1.0.0.src.rpm
    

    ftp> bye
    221 Goodbye.
    
    If you preferred source we have to prepare the arch-os-cw bootstrap script and build the bootstrap RPM package. This guide assumes that you create your new cool world below /cw using the to-be-created user "cw" and group "cw" and thus stick with that default. OpenPKG does not force you to do that.
    $ sh openpkg-1.0.0-1.0.0.src.sh --prefix=/cw --user=cw --group=cw
    
    Remember the binary download options above? We now have essentially the same files available. Upgraders do not have the arch-os-cw bootstrap script. They don't need it anyway as the already bootstrapped.
    $ ls openpkg*
    openpkg-1.0.0-1.0.0.arch-os-cw.rpm
    openpkg-1.0.0-1.0.0.arch-os-cw.sh
    openpkg-1.0.0-1.0.0.src.rpm
    
    If you're upgrading from source you have to build the binary now.
    $ /cw/bin/rpm --rebuild openpkg-1.0.0-1.0.0.src.rpm
    
    Now the remaining tasks do real installation work and require root privileges.
    $ su
    \#
    
    Unless you're upgrading execute the bootstrap script now.
    \# sh openpkg-1.0.0-1.0.0.arch-os-cw.sh
    
    Now to upgrade you just have to install OpenPKG as a OpenPKG package. This was already part of the previous bootstrap script so if you did it you don't have to do the OpenPKG upgrade installation. Otherwise execute the upgrade command.
    \# /cw/bin/rpm -Uvh openpkg-1.0.0-1.0.0.arch-os-cw.rpm
    
    release root priviledges. d62 1 a62 1 and --nodeps and add (one of) them to the command line listed above. d64 8 a71 9
    \# exit
    $
    
    READY! No matter if you build from source or binary, had a vanilla system or did an upgrade, the downloaded version of OpenPKG is installed, up and running. Think how short this instructions would have been if we'd coverd just one of all those cases. d75 2 a76 2 So now head for the bash installation. We already downloaded the bash RPM package before. a77 15 If you preferred source ...
    $ /cw/bin/rpm --rebuild bash-2.05a-1.0.0.src.rpm
    
    Now you have the binary, either just built or download previously. Install it. If you build the binary it is located in /cw/RPM/PKG. Use the correct path in the command listed below.
    $ su
    \# /cw/bin/rpm -Uvh /cw/RPM/PKG/bash-2.05a-arch-os-cw.rpm
    \# exit
    
    DONE! d103 74 a176 1 see Package Repository @ 1.8 log @cleanups @ text @d46 1 a46 1 $ which gcc cc || echo "you don't have a compiler, so must use binaries" d71 1 a71 4

    Do you need binaries and have a vanilla machine without any previous instance of OpenPKG? Then do this: d75 1 d78 1 a78 4

    Do you need binaries, already bootstrapped your machine and want to upgrade OpenPKG? Then do this: d84 2 a85 1 Do you want source and have a vanilla machine without any previous instance of OpenPKG? Do this: d91 2 a92 1 Do you want source, already bootstrapped your machine and want to upgrade OpenPKG? Do this: d95 1 a95 1 ftp> get openpkg-1.0.0-1.0.0.rpm d98 2 d112 1 a112 1 Remember the binary download options above? We're now have essentially the d147 10 d191 19 d211 1 @ 1.7 log @fixed URLs @ text @d6 9 a14 7 This tutorial guides you on your way into the cool world of OpenPKG showing you how to bootstrap OpenPKG and install bash as an example package. For more details about the commands being used here see the Quick Reference or refer to the OpenPKG Handbook to dive deeper or take off and have a look at the Slideset for a birds' eye view. d18 1 a18 1 Ensure your system is running one of the supported platforms: d24 1 a24 2 sparc64-solaris2.7 Solaris 2.7 SunOS 5.7 sun4u  sparc64-solaris2.8 Solaris 2.8 SunOS 5.8 sun4u  d27 11 a37 3 Make sure you have root access to your system, we need this later but not all the time. Have approximately 20MB<-- FIXME--> free disk space on the / filesystem. You can move and symlink to some better places afterwards. d41 3 a43 3 While we strongly recommend you use source packages whenever possible the absence of development tools is the number one reason to prefer binaries. Let's make a quick'n'dirty but mostly useful check: d46 1 a46 1 $ which gcc cc || echo "you don't have a compiler, must use binaries" d49 3 a51 3 This guide assumes that your decision whether perferring source or binary is valid for both bootstrapping and the bash example. OpenPKG does not enforce an ultimate decision. You can mix and match binaries and source. d55 1 a55 1 First we need to fetch some material. d60 2 a61 2 Connected to master.openpkg.org. 220 ftp.openpkg.org OpenPKG Anonymous FTP Server (ProFTPD) ready. d64 1 a64 1 Password: your@@email.org d70 5 a74 1 Do you need binaries and have a vanilla machine without any previous instance of OpenPKG? Do this: d79 5 a83 1 Do you need binaries, already bootstrapped your machine and want to upgrade OpenPKG? Do this: @ 1.6 log @corrected path to RPM binaries @ text @d9 3 a11 3 href="quickref/openpkg.txt">Quick Reference or refer to the OpenPKG Handbook to dive deeper or take off and have a look at the Slideset for a birds' eye @ 1.5 log @Minor corrections. @ text @d156 1 a156 1 \# /cw/bin/rpm -Uvh bash-2.05a-arch-os-cw.rpm @ 1.4 log @new tutorial as step-by-step guide @ text @d7 1 a7 1 you how to bootstrap OpenPKG and installing bash as an example package. For d28 1 a28 1 filesystem. You can move and symlink to some better places afterwards. d61 1 a61 1 You need binaries and have a vanilla machine without any previous instance of OpenPKG? Do this: d66 1 a66 1 You need binaries, already bootstrapped your machine and want to upgrade OpenPKG? Do this: d72 1 a72 1 You want source and have a vanilla machine without any previous instance of OpenPKG? Do this: d78 1 a78 1 You want source, already bootstrapped your machine and want to upgrade OpenPKG? Do this: d91 2 a92 2 your new cool world below /cw using the to-be-created user "cw" and group" cw" and thus stick with that default. OpenPKG does not force you to do that. @ 1.3 log @clear just before complete rewrite @ text @d6 161 a166 1 will be rewritten to a step-by-step guide now. @ 1.2 log @fix URL @ text @d6 1 a6 338

    User Tutorial

    In the following, we will go into detail on how to use the RPM-based software packaging system OpenPKG from a users point of view. For this, we provide the essential steps and commands in a tutorial-style way. For more in-depth information about RPM you should read the book Maximum RPM, which we also provide online for your convinience.

    Platform Prerequisites

    First, make sure that the underlying Unix platform is either Solaris, FreeBSD or Linux (run uname -a to determine this, if you don't know already). The particular currently supported platform versions are:
    • Solaris 2.[678]
    • FreeBSD 4.[123]
    • Debian GNU/Linux 2.2 ("Potato")
    If you have a Solaris, Linux or FreeBSD version different from the listed ones, the chance is very high that OpenPKG nevertheless works. But be aware that some things/packages might break. If you have a completely different Unix platform, there is definetly no out-of-the-box support and you are own and have to port the OpenPKG packages to these platform first.

    Filesystem Assumptions

    The whole OpenPKG software package system is located on the Unix filesystem under a single root directory. At Cable & Wireless Deutschland this root directory is intuitively and uniquely named /cw. That is, why this tutorial uses this particular path from now on. But the whole package system is designed to work with an arbitrary root directory, although after performing the bootstrap procedure it is a fixed one.

    So, on non-C&W machines one would usually use perhaps /sw (for "software") instead, of course. It is just important that the path does not conflict with an area where the operating system vendor already placed files (like /opt under Solaris, /usr/local under FreeBSD, etc). Additionally the software packages are designed to also work for underpriviledged situations where no root (uid 0) access exists. Then the root directory is usually a sub-directory of a regular user's home directory, like /home/foo/sw.

    Filesystem Layout

    The /cw filesystem hierarchy directly resembles the commonly known /usr hierarchy, that is, it contains sub-directories which correspond to those one usually can find also under /usr: bin, etc, include, info, lib, libexec, man, sbin, share and var. All data in those sub-directories are managed by RPM.

    Additionally, there is a /cw/local area in analogon to /usr/local, which obviously contains machine-local stuff, i.e., software packages which are only interesting for the local machine and which were installed manually. So, this area is intentionally not managed by RPM. Nevertheless it also slightly resembles the layout of /usr, that is /cw/local contains the sub-directories bin, etc, include, info, lib, libexec, man and sbin. The directories libexec, share and var are intentionally missing there for reasons explained later.

    Bootstrapping

    Bootstrapping means, to initially create the /cw filesystem hierarchy, install RPM (the tool on which all depends) into it, create an initial RPM database for the /cw filesystem hierarchy and making sure that from then on the /cw filesystem hierarchy is controlled by RPM. This even means that RPM installs itself into its own database and manages its own installation (as a result, one even can upgrade RPM with RPM ;). To achieve all this, a special bootstrapping step is required before other software packages can be installed with RPM. Here we have two situations we have to distinguish:

    • The machine has development tools installed.

      This is the required prerequisite...

      • if you build the packaging system from scratch on a new Unix flavor for which still no binary bootstrapping package exists or

      • if you have a full-featured vendor installation and want to add the packaging system by just building from source (instead of installing pre-built binaries which could cause trouble because of slight differences between the build and install machines) or

      • if existing binary packages were built for different root directories and/or owner uid/gid.

      If this is the case, perform the following steps:

      1. Download the latest RPM bootstrapping source package from the package repository (it is named openpkg-0.9-N.src.sh) onto the target machine.

      2. Make sure the following tools are already provided by your vendor installation and are in your $PATH: sh, uudecode, uncompress, tar, gzip, gmake (or make if it is GNU make), patch and gcc (or cc if it is the GNU C/C++ compiler). If you have a modern Unix operating system, an Open-Source development environment and a reasonable shell environment this should be the case anyway.

      3. Execute the bootstrap command (as a regular user inside an abitrary temporary directory):
        $ sh openpkg-0.9-N.src.sh --prefix=/cw [--user=cw] [--group=cw]\
            
        The user and group you specify are the uid/gid which will own the hierarchy. If left out, the current uid/gid of the caller is used.

      Keep in mind that until now access to the real target directory /cw was still NOT required. Nothing was actually touched on the system, only three other files were rolled as the result:

      • openpkg-0.9-N.arch-os-id.sh
        This is the bootstrapping binary package. This can be used in a second step (as described below under "The machine has NO development tools installed.") to initially create the target /cw.

      • openpkg-0.9-N.arch-os-id.rpm
        This is the upgrading binary package. This can be used to upgrade an already created /cw hierarchy (on a different machine) or to later fix the existing /cw hierarchy (on the current machine) by running "/cw/bin/rpm -Uvh --force" on it.

      • openpkg-0.9-N.src.rpm
        This is the upgrading source package. This can be used to install the RPM bootstrapping package sources in order to rebuild again -- but this time by using the already installed RPM.

      So, to finally create the /cw hierarchy and link it into the system (by creating the owner uid/gid, by activating ts irc scripts and its cron jobs), execute (as root if you used --user/--group options before):

      $ sh openpkg-0.9-N.arch-os-id.sh
          

    • The machine has NO development tools installed.

      This is the situation..

      • if you have a brand-new machine where only a base Unix operation system is installed (no development tools) but for which an existing binary bootstrap package exists or

      • if you want to quickly establish the packaging system onto an existing machine by accepting that using pre-build binaries can be not optimal.

      If this is the case, perform the following steps:

      1. Download the latest RPM bootstrapping binary package from the package repository (it is named openpkg-0.9-N.arch-os-id.sh) onto the target machine.

      2. Make sure the following tools are already provided by your vendor installation and are in your $PATH: sh, uudecode, uncompress and tar. If you have a modern Unix operating system and a reasonable shell environment this should be the case anyway.

      3. Execute the bootstrap command:
        $ sh openpkg-0.9-N.arch-os-id.sh

    Initial Filesystem Hierarchy

    After installing the RPM binary bootstrap package, the /cw filesystem hierarchy looks exactly like this:

                              +-Basenames     
                              |-Conflictname  
                              |-Group         
         +-README             |-Name          
         |         +-DB/------|-Packages      
         |         |-PKG/     |-Providename   
         |-RPM/----|-SRC/     |-Requirename   
         |         +-TMP/     +-Triggername   
         |                    
         |-bin/----+-rpm 
         |         +-rpm2cpio 
         |-sbin/---+-lsync    
         |         +-rpmtool  
         |
         |         +-rc       
         |-etc/----|-rc.env   +-pubring.gpg   
         |         |-rc.d/    |-rpmdev.mk     
         |         +-rpm/-----|-rpmmacros     
         |                    +-rpmrc         
         |
         |                    +-find-provides 
         |                    |-find-requires 
         |                    |-macros        
         |                    |-rpm           
         |                    |-rpmb          
         |                    |-rpmdb         
         |-lib/----+-rpm/-----|-rpme          
         |                    |-rpmi          
         |         +-man1/    |-rpmk          
         |         |-man2/    |-rpmpopt-4.0   
         |         |-man3/    |-rpmq          
    /cw/-|         |-man4/    |-rpmt          
         |         |-man5/    |-rpmu          
         |-man/----|-man6/    +-rpmv          
         |         |-man7/    
         |         +-man8/----+-lsync.8       
         |                    |-rpm.8         
         |-include/           |-rpm2cpio.8    
         |-info/              +-rpmtool.8     
         |-libexec/
         |-share/
         |-var/
         |         +-README   
         |         |-PKG/     
         |         |-bin/     +-man1/
         +-local/--|-sbin/    |-man2/
                   |-etc/     |-man3/
                   |-include/ |-man4/
                   |-info/    |-man5/
                   |-lib/     |-man6/ 
                   +-man/-----|-man7/ 
                              +-man8/
    As you can see, it's the directory structure described above plus the first package (RPM) already installed. Additionally you can see that under /cw/RPM/ an RPM-specific area exists. There is the RPM database, that is, the whole filesystem hierarchy is self-contained because it contains its own database and packaging tool.

    Package Management

    If the /cw hierarchy was bootstrapped, one can start managing packages for it. The following common tasks give you a very short overview of the most essential RPM commands:
    • Query Information

      $ rpm -qa
      (q)uery list of (a)ll installed packages

      $ rpm -qi foo
      (q)uery (i)nformation about package "foo"

      $ rpm -qvl foo
      (q)uery (v)erbose file (l)ist of package "foo"

      $ rpm -qpi /path/to/foo-X.X-X.XXX-XXXX-XX.rpm
      (q)uery (p)package file for (i)nformation

      $ rpm -qpvl /path/to/foo-X.X-X.XXX-XXXX-XX.rpm
      (q)uery (p)package file for (v)erbose file (l)ist

    • Install or Upgrade a Package

      $ rpm -Uvh /path/to/foo-X.X-X.XXX-XXXX.rpm
      smart (u)pgrade while (v)erbosely showing (h)ash characters

    • Verify a Package

      $ rpm -V foo
      (v)erify integrity of package "foo"

    • Erase a Package

      $ rpm -e foo
      (e)erase package "foo"

    For more details on the really sophisticated RPM command and its numerious functions, please consult the book Maximum RPM, which we also provide online for your convinience.

    Notice that the /path/to/foo-X.X-X.XXX-XXXX.rpm in the above commands can even be a fully-qualified URL with the FTP and HTTP schemes. So, with RPM you even can directly install or upgrade a package from the package repository by prefixing the filename listed there with http://www.openpkg.org/pkg/. For instance to easily upgrade the RPM installation, just run

    rpm -Uvh http://www.openpkg.org/pkg/rpm-4.0-X.XXX-XXXXX.rpm

    (replace the X characters with the latest release number and the architecture and operation system id) #

    The local/ Area

    # # We still have to explain the /cw/local area, which, as already said # above, is intentionally not RPM managed and intended for manual # installation of software packages local to the particular machine. The # RPM bootstrap package created just the top-level directories for this # area and a tool /cw/sbin/lsync (for "local sync"). But what is # special on this area? # #

    # ... @ 1.1 log @Initial revision @ text @d12 1 a12 1 href="doc/maximum-rpm/index.html">Maximum RPM, which we also provide @ 1.1.1.1 log @Import www.openpkg.org website @ text @@