Give example of package adoption
[packaging-tutorial.git] / packaging-tutorial.tex
index 44fc5e0..7b4efea 100644 (file)
@@ -1,15 +1,26 @@
 \documentclass[10pt,final]{beamer}
 \mode<presentation>
 \usetheme{debian}
+
+%Translators:
+%change debiantutorial to debiantutorial.$lang to use translated file, and
+%append to this string all commands to load localisation packages, e.g.:
+%\\usepackage{debiantutorial.fr} \\usepackage[french]{babel} \\frenchsetup{...}
 \usepackage{debiantutorial}
 
-\hypersetup{pdftitle={Debian Packaging Tutorial},bookmarks}
+\hypersetup{bookmarks}
 \title{Debian Packaging Tutorial}
 \author[]{Lucas Nussbaum\\{\small\texttt{lucas@debian.org}}}
-\date{\footnotesize version 0.1 - 2011-05-25}
+
+%Translators:
+%leave \\version unchanged: this will a variable containing the actual version
+%To translate the date, use \\today or a string containing \\year, \\month, \\day
+%(numeric values).
+\date{\footnotesize version 0.5 -- 2012-01-14} % DATE - use debian/rules update-version-date
 
 \begin{document}
 
+
 \frame{\titlepage}
 
 \begin{frame}{About this tutorial}
@@ -178,8 +189,9 @@ rw-r--r-- 0/0 751613 Sep  5 15:43 2010 data.tar.gz
 \subsection{Rebuilding dash}
 \begin{frame}{Example: rebuilding dash}
 \begin{enumerate}
-\item Install build-essential, devscripts and debhelper (needed to build dash)\\
-  {\texttt{apt-get install build-essential devscripts debhelper}}
+\item Install packages needed to build dash, and devscripts\\
+  {\texttt{sudo apt-get build-dep dash}\\ (requires \texttt{deb-src} lines in \texttt{/etc/apt/sources.list})}\\
+  {\texttt{sudo apt-get install -{}-no-install-recommends devscripts}}
   \hbr
 \item Create a working directory, and get in it:\\
  \texttt{mkdir /tmp/debian-tutorial ; cd /tmp/debian-tutorial}
@@ -189,7 +201,7 @@ rw-r--r-- 0/0 751613 Sep  5 15:43 2010 data.tar.gz
   {\small (This needs you to have \texttt{deb-src} lines in your \texttt{/etc/apt/sources.list})}
   \hbr
 \item Build the package\\
-  {\texttt{cd dash-*\\ debuild -us -uc}}
+  {\texttt{cd dash-*\\ debuild -us -uc}} ~~~(\texttt{-us -uc} disables signing the package with GPG)
 
   \hbr
 \item Check that it worked
@@ -238,7 +250,7 @@ rw-r--r-- 0/0 751613 Sep  5 15:43 2010 data.tar.gz
       \end{itemize}
     \end{itemize}
   \end{itemize}
-  \br
+  \hbr
   (See \texttt{dpkg-source(1)} for exact details)
 \end{frame}
 
@@ -356,7 +368,10 @@ Files:
 
 
          %%
