Title: Cross-Platform Unix Software Packaging
1Cross-PlatformUnix SoftwarePackaging
The best way to predictthe future is to invent
it. Alan Kay
Only those who attemptthe absurd can achievethe
impossible. Unknown
package once use everywhere !
- Ralf S. Engelschall
- Development Team
- Application Services
- Cable Wireless Deutschland
2Part I Overview
- A brief overview of OpenPKG
- from a users point of view
A distributed system is one onwhich I cannot get
any work done,because a machine I have
neverheard of has crashed.
Leslie Lamport
A supercomputer isa machine, that runs
anendless loop in just 2 seconds.
Unknown
3The General Problem
- Different flavors of Unix Operating Systems in
use. - Very(!) different sets of vendor supplied add-on
applications - Number of total applications
- Program versions of applications
- Installation Paths
- Amount of pre-configuration
user
???
???
???
Add-onApplications
base
base
base
kernel
kernel
kernel
Solaris
FreeBSD
Linux
There's a lesson to be learned from thisbut I'll
be damned if I know what it is.
Al Bundy
4The OpenPKG Solution
- Different flavors of Unix Operating Systems in
use. - Vendor suppliedadd-on applications are ignored.
- All actually usedadd-on applications are
provided cross-platform by OpenPKG. - Engineers now only have to manage 1 single
virtual platform.
user
Add-onApplications
OpenPKG
base
base
base
kernel
kernel
kernel
Solaris
FreeBSD
Linux
The software said it requires Solaris 2.6or
better, so I installed OpenPKG...
5OpenPKG is...
- a cross-platform packaging facility for add-on
Unix software. - based on an extended version of the popular
RedHat Package Manager (RPM v4). - a self-contained packaging system which is
maximum independent of underlying OS.
- currently available for
- Sun Solaris
- Debian GNU/Linux
- RedHat Linux
- FreeBSD
- OpenBSD
- NetBSD
- Compaq Tru64 (partially)
- HP-UX (partially)
- very complete, i.e., it currently provides
already over 190 packaged applications. - OpenPKG is freely available to anyone as Open
Source.
Software is like sex it's better when it's
free. Linus Torvalds
6Package Lifecycle
- Writing package specification
- Building application from vendor sources
- Temporarily installing application
- Rolling package from installed application files
- Deinstalling application
- Place package into repository
- Fetching package from repository
- Installing package
- Fetching newer version of package from repository
- Upgrading package
- Deinstalling package
User Part
My hack This universe. Just one little
problem core keeps dumping.
Developer Part
7OpenPKG Live
Seek simplicity,but distrust it. A. N.
Whitehead
lynx http//www.openpkg.org/pkg/openpkg-0.9-36.s
rc.sh sh ./openpkg-0.9-36.src.sh --prefix/cw
-usercw -groupcw ... sh
./openpkg-0.9-36.ix86-freebsd4.4.sh ...
/cw/bin/rpm -rebuild http//www.openpkg.org/pkg/b
ash-2.05-3.src.rpm ... /cw/bin/rpm Uvh
/cw/RPM/PKG/bash-2.05-3.ix86-freebsd4.4.rpm bash
/cw/bin/rpm qi bash Name bash
Source RPM
bash-2.05-3.src.rpm Version 2.05
Packager rse_at_openpkg.org Release 0
Build Host
dev1.de.cw.net Group Shell
Build System ix86-freebsd4.4 Distrib OpenPKG
Build Time Tue May 1
180625 2001 License GPL
Relocations /cw Vendor Free Software
Foundation Install Size 1065082 bytes URL
http//www.gnu.org/ Install Time Tue
May 1 180635 2001 Summary Bourne-Again
Shell Description Bash (Bourne-Again Shell)
is an sh-compatible command language interpreter
that executes commands read from the standard
input or from a file. Bash also incorporates
useful features from the Korn and C shells (ksh
and csh). Bash is intended to be a conformant
implementation of the IEEE POSIX Shell and
Tools specification (IEEE Working Group
1003.2). /cw/bin/bash
8Why to use OpenPKG?
- Package is reasonable wrapper around
applications - unattended and repeatable building and
installation procedure - packager knowledge built-in (configure options,
additional patches, etc.) - package abstracts differences between
applications - Both source and binary packages supported.
- Sophisticated package management
- flexible queries on package information
- verification of package integrity
- Single and uniform facility for all platforms
- cross-platform
- same filesystem paths
- reasonable default configurations
- safe upgrading path
- complete deinstallation
9Part II Close-Up View
- A close-up view of OpenPKGfrom a developers
point of view
There are two types of peoplein this world, good
and bad. The good sleep better, but thebad seem
to enjoy the wakinghours much more.
Woody Allen
Hiroshima '45Czernobyl '86Windows '95
10Package Lifecycle(Developer Part)
Recursive, adj. see Recursive.
- Writing the package specification
- meta-information
- package source files
- package dependencies
- description text
- build instructions
- Fetching source files
- Preparation
- unpacking
- fixing permissions
- applying patches
- Building
- configuration
- compilation
- Installation
- redirection to temporary root
- performing installation
- adding extra files
- Packaging
- determining file list
- rolling binary RPM
- rolling source RPM
11Package Lifecycle(User Part)
- (Starting from scratch) with source RPM
- Fetching source RPM
- Installation of sources
- Dev.-Step Preparation
- Dev.-Step Building
- Dev.-Step Installation
- Dev.-Step Packaging
- Deinstallation of sources
- ...
- (Continuing)with binary RPM
- Fetching binary RPM
- Installation of binary
- Upgrading of binary
- Deinstallation of binary
Patient Doctor, it hurts when I do this! Doctor
Well, then don't do it.
If a trainstation is where trainsstop, what is a
workstation?
12Package Components
- Package Specification(RPM .spec-file)
- central packaging information
- Vendor source(s)
- distribution files
- optionally patches
- Extra files
- packager or third-party patches
- run-command scripts
- default configuration file(s)
- ...
UNIX is simple.It just takes a genius
tounderstand its simplicity. Dennis
Ritchie
-rw-rw-r-- 1 rse openpkg 504 Apr 10 1132
bash-2.05.patch.1 -rw-rw-r-- 1 rse openpkg
1033 Apr 10 1132 bash-2.05.patch.2 -rw-rw-r-- 1
rse openpkg 1792319 Apr 10 1123
bash-2.05.tar.gz -rw-rw-r-- 1 rse openpkg
3770 Apr 10 1133 bash.spec -rw-rw-r-- 1 rse
openpkg 1342 Feb 7 1634 profile
13Package SpecificationExample (1)
What you seeis all you get. Brian Kernighan
Name bash Summary Bourne-Again
Shell Group Shell URL
http//www.gnu.org/ Vendor Free Software
Foundation Packager rse_at_openpkg.org Distribut
ion OpenPKG License GPL Version
2.05 Release 0 Source0
ftp//ftp.gnu.org/gnu/bash/bash-version.tar.gz
Source1 profile Patch0
bash-version.patch.1 Patch1
bash-version.patch.2 Prefix
l_prefix BuildRoot l_buildroot BuildPreR
eq OpenPKG PreReq OpenPKG description
Bash (Bourne-Again Shell) is an sh-compatible
command language interpreter that executes
commands read from the standard input or from a
file. Bash also incorporates useful features
from the Korn and C shells (ksh and csh).
Bash is intended to be a conformant
implementation of the IEEE POSIX Shell and
Tools specification (IEEE Working Group 1003.2).
Meta informations
List of sources
Dependencies
Description
14Package SpecificationExample (2)
prep setup -q patch0 -p0 patch1
-p0build CC"l_cc" \
CFLAGS"l_cflags -O" \ ./configure \
--prefixl_prefix l_make l_mflags
-Oinstall rm -rf RPM_BUILD_ROOT
l_make l_mflags install prefixRPM_BUILD_RO
OTl_prefix rm -f RPM_BUILD_ROOTl_prefix
/info/dir strip RPM_BUILD_ROOTl_prefix/bin
/bash l_shtool mkdir -f -p -m 755
RPM_BUILD_ROOTl_prefix/etc/bash
l_shtool install -c -m 644 -e
"s_at_l_prefix_at_l_prefixg" \
RPM_SOURCE_DIR/profile RPM_BUILD_ROOTl_prefix
/etc/bash/ l_rpmtool files -v -ofiles
-rRPM_BUILD_ROOT \ l_files_std \
'config l_prefix/etc/bash/profile'files
-f filesclean rm -rf RPM_BUILD_ROOT
Preparation
Building
Installation
Beware of bugs inthe above codeI have only
proved itcorrect, not tried it. D.E.
Knuth
Packaging
15Package Building
Murphy's Law is recursive Washing your car to
makeit rain doesn't work.
16More about OpenPKG
- The Websitehttp//www.openpkg.org/
- The FTP Serverftp//ftp.openpkg.org/
- The RSYNC Serverrsync//rsync.openpkg.org/
- The Anonymous-CVS Serverpserveranoncvs_at_cvs.ope
npkg.org/cvs - The Support Mailing Listopenpkg-users_at_openpkg.or
g
I have made this longer than usual because I lack
the time to make itshorter. Blaise
Pascal