mentors + add debconf in conclusion
[packaging-tutorial.git] / pract2-gnujump.tex
1 \documentclass[10pt,final]{beamer}
2 \mode<presentation>
3 \usetheme{lucasdeb}
4 \usepackage{debiantutorial}
5
6 \hypersetup{pdftitle={Practical session 2: gnujump},bookmarks}
7 \title[Practical session 2: gnujump]{Practical session 2:\\ Packaging GNUjump}
8 \author[]{Lucas Nussbaum\\{\small\texttt{lucas@debian.org}}}
9 \institute{\includegraphics[viewport=274 335 360 440,width=1cm]{figs/openlogo-nd.pdf}}
10 \date{}
11
12 \begin{document}
13
14 \frame{\titlepage}
15
16 \begin{frame}{Practical session: packaging GNUjump}
17 \begin{enumerate}
18         \item Download GNUjump 1.0.6 from
19                 \url{http://ftp.gnu.org/gnu/gnujump/1.0.6/gnujump-1.0.6.tar.gz}
20                 \br
21         \item Create a Debian package for it
22                 \begin{itemize}
23                         \item Install build-dependencies so that you can build the package
24                         \item Get a basic working package
25                         \item Finish filling \texttt{debian/control} and other files
26                 \end{itemize}
27                 \br
28         \item Enjoy
29 \end{enumerate}
30 \vfill
31 \centerline{\includegraphics[width=6cm]{gnujump.png}}
32 \end{frame}
33
34 \begin{frame}[fragile]
35 \frametitle{Step by step\ldots}
36 \begin{itemize}
37         \item \texttt{wget http://ftp.gnu.org/gnu/gnujump/1.0.6/gnujump-1.0.6.tar.gz}
38                 \hbr
39         \item \texttt{mv gnujump-1.0.6.tar.gz gnujump\_1.0.6.orig.tar.gz}
40                 \hbr
41         \item \texttt{tar xf gnujump\_1.0.6.orig.tar.gz}
42                 \hbr
43         \item \texttt{cd gnujump-1.0.6/}
44                 \hbr
45         \item \texttt{dh\_make}
46         \begin{itemize}
47                 \item \small Type of package: single binary (for now)
48         \end{itemize}
49 \end{itemize}
50 \begin{lstlisting}[basicstyle=\ttfamily\small]
51 gnujump-1.0.6$ ls debian/
52 changelog           gnujump.default.ex   preinst.ex
53 compat              gnujump.doc-base.EX  prerm.ex
54 control             init.d.ex            README.Debian
55 copyright           manpage.1.ex         README.source
56 docs                manpage.sgml.ex      rules
57 emacsen-install.ex  manpage.xml.ex       source
58 emacsen-remove.ex   menu.ex              watch.ex
59 emacsen-startup.ex  postinst.ex
60 gnujump.cron.d.ex   postrm.ex
61 \end{lstlisting}
62 \end{frame}
63
64 \begin{frame}[fragile]
65 \frametitle{Step by step \ldots (2)}
66 \begin{itemize}
67         \item Look at \texttt{debian/changelog}, \texttt{debian/rules}, \texttt{debian/control} (auto-filled by \textbf{dh\_make})
68         \item In \texttt{debian/control}:\\
69                 \texttt{Build-Depends: debhelper (>= 7.0.50~), autotools-dev}
70                 This field lists the \textsl{build-dependencies}: packages needed to build the package
71         \item Try to build the package as-is (thanks to \textbf{dh} magic)
72                 \begin{itemize}
73                         \item And add build-dependencies, until it builds
74                         \item Hint: use \texttt{apt-cache search} and \texttt{apt-file} to find the packages
75                         \item Example:
76 \begin{lstlisting}[basicstyle=\ttfamily\footnotesize]
77 checking for sdl-config... no
78 checking for SDL - version >= 1.2.0... no
79 [...]
80 configure: error: *** SDL version 1.2.0 not found!
81 \end{lstlisting}
82 $\rightarrow$ Add \textbf{libsdl1.2-dev} to Build-Depends and install it.
83                 \end{itemize}
84 \end{itemize}
85 \end{frame}
86
87 \begin{frame}
88 \frametitle{Step by step \ldots (3)}
89 \begin{itemize}
90         \item After installing \texttt{libsdl1.2-dev, libsdl-image1.2-dev, libsdl-mixer1.2-dev}, the package builds fine.
91                 \hbr
92         \item Use \texttt{debc} to list the content of the generated package.
93                 \hbr
94         \item Use \texttt{debi} to install it and test it.
95                 \hbr
96         \item Fill in \texttt{debian/control} using \url{http://www.debian.org/doc/debian-policy/ch-controlfields.html}
97                 \hbr
98         \item Test the package with \texttt{lintian}
99                 \hbr
100         \item Remove the files that you don't need in \texttt{debian/}
101                 \hbr
102         \item Compare your package with the one already packaged in Debian:
103                 \begin{itemize}
104                         \item It splits the data files to a second package, that is the same across all architectures ($\rightarrow$ saves space in the Debian archive)
105                         \item It installs a .desktop file (for the GNOME/KDE menus) and also integrates into the Debian menu
106                         \item It fixes a few minor problems using patches
107                 \end{itemize}
108 \end{itemize}
109 \end{frame}
110 \end{document}