%% %% Define the fonts we will use %% %deffont "standard" tfont "arial.ttf" %deffont "typewriter" tfont "courbd.tf" %% %% Default settings for special lines %% %default 1 leftfill, fore "yellow", back "darkblue" %default 2 size 7, vgap 10, prefix " ", font "standard" %default 3 size 2, bar "gray70", vgap 10 %default 4 size 5, vgap 30, font "standard" %% %% Default settings for indented lines %% %tab 1 size 5, vgap 40, prefix " ", icon box "green" 50 %tab 2 size 4, vgap 40, prefix " ", icon arc "yellow" 50 %tab 3 size 3, vgap 40, prefix " ", icon delta3 "white" 40 %% %%%%%%%%%%%%%%%%%% %page %nodefault, font "standard", fore "yellow", back "darkblue" %center a quick guide to the Debian Package Management system %size 6 Wichert Akkerman %size 5 wichert@linux.com %%%%%%%%%%%%%%%%%% %page Overview The deb package format Using packages dpkg and friends libapt-pkg dselect Making packages dpkg-dev debhelper %%%%%%%%%%%%%%%%%% %page The deb package format Our basic building block, which consists of: debian-binary: version information control: contains the package metadata data: contains the to-be-installed data %center, newimage "package.eps" %%%%%%%%%%%%%%%%%% %page The package metadata Metadata gives information about the package: name version dependencies description maintainer scripts %%%%%%%%%%%%%%%%%% %page Metadata syntax RFC822 style field names and values seperatons by colon (:) multi-line fields by starting extra lines with whitespace block seperated by newline %%%%%%%%%%%%%%%%%% %page Example control file %font "typewriter", size 3 Package: acpid Version: 0.2000042500-1 Section: admin Priority: extra Architecture: i386 Depends: libc6 (>= 2.1.2) Installed-Size: 204 Maintainer: Wichert Akkerman Description: ACPI daemon Modern computers support the Advanced Configuration and Power Interface (ACPI) to allow intelligent power management on your system. . This package contains acpid, which is the user-space daemon needed in order to make the Linux ACPI support completely functional. %%%%%%%%%%%%%%%%%% %page Maintainer scripts Currently there are 4 possible scripts: preinst postinst prerm postrm Scripts that will be / are being added: config template trigger %%%%%%%%%%%%%%%%%% %page dpkg dpkg is the low-level tool used to manipulate packages and manage \ the package status information. In order to not be tied completely to a single package format a lot of \ the work to build and extract a package file is handled by a seperate \ tool called dpkg-deb. %%%%%%%%%%%%%%%%%% %page dpkg database (/var/lib/dpkg) available status diversions alternatives/ %%%%%%%%%%%%%%%%%% %page status Stores both the current and wanted state of a package. Has a copy \ of the package control information for installed packages. %font "typewriter", size 3 Package: emacs19 Status: purge ok not-installed Priority: optional Section: editors %font "standard", size 5 Status has three entries wanted state (unknown, install, hold, deinstall, purge) error state (ok, reinstreq) current state (not-installed, unpacked, half-configured, installed, half-installed, config-files) %%%%%%%%%%%%%%%%%% %page libapt-pkg dpkg is a low-level way of dealing with packages; for non-trivial \ tasks more intelligence is required. This is provided by the apt \ library, which gives us: high-level logic for dealing with package relations can handle complex installations and upgrades database with lists of available packages ability to download packages if needed %%%%%%%%%%%%%%%%%% %page apt methods Stand-alone tools which libapt can use to download files using a \ specific protocol. Currently supported are: cdrom copy file ftp http %%%%%%%%%%%%%%%%%% %page Example apt configuration %font "typewriter", size 3 # The morsnet local mirror deb file:/morsnet/wichert/debian/archive potato mirror local deb file:/morsnet/wichert/debian/archive woody mirror local # Dutch mirror deb http://ftp.nl.debian.org/debian potato main contrib non-free deb-src http://ftp.nl.debian.org/debian potato main contrib non-free deb http://ftp.nl.debian.org/debian woody main contrib non-free deb-src http://ftp.nl.debian.org/debian woody main contrib non-free ## Non-US deb http://non-us.debian.org/debian-non-US potato/non-US main contrib non-free deb-src http://non-us.debian.org/debian-non-US potato/non-US main contrib non-free deb http://non-us.debian.org/debian-non-US woody/non-US main contrib non-free deb-src http://non-us.debian.org/debian-non-US woody/non-US main contrib non-free ## Security updates deb http://security.debian.org/ potato/updates main contrib non-free deb-src http://security.debian.org/ potato/updates main contrib non-free %%%%%%%%%%%%%%%%%% %page dselect The traditional frontend to the Debian package management system. \ dselect is part of the dpkg sources and uses the dpkg datafiles \ directly. dselect consists of multiple parts: the dselect frontend itself, \ and dselect methods which abstract updating the list of available \ packages, installing packages and removing packages. These days the most common dselect method is.... %pause apt. %%%%%%%%%%%%%%%%%% %page Putting it all together %center, newimage "overview.eps" %%%%%%%%%%%%%%%%%% %page Making packages debian/rules source format debhelper %%%%%%%%%%%%%%%%%% %page debian/rules All packages must have a debian/rules script which handles all the steps \ needed for building packages. It must be able to clean the sourcetree build architecture-dependent packages build architecture-independent packages %%%%%%%%%%%%%%%%%% %page debian/control contains basic information about the packages we are building. %font "typewriter", size 3 Source: grep Section: base Priority: required Maintainer: Wichert Akkerman Standards-Version: 3.1.0 Package: grep Architecture: any Essential: yes Pre-Depends: ${shlibs:Pre-Depends} Conflicts: rgrep Provides: rgrep Description: GNU grep, egrep and fgrep. The GNU family of grep utilities may be the "fastest grep in the west". GNU grep is based on a fast lazy-state deterministic matcher (about twice as fast as stock Unix egrep) hybridized with a Boyer-Moore-Gosper search for a fixed string that eliminates impossible text from being ronsidered by the full regexp matcher without necessarily having to look at every character. The result is typically many times faster than Unix grep or egrep. (Regular expressions containing backreferencing will run more slowly, however.) %%%%%%%%%%%%%%%%%% %page debian/changelog Lists all the changes made to a package. We use a special format which \ the dpkg-dev tools can parse to extract the latest changes and the \ version number. %font "typewriter", size 3 grep (2.4.2-1) frozen unstable; urgency=low * New upstream release. This is only a translation-update and bugfix release, there is no new code (besides the bugfixes that is) * Fix location of GPL (lintian) * add -isp option to dpkg-gencontrol (lintian) * Fix grep-call in rgrep, Closes: Bug# 52751 -- Wichert Akkerman Sun, 2 Apr 2000 17:57:56 +0200 %%%%%%%%%%%%%%%%%% %page Creating a .deb The basic steps for building a .deb are: build all the sources install the package into a temporary directory (debian/tmp) create a debian/tmp/DEBIAN subdirectory and put metadata in it call dpkg-shlibdeps to generate scan for library dependencies call dpkg-gencontrol to generate a control file call "dpkg --build" to build the .deb %%%%%%%%%%%%%%%%%% %page debhelper Most of the work done in debian/rules is common to a lot of packages. \ To make this work easier debhelper contains a set of tools to automate \ the most common tasks such as compressing documentationrfixing file \ permissions, registering menus, building the final .deb. This is also an easy way to keep a package complient with policy: if \ policy changes a new version of debhelper will implement those changes \ automatically. %%%%%%%%%%%%%%%%% %page debhelper example %font "typewriter", size 3 gzip -9f debian/tmp/usr/share/man/*/* dpkg-shlibdeps debian/tmp/bin/* debian/tmp/usr/bin/*Rr install -d debian/tmp/DEBIAN install -m 755 debian/postinst debian/tmp/DEBIAN/ install -m 755 debian/prerm debian/tmp/DEBIAN/ dpkg-gencontrol -isp dpkg --build debian/tmp .. %font "standard", size 5 Will become %font "typewriter", size 3 dh_compress dh_shlibdeps dh_installdeb dh_builddeb %%%%%%%%%%%%%%%%%% %page Where do we want to be tomorrow? Exciting changes in the world of debian packaging: debconf! new source format statoverrides signed packages (or: how to survive in a paranoid world) %%%%%%%%%%%%%%%%%% %page The end (This is where you ask questions or take a break)