Debian packaging workshop
George Danchev
Debian Developer
The Debian Project
- Organization and Roles
- The people behind - DD, DM, sponsorees (hopefully to join the NM-process)
- Machines and Daemons behind
- Debian terms and developer's docs
- upstream authors and code
- maintainers, mentors, sponsors and sponsorees
- working together - patches, VCS
- debian-policy - normative document
- debian-reference, maint-guide, developers-reference, libpkg-guide
- The official archive - source, binary packages and metadata
[any material that should appear in print but not on the slide]
Archive organization and tools
- The Official Archive Structure
- Creating Debian Archives (repositories)
- trivial - apt-ftparchive
- complex - mini-dinstall, debpool, reprepro
- official (extremely sophisticated) - dak and buildd.debian.org
[any material that should appear in print but not on the slide]
Source and binary packages
- Source package (upstream code with debian/ directory or patched with diff.gz)
- The contents of debian/ directory
- control file - deb-control(5)
- rules file - an executable make file
- changelog file
- copyright file freestyle and machine-parsable format
- other related files and dirs
- samples produced by dh_make(8)
- binary package directories after build - debian/binary_package_name/ or debian/tmp/
- Binary packages (debs and udebs used in debian-installer)
- name listed in control field Package
- format described in deb(5) - ar(1) archive with a special magic value
- Versions (deb-version(5))
- head of debian/changelog as [Epoch:]Upstream_version-[Debian_revision]
[any material that should appear in print but not on the slide]
Don't do it that way
- Construct directory structure
mkdir -p proggie/usr/bin proggie/DEBIAN
cp proggie proggie/usr/bin
- Populate DEBIAN/control in the binary package directory,
not to be confused with debian/control from the source package
echo "Package: proggie" >> proggie/DEBIAN/control
echo "Version: 1.2-3" >> proggie/DEBIAN/control
echo "Architecture: i386" >> proggie/DEBIAN/control
echo "Maintainer: A <a@b.c>" >> proggie/DEBIAN/control
echo "Desctiption: desc" >> proggie/DEBIAN/control
- Build it
dpkg-deb -b proggie
[any material that should appear in print but not on the slide]
Overview of the fields used as packaging metadata
- Standardized fields - mandated by Debian policy §5.7
- User-defined field format mandated by policy - X[SBC]-FIELDNAME
- Where are these declared
- debian/control
- debian/changelog
- debian/binary_package/DEBIAN/control
- Where they propagate
- *.dsc
- *.changes
- Release files
- *_Packages
- *_Sources
- Short Fields survey
[any material that should appear in print but not on the slide]
Packaging without using construction Helpers (like debhelper)
- Using Standard UNIX tools
- create debian/control and debian/changelog as mandated by Debian Policy
- create debian/rules which is a make(1)
- tune the upstream build system and/or patch the source, eventually
- install(1) into binary package directories and take care of permissions
- And tools provided by dpkg-dev to generate control information
- dpkg-gencontrol
- dpkg-source
- dpkg-checkbuilddeps
- dpkg-parsechangelog
- dpkg-genchanges
- dpkg-architecture
- dpkg-shlibdeps
- dpkg-gensymbols
[any material that should appear in print but not on the slide]
Helpers
- Construction Helpers (source to binary packages)
- dh_make to prepare a prototype
- debhelper and dh(1)
- cdbs (can also call debhelper scripts if desired)
- yada (not very popular)
- dbs (not very popular)
- Build and VCS helpers
- cvs-buildpackage - CVS anyone?
- svn-buildpackage
- git-buildpackage
- gitpkg
- discuss new ideas in vcs-pkg.org mailing list
[any material that should appear in print but not on the slide]
Patching upstream source
- Stacked patches in debian/patches
- dpatch
- quilt
- dh --with quilt $@
- cdbs patch system
- Directly patching upstream via diff.gz
- Logical changes/diffs stored in *somebody's* VCS
- Inspect it - lsdiff -z -x '*/debian/*' *.diff.gz
- Managing patch queues out of VCS for 2.0 source format
- topgit - a possible workflow /usr/share/doc/topgit/HOWTO-tg2quilt.gz
- Ultimate solution - 3.0 source formats (not allowed by dak yet)
- 3.0 (git), 3.0 (bzr) - DVCS repo shipped with the source package itself
- 3.0 (quilt)
- 3.0 (native)
- 3.0 (custom)
[any material that should appear in print but not on the slide]
Chroot Package Builders
- cowbuilder(8) / pbuilder(8)
- Directly build as root: cowbuilder --build *.dsc
- Or enter the chroot: cowbuilder --login user --bindmount /some/dir
- schroot
- sbuild
[any material that should appear in print but not on the slide]
More Power Tools
- the devscripts package
- scripts to automate many routine tasks DDs usually do
- Taking care of user config files
- dpkg conffiles
- debconf
- ucf
[any material that should appear in print but not on the slide]
Package Uploaders
- dupload(1)
- dput(1), dcut(1)
[any material that should appear in print but not on the slide]
Project Resources
- Debian Policy and Developer's Reference
- BTS and PTS
- lists.debian.org
- debian-mentors@lists.debian.org
- debian-devel@lists.debian.org
- irc.debian.org #debian-devel #debian-mentors
[any material that should appear in print but not on the slide]
How to Join
- Adopting a neglected package(s)
- Sending patches to BTS, especially related to RC-bugs
- Starting the NM-process
- DD signs your key
- DD-advocacy, AM, DAM
[any material that should appear in print but not on the slide]
Examples
- [point one]
- [point two]
- [point three]
- [point four]
- [point five]
[any material that should appear in print but not on the slide]