-  \item Edited manually or with \texttt{dch}
+  \item Edited manually or with \textttc{dch}
+  \begin{itemize}
+         \item Create a changelog entry for a new release: \textttc{dch -i}
+  \end{itemize}
   \item Special format to automatically close Debian or Ubuntu bugs\\
     Debian: \texttt{Closes:~\#595268}; Ubuntu: \texttt{LP:~\#616929}
   \item Installed as \texttt{/usr/share/doc/\textit{package}/changelog.Debian.gz}
@@ -487,7 +502,7 @@ Description: retrieves files from the web
     \item Called from \texttt{debian/rules}
     \item Configurable using command parameters or files in \texttt{debian/}
     \end{itemize}
-    {\footnotesize \ttfamily dirs, \textsl{package}.docs, \textsl{package}.examples,
+    {\footnotesize \ttfamily \textsl{package}.docs, \textsl{package}.examples,
       \textsl{package}.install, \textsl{package}.manpages, \ldots} \hbr
   \item Third-party helpers for sets of packages: \textbf{python-support},
     \textbf{dh\_ocaml}, \ldots \hbr
@@ -496,7 +511,7 @@ Description: retrieves files from the web
 \end{frame}
 
 \begin{frame}[fragile]{debian/rules using debhelper (1/2)}
-  \begin{lstlisting}[basicstyle=\ttfamily\footnotesize]
+  \begin{lstlisting}[basicstyle=\ttfamily\footnotesize,escapeinside=\{\}]
 #!/usr/bin/make -f
 
 # Uncomment this to turn on verbose mode.
@@ -524,7 +539,7 @@ install: build
 \end{frame}
 
 \begin{frame}[fragile]{debian/rules using debhelper (2/2)}
-  \begin{lstlisting}[basicstyle=\ttfamily\footnotesize]
+  \begin{lstlisting}[basicstyle=\ttfamily\footnotesize,escapeinside=\{\}]
 
 # Build architecture-independent files here.
 binary-indep: build install
@@ -560,14 +575,14 @@ binary: binary-indep binary-arch
     \hbr
   \item Second-level helpers that factor common functionality
     \begin{itemize}
-    \item Building with \texttt{./configure \&\& make \&\& make install} or CMake
-    \item Support for Perl, Python, Ruby, GNOME, KDE, Java, Haskell, \ldots
+    \item E.g building with \texttt{./configure \&\& make \&\& make install} or CMake
     \end{itemize}
     \hbr
   \item CDBS:
     \begin{itemize}
     \item Introduced in 2005, based on advanced \textsl{GNU make} magic
     \item Documentation: \texttt{/usr/share/doc/cdbs/}
+    \item Support for Perl, Python, Ruby, GNOME, KDE, Java, Haskell, \ldots
     \item But some people hate it:
       \begin{itemize}
       \item Sometimes difficult to customize package builds:\\
@@ -577,7 +592,7 @@ binary: binary-indep binary-arch
     \end{itemize}
   \end{itemize}
   \seprule
-      \begin{lstlisting}[basicstyle=\ttfamily\footnotesize]
+      \begin{lstlisting}[basicstyle=\ttfamily\footnotesize,escapeinside=\{\}]
 #!/usr/bin/make -f
 include /usr/share/cdbs/1/rules/debhelper.mk
 include /usr/share/cdbs/1/class/autotools.mk
@@ -613,14 +628,14 @@ override_dh_auto_configure:
 override_dh_auto_build:
      make world
 
-    \end{lstlisting}%$
+    \end{lstlisting}
 \end{frame}
 
 \begin{frame}{Classic debhelper vs CDBS vs dh}
   \hbr
   \begin{itemize}
   \item Mind shares:\\
-    Classic debhelper: 41\% \hskip 1em CDBS: 23\% \hskip 1em  dh: 34\%
+    Classic debhelper: 36\% \hskip 1em CDBS: 21\% \hskip 1em  dh: 41\%
     \hbr
   \item Which one should I learn?
     \begin{itemize}
@@ -656,7 +671,8 @@ override_dh_auto_build:
 \begin{frame}{Building packages}
   \begin{itemize}
   \item \textttc{apt-get build-dep mypackage}\\
-    Installs the \textsl{build-dependencies} (for a package in the archive)
+    Installs the \textsl{build-dependencies} (for a package already in Debian)\\
+    Or \textttc{mk-build-deps -ir} (inside the package source tree)
     
     \br
   \item \textttc{debuild}: build, test with \texttt{lintian}, sign with GPG
@@ -677,7 +693,7 @@ override_dh_auto_build:
        see: \url{https://help.ubuntu.com/community/SbuildLVMHowto} )
     \end{itemize}
     \br
-  \item Generate \texttt{.deb} files and a \texttt{.changes} file
+  \item Generates \texttt{.deb} files and a \texttt{.changes} file
     \begin{itemize}
     \item \texttt{.changes}: describes what was built; used to upload the package
     \end{itemize}
@@ -707,7 +723,13 @@ override_dh_auto_build:
 \begin{frame}{Practical session 1: modifying the grep package}
   \begin{enumerate}
   \item Go to \url{http://ftp.debian.org/debian/pool/main/g/grep/} and
-    download version 2.6.3-3 of the package
+    download version 2.6.3-3 of the package (if you use Ubuntu 11.10 or
+    later, or Debian testing or unstable, use version 2.9-1 or 2.9-2 instead)
+    \begin{itemize}
+                  \item If the source package is not unpacked automatically, unpack it with
+                          \texttt{dpkg-source~-x~grep\_*.dsc}
+    \end{itemize}
+
   \item Look at the files in \texttt{debian/}.
     \begin{itemize}
     \item              How many binary packages are generated by this source package?
@@ -815,7 +837,8 @@ License:
          \hbr
   \item You need to learn \textsl{quilt}\\
     \url{http://pkg-perl.alioth.debian.org/howto/quilt.html}
-    
+    \hbr
+  \item Patch-system-agnostic tool in \texttt{devscripts}: \texttt{edit-patch}
   \end{itemize}
   \end{itemize}
 \end{frame}
@@ -823,13 +846,11 @@ License:
 \begin{frame}[fragile]{Documentation of patches}
   \begin{itemize}
          \item Standard headers at the beginning of the patch
-    \hbr
+    \br
   \item Documented in DEP-3 - Patch Tagging Guidelines\\
     \url{http://dep.debian.net/deps/dep3/}
   \end{itemize}
-\begin{itemize}
-\item All patches are published on \url{http://patch-tracker.debian.org/}
-\end{itemize}
+  \vfill
 \seprule
   \begin{lstlisting}[basicstyle=\ttfamily\footnotesize]
 Description: Fix widget frobnication speeds
@@ -902,8 +923,8 @@ http://tmrc.mit.edu/mirror/twisted/Twisted/(\d\.\d)/ \
   \end{itemize}
 \end{frame}
 
-\subsection{Packaging with a VCS (SVN, Git \& friends)}
-\begin{frame}[fragile]{Packaging with a VCS (SVN, Git, etc.)}
+\subsection{Packaging with a Version Control System (SVN, Git)}
+\begin{frame}[fragile]{Packaging with a Version Control System}
   \begin{itemize}
   \item Several tools to help manage branches and tags for your packaging work:\\
     \texttt{svn-buildpackage}, \texttt{git-buildpackage}
@@ -940,6 +961,31 @@ Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/libwww-perl
 \end{itemize}
 \end{frame}
 
+\subsection{Backporting packages}
+\begin{frame}{Backporting packages}
+  \begin{itemize}
+  \item Goal: use a newer version of a package on an older system\\
+         e.g use \textsl{mutt} from Debian \textsl{unstable} on Debian \textsl{stable}
+       \br
+  \item General idea:
+         \begin{itemize}
+               \item Take the source package from Debian unstable
+               \hbr
+               \item Modify it so that it builds and works fine on Debian stable
+               \begin{itemize}
+                       \item Sometimes trivial (no changes needed)
+                       \item Sometimes difficult
+                       \item Sometimes impossible (many unavailable dependencies)
+               \end{itemize}
+       \end{itemize}
+       \br
+   \item Some backports are provided and supported by the Debian project\\
+          \url{http://backports.debian.org/}
+\end{itemize}
+\end{frame}
+
+
+
 \section{Maintaining packages in Debian}
 \subsection{Several ways to contribute to Debian}
 \begin{frame}{Several ways to contribute to Debian}
@@ -951,71 +997,51 @@ Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/libwww-perl
     \item Disappear
     \end{enumerate}
     \br
-  \item Adopt existing unmaintained packages (\textsl{orphaned packages})
-    \begin{itemize}
-    \item Many unmaintained packages in Debian
-    \item Including some that you use daily!
-    \end{itemize}
-    \br
-  \item Get involved in packaging teams
+  \item \textbf{Better} ways to contribute:
+         \begin{itemize}
+                 \item Get involved in packaging teams
     \begin{itemize}
     \item Many teams that focus on set of packages, and need help
     \item List available at \url{http://wiki.debian.org/Teams}
     \item An excellent way to learn from more experienced contributors
     \end{itemize}
     \br
+\item Adopt existing unmaintained packages (\textsl{orphaned packages})
+    \br
   \item Bring new software to Debian
     \begin{itemize}
     \item Only if it's interesting/useful enough, please
     \item Are there alternatives already packaged in Debian?
     \end{itemize}
   \end{itemize}
-\end{frame}
 
-\subsection{More interested in Ubuntu?}
-\begin{frame}{More interested in Ubuntu?}
-  \begin{itemize}
-  \item Ubuntu mainly manages the divergence with Debian
-    \br
-  \item No real focus on specific packages\\
-    Instead, collaboration with Debian teams
-    \br
-  \item Usually recommend uploading new packages to Debian first\\
-    \url{https://wiki.ubuntu.com/UbuntuDevelopment/NewPackages}
-    \br
-  \item Possibly a better plan:
-    \begin{itemize}
-    \item Get involved in a Debian team and act as a bridge with Ubuntu
-      \hbr
-    \item Help reduce divergence, triage bugs in Launchpad
-      \hbr
-    \item Many Debian tools can help:
-      \begin{itemize}
-      \item Ubuntu column on the Developer's packages overview
-      \item Ubuntu box on the Package Tracking System
-      \item Receive launchpad bugmail via the PTS
-      \end{itemize}
-    \end{itemize}
   \end{itemize}
 \end{frame}
 
 \subsection{Adopting orphaned packages}
 \begin{frame}{Adopting orphaned packages}
+      \hbr
   \begin{itemize}
-  \item Full list: \url{http://www.debian.org/devel/wnpp/}
+    \item Many unmaintained packages in Debian
+    \hbr
+  \item Full list + process: \url{http://www.debian.org/devel/wnpp/}
     \hbr
   \item Installed on your machine: \texttt{wnpp-alert}
     \hbr
   \item Different states:
     \begin{itemize}
+                   \small
     \item \textbf{O}rphaned: the package is unmaintained\\
       Feel free to adopt it
+      \hbr
     \item \textbf{RFA}: \textbf{R}equest \textbf{F}or \textbf{A}dopter\\
       Maintainer looking for adopter, but continues work in the meantime\\
       Feel free to adopt it. A mail to the current maintainer is polite
+      \hbr
     \item \textbf{ITA}: \textbf{I}ntent \textbf{T}o \textbf{A}dopt\\
       Someone intends to adopt the package\\
       You could propose your help!
+      \hbr
     \item \textbf{RFH}: \textbf{R}equest \textbf{F}or \textbf{H}elp\\
       The maintainer is looking for help
     \end{itemize}
@@ -1027,6 +1053,32 @@ Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/libwww-perl
   \end{itemize}
 \end{frame}
 
+\begin{frame}[fragile]{Adopting a package: example}
+\begin{lstlisting}[basicstyle=\ttfamily\footnotesize]
+From: You <you@yourdomain>
+To: 640454@bugs.debian.org, control@bugs.debian.org
+Cc: Francois Marier <francois@debian.org>
+Subject: ITA: verbiste -- French conjugator
+
+retitle 640454 \textbf{ITA}: verbiste -- French conjugator
+owner 640454 !
+thanks
+
+Hi,
+
+I am using verbiste and I am willing to take care of the package.
+
+Cheers,
+
+You
+\end{lstlisting}
+
+\begin{itemize}
+\item Polite to contact the previous maintainer (especially if the package was RFAed, not orphaned)
+\item Very good idea to contact the upstream project
+\end{itemize}
+\end{frame}
+
 \subsection{Getting your package in Debian}
 \begin{frame}{Getting your package in Debian}
 \begin{itemize}
@@ -1059,11 +1111,10 @@ Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/libwww-perl
   \br
   You can get help from:
   \begin{itemize}
-  \item Other members of a packaging team: the best solution
+         \item \textbf{Other members of a packaging team}
     \begin{itemize}
     \item They know the specifics of your package
     \item You can become a member of the team
-    \item See \url{http://wiki.debian.org/Teams}
     \end{itemize}
     \hbr
   \item The Debian Mentors group (if your package doesn't fit in a team)
@@ -1083,15 +1134,15 @@ Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/libwww-perl
   \item Debian Developers' Corner\\
     \url{http://www.debian.org/devel/}\\
     {\small Links to many resources about Debian development}
-    \br
+    \hbr
   \item Debian New Maintainers' Guide\\
     \url{http://www.debian.org/doc/maint-guide/}\\
     {\small An introduction to Debian packaging, but could use an update}
-    \br
+    \hbr
   \item Debian Developer's Reference\\
     \url{http://www.debian.org/doc/developers-reference/}\\
     {\small Mostly about Debian procedures, but also some best packaging practices (part 6)}
-    \br
+    \hbr
   \item Debian Policy\\
     \url{http://www.debian.org/doc/debian-policy/}\\
     
@@ -1099,7 +1150,7 @@ Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/libwww-perl
       \item \small All the requirements that every package must satisfy
       \item \small Specific policies for Perl, Java, Python, \ldots
       \end{itemize}}
-    \br
+    \hbr
     
   \item Ubuntu Packaging Guide\\
     \url{https://wiki.ubuntu.com/PackagingGuide}
@@ -1116,6 +1167,33 @@ Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/libwww-perl
   \end{itemize}
 \end{frame}
 
+\subsection{More interested in Ubuntu?}
+\begin{frame}{More interested in Ubuntu?}
+  \begin{itemize}
+  \item Ubuntu mainly manages the divergence with Debian
+    \br
+  \item No real focus on specific packages\\
+    Instead, collaboration with Debian teams
+    \br
+  \item Usually recommend uploading new packages to Debian first\\
+    \url{https://wiki.ubuntu.com/UbuntuDevelopment/NewPackages}
+    \br
+  \item Possibly a better plan:
+    \begin{itemize}
+    \item Get involved in a Debian team and act as a bridge with Ubuntu
+      \hbr
+    \item Help reduce divergence, triage bugs in Launchpad
+      \hbr
+    \item Many Debian tools can help:
+      \begin{itemize}
+      \item Ubuntu column on the Developer's packages overview
+      \item Ubuntu box on the Package Tracking System
+      \item Receive launchpad bugmail via the PTS
+      \end{itemize}
+    \end{itemize}
+  \end{itemize}
+\end{frame}
+
 \section{Conclusion}
 \subsection{Conclusion}
 \begin{frame}{Conclusion}
@@ -1177,10 +1255,14 @@ Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/libwww-perl
   \end{itemize}
   
   \begin{itemize}
-  \item Contribute:\\
-    \texttt{git clone git://git.debian.org/collab-maint/packaging-tutorial.git}\\
+  \item Contribute:
+         \begin{itemize}
+                 \item  {\small \texttt{git clone\\ git://git.debian.org/collab-maint/packaging-tutorial.git}}
+    \hbr
+    \item {\small \texttt{apt-get source packaging-tutorial}}
     \hbr
-    Or over HTTP: \url{http://git.debian.org/?p=collab-maint/packaging-tutorial.git}
+    \item {\small \url{http://git.debian.org/?p=collab-maint/packaging-tutorial.git}}
+    \end{itemize}
     \br
   \item Feedback: \href{mailto:lucas@debian.org}{\textbf{\texttt{lucas@debian.org}}}
   \end{itemize}
@@ -1229,8 +1311,427 @@ Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/libwww-perl
 \end{enumerate}
 \end{frame}
 
-\backupbegin
+\section{Practical session 4: packaging a Ruby gem}
+\begin{frame}{Practical session 4: packaging a Ruby gem}
+\begin{enumerate}
+       \item Take a quick look at some documentation about Ruby packaging:\\
+               \begin{itemize}
+               \item \url{http://wiki.debian.org/Ruby}
+      \hbr
+               \item \url{http://wiki.debian.org/Teams/Ruby}
+      \hbr
+               \item \url{http://wiki.debian.org/Teams/Ruby/Packaging}
+      \hbr
+               \item \texttt{gem2deb(1)}, \texttt{dh\_ruby(1)} (in the \texttt{gem2deb} package)
+               \end{itemize}
+               \hbr
+       \item Create a basic Debian source package from the \texttt{net-ssh} gem:\\
+               \texttt{gem2deb net-ssh}
+       \hbr
+       \item Improve it so that it becomes a proper Debian package
+\end{enumerate}
+\end{frame}
+
+\section{Answers to practical sessions}
+
+\begin{frame}
+       \begin{center}
+               \LARGE Answers to\\[0.5em]  practical sessions
+       \end{center}
+\end{frame}
+
+
+\subsection{Practical session 1: modifying the grep package}
+
+\begin{frame}{Practical session 1: modifying the grep package}
+\begin{enumerate}
+  \item Go to \url{http://ftp.debian.org/debian/pool/main/g/grep/} and
+    download version 2.6.3-3 of the package (if you use Ubuntu 11.10 or
+    later, or Debian testing or unstable, use version 2.9-1 or 2.9-2 instead)
+
+       \item Look at the files in \texttt{debian/}.
+               \begin{itemize}
+                       \item           How many binary packages are generated by this source package?
+                       \item           Which packaging helper does this package use?
+               \end{itemize}
+    \hbr
+       \item Build the package
+    \hbr
+       \item We are now going to modify the package. Add a changelog entry and increase the version number.
+    \hbr
+       \item Now disable perl-regexp support (it is a \texttt{./configure} option)
+    \hbr
+       \item Rebuild the package
+    \hbr
+       \item Compare the original and the new package with debdiff
+    \hbr
+       \item Install the newly built package
+    \hbr
+       \item Cry if you messed up ;)
+\end{enumerate}
+\end{frame}
+
+\begin{frame}{Fetching the source}
+\begin{enumerate}
+       \item Go to \url{http://ftp.debian.org/debian/pool/main/g/grep/} and
+               download version 2.6.3-3 of the package
+\end{enumerate}
+\begin{itemize}
+       \item Use dget to download the \texttt{.dsc} file:\\
+               {\small \texttt{dget http://cdn.debian.net/debian/pool/main/g/grep/grep\_2.6.3-3.dsc}}
+               \hbr
+       \item According to \texttt{http://packages.qa.debian.org/grep}, \texttt{grep} version 2.6.3-3 is currently in \textsl{stable} (\textsl{squeeze}). If you have \texttt{deb-src} lines for \textsl{squeeze} in your \texttt{/etc/apt/sources.list}, you can use:\\
+               \texttt{apt-get source grep=2.6.3-3}\\
+               or \texttt{apt-get source grep/stable}\\
+               or, if you feel lucky: \texttt{apt-get source grep}
+       \hbr
+       \item The \texttt{grep} source package is composed of three files:
+               \begin{itemize}
+                       \item \texttt{grep\_2.6.3-3.dsc}
+                       \item \texttt{grep\_2.6.3-3.debian.tar.bz2}
+                       \item \texttt{grep\_2.6.3.orig.tar.bz2}
+               \end{itemize}
+               This is typical of the "3.0 (quilt)" format.
+       \hbr
+\item If needed, uncompress the source with\\
+       \texttt{dpkg-source -x grep\_2.6.3-3.dsc}
+\end{itemize}
+\end{frame}
+
+\begin{frame}{Looking around and building the package}
+       \begin{enumerate}
+                       \setcounter{enumi}{1}
+       \item Look at the files in \texttt{debian/}.
+               \begin{itemize}
+                       \item           How many binary packages are generated by this source package?
+                       \item           Which packaging helper does this package use?
+               \end{itemize}
+       \end{enumerate}
+       \hbr
+       \begin{itemize}
+               \item According to \texttt{debian/control}, this package only generates one binary package, named \texttt{grep}.
+                       \hbr
+               \item According to \texttt{debian/rules}, this package is typical of \textsl{classic} debhelper packaging, without using \textsl{CDBS} or \textsl{dh}. One can see the various calls to \texttt{dh\_*} commands in \texttt{debian/rules}.
+       \end{itemize}
+       \hbr
+       \begin{enumerate}
+                       \setcounter{enumi}{2}
+
+               \item Build the package
+       \end{enumerate}
+       \hbr
+       \begin{itemize}
+               \item Use \texttt{apt-get build-dep grep} to fetch the build-dependencies
+               \item Then \texttt{debuild} or \texttt{dpkg-buildpackage -us -uc} (Takes about 1 min)
+       \end{itemize}
+\end{frame}
+
+\begin{frame}{Editing the changelog}
+       \begin{enumerate}
+                       \setcounter{enumi}{3}
+
+       \item We are now going to modify the package. Add a changelog entry and increase the version number.
+       \end{enumerate}
+       \hbr
+       \begin{itemize}
+               \item \texttt{debian/changelog} is a text file. You could edit it and add a new entry manually.
+       \hbr
+               \item Or you can use \texttt{dch -i}, which will add an entry and open the editor
+       \hbr
+               \item The name and email can be defined using the \texttt{DEBFULLNAME} and \texttt{DEBEMAIL} environment variables
+       \hbr
+               \item After that, rebuild the package: a new version of the package is built
+       \hbr
+               \item Package versioning is detailed in section 5.6.12 of the Debian policy\\
+                       \url{http://www.debian.org/doc/debian-policy/ch-controlfields.html}
+       \end{itemize}
+\end{frame}
+
+\begin{frame}{Disabling Perl regexp support and rebuilding}
+       \begin{enumerate}
+                       \setcounter{enumi}{4}
+
+       \item Now disable perl-regexp support (it is a \texttt{./configure} option)
+       \item Rebuild the package
+       \end{enumerate}
+       \hbr
+       \begin{itemize}
+         \item Check with \texttt{./configure -{}-help}: the option to disable
+           Perl regexp is \texttt{-{}-disable-perl-regexp}
+       \hbr
+               \item Edit \texttt{debian/rules} and find the \texttt{./configure} line
+       \hbr
+               \item Add \texttt{-{}-disable-perl-regexp}
+       \hbr
+               \item Rebuild with \texttt{debuild} or \texttt{dpkg-buildpackage -us -uc}
+       \end{itemize}
+\end{frame}
+
+\begin{frame}{Comparing and testing the packages}
+       \begin{enumerate}
+                       \setcounter{enumi}{6}
+
+       \item Compare the original and the new package with debdiff
+       \item Install the newly built package
+       \end{enumerate}
+       \hbr
+       \begin{itemize}
+               \item Compare the binary packages: \texttt{debdiff ../*changes}
+       \hbr
+               \item Compare the source packages: \texttt{debdiff ../*dsc}
+       \hbr
+               \item Install the newly built package: \texttt{debi}\\
+                       Or \texttt{dpkg -i ../grep\_<TAB>}
+       \hbr
+               \item \texttt{grep -P foo} no longer works!
+       \end{itemize}
+\br
+\begin{enumerate}
+               \setcounter{enumi}{8}
+       \item Cry if you messed up ;)
+\end{enumerate}
+\hbr
+Or not: reinstall the previous version of the package:
+\begin{itemize}
+       \item \texttt{apt-get install -{}-reinstall grep=2.6.3-3} \textit{(= previous version)}
+\end{itemize}
+\end{frame}
+
+\subsection{Practical session 2: packaging GNUjump}
+\begin{frame}{Practical session 2: packaging GNUjump}
+\begin{enumerate}
+       \item Download GNUjump 1.0.6 from
+               \url{http://ftp.gnu.org/gnu/gnujump/1.0.6/gnujump-1.0.6.tar.gz}
+               \br
+       \item Create a Debian package for it
+               \begin{itemize}
+                       \item Install build-dependencies so that you can build the package
+                       \item Get a basic working package
+                       \item Finish filling \texttt{debian/control} and other files
+               \end{itemize}
+               \br
+       \item Enjoy
+\end{enumerate}
+\centerline{\includegraphics[width=5cm]{figs/gnujump.png}}
+\end{frame}
+
+\begin{frame}[fragile]{Step by step\ldots}
+\begin{itemize}
+       \item \texttt{wget http://ftp.gnu.org/gnu/gnujump/1.0.6/gnujump-1.0.6.tar.gz}
+               \hbr
+       \item \texttt{mv gnujump-1.0.6.tar.gz gnujump\_1.0.6.orig.tar.gz}
+               \hbr
+       \item \texttt{tar xf gnujump\_1.0.6.orig.tar.gz}
+               \hbr
+       \item \texttt{cd gnujump-1.0.6/}
+               \hbr
+       \item \texttt{dh\_make}
+       \begin{itemize}
+               \item \small Type of package: single binary (for now)
+       \end{itemize}
+\end{itemize}
+\begin{lstlisting}[basicstyle=\ttfamily\small]
+gnujump-1.0.6$ ls debian/
+changelog           gnujump.default.ex   preinst.ex
+compat              gnujump.doc-base.EX  prerm.ex
+control             init.d.ex            README.Debian
+copyright           manpage.1.ex         README.source
+docs                manpage.sgml.ex      rules
+emacsen-install.ex  manpage.xml.ex       source
+emacsen-remove.ex   menu.ex              watch.ex
+emacsen-startup.ex  postinst.ex
+gnujump.cron.d.ex   postrm.ex
+\end{lstlisting}
+\end{frame}
+
+\begin{frame}[fragile]{Step by step\ldots (2)}
+\begin{itemize}
+       \item Look at \texttt{debian/changelog}, \texttt{debian/rules}, \texttt{debian/control}\\
+               (auto-filled by \textbf{dh\_make})
+               \hbr
+       \item In \texttt{debian/control}:\\
+               \texttt{Build-Depends: debhelper (>= 7.0.50~), autotools-dev}\\
+               Lists the \textsl{build-dependencies} = packages needed to build the package
+               \hbr
+       \item Try to build the package as-is (thanks to \textbf{dh} magic)
+               \begin{itemize}
+                       \item And add build-dependencies, until it builds
+                       \item Hint: use \texttt{apt-cache search} and \texttt{apt-file} to find the packages
+                       \item Example:
+\begin{lstlisting}[basicstyle=\ttfamily\footnotesize]
+checking for sdl-config... no
+checking for SDL - version >= 1.2.0... no
+[...]
+configure: error: *** SDL version 1.2.0 not found!
+\end{lstlisting}
+$\rightarrow$ Add \textbf{libsdl1.2-dev} to Build-Depends and install it.
+               \hbr
+       \item Better: use \textbf{pbuilder} to build in a clean environment
+               \end{itemize}
+\end{itemize}
+\end{frame}
+
+\begin{frame}{Step by step\ldots (3)}
+\begin{itemize}
+       \item After installing \texttt{libsdl1.2-dev, libsdl-image1.2-dev, libsdl-mixer1.2-dev}, the package builds fine.
+               \hbr
+       \item Use \texttt{debc} to list the content of the generated package.
+               \hbr
+       \item Use \texttt{debi} to install it and test it.
+               \hbr
+       \item Fill in \texttt{debian/control} using \url{http://www.debian.org/doc/debian-policy/ch-controlfields.html}
+               \hbr
+       \item Test the package with \texttt{lintian}
+               \hbr
+       \item Remove the files that you don't need in \texttt{debian/}
+               \hbr
+       \item Compare your package with the one already packaged in Debian:
+               \begin{itemize}
+                       \item It splits the data files to a second package, that is the same across all architectures ($\rightarrow$ saves space in the Debian archive)
+                       \item It installs a .desktop file (for the GNOME/KDE menus) and also integrates into the Debian menu
+                       \item It fixes a few minor problems using patches
+               \end{itemize}
+\end{itemize}
+\end{frame}
+
+\subsection{Practical session 3: packaging a Java library}
+\begin{frame}{Practical session 3: packaging a Java library}
+\begin{enumerate}
+       \item Take a quick look at some documentation about Java packaging:\\
+               \begin{itemize}
+               \item \url{http://wiki.debian.org/Java}
+      \hbr
+               \item \url{http://wiki.debian.org/Java/Packaging}
+      \hbr
+               \item \url{http://www.debian.org/doc/packaging-manuals/java-policy/}
+      \hbr
+               \item \url{http://pkg-java.alioth.debian.org/docs/tutorial.html}
+      \hbr
+               \item Paper and slides from a Debconf10 talk about javahelper:\\
+                       {\footnotesize
+                       \url{http://pkg-java.alioth.debian.org/docs/debconf10-javahelper-paper.pdf}\\
+                       \url{http://pkg-java.alioth.debian.org/docs/debconf10-javahelper-slides.pdf}}
+               \end{itemize}
+               \br
+       \item Download IRClib from \url{http://moepii.sourceforge.net/}
+               \br
+       \item Package it
+\end{enumerate}
+\end{frame}
+
+\begin{frame}{Step by step\ldots}
+\begin{itemize}
+       \item \texttt{apt-get install javahelper}
+               \hbr
+       \item Create a basic source package: \texttt{jh\_makepkg}
+               \begin{itemize}
+                       \item Library
+                       \item None
+                       \item Default Free compiler/runtime
+               \end{itemize}
+               \hbr
+       \item Look at and fix \texttt{debian/*}
+               \hbr
+       \item \texttt{dpkg-buildpackage -us -uc} or \texttt{debuild}
+               \hbr
+       \item \texttt{lintian}, \texttt{debc}, etc.
+               \hbr
+       \item Compare your result with the \texttt{libirclib-java} source package
+\end{itemize}
+\end{frame}
+
+\subsection{Practical session 4: packaging a Ruby gem}
+\begin{frame}{Practical session 4: packaging a Ruby gem}
+\begin{enumerate}
+       \item Take a quick look at some documentation about Ruby packaging:\\
+               \begin{itemize}
+               \item \url{http://wiki.debian.org/Ruby}
+      \hbr
+               \item \url{http://wiki.debian.org/Teams/Ruby}
+      \hbr
+               \item \url{http://wiki.debian.org/Teams/Ruby/Packaging}
+      \hbr
+               \item \texttt{gem2deb(1)}, \texttt{dh\_ruby(1)} (in the \texttt{gem2deb} package)
+               \end{itemize}
+               \hbr
+       \item Create a basic Debian source package from the \texttt{net-ssh} gem:\\
+               \texttt{gem2deb net-ssh}
+       \hbr
+       \item Improve it so that it becomes a proper Debian package
+\end{enumerate}
+\end{frame}
+
+\begin{frame}{Step by step\ldots}
+\texttt{gem2deb net-ssh}:
+\begin{itemize}
+\item Downloads the gem from rubygems.org
+\item Creates a suitable .orig.tar.gz archive, and untar it
+\item Initializes a Debian source package based on the gem's metadata
+       \begin{itemize}
+               \item Named \texttt{ruby-\textsl{gemname}}
+       \end{itemize}
+\item Tries to build the Debian binary package (this might fail)
+\end{itemize}
+\br
+\texttt{dh\_ruby} (included in \textsl{gem2deb}) does the Ruby-specific tasks:
+\begin{itemize}
+       \item Build C extensions for each Ruby version
+       \item Copy files to their destination directory
+       \item Update shebangs in executable scripts
+       \item Run tests defined in \texttt{debian/ruby-tests.rb} or \texttt{debian/ruby-test-files.yaml}, as well as various other checks
+\end{itemize}
+\end{frame}
 
-\backupend
+\begin{frame}[fragile]{Step by step\ldots (2)}
+Improve the generated package:
+\begin{itemize}
+       \item Run \texttt{debclean} to clean the source tree. Look at \texttt{debian/}.
+               \hbr
+       \item \texttt{changelog} and \texttt{compat} should be correct
+               \hbr
+       \item Edit \texttt{debian/control}: uncomment \texttt{Homepage}, improve \texttt{Description}
+               \hbr
+       \item Write a proper \texttt{copyright} file based on the upstream files
+               \hbr
+       \item \texttt{ruby-net-ssh.docs}: install \texttt{README.rdoc}
+               \hbr
+       \item \texttt{ruby-tests.rb}: run the tests. In that case, it is enough to do:\\
+               \verb+$: << 'test' << 'lib' << '.'+\\
+               \verb+require 'test/test_all.rb'+
+\end{itemize}
+\end{frame}
+
+\begin{frame}[fragile]{Step by step\ldots (3)}
+Build the package.
+It fails to build. There are two problems:
+\begin{itemize}
+       \item You need to disable the \texttt{gem} call in the test suite.\\
+       In \texttt{test/common.rb}, remove the \verb+gem "test-unit"+ line:
+               \begin{itemize}
+                       \item \texttt{edit-patch disable-gem.patch}
+                       \item Edit \texttt{test/common.rb}, remove the \texttt{gem} line. Exit the sub-shell
+                       \item Describe the changes in \texttt{debian/changelog}
+                       \item Document the patch in \texttt{debian/patches/disable-gem.patch}
+               \end{itemize}
+               \hbr
+
+       \item The package lacks a build-dependency on \texttt{ruby-mocha},
+               which is used by the test suite (you might need to build your
+               package in a clean environment, using \texttt{pbuilder}, to
+               reproduce that problem)
+
+               \begin{itemize}
+                       \item Add \texttt{ruby-mocha} to the package's \texttt{Build-Depends}
+
+                       \item \textsl{gem2deb} copies the dependencies
+                               documented in the \textsl{gem} as comments in
+                               \texttt{debian/control}, but \textsl{mocha} is
+                               not listed as a development dependency by the
+                               gem (that's a bug in the gem)
+               \end{itemize}
+\end{itemize}
+\hbr
+Compare your package with the \texttt{ruby-net-ssh} package in the Debian archive
+\end{frame}
 
 \end{document}