1 \documentclass[10pt,final]{beamer}
4 \usepackage{debiantutorial}
6 \hypersetup{pdftitle={An Introduction to Debian Packaging},bookmarks}
7 \title{An Introduction to Debian Packaging}
8 \author[]{Lucas Nussbaum\\{\small\texttt{lucas@debian.org}}}
9 \institute{\includegraphics[viewport=274 335 360 440,width=1cm]{figs/openlogo-nd.pdf}}
16 \section{Introduction}
17 \subsection{Legal stuff}
19 \frametitle{Legal stuff}
21 Copyright \copyright 2011 Lucas Nussbaum -- lucas@debian.org
25 \textbf{This document is free software}: you can redistribute it and/or modify
26 it under either (at your option):
29 \item The terms of the GNU General Public License as published by
30 the Free Software Foundation, either version 3 of the License, or
31 (at your option) any later version.\\
32 \url{http://www.gnu.org/licenses/gpl.html}
34 \item The terms of the Creative Commons Attribution-ShareAlike 3.0 Unported License.\\
35 \url{http://creativecommons.org/licenses/by-sa/3.0/}
40 \subsection{Latest version \& source code}
42 \frametitle{Latest version \& source code}
44 \item Latest version:\\
45 {\footnotesize \url{http://git.debian.org/?p=users/lucas/packaging-tutorial.git;a=blob\_plain;f=packaging-tutorial.pdf;hb=refs/heads/pdf}}
50 \texttt{git clone git://git.debian.org/\~{}lucas/packaging-tutorial.git}\\
52 Or over HTTP: \url{http://git.debian.org/?p=users/lucas/packaging-tutorial.git}
54 \item Feedback: \href{mailto:lucas@debian.org}{\textbf{\texttt{lucas@debian.org}}}
58 \subsection{About this tutorial}
59 \begin{frame}{About this tutorial}
61 \item Goal: tell you what you really need to know about Debian packaging
64 \item To modify existing packages
66 \item To create your own packages
68 \item To become a Debian power-user
71 \item Tries to keep a reasonable size
74 \item No attempt to be complete
76 \item You will need to read more documentation
79 \item Most of the content also applies to Debian derivatives distributions
82 \item That includes Ubuntu
87 \subsection{The Deb package format}
88 \begin{frame}[fragile]
89 \frametitle{Introduction: the Deb package format}
91 \item One of the two most common packages format (with RPM)
92 \item A very powerful and convenient way to distribute software to users
93 \item \texttt{.deb} file: an \texttt{ar} archive
94 \begin{lstlisting}[basicstyle=\ttfamily\footnotesize]
95 $ ar tv wget_1.12-2.1_i386.deb
96 rw-r--r-- 0/0 4 Sep 5 15:43 2010 debian-binary
97 rw-r--r-- 0/0 2403 Sep 5 15:43 2010 control.tar.gz
98 rw-r--r-- 0/0 751613 Sep 5 15:43 2010 data.tar.gz
101 \item \texttt{debian-binary}: version of the deb file format, \texttt{"2.0\textbackslash{}n"}
102 \item \texttt{control.tar.gz}: metadata about the package\\
103 {\small \texttt{\textbf{control}, md5sums, (pre|post)(rm|inst), triggers, shlibs}, \ldots}
104 \item \texttt{data.tar.gz}: data files of the package
106 \item You could create your \texttt{.deb} files manually\\
107 {\footnotesize \url{http://tldp.org/HOWTO/html\_single/Debian-Binary-Package-Building-HOWTO/}}
108 \item But most people don't do it that way
111 \centerline{\textbf{This tutorial: create Debian packages, the Debian way}}
114 \subsection{Tools you will need}
115 \begin{frame}{Tools you will need}
117 \item A Debian (or Ubuntu) system (with root access)
121 \item \textbf{build-essential}: has dependencies on the packages that will be assumed to be available on the developers' machine (no need to specify them in the \texttt{Build-Depends:} control field of your package)
123 \item includes a dependency on \textbf{dpkg-dev}, which contains basic Debian-specific tools to create packages
126 \item \textbf{devscripts}: contains many useful scripts for Debian maintainers
131 Many other tools will also be mentioned later, such as \textbf{debhelper}, \textbf{cdbs}, \textbf{quilt}, \textbf{pbuilder}, \textbf{sbuild}, \textbf{lintian}, \textbf{svn-buildpackage}, \textbf{git-buildpackage}, \ldots\\
132 Install them when you need them.
135 \subsection{General packaging workflow}
136 \begin{frame}{General packaging workflow}
139 node1/.style={shape=rectangle,draw=rouge,fill=debianbackgroundblue,thick},
140 arr/.style={very thick},
141 command/.style={text=rouge,font=\ttfamily},
143 \node[node1] (www) at (0, 0) {Web};
144 \node[node1] (us) at (2.5, 0) {upstream source};
145 \node[node1] (da) at (-2.5, 0) {Debian mirror};
146 \node[node1] (sp) at (0, -2) {source package};
147 \draw[arr,<-,dashed] (sp) -- (2.5,-2) node[right=0cm,text width=2.98cm,text centered,font=\small] {where most of the manual work is done};
148 \node[node1] (bin) at (0, -4) {one or several binary packages};
149 \draw[arr,<-,dashed] (bin) -- (3.5,-4) node[right,text centered,font=\ttfamily] {.deb\normalfont};
150 \draw[arr,->] (us) -- (sp) node[pos=0.5,right,command] {dh\_make};
151 \draw[arr,->] (da) -- (sp) node[pos=0.5,left,command] {apt-get source};
152 \draw[arr,->] (www) -- (sp) node[pos=0.5,left,command] {dget};
153 \draw[arr,->] (sp) -- (bin) node[pos=0.5,right,text width=6cm] {\textttc{debuild} (build and test with \textttc{lintian}) or \textttc{dpkg-buildpackage}};
154 \draw[arr,->] (bin) -- (-1,-6) node[pos=0.5,left] {install (\textttc{debi})};
155 \draw[arr,->] (bin) -- (1,-6) node[pos=0.5,right] {upload (\textttc{dput})};
156 \useasboundingbox (-4,-6) rectangle (6,0); % hack hack hack
161 \section{Creating source packages}
162 \subsection{Source packages basics}
164 \frametitle{Source package}
166 \item One source package can generate several binary packages\\
167 {\small e.g the \texttt{\bfseries libtar} source generates the \texttt{\bfseries libtar} and \texttt{\bfseries libtar-dev} binary packages}
169 \item Two kinds of packages: (if unsure, use non-native)
172 \item Native packages: software developed inside Debian (\textsl{dpkg}, \textsl{apt})
173 \item Non-native packages: software developed outside Debian
176 \item Main file: \texttt{.dsc} (meta-data)
178 \item Other files depending on the version of the source format
180 \item 1.0 -- native: \texttt{package\_version.tar.gz}
182 \item 1.0 -- non-native:
184 \item \texttt{pkg\_ver.orig.tar.gz} : upstream source
185 \item \texttt{pkg\_debver.diff.gz} : patch to add Debian-specific changes
190 \item \texttt{pkg\_ver.orig.tar.gz} : upstream source
191 \item \texttt{pkg\_debver.debian.tar.gz} : tarball with the Debian changes
196 (See \texttt{dpkg-source(1)} for exact details)
199 \begin{frame}[fragile]
200 \frametitle{Source package example (wget\_1.12-2.1.dsc)}
201 \begin{lstlisting}[basicstyle=\ttfamily\small]
207 Maintainer: Noel Kothe <noel@debian.org>
208 Homepage: http://www.gnu.org/software/wget/
209 Standards-Version: 3.8.4
210 Build-Depends: debhelper (>> 5.0.0), gettext, texinfo, libssl-dev (>= 0.9.8), dpatch, info2man
212 50d4ed2441e67db7aa5061d8a4dde41ee0e94248 2464747 wget_1.12.orig.tar.gz
213 d4c1c8bbe431d6131cbd7ed2e4fc37dd7cef3611 48308 wget_1.12-2.1.debian.tar.gz
215 7578ed0974e12caa71120581fa3962ee5a69f7175ddc3d6a6db0ecdcba65b572 2464747 wget_1.12.orig.tar.gz
216 1e9b0c4c00eae6b4172baae219a14857f4002382b9d7a289de7ab789c402ad78 48308 wget_1.12-2.1.debian.tar.gz
218 141461b9c04e454dc8933c9d1f2abf83 2464747 wget_1.12.orig.tar.gz
219 e93123c934e3c141916f472f380278c2 48308 wget_1.12-2.1.debian.tar.gz
223 \subsection{Retrieving source packages}
225 \frametitle{Retrieving an existing source package}
227 \item From the Debian archive:
229 \item \texttt{apt-get source \textsl{package}}
230 \item \texttt{apt-get source \textsl{package=version}}
231 \item \texttt{apt-get source \textsl{package/release}}
233 (You need \texttt{deb-src} lines in \texttt{sources.list})
235 \item From the Internet:
237 \item \texttt{dget \textsl{url-to.dsc}}
238 \item \texttt{dget http://snapshot.debian.org/archive/debian-archive/\\20090802T004153Z/debian/dists/bo/main/source/web/\\wget\_1.4.4-6.dsc}\\
239 (\href{http://snapshot.debian.org/}{\ttfamily snapshot.d.o} provides all packages from Debian since 2005)
242 \item Once downloaded, extract with \texttt{dpkg-source -x \textsl{file.dsc}}
246 \subsection{Creating a basic source package}
248 \frametitle{Creating a basic source package}
250 \item Download the upstream source
252 \item Rename to \texttt{\textsl{source\_package}\_\textsl{upstream\_version}.orig.tar.gz}
256 \item \texttt{cd \textsl{upstream\_source} \&\& dh\_make} (from the \textbf{dh-make} package)
258 \item There are some alternatives to \texttt{dh\_make} for specific sets of packages: \textbf{dh-make-perl}, \textbf{dh-make-php}, \ldots
260 \item \texttt{debian/} directory created, with a lot of files in it
264 \subsection{Files in debian/}
265 \begin{frame}{Files in debian/}
266 All the packaging work should usually be made by modifying files in \texttt{debian/}
277 \item Optional files:
281 \item dh\_install* targets\\
282 {\small *.dirs, *.docs, *.manpages, \ldots}
283 \item maintainer scripts\\
284 {\small *.postinst, *.prerm, \ldots}
291 \begin{frame}[fragile]{debian/changelog}
293 \item Lists the Debian packaging changes
294 \item Edited manually or with \texttt{dch}
295 \item Special format to automatically close Debian or Ubuntu bugs\\
296 Debian: \texttt{Closes:~\#595268} ; Ubuntu: \texttt{LP:~\#616929}
297 \item Installed as \texttt{/usr/share/doc/\textit{package}/changelog.Debian.gz}
299 \begin{lstlisting}[basicstyle=\ttfamily\footnotesize]
300 mpich2 (1.2.1.1-5) unstable; urgency=low
302 * Use /usr/bin/python instead of /usr/bin/python2.5. Allow
303 to drop dependency on python2.5. Closes: #595268
304 * Make /usr/bin/mpdroot setuid. This is the default after
305 the installation of mpich2 from source, too. LP: #616929
306 + Add corresponding lintian override.
308 -- Lucas Nussbaum <lucas@debian.org> Wed, 15 Sep 2010 18:13:44 +0200
312 \begin{frame}[fragile]{debian/copyright}
315 \item Copyright and license information for the source and the packaging
316 \item Traditionally written as a text file
317 \item New machine-readable format: \url{http://dep.debian.net/deps/dep5/}
319 \begin{lstlisting}[basicstyle=\ttfamily\footnotesize]
320 Format: <VERSIONED_FORMAT_URL>
321 Upstream-Name: X Solitaire
322 Source: ftp://ftp.example.com/pub/games
325 Copyright: Copyright 1998 John Doe <jdoe@example.com>
327 This program is free software; you can redistribute it
330 On Debian systems, the full text of the GNU General Public
331 License version 2 can be found in the file
332 `/usr/share/common-licenses/GPL-2'.
335 Copyright: Copyright 1998 Jane Smith <jsmith@example.net>
341 \begin{frame}[fragile]{debian/control}
344 \item Package metadata
346 \item For the source package itself
347 \item For each binary package built from this source
350 \item Package name, section, priority, maintainer, uploaders, build-dependencies, dependencies, description, homepage, \ldots
352 \item Documentation: Debian Policy chapter 5\\
353 \url{http://www.debian.org/doc/debian-policy/ch-controlfields.html}
355 \begin{lstlisting}[basicstyle=\ttfamily\footnotesize]
359 Maintainer: Noel Kothe <noel@debian.org>
360 Build-Depends: debhelper (>> 5.0.0), gettext, texinfo,
361 libssl-dev (>= 0.9.8), dpatch, info2man
362 Standards-Version: 3.8.4
363 Homepage: http://www.gnu.org/software/wget/
367 Depends: ${shlibs:Depends}, ${misc:Depends}
368 Description: retrieves files from the web
369 Wget is a network utility to retrieve files from the Web
373 \begin{frame}{Architecture: all or any}
374 Two kinds of binary packages:
377 \item Packages with a different content on each Debian architecture
379 \item Example: C program
380 \item \texttt{Architecture:\ any} in \texttt{debian/control}
382 \item Or, if it only works on a subset of architectures:\\
383 \texttt{Architecture:\ amd64 i386 ia64 hurd-i386}
385 \item Packages for other architectures built by the Debian infrastructure
386 \item Named \texttt{\textsl{package}\_\textsl{version}\_\textsl{architecture}.deb}
389 \item Packages with the same content on all architectures
391 \item Example: Perl library
392 \item \texttt{Architecture:\ all} in \texttt{debian/control}
393 \item Named \texttt{\textsl{package}\_\textsl{version}\_\textbf{all}.deb}
398 \begin{frame}[fragile]{debian/rules}
403 \item Interface used to build Debian packages
405 \item Documented in Debian Policy, chapter 4.8\\
406 {\small \texttt{http://www.debian.org/doc/debian-policy/ch-source.html\#s-debianrules}}
408 \item Five required targets:
410 \item \texttt{build}: should perform all the configuration and compilation of the package
412 \item \texttt{binary, binary-arch, binary-indep}: build the binary packages produced by this source package
414 \item \texttt{dpkg-buildpackage} will call \texttt{binary} to build all the packages, or \texttt{binary-arch} to build only the \texttt{Architecture:~any} packages
417 \item \texttt{clean}: clean up the source directory
422 \subsection{Packaging helpers}
423 \begin{frame}{Packaging helpers -- debhelper}
425 \item You could write shell code in \texttt{debian/rules} directly
427 \item See the \texttt{adduser} package for example
430 \item But most packages in Debian use a \textsl{Packaging helper}
432 \item Most popular one: \textbf{debhelper} (used by 98\% of packages)
434 \item Goal: factor the common tasks in standard tools used by all packages\\
435 {\footnotesize dh\_installdirs, dh\_installchangelogs, dh\_installdocs, dh\_installexamples, dh\_install, dh\_installdebconf, dh\_installinit, dh\_link, dh\_strip, dh\_compress, dh\_fixperms, dh\_perl, dh\_makeshlibs, dh\_installdeb, dh\_shlibdeps, dh\_gencontrol, dh\_md5sums, dh\_builddeb, \ldots}
437 \item Called from \texttt{debian/rules}
438 \item Configurable using command parameters or files in \texttt{debian/}\\
439 {\footnotesize \ttfamily dirs, package.docs, package.examples, package.install, package.menu, package.logrotate, package.manpages, \ldots}
442 \item Third-party helpers for sets of packages: \textbf{python-support}, \textbf{dh\_ocaml}, \ldots
444 \item Gotcha: \texttt{debian/compat}: Debhelper compatibility version (use "7")
448 \begin{frame}[fragile]{debian/rules using debhelper (1/2)}
449 \begin{lstlisting}[basicstyle=\ttfamily\footnotesize]
452 # Uncomment this to turn on verbose mode.
457 #docbook-to-man debian/packagename.sgml > packagename.1
462 rm -f build-stamp configure-stamp
471 # Add here commands to install the package into debian/packagename.
472 $(MAKE) DESTDIR=$(CURDIR)/debian/packagename install
476 \begin{frame}[fragile]{debian/rules using debhelper (2/2)}
477 \begin{lstlisting}[basicstyle=\ttfamily\footnotesize]
479 # Build architecture-independent files here.
480 binary-indep: build install
482 # Build architecture-dependent files here.
483 binary-arch: build install
501 binary: binary-indep binary-arch
502 .PHONY: build clean binary-indep binary-arch binary install configure
506 \begin{frame}[fragile]{CDBS}
509 \item Still a lot of redundancy between packages
511 \item Second-level helpers that factor common funtionality
513 \item Building with \texttt{./configure \&\& make \&\& make install} or CMake
514 \item Support for Perl, Python, Ruby, GNOME, KDE, Java, Haskell, \ldots
519 \item Introduced in 2005, based on advanced \textsl{GNU make} magic
520 \item Documentation: \texttt{/usr/share/doc/cdbs/}
521 \item But some people hate it:
523 \item Sometimes difficult to customize package builds:\\
524 "\textsl{twisty maze of makefiles, environment vars and black magic}"
525 \item Slower than plain debhelper (many useless calls to \texttt{dh\_*})
527 \begin{lstlisting}[basicstyle=\ttfamily\footnotesize]
529 include /usr/share/cdbs/1/rules/debhelper.mk
530 include /usr/share/cdbs/1/class/autotools.mk
532 # add an action after the build
534 /bin/bash debian/scripts/foo.sh
540 \begin{frame}[fragile]{Dh (aka Debhelper 7, or dh7)}
542 \item Introduced in 2008 as a \textsl{CDBS killer}
544 \item \textbf{dh} command that calls \texttt{dh\_*}
546 \item Simple \textsl{debian/rules}, listing only overrides
548 \item Easier to customize than CDBS
550 \item Doc: manpages (\texttt{debhelper(7)}, \texttt{dh(1)}) + slides from DC9 talk\\
551 \url{http://kitenet.net/~joey/talks/debhelper/debhelper-slides.pdf}
553 \begin{lstlisting}[basicstyle=\ttfamily\footnotesize]
558 override_dh_auto_configure:
559 dh_auto_configure -- --with-kitchen-sink
561 override_dh_auto_build:
568 \begin{frame}{Classic debhelper vs CDBS vs dh}
571 \item Market shares: (feb'11)\\
572 Classic debhelper: 45\% \hskip 1em CDBS: 24\% \hskip 1em dh: 29\%
574 \item Which one should I learn?
576 \item Probably all of them
577 \item You need to know debhelper to use CDBS and dh
578 \item You might have to modify CDBS packages
581 \item Which one should I use for a new package?
583 \item \textbf{dh} (only solution with an increasing market share)
590 \begin{axis}[small,label style={font=\footnotesize},xlabel={\small Time},ylabel={\small Market share (\%)},
591 date coordinates in=x,height=4.85cm,width=9cm,xticklabel={\month/\year},
592 legend style={font=\footnotesize,at={(1.02,1)},anchor=north west},max space between ticks=82,try min ticks=5,ymin=0]
593 \addplot[mark=none,blue,thick] table[x=date,y=dh] {cdbs-dh7.txt};
594 \addplot[mark=none,red,thick] table[x=date,y=dh7] {cdbs-dh7.txt};
595 \addplot[mark=none,green,thick] table[x=date,y=cdbs] {cdbs-dh7.txt};
596 \legend{debhelper, dh, CDBS}
603 \section{Building and testing packages}
604 \subsection{Building packages}
605 \begin{frame}{Building packages}
607 \item \textttc{apt-get build-dep mypackage}\\
608 Installs the \textsl{build-dependencies} (for a package in the archive)
611 \item \textttc{debuild}: build, test with \texttt{lintian}, sign with GPG
613 \item Also possible to call \textttc{dpkg-buildpackage} directly
615 \item Usually with \texttt{dpkg-buildpackage -us -uc}
618 \item It is better to build packages in a clean \& minimal environment
620 \item \textttc{pbuilder} -- helper to build packages in a \textsl{chroot}\\
621 Good documentation: \url{https://wiki.ubuntu.com/PbuilderHowto}
623 \item \textttc{schroot} and \textttc{sbuild}: used on the Debian build daemons\\
624 (not as easy to use as \texttt{pbuilder})
627 \item Generate \texttt{.deb} files and a \texttt{.changes} file
629 \item \texttt{.changes}: describes what was built ; used to upload the package
633 \subsection{Installing and testing packages}
634 \begin{frame}{Installing and testing packages}
636 \item Install the package locally: \textttc{debi} (will use \texttt{.changes} to know what to install)
638 \item List the content of the package: \texttt{{\color{rouge}debc} ../mypackage<TAB>.changes}
640 \item Compare the package with a previous version:\\
641 \texttt{{\color{rouge}debdiff} ../mypackage\_1\_*.changes ../mypackage\_2\_*.changes}\\
642 or to compare the sources:\\
643 \texttt{{\color{rouge}debdiff} ../mypackage\_1\_*.dsc ../mypackage\_2\_*.dsc}\\
645 \item Check the package with \texttt{lintian} (static analyzer):\\
646 \texttt{{\color{rouge}lintian} ../mypackage<TAB>.changes}\\
647 \texttt{lintian -i}: gives more information about the errors
649 \item Upload the package to Debian (\textttc{dput})
651 \item Manage a private Debian archive with \textttc{reprepro}\\
652 Documentation: \url{http://mirrorer.alioth.debian.org/}
656 \section{Practical session: modifying the grep package}
657 \begin{frame}{Practical session: modifying the grep package}
659 \item Go to \url{http://ftp.debian.org/debian/pool/main/g/grep/} and
660 download version 2.6.3-3 of the package
661 \item Look at the files in \texttt{debian/}.
663 \item How many binary packages are generated by this source package?
664 \item Which packaging helper does this package use?
666 \item Build the package
667 \item We are now going to modify the package. Add a changelog entry and increase the version number.
668 \item Now disable perl-regexp support (it is a \texttt{./configure} option)
669 \item Rebuild the package
670 \item Compare the original and the new package with debdiff
671 \item Install the newly built package
675 \section{Advanced packaging topics}
676 \subsection{Modifying the upstream source}
677 \begin{frame}{Modifying the upstream source}
680 \item Fix bugs or add customizations that are specific to Debian
682 \item Backport fixes from a newer upstream release
685 Several methods to do it:
687 \item Modifying the files directly
690 \item But no way to track and document the changes
693 \item Using patch systems
697 \begin{frame}{Patch systems}
699 \item Principle: changes are stored as patches in \texttt{debian/patches/}
701 \item Applied and unapplied during build
703 \item Several implementations: \textsl{simple-patchsys} (\textsl{cdbs} only), \textsl{dpatch}, \textbf{\textsl{quilt}}
705 \item Each supports two \texttt{debian/rules} targets:
707 \item \texttt{debian/rules patch}: apply all patches
708 \item \texttt{debian/rules unpatch}: de-apply all patches
711 \item More documentation: \url{http://wiki.debian.org/debian/patches}
714 Future: new source package format with built-in patch system: \textbf{3.0 (quilt)}
716 \item Recommended solution
717 \item You need to learn \textsl{quilt}\\
718 \url{http://pkg-perl.alioth.debian.org/howto/quilt.html}
723 \begin{frame}[fragile]{Documentation of patches}
725 \item Standard headers
727 \item Documented in DEP3 - Patch Tagging Guidelines\\
728 \url{http://dep.debian.net/deps/dep3/}
730 \begin{lstlisting}[basicstyle=\ttfamily\footnotesize]
731 Description: Fix widget frobnication speeds
732 Frobnicating widgets too quickly tended to cause explosions.
733 Forwarded: http://lists.example.com/2010/03/1234.html
734 Author: John Doe <johndoe-guest@users.alioth.debian.org>
735 Applied-Upstream: 1.2, http://bzr.foo.com/frobnicator/revision/123
736 Last-Update: 2010-03-29
740 \subsection{Doing things during installation and removal}
741 \begin{frame}{Doing things during installation and removal}
743 \item Decompressing the package is sometimes not enough
745 \item Create/remove system users, start/stop services, manage \textsl{alternatives}
747 \item Done in \textsl{maintainer scripts}\\
748 \texttt{preinst, postinst, prerm, postrm}
752 \item Debian Policy Manual, chapter 6\\
753 {\footnotesize \url{http://www.debian.org/doc/debian-policy/ch-maintainerscripts.html}}
756 \item Debian Developer's Reference, chapter 6.4\\
757 {\scriptsize \url{http://www.debian.org/doc/developers-reference/best-pkging-practices.html}}
759 \item {\footnotesize \url{http://people.debian.org/~srivasta/MaintainerScripts.html}}
762 \item Prompting the user
764 \item Must be done with \textbf{debconf}
766 \item Documentation: \texttt{debconf-devel(7)} (\texttt{debconf-doc} package)
771 \begin{frame}[fragile]{Monitoring upstream versions}
773 \item Specify where to look in \texttt{debian/watch} (see \texttt{uscan(1)})
774 \begin{lstlisting}[basicstyle=\ttfamily\footnotesize]
777 http://tmrc.mit.edu/mirror/twisted/Twisted/(\d\.\d)/ \
778 Twisted-([\d\.]*)\.tar\.bz2
781 \item Debian infrastructure that makes use of \texttt{debian/watch}:\\
782 \textbf{Debian External Health Status}\\
783 \url{http://dehs.alioth.debian.org/}
785 \item Maintainer warned by emails sent to the Packages Tracking System
787 \item \texttt{uscan}: run a manual check
789 \item \texttt{uupdate}: try to update your package to the latest upstream version
793 \subsection{Packaging with a VCS (SVN, Git \& friends)}
794 \begin{frame}[fragile]{Packaging with a VCS (SVN, Git \& friends)}
796 \item Several tools to help manage branches and tags for your packaging work:\\
797 \texttt{svn-buildpackage}, \texttt{git-buildpackage}
799 \item Example: \texttt{git-buildpackage}
801 \item \texttt{upstream} branch to track upstream with \texttt{upstream/\textsl{version}} tags
802 \item \texttt{master} branch tracks the Debian package
803 \item \texttt{debian/\textsl{version}} tags for each upload
804 \item \texttt{pristine-tar} branch to be able to rebuild the upstream tarball
807 \item \texttt{Vcs-*} fields in \texttt{debian/control} to locate the repository
809 \begin{lstlisting}[basicstyle=\ttfamily\footnotesize]
810 Vcs-Browser: http://git.debian.org/?p=devscripts/devscripts.git
811 Vcs-Git: git://git.debian.org/devscripts/devscripts.git
813 Vcs-Browser: http://svn.debian.org/viewsvn/pkg-perl/trunk/libwww-perl/
814 Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/libwww-perl
817 \item VCS-agnostic interface: \texttt{debcheckout}, \texttt{debcommit}, \texttt{debrelease}\\
818 \texttt{debcheckout devscripts} $\rightarrow$ check out the source package from Git
822 \section{Maintaining packages in Debian}
823 \subsection{Several ways to contribute to Debian}
824 \begin{frame}{Several ways to contribute to Debian}
826 \item Bring new software to Debian
828 \item Is that new software interesting/useful enough?
829 \item Are there alternatives already packaged in Debian?
832 \item Adopt existing unmaintained packages (\textsl{orphaned packages})
834 \item Many unmaintained packages in Debian
835 \item Including some that you rely on, probably
838 \item Get involved in packaging teams
840 \item Many teams that focus on set of packages, and need help
841 \item Full list on \url{http://wiki.debian.org/Teams}
842 \item An excellent way to work with more experienced contributors
847 \subsection{More interested in Ubuntu?}
849 \frametitle{More interested in Ubuntu?}
851 \item Ubuntu mainly manages the divergence with Debian
853 \item Do not really focus on specific packages\\
854 Instead, collaborate with Debian teams
856 \item Usually recommend uploading new packages to Debian first\\
857 \url{https://wiki.ubuntu.com/UbuntuDevelopment/NewPackages/}
859 \item Possibly a better plan:
861 \item Get involved in a Debian team and act as a bridge with Ubuntu
863 \item Help reduce divergence, triage bugs in Launchpad
865 \item Many Debian tools can help:
867 \item Ubuntu column on the Developer' packages overview
868 \item Ubuntu box on the Packages Tracking System
869 \item Receive launchpad bugmail via the PTS
875 \subsection{Adopting orphaned packages}
876 \begin{frame}{Adopting orphaned packages}
878 \item Full list: \url{http://www.debian.org/devel/wnpp/}
880 \item Installed on your machine: \texttt{wnpp-alert}
882 \item Different states:
884 \item \textbf{O}rphaned: the package is unmaintained\\
885 Feel free to adopt it
886 \item \textbf{RFA}: \textbf{R}equest \textbf{F}or \textbf{A}dopter\\
887 Maintainer looking for adopter, but continues work in the meantime\\
888 Feel free to adopt it. A mail to the current maintainer is polite
889 \item \textbf{ITA}: \textbf{I}ntent \textbf{T}o \textbf{A}dopt\\
890 Someone intends to adopt the package\\
891 You could propose your help!
892 \item \textbf{RFH} (\textbf{R}equest \textbf{F}or \textbf{H}elp\\
893 The maintainer is looking for help
896 \item Some unmaintained packages not detected \arr not orphaned yet
898 \item When in doubt, ask \texttt{debian-qa@lists.debian.org}
903 \subsection{Where to find help?}
905 \frametitle{Where to find help?}
908 \item Various advices and answers to your questions, code reviews
909 \item Sponsorship of your uploads, when your package is ready
912 You can get help from:
914 \item Other members of a packaging team: the best solution
916 \item They know the specifics of your package
917 \item You can become a member of the team
918 \item See \url{http://wiki.debian.org/Teams}
921 \item The Debian Mentors group (if your package doesn't fit in a team)
923 \item \url{http://wiki.debian.org/DebianMentorsFaq}
924 \item Mailing list: \url{debian-mentors@lists.debian.org}
925 \item IRC: \texttt{\#debian-mentors} on \texttt{irc.debian.org}
926 \item \url{http://mentors.debian.net/}
931 \subsection{Official documentation}
932 \begin{frame}{Official documentation}
934 \item Debian Developers' Corner\\
935 \url{http://www.debian.org/devel/}\\
936 {\small Links to many resources about Debian development}
938 \item Debian New Maintainers' Guide\\
939 \url{http://www.debian.org/doc/maint-guide/}\\
940 {\small An introduction to Debian packaging, but could use an update}
942 \item Debian Developer's Reference\\
943 \url{http://www.debian.org/doc/developers-reference/}\\
944 {\small Mostly about Debian procedures, but also some best packaging practices (part 6)}
946 \item Debian Policy\\
947 \url{http://www.debian.org/doc/debian-policy/}\\
948 {\small All the requirements that every package must satisfy}
951 \item Ubuntu Packaging Guide\\
952 \url{https://wiki.ubuntu.com/PackagingGuide}
957 \begin{frame}{Conclusion}
959 \item You now have a full overview of Debian packaging
961 \item But you will need to read more documentation
963 \item Best practices have evolved over the years
965 \item If not sure, use the \textbf{dh} packaging helper, and the \textbf{3.0 (quilt)} format
969 \centerline{\large Feedback: \textbf{lucas@debian.org}}
977 \item Fix background with N900 PDF viewer
978 \item more practical sessions
979 \item debc and lintian should really pick-up the .changes file automatically
983 \begin{frame}{Debian branches (\textsl{suites})}
985 \item \textbf{stable} (currently codenamed \textbf{squeeze}): stable and supported. Only important bug fixes.
987 \item \textbf{testing} (currently codenamed \textbf{wheezy}): the future stable release.
989 \item \textbf{unstable} (always codenamed \textbf{sid}): where most of the work occurs, and where packages are uploaded. Packages migrate automatically from \textsl{unstable} to \textsl{testing} according to some rules.
991 \item \textbf{experimental}: for experimental packages that are not suited for a stable release.
994 Developers mostly run \textsl{unstable} or \textsl{testing} (with \textsl{APT pinning})
997 Packages can be \textbf{backported} from \textsl{testing/unstable} to \textsl{stable}. See \url{http://backports.debian.org/}
1000 \begin{frame}{Debian portals for maintainers}
1002 \item Source package centric: Packages Tracking System\\
1003 \url{http://packages.qa.debian.org/dpkg}
1005 \item Maintainer/team centric: Developer's Packages Overview\\
1006 \url{http://qa.debian.org/developer.php?login=pkg-ruby-extras-maintainers@lists.alioth.debian.org}