an introduction to debian packaging
TRANSCRIPT
-
8/7/2019 An Introduction to Debian Packaging
1/50
An Introduction to Debian Packaging
Lucas [email protected]
An Introduction to Debian Packaging 1 / 47
-
8/7/2019 An Introduction to Debian Packaging
2/50
About this tutorial
Goal: tell you what you really need to know about Debian packagingModify existing packages
Create your own packages
Become a Debian power-user
Covers the most important points, but is not completeYou will need to read more documentation
Most of the content also applies to Debian derivatives distributions
That includes Ubuntu
An Introduction to Debian Packaging 2 / 47
-
8/7/2019 An Introduction to Debian Packaging
3/50
Outline
1 Introduction
2 Creating source packages
3 Building and testing packages
4 Practical session: modifying the grep package
5 Advanced packaging topics
6 Maintaining packages in Debian
7 Resources
8 Conclusion
An Introduction to Debian Packaging 3 / 47
-
8/7/2019 An Introduction to Debian Packaging
4/50
Outline
1 Introduction
2 Creating source packages
3 Building and testing packages
4 Practical session: modifying the grep package
5 Advanced packaging topics
6 Maintaining packages in Debian
7 Resources
8 Conclusion
An Introduction to Debian Packaging 4 / 47
-
8/7/2019 An Introduction to Debian Packaging
5/50
Introduction: the Deb package format
One of the two most common packages format (with RPM)A very powerful and convenient way to distribute software to users.deb le: an ar archive
$ a r tv w ge t_ 1 . 12 - 2 .1 _ i 38 6 . d ebrw -r --r -- 0/0 4 Sep 5 15:43 2010 debian - binaryrw -r --r -- 0/0 2403 S ep 5 15:43 2 010 c ontrol . tar . gzrw - r -- r- - 0 /0 7 51 61 3 S ep 5 1 5: 43 2 01 0 d at a . ta r. gz
debian-binary : version of the deb le format, "2.0 \ n"control.tar.gz : metadata about the packagecontrol, md5sums, (pre|post)(rm|inst), triggers, shlibs , . . .data.tar.gz : data les of the package
You could create your .deb les manuallyhttp://tldp.org/HOWTO/html_single/Debian-Binary-Package-Building-HOWTO/
But most people dont do it that way
This tutorial: create Debian packages, the Debian way
An Introduction to Debian Packaging 5 / 47
http://tldp.org/HOWTO/html_single/Debian-Binary-Package-Building-HOWTO/http://tldp.org/HOWTO/html_single/Debian-Binary-Package-Building-HOWTO/ -
8/7/2019 An Introduction to Debian Packaging
6/50
Tools you will need
A Debian (or Ubuntu) system (with root access)
Some packages:build-essential : has dependencies on the packages that will beassumed to be available on the developers machine (no need tospecify them in the Build-Depends: control eld of your package)
includes a dependency on dpkg-dev , which contains basicDebian-specic tools to create packages
devscripts : contains many useful scripts for Debian maintainers
Many other tools will also be mentioned later, such as debhelper , cdbs , quilt ,pbuilder , sbuild , lintian , svn-buildpackage , git-buildpackage , . . .Install them when you need them.
An Introduction to Debian Packaging 6 / 47
-
8/7/2019 An Introduction to Debian Packaging
7/50
General packaging workow
Web upstream sourceDebian mirror
source package where most of the manual work is done
one or several binary packages .deb
dh makeapt-get source dget
debuild (build and test with lintian )or dpkg-buildpackage
install ( debi )upload ( dput )
An Introduction to Debian Packaging 7 / 47
-
8/7/2019 An Introduction to Debian Packaging
8/50
Outline
1 Introduction
2 Creating source packages
3 Building and testing packages
4 Practical session: modifying the grep package
5 Advanced packaging topics
6 Maintaining packages in Debian
7 Resources
8 Conclusion
An Introduction to Debian Packaging 8 / 47
-
8/7/2019 An Introduction to Debian Packaging
9/50
Source packageOne source package can generate several binary packagese.g the libtar source generates the libtar and libtar-dev binary packages
Two kinds of packages: (if unsure, use non-native)Native packages: software developed inside Debian ( dpkg , apt )Non-native packages: software developed outside Debian
Main le: .dsc (meta-data)
Other les depending on the version of the source format1.0 native: package version.tar.gz
1.0 non-native:pkg ver.orig.tar.gz : upstream sourcepkg debver.diff.gz : patch to add Debian-specic changes
3.0 (quilt):pkg ver.orig.tar.gz : upstream sourcepkg debver.debian.tar.gz : tarball with the Debian changes
(See dpkg-source(1) for exact details)An Introduction to Debian Packaging 9 / 47
-
8/7/2019 An Introduction to Debian Packaging
10/50
Source package example (wget 1.12-2.1.dsc)
F or ma t : 3 .0 ( qui lt )Source : wge t
Binary : wge tArchi tectu re : anyVers ion : 1 .12-2 .1Main ta ine r : Noe l Kothe Homepage : h ttp : / /www.gnu .org / software /wge t /Standards -Vers ion: 3 .8 .4
Bui ld -Depends : debhe lper (>> 5 .0 .0 ) , get text , t ex in fo ,l ib ss l -dev (>= 0 .9 .8 ) , dpa tch , i nfo2man
Checksums - Sha1:50d4ed2441e67[ . . ]1 ee0e94248 2464747 wget_1 .12. o rig . t a r.gzd4c1c8bbe431d [ .. ]dd7cef3611 48308 wget_1 .12-2 .1 .deb ian . t a r.gz
Checksums -Sha256 :
7578ed0974e12 [ .. ]dcba65b572 2464747 wget_1 .12. o rig . t a r.gz1e9b0c4c00eae [ . .]89c402ad78 48308 wget_1 .12-2 .1 .deb ian . t a r.gz
Files:141461b9c04e4[ . . ]9 d1f2abf83 2464747 wget_1 .12. o rig . t a r.gze93123c934e3c [ .. ]2 f380278c2 48308 wget_1 .12-2 .1 .deb ian . t a r.gz
An Introduction to Debian Packaging 10 / 47
-
8/7/2019 An Introduction to Debian Packaging
11/50
Retrieving an existing source package
From the Debian archive:apt-get source packageapt-get source package=versionapt-get source package/release
(You need deb-src lines in sources.list )
From the Internet:dget url-to.dscdget http://snapshot.debian.org/archive/debian-archive/20090802T004153Z/debian/dists/bo/main/source/web/wget 1.4.4-6.dsc
(snapshot.d.o provides all packages from Debian since 2005)
Once downloaded, extract with dpkg-source -x file.dsc
An Introduction to Debian Packaging 11 / 47
http://snapshot.debian.org/http://snapshot.debian.org/http://snapshot.debian.org/ -
8/7/2019 An Introduction to Debian Packaging
12/50
Creating a basic source package
Download the upstream source(upstream source = the one from the softwares original developers)
Rename to .orig.tar.gz(example: simgrid 3.6.orig.tar.gz )
Untar itcd upstream source && dh make(from the dh-make package)
There are some alternatives to dh make for specic sets of packages:dh-make-perl , dh-make-php , . . .
debian/ directory created, with a lot of les in it
An Introduction to Debian Packaging 12 / 47
-
8/7/2019 An Introduction to Debian Packaging
13/50
Files in debian/All the packaging work should be made by modifying les in debian/
Main les:
changelog history of the Debian packagecopyright copyright information for the packagecontrol meta-data about the package (dependencies, etc)rules species how to build the package
Optional les:compatwatchdh install* targets*.dirs, *.docs, *.manpages, . . .maintainer scripts*.postinst, *.prerm, . . .source/formatpatches if you need to modify the upstream sources
Most of the les use a format based on RFC 822 (mail headers)
An Introduction to Debian Packaging 13 / 47
-
8/7/2019 An Introduction to Debian Packaging
14/50
debian/changelog
Lists the Debian packaging changesEdited manually or with dchSpecial format to automatically close Debian or Ubuntu bugsDebian: Closes: #595268 ; Ubuntu: LP: #616929Installed as /usr/share/doc/ package /changelog.Debian.gz
mp ich2 (1 .2 .1.1 -5 ) unstable ; u rgency=low
* U se / u sr / b in / p y th on i ns te ad o f / u sr / b in / p y th on 2 . 5. A ll owto d ro p d ep en de nc y on p yt ho n2 . 5. C lo se s : # 59 52 68
* M ak e / us r /b in / m pd ro ot s et ui d . T hi s is th e d ef au lt a ft erth e i ns ta ll at io n of m pi ch 2 f ro m so ur ce , t oo . LP : # 61 69 29
+ A dd c or r es po n di ng l in ti an o ve rr id e .
- - L uc as N us sb au m < l uc as @d eb ia n . org > Wed , 15 Se p 2 01 0 1 8: 13 :4 4 + 02 0
An Introduction to Debian Packaging 14 / 47
-
8/7/2019 An Introduction to Debian Packaging
15/50
debian/copyrightCopyright and license information for the source and the packagingTraditionally written as a text le
New machine-readable format: http://dep.debian.net/deps/dep5/
Format : Upst ream -Name: X Sol i ta ireSource : f tp : / / f tp .example .com/pub/games
F il es : *C op yr ig h t : C o py ri gh t 1 99 8 J oh n D oe < j d oe @e x am p le . c om >License : GPL -2+
T hi s p ro gr am is f re e s of tw ar e ; y ou ca n r ed is tr ib ut e it[ . . . ].On D eb ia n s ys te ms , t he f ul l t ex t of th e GN U G en er al P ub li c
L ic en se v er si on 2 c an be f ou nd in th e f il e /usr /share/common - l icenses/GPL-2.
F i le s : debian /*Copyr igh t : Copyr igh t 1998 Jane Smith < j smi th@example .net >License :
[LICENSE TEXT]
An Introduction to Debian Packaging 15 / 47
http://dep.debian.net/deps/dep5/http://dep.debian.net/deps/dep5/ -
8/7/2019 An Introduction to Debian Packaging
16/50
debian/controlPackage metadata
For the source package itselfFor each binary package built from this source
Package name, section, priority, maintainer, uploaders,build-dependencies, dependencies, description, homepage, . . .
Documentation: Debian Policy chapter 5http://www.debian.org/doc/debian-policy/ch-controlfields.html
Source : wge tSect ion : webPr io r ity : impor tan tMain ta ine r : Noel Kothe Bui ld -Depends : debhe lpe r (>> 5 .0 .0 ) , get text , t ex in fo ,
l ib ss l -dev (>= 0 .9 .8 ) , dpa tch , i n fo2manStandards -Vers ion: 3 .8 .4Homepage: h t tp : / /www.gnu. org/sof tware /wget /
Package : wge tArchi t ectu re : anyDepends : ${sh l ibs :Depends} , ${misc : Depends}D es c ri p ti o n : r et ri ev e s f il es f ro m t he w eb
W ge t is a n et wo rk u ti li ty to r et ri ev e f il es f ro m t he We b
An Introduction to Debian Packaging 16 / 47
http://www.debian.org/doc/debian-policy/ch-controlfields.htmlhttp://www.debian.org/doc/debian-policy/ch-controlfields.html -
8/7/2019 An Introduction to Debian Packaging
17/50
Architecture: all or any
Two kinds of binary packages:
Packages with a different content on each Debian architectureExample: C programArchitecture: any in debian/control
Or, if it only works on a subset of architectures:
Architecture: amd64 i386 ia64 hurd-i386Packages for other architectures built by the Debian infrastructureNamed package version architecture .deb
Packages with the same content on all architectures
Example: Perl libraryArchitecture: all in debian/controlNamed package version all.deb
An Introduction to Debian Packaging 17 / 47
d b l
-
8/7/2019 An Introduction to Debian Packaging
18/50
debian/rules
Makele
Interface used to build Debian packages
Documented in Debian Policy, chapter 4.8http://www.debian.org/doc/debian-policy/ch-source.html#s-debianrules
Five required targets:build : should perform all the conguration and compilation
binary, binary-arch, binary-indep : build the binary packagesdpkg-buildpackage will call binary to build all the packages, or
binary-arch to build only the Architecture: any packagesclean : clean up the source directory
An Introduction to Debian Packaging 18 / 47
P k i h l d bh l
-
8/7/2019 An Introduction to Debian Packaging
19/50
Packaging helpers debhelperYou could write shell code in debian/rules directly
See the adduser package for example
Better practice (used by most packages): use a Packaging helper
Most popular one: debhelper (used by 98% of packages)
Goals:Factor the common tasks in standard tools used by all packages
Fix some packaging bugs once for all packagesdh installdirs, dh installchangelogs, dh installdocs, dh installexamples, dh install,dh installdebconf, dh installinit, dh link, dh strip, dh compress, dh xperms, dh perl,dh makeshlibs, dh installdeb, dh shlibdeps, dh gencontrol, dh md5sums, dh builddeb, . . .
Called from debian/rules
Congurable using command parameters or les in debian/dirs, package.docs, package.examples, package.install, package.manpages, ...
Third-party helpers for sets of packages: python-support , dh ocaml , . . .
Gotcha: debian/compat : Debhelper compatibility version (use 7)
An Introduction to Debian Packaging 19 / 47
d bi / l i d bh l (1/2)
-
8/7/2019 An Introduction to Debian Packaging
20/50
debian/rules using debhelper (1/2)#!/us r /b in /make - f
# U nc om me nt t hi s to t ur n on v er bo se m od e .
#expor t DH_VERBOSE=1
build:$(MAKE)#docbook - to - man debian /packagename . sgml > packagename .1
clean:
dh_testdirdh_testrootrm - f bui ld - s t amp conf igure - s t amp$(MAKE) c l eandh_clean
insta ll : bu ilddh_testdirdh_testrootdh_c lean -kdh_instal ldirs# Ad d h er e c om ma nd s to i ns ta ll t he p ac ka ge i nt o d eb ia n / pa ck ag$(MAKE) DESTDIR=$(CURDIR) /deb ian / packagename inst a ll
An Introduction to Debian Packaging 20 / 47
d bi / l i d bh l (2/2)
-
8/7/2019 An Introduction to Debian Packaging
21/50
debian/rules using debhelper (2/2)
# Bu ild a rch i tec tu re - independent f i le s here .b inary - indep: bui ld ins tal l
# Bu ild a rch i tec tu re -dependent f i le s he re .b inary -arch: bui ld ins ta ll
dh_testdirdh_testrootdh_ins ta l lchangelogsdh_instal ldocsdh_ins ta l lexamples
# dh_insta l ldh_instal lmandh_linkdh_str ipdh_compressdh_fixperms
dh_instal ldebdh_shlibdepsdh_gencontroldh_md5sumsdh_builddeb
b ina ry : b inary - indep b inary -a rch
.PHONY: bu ild c l ean b inary - indep b inary - a rch b ina ry inst a ll conf igureAn Introduction to Debian Packaging 21 / 47
CDBS
-
8/7/2019 An Introduction to Debian Packaging
22/50
CDBSStill a lot of redundancy between packages
Second-level helpers that factor common funtionality
Building with ./configure && make && make install or CMakeSupport for Perl, Python, Ruby, GNOME, KDE, Java, Haskell, . . .
CDBS:Introduced in 2005, based on advanced GNU make magicDocumentation: /usr/share/doc/cdbs/But some people hate it:
Sometimes difcult to customize package builds:twisty maze of makeles, environment vars and black magic Slower than plain debhelper (many useless calls to dh * )
#!/us r /b in /make - finc lude /usr / share / cdbs /1 / ru les /debhelper.mkinclude /usr / share / cdbs /1 /c lass /auto tools .mk
# add an a ct ion af ter the b ui ldbui ld /mypackage: :
/b in /bash debian / sc r ip t s / foo . sh
An Introduction to Debian Packaging 22 / 47
Dh (aka Debhelper 7 or dh7)
-
8/7/2019 An Introduction to Debian Packaging
23/50
Dh (aka Debhelper 7, or dh7)
Introduced in 2008 as a CDBS killer
dh command that calls dh *
Simple debian/rules , listing only overrides
Easier to customize than CDBS
Doc: manpages ( debhelper(7) , dh(1) ) + slides from DebConf9 talkhttp://kitenet.net/
~joey/talks/debhelper/debhelper-slides.pdf
#!/us r /b in /make - f%:
dh $@
overr ide_dh_auto_conf igure :dh_auto_configure - - - -with- k i tchen -s ink
overr ide_dh_auto_bui ld : make wor ld
An Introduction to Debian Packaging 23 / 47
Classic debhelper vs CDBS vs dh
http://kitenet.net/~joey/talks/debhelper/debhelper-slides.pdfhttp://kitenet.net/~joey/talks/debhelper/debhelper-slides.pdfhttp://kitenet.net/~joey/talks/debhelper/debhelper-slides.pdfhttp://kitenet.net/~joey/talks/debhelper/debhelper-slides.pdf -
8/7/2019 An Introduction to Debian Packaging
24/50
Classic debhelper vs CDBS vs dhMarket shares: (feb11)Classic debhelper: 45% CDBS: 24% dh: 29%
Which one should I learn?Probably all of themYou need to know debhelper to use dh and CDBSYou might have to modify CDBS packages
Which one should I use for a new package?
dh (only solution with an increasing market share)
11/2009 05/2010 12/20100
20
40
60
Time
M a r k e t s h a r e ( % ) debhelper
dhCDBS
An Introduction to Debian Packaging 24 / 47
Outline
-
8/7/2019 An Introduction to Debian Packaging
25/50
Outline
1 Introduction
2 Creating source packages
3 Building and testing packages
4 Practical session: modifying the grep package
5 Advanced packaging topics
6 Maintaining packages in Debian
7 Resources
8 Conclusion
An Introduction to Debian Packaging 25 / 47
-
8/7/2019 An Introduction to Debian Packaging
26/50
Installing and testing packages
-
8/7/2019 An Introduction to Debian Packaging
27/50
Installing and testing packages
Install the package locally: debi (will use .changes to know what to install)
List the content of the package: debc ../mypackage.changes
Compare the package with a previous version:debdiff ../mypackage 1 *.changes ../mypackage 2 *.changesor to compare the sources:
debdiff ../mypackage 1 *.dsc ../mypackage 2 *.dscCheck the package with lintian (static analyzer):lintian ../mypackage.changeslintian -i : gives more information about the errors
Upload the package to Debian ( dput ) (needs conguration)
Manage a private Debian archive with repreproDocumentation: http://mirrorer.alioth.debian.org/
An Introduction to Debian Packaging 27 / 47
Outline
http://mirrorer.alioth.debian.org/http://mirrorer.alioth.debian.org/ -
8/7/2019 An Introduction to Debian Packaging
28/50
Outline
1 Introduction
2 Creating source packages
3 Building and testing packages
4 Practical session: modifying the grep package
5 Advanced packaging topics
6 Maintaining packages in Debian
7 Resources
8 Conclusion
An Introduction to Debian Packaging 28 / 47
Practical session: modifying the grep package
-
8/7/2019 An Introduction to Debian Packaging
29/50
Practical session: modifying the grep package
1 Go to http://ftp.debian.org/debian/pool/main/g/grep/ and
download version 2.6.3-3 of the package2 Look at the les in debian/ .
How many binary packages are generated by this source package?Which packaging helper does this package use?
3 Build the package4 We are now going to modify the package. Add a changelog entry and
increase the version number.5 Now disable perl-regexp support (it is a ./configure option)6 Rebuild the package
7 Compare the original and the new package with debdiff8 Install the newly built package9 Cry if you messed up ;)
An Introduction to Debian Packaging 29 / 47
Outline
http://ftp.debian.org/debian/pool/main/g/grep/http://ftp.debian.org/debian/pool/main/g/grep/ -
8/7/2019 An Introduction to Debian Packaging
30/50
Outline
1 Introduction
2 Creating source packages
3 Building and testing packages
4 Practical session: modifying the grep package
5 Advanced packaging topics
6 Maintaining packages in Debian
7 Resources
8 Conclusion
An Introduction to Debian Packaging 30 / 47
Modifying the upstream source
-
8/7/2019 An Introduction to Debian Packaging
31/50
Modifying the upstream source
Often needed:
Fix bugs or add customizations that are specic to DebianBackport xes from a newer upstream release
Several methods to do it:Modifying the les directly
SimpleBut no way to track and document the changes
Using patch systemsEases contributing your changes to upstream
Helps sharing the xes with derivativesGives more exposure to the changeshttp://patch-tracker.debian.org/
An Introduction to Debian Packaging 31 / 47
Patch systems
http://patch-tracker.debian.org/http://patch-tracker.debian.org/ -
8/7/2019 An Introduction to Debian Packaging
32/50
y
Principle: changes are stored as patches in debian/patches/
Applied and unapplied during buildSeveral implementations: simple-patchsys (cdbs only), dpatch , quilt
Each supports two debian/rules targets:debian/rules patch : apply all patches
debian/rules unpatch : de-apply all patchesMore documentation: http://wiki.debian.org/debian/patches
Future: new source package format with built-in patch system: 3.0 (quilt)
Recommended solutionYou need to learn quilt http://pkg-perl.alioth.debian.org/howto/quilt.html
An Introduction to Debian Packaging 32 / 47
Documentation of patches
http://wiki.debian.org/debian/patcheshttp://pkg-perl.alioth.debian.org/howto/quilt.htmlhttp://pkg-perl.alioth.debian.org/howto/quilt.htmlhttp://wiki.debian.org/debian/patches -
8/7/2019 An Introduction to Debian Packaging
33/50
p
Standard headers
Documented in DEP3 - Patch Tagging Guidelineshttp://dep.debian.net/deps/dep3/
Descr ip tion : F ix widge t f robn icat ion speedsF r ob n ic a ti n g w id ge ts t oo q ui ck ly t en de d to c au se e xp lo s io ns .Forwarded: h t tp : / / l i s t s .example .com/2010/03/1234. h tmlAuthor : John Doe < johndoe -gues t@user s . a l io th . debian .org>Appl ied -Upst ream: 1 .2 , h t tp : / /bzr. foo .com/frobnica tor / revis ion /123Las t - Upda te : 2010-03-29
An Introduction to Debian Packaging 33 / 47
Doing things during installation and removal
http://dep.debian.net/deps/dep3/http://dep.debian.net/deps/dep3/ -
8/7/2019 An Introduction to Debian Packaging
34/50
g g g
Decompressing the package is sometimes not enough
Create/remove system users, start/stop services, manage alternatives
Done in maintainer scripts preinst, postinst, prerm, postrm
Documentation:Debian Policy Manual, chapter 6http://www.debian.org/doc/debian-policy/ch-maintainerscripts.html
Debian Developers Reference, chapter 6.4http://www.debian.org/doc/developers-reference/best-pkging-practices.html
http://people.debian.org/ ~srivasta/MaintainerScripts.html
Prompting the userMust be done with debconf
Documentation: debconf-devel(7) (debconf-doc package)
An Introduction to Debian Packaging 34 / 47
Monitoring upstream versions
http://www.debian.org/doc/debian-policy/ch-maintainerscripts.htmlhttp://www.debian.org/doc/developers-reference/best-pkging-practices.htmlhttp://people.debian.org/~srivasta/MaintainerScripts.htmlhttp://people.debian.org/~srivasta/MaintainerScripts.htmlhttp://people.debian.org/~srivasta/MaintainerScripts.htmlhttp://people.debian.org/~srivasta/MaintainerScripts.htmlhttp://www.debian.org/doc/developers-reference/best-pkging-practices.htmlhttp://www.debian.org/doc/debian-policy/ch-maintainerscripts.html -
8/7/2019 An Introduction to Debian Packaging
35/50
g p
Specify where to look in debian/watch (see uscan(1) )
vers ion=3
ht tp : / / tmrc .mi t .edu/mir ror / twis ted/ Twis ted/ ( \d \ . \d) / \Twisted -([ \d \ . ]*)\ . tar \ . bz2
Debian infrastructure that makes use of debian/watch :Debian External Health Statushttp://dehs.alioth.debian.org/
Maintainer warned by emails sent to the Packages Tracking System
uscan : run a manual check
uupdate : try to update your package to the latest upstream version
An Introduction to Debian Packaging 35 / 47
Packaging with a VCS (SVN, Git & friends)
http://dehs.alioth.debian.org/http://dehs.alioth.debian.org/ -
8/7/2019 An Introduction to Debian Packaging
36/50
Several tools to help manage branches and tags for your packaging work:svn-buildpackage , git-buildpackage
Example: git-buildpackageupstream branch to track upstream with upstream/ version tags master branch tracks the Debian packagedebian/ version tags for each uploadpristine-tar branch to be able to rebuild the upstream tarball
Vcs-* elds in debian/control to locate the repository
Vcs -Browser : h t tp : / /g i t .debian .org/?p=devscr ip ts / devscr ipts . g i tVcs -Gi t : g i t : / /g i t .debian .org/devscr ip ts / devscr ipts . g i t
Vcs -Browser : h t tp : / / svn .debian .org/v iewsvn/pkg -per l / t runk/ l ibwww -per lVcs -Svn: svn: / / svn .debian .org/pkg -per l / t runk/ l ibwww -per l
VCS-agnostic interface: debcheckout , debcommit , debreleasedebcheckout devscripts check out the source package from Git
An Introduction to Debian Packaging 36 / 47
Outline
-
8/7/2019 An Introduction to Debian Packaging
37/50
1 Introduction
2 Creating source packages
3 Building and testing packages
4 Practical session: modifying the grep package
5 Advanced packaging topics
6 Maintaining packages in Debian
7 Resources
8 Conclusion
An Introduction to Debian Packaging 37 / 47
Several ways to contribute to Debian
-
8/7/2019 An Introduction to Debian Packaging
38/50
Worst way to contribute:Package your own application
Get it into DebianDisappear
Bring new software to DebianOnly if its interesting/useful enough, pleaseAre there alternatives already packaged in Debian?
Adopt existing unmaintained packages ( orphaned packages )Many unmaintained packages in DebianIncluding some that you use daily!
Get involved in packaging teamsMany teams that focus on set of packages, and need helpFull list on http://wiki.debian.org/TeamsAn excellent way to work with more experienced contributors
An Introduction to Debian Packaging 38 / 47
More interested in Ubuntu?
http://wiki.debian.org/Teamshttp://wiki.debian.org/Teams -
8/7/2019 An Introduction to Debian Packaging
39/50
Ubuntu mainly manages the divergence with Debian
No real focus on specic packagesInstead, collaboration with Debian teams
Usually recommend uploading new packages to Debian rsthttps://wiki.ubuntu.com/UbuntuDevelopment/NewPackages
Possibly a better plan:Get involved in a Debian team and act as a bridge with Ubuntu
Help reduce divergence, triage bugs in Launchpad
Many Debian tools can help:
Ubuntu column on the Developer packages overviewUbuntu box on the Packages Tracking SystemReceive launchpad bugmail via the PTS
An Introduction to Debian Packaging 39 / 47
Adopting orphaned packages
https://wiki.ubuntu.com/UbuntuDevelopment/NewPackageshttps://wiki.ubuntu.com/UbuntuDevelopment/NewPackages -
8/7/2019 An Introduction to Debian Packaging
40/50
Full list: http://www.debian.org/devel/wnpp/
Installed on your machine: wnpp-alert
Different states:Orphaned: the package is unmaintainedFeel free to adopt itRFA : Request For AdopterMaintainer looking for adopter, but continues work in the meantime
Feel free to adopt it. A mail to the current maintainer is politeITA: Intent To AdoptSomeone intends to adopt the packageYou could propose your help!RFH : (Request For Help
The maintainer is looking for helpSome unmaintained packages not detected not orphaned yet
When in doubt, ask [email protected] #debian-qa on irc.debian.org
An Introduction to Debian Packaging 40 / 47
Outline
http://www.debian.org/devel/wnpp/http://www.debian.org/devel/wnpp/ -
8/7/2019 An Introduction to Debian Packaging
41/50
1 Introduction
2 Creating source packages
3 Building and testing packages
4 Practical session: modifying the grep package
5 Advanced packaging topics
6 Maintaining packages in Debian
7 Resources
8 Conclusion
An Introduction to Debian Packaging 41 / 47
Where to nd help?
-
8/7/2019 An Introduction to Debian Packaging
42/50
Help you will need:Various advices and answers to your questions, code reviewsSponsorship of your uploads, when your package is ready
You can get help from:Other members of a packaging team: the best solution
They know the specics of your packageYou can become a member of the teamSee http://wiki.debian.org/Teams
The Debian Mentors group (if your package doesnt t in a team)http://wiki.debian.org/DebianMentorsFaqMailing list: [email protected]: #debian-mentors on irc.debian.orghttp://mentors.debian.net/
An Introduction to Debian Packaging 42 / 47
Ofcial documentation
http://wiki.debian.org/Teamshttp://wiki.debian.org/DebianMentorsFaqhttp://[email protected]/http://mentors.debian.net/http://mentors.debian.net/http://[email protected]/http://wiki.debian.org/DebianMentorsFaqhttp://wiki.debian.org/Teams -
8/7/2019 An Introduction to Debian Packaging
43/50
Debian Developers Cornerhttp://www.debian.org/devel/Links to many resources about Debian development
Debian New Maintainers Guidehttp://www.debian.org/doc/maint-guide/An introduction to Debian packaging, but could use an update
Debian Developers Referencehttp://www.debian.org/doc/developers-reference/Mostly about Debian procedures, but also some best packaging practices (part 6)
Debian Policyhttp://www.debian.org/doc/debian-policy/
All the requirements that every package must satisfySpecic policies for Perl, Java, Python, . . .
Ubuntu Packaging Guidehttps://wiki.ubuntu.com/PackagingGuide
An Introduction to Debian Packaging 43 / 47
Outline
http://www.debian.org/devel/http://www.debian.org/doc/maint-guide/http://www.debian.org/doc/developers-reference/http://www.debian.org/doc/debian-policy/https://wiki.ubuntu.com/PackagingGuidehttps://wiki.ubuntu.com/PackagingGuidehttp://www.debian.org/doc/debian-policy/http://www.debian.org/doc/developers-reference/http://www.debian.org/doc/maint-guide/http://www.debian.org/devel/ -
8/7/2019 An Introduction to Debian Packaging
44/50
1 Introduction
2 Creating source packages
3 Building and testing packages
4 Practical session: modifying the grep package
5 Advanced packaging topics
6 Maintaining packages in Debian
7 Resources
8 Conclusion
An Introduction to Debian Packaging 44 / 47
Conclusion
-
8/7/2019 An Introduction to Debian Packaging
45/50
You now have a full overview of Debian packagingBut you will need to read more documentation
Best practices have evolved over the yearsIf not sure, use the dh packaging helper, and the 3.0 (quilt) format
Debian is not only a technical project, its also a community
Feedback: [email protected]
An Introduction to Debian Packaging 45 / 47
Legal stuff
-
8/7/2019 An Introduction to Debian Packaging
46/50
Copyright c 2011 Lucas Nussbaum [email protected]
This document is free software : you can redistribute it and/or modify it under either(at your option):
The terms of the GNU General Public License as published by the Free SoftwareFoundation, either version 3 of the License, or (at your option) any later version.http://www.gnu.org/licenses/gpl.html
The terms of the Creative Commons Attribution-ShareAlike 3.0 Unported License.http://creativecommons.org/licenses/by-sa/3.0/
An Introduction to Debian Packaging 46 / 47
Latest version & source code
http://www.gnu.org/licenses/gpl.htmlhttp://creativecommons.org/licenses/by-sa/3.0/http://creativecommons.org/licenses/by-sa/3.0/http://www.gnu.org/licenses/gpl.html -
8/7/2019 An Introduction to Debian Packaging
47/50
Latest version:http://git.debian.org/?p=users/lucas/packaging-tutorial.git;a=blob_plain;f=packaging-tutorial.pdf;hb=refs/heads/pdf
Contribute:
git clone git://git.debian.org/~lucas/packaging-tutorial.gitOr over HTTP:http://git.debian.org/?p=users/lucas/packaging-tutorial.git
Feedback: [email protected]
An Introduction to Debian Packaging 47 / 47
TODO
http://git.debian.org/?p=users/lucas/packaging-tutorial.git;a=blob_plain;f=packaging-tutorial.pdf;hb=refs/heads/pdfhttp://git.debian.org/?p=users/lucas/packaging-tutorial.git;a=blob_plain;f=packaging-tutorial.pdf;hb=refs/heads/pdfhttp://git.debian.org/?p=users/lucas/packaging-tutorial.gitmailto:[email protected]:[email protected]://git.debian.org/?p=users/lucas/packaging-tutorial.githttp://git.debian.org/?p=users/lucas/packaging-tutorial.git;a=blob_plain;f=packaging-tutorial.pdf;hb=refs/heads/pdfhttp://git.debian.org/?p=users/lucas/packaging-tutorial.git;a=blob_plain;f=packaging-tutorial.pdf;hb=refs/heads/pdf -
8/7/2019 An Introduction to Debian Packaging
48/50
more practical sessionsdebc and lintian should really pick-up the .changes le automaticallyUCFBlendsBTSsecurityvolatiles
An Introduction to Debian Packaging 48 / 47
Debian branches ( suites )
-
8/7/2019 An Introduction to Debian Packaging
49/50
stable (currently codenamed squeeze ): stable and supported. Only
important bug xes.testing (currently codenamed wheezy ): the future stable release.
unstable (always codenamed sid ): where most of the work occurs, andwhere packages are uploaded. Packages migrate automatically from
unstable to testing according to some rules.
experimental : for experimental packages that are not suited for a stablerelease.
Developers mostly run unstable or testing (with APT pinning )
Packages can be backported from testing/unstable to stable . Seehttp://backports.debian.org/
An Introduction to Debian Packaging 49 / 47
Debian dashboards for maintainers
http://backports.debian.org/http://backports.debian.org/ -
8/7/2019 An Introduction to Debian Packaging
50/50
Source package centric: Packages Tracking Systemhttp://packages.qa.debian.org/dpkg
Maintainer/team centric: Developers Packages Overviewhttp://qa.debian.org/developer.php?login=pkg-ruby-extras-maintainers@lists.alioth.debian.org
An Introduction to Debian Packaging 50 / 47
http://packages.qa.debian.org/dpkghttp://qa.debian.org/developer.php?login=pkg-ruby-extras-maintainers@lists.alioth.debian.orghttp://qa.debian.org/developer.php?login=pkg-ruby-extras-maintainers@lists.alioth.debian.orghttp://qa.debian.org/developer.php?login=pkg-ruby-extras-maintainers@lists.alioth.debian.orghttp://qa.debian.org/developer.php?login=pkg-ruby-extras-maintainers@lists.alioth.debian.orghttp://packages.qa.debian.org/dpkg