volatile is gone, mention *-updates instead
[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 2: 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 \centerline{\includegraphics[width=5cm]{figs/gnujump.png}}
31 \end{frame}
32
33 \begin{frame}[fragile]
34 \frametitle{Step by step\ldots}
35 \begin{itemize}
36         \item \texttt{wget http://ftp.gnu.org/gnu/gnujump/1.0.6/gnujump-1.0.6.tar.gz}
37                 \hbr
38         \item \texttt{mv gnujump-1.0.6.tar.gz gnujump\_1.0.6.orig.tar.gz}
39                 \hbr
40         \item \texttt{tar xf gnujump\_1.0.6.orig.tar.gz}
41                 \hbr
42         \item \texttt{cd gnujump-1.0.6/}
43                 \hbr
44         \item \texttt{dh\_make}
45         \begin{itemize}
46                 \item \small Type of package: single binary (for now)
47         \end{itemize}
48 \end{itemize}
49 \begin{lstlisting}[basicstyle=\ttfamily\small]
50 gnujump-1.0.6$ ls debian/
51 changelog           gnujump.default.ex   preinst.ex
52 compat              gnujump.doc-base.EX  prerm.ex
53 control             init.d.ex            README.Debian
54 copyright           manpage.1.ex         README.source
55 docs                manpage.sgml.ex      rules
56 emacsen-install.ex  manpage.xml.ex       source
57 emacsen-remove.ex   menu.ex              watch.ex
58 emacsen-startup.ex  postinst.ex
59 gnujump.cron.d.ex   postrm.ex
60 \end{lstlisting}
61 \end{frame}
62
63 \begin{frame}[fragile]
64 \frametitle{Step by step \ldots (2)}
65 \begin{itemize}
66         \item Look at \texttt{debian/changelog}, \texttt{debian/rules}, \texttt{debian/control}\\
67                 (auto-filled by \textbf{dh\_make})
68                 \hbr
69         \item In \texttt{debian/control}:\\
70                 \texttt{Build-Depends: debhelper (>= 7.0.50~), autotools-dev}\\
71                 Lists the \textsl{build-dependencies} = packages needed to build the package
72                 \hbr
73         \item Try to build the package as-is (thanks to \textbf{dh} magic)
74                 \begin{itemize}
75                         \item And add build-dependencies, until it builds
76                         \item Hint: use \texttt{apt-cache search} and \texttt{apt-file} to find the packages
77                         \item Example:
78 \begin{lstlisting}[basicstyle=\ttfamily\footnotesize]
79 checking for sdl-config... no
80 checking for SDL - version >= 1.2.0... no
81 [...]
82 configure: error: *** SDL version 1.2.0 not found!
83 \end{lstlisting}
84 $\rightarrow$ Add \textbf{libsdl1.2-dev} to Build-Depends and install it.
85                 \hbr
86         \item Better: use \textbf{pbuilder} to build in a clean environment
87                 \end{itemize}
88 \end{itemize}
89 \end{frame}
90
91 \begin{frame}
92 \frametitle{Step by step \ldots (3)}
93 \begin{itemize}
94         \item After installing \texttt{libsdl1.2-dev, libsdl-image1.2-dev, libsdl-mixer1.2-dev}, the package builds fine.
95                 \hbr
96         \item Use \texttt{debc} to list the content of the generated package.
97                 \hbr
98         \item Use \texttt{debi} to install it and test it.
99                 \hbr
100         \item Fill in \texttt{debian/control} using \url{http://www.debian.org/doc/debian-policy/ch-controlfields.html}
101                 \hbr
102         \item Test the package with \texttt{lintian}
103                 \hbr
104         \item Remove the files that you don't need in \texttt{debian/}
105                 \hbr
106         \item Compare your package with the one already packaged in Debian:
107                 \begin{itemize}
108                         \item It splits the data files to a second package, that is the same across all architectures ($\rightarrow$ saves space in the Debian archive)
109                         \item It installs a .desktop file (for the GNOME/KDE menus) and also integrates into the Debian menu
110                         \item It fixes a few minor problems using patches
111                 \end{itemize}
112 \end{itemize}
113 \end{frame}
114 \end{document}