Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 package once — use everywhere ! Cross-Platform Unix Software Packaging Ralf S. Engelschall Development Team Application Services Cable & Wireless Deutschland.

Similar presentations


Presentation on theme: "1 package once — use everywhere ! Cross-Platform Unix Software Packaging Ralf S. Engelschall Development Team Application Services Cable & Wireless Deutschland."— Presentation transcript:

1 1 package once — use everywhere ! Cross-Platform Unix Software Packaging Ralf S. Engelschall Development Team Application Services Cable & Wireless Deutschland Only those who attempt the absurd can achieve the impossible. — Unknown The best way to predict the future is to invent it. — Alan Kay

2 2 Part I: Overview A brief overview of OpenPKG from a users point of view A distributed system is one on which I cannot get any work done, because a machine I have never heard of has crashed. — Leslie Lamport A supercomputer is a machine, that runs an endless loop in just 2 seconds. — Unknown

3 3 The 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 kernel base Solaris kernel base FreeBSD kernel base Linux ??? Add-on Applications user There's a lesson to be learned from this but I'll be damned if I know what it is. — Al Bundy

4 4 The OpenPKG Solution Different flavors of Unix Operating Systems in use. Vendor supplied add-on applications are ignored. All actually used add-on applications are provided cross- platform by OpenPKG. Engineers now only have to manage 1 single virtual platform. kernel base Solaris kernel base FreeBSD kernel base Linux OpenPKG Add-on Applications user The software said it requires Solaris 2.6 or better, so I installed OpenPKG...

5 5 OpenPKG 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

6 6 Package 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 Developer Part User Part My hack: This universe. Just one little problem: core keeps dumping.

7 7 OpenPKG Live $ lynx http://www.openpkg.org/pkg/openpkg-0.9-36.src.sh $ sh./openpkg-0.9-36.src.sh --prefix=/cw –-user=cw –-group=cw [...] # sh./openpkg-0.9-36.ix86-freebsd4.4.sh [...] $ /cw/bin/rpm –-rebuild http://www.openpkg.org/pkg/bash-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@openpkg.org Release: 0 Build Host: dev1.de.cw.net Group: Shell Build System: ix86-freebsd4.4 Distrib: OpenPKG Build Time: Tue May 1 18:06:25 2001 License: GPL Relocations: /cw Vendor: Free Software Foundation Install Size: 1065082 bytes URL: http://www.gnu.org/ Install Time: Tue May 1 18:06:35 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 Seek simplicity, but distrust it. — A. N. Whitehead

8 8 Why 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

9 9 Part II: Close-Up View A close-up view of OpenPKG from a developers point of view There are two types of people in this world, good and bad. The good sleep better, but the bad seem to enjoy the waking hours much more. — Woody Allen Hiroshima '45 Czernobyl '86 Windows '95 :

10 10 Package Lifecycle (Developer Part) 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 Recursive, adj.; see Recursive.

11 11 Package 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 If a trainstation is where trains stop, what is a workstation? Patient: Doctor, it hurts when I do this! Doctor: Well, then don't do it.

12 12 Package 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)... -rw-rw-r-- 1 rse openpkg 504 Apr 10 11:32 bash-2.05.patch.1 -rw-rw-r-- 1 rse openpkg 1033 Apr 10 11:32 bash-2.05.patch.2 -rw-rw-r-- 1 rse openpkg 1792319 Apr 10 11:23 bash-2.05.tar.gz -rw-rw-r-- 1 rse openpkg 3770 Apr 10 11:33 bash.spec -rw-rw-r-- 1 rse openpkg 1342 Feb 7 16:34 profile UNIX is simple. It just takes a genius to understand its simplicity. — Dennis Ritchie

13 13 Name: bash Summary: Bourne-Again Shell Group: Shell URL: http://www.gnu.org/ Vendor: Free Software Foundation Packager: rse@openpkg.org Distribution: 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} BuildPreReq: 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). Package Specification Example (1) Meta informations List of sources Dependencies Description What you see is all you get. — Brian Kernighan

14 14 Package Specification Example (2) %prep %setup -q %patch0 -p0 %patch1 -p0 %build CC="%{l_cc}" \ CFLAGS="%{l_cflags -O}" \./configure \ --prefix=%{l_prefix} %{l_make} %{l_mflags -O} %install rm -rf $RPM_BUILD_ROOT %{l_make} %{l_mflags} install prefix=$RPM_BUILD_ROOT%{l_prefix} rm -f $RPM_BUILD_ROOT%{l_prefix}/info/dir strip $RPM_BUILD_ROOT%{l_prefix}/bin/bash %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/bash %{l_shtool} install -c -m 644 -e "s;@l_prefix@;%{l_prefix};g" \ $RPM_SOURCE_DIR/profile $RPM_BUILD_ROOT%{l_prefix}/etc/bash/ %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ %{l_files_std} \ '%config %{l_prefix}/etc/bash/profile' %files -f files %clean rm -rf $RPM_BUILD_ROOT Preparation Building Installation Packaging Beware of bugs in the above code; I have only proved it correct, not tried it. — D.E. Knuth

15 15 Package Building Murphy's Law is recursive: Washing your car to make it rain doesn't work.

16 16 More about OpenPKG The Website: http://www.openpkg.org/ The FTP Server: ftp://ftp.openpkg.org/ The RSYNC Server: rsync://rsync.openpkg.org/ The Anonymous-CVS Server: :pserver:anoncvs@cvs.openpkg.org:/cvs The Support Mailing List: openpkg-users@openpkg.org I have made this longer than usual because I lack the time to make it shorter. — Blaise Pascal


Download ppt "1 package once — use everywhere ! Cross-Platform Unix Software Packaging Ralf S. Engelschall Development Team Application Services Cable & Wireless Deutschland."

Similar presentations


Ads by Google