style moved to .sty ; answers to grep practical session
authorLucas Nussbaum <lucas@lucas-nussbaum.net>
Mon, 21 Feb 2011 15:02:27 +0000 (16:02 +0100)
committerLucas Nussbaum <lucas@lucas-nussbaum.net>
Mon, 21 Feb 2011 15:02:27 +0000 (16:02 +0100)
debiantutorial.sty [new file with mode: 0644]
packaging-tutorial.tex
pract1-grep.tex [new file with mode: 0644]

diff --git a/debiantutorial.sty b/debiantutorial.sty
new file mode 100644 (file)
index 0000000..1dc237d
--- /dev/null
@@ -0,0 +1,46 @@
+\usepackage{wasysym}
+\definecolor{darkgreen}{rgb}{0,.7,0}
+\definecolor{darkred}{rgb}{.7,0,0}
+\newcommand{\Smiley}{{\color{darkgreen}\smiley}}
+\newcommand{\Frownie}{{\color{darkred}\frownie}}
+\usepackage[utf8]{inputenc}
+\usepackage{helvet}
+\usepackage[OT1]{fontenc}
+\usepackage{xspace}
+\usepackage{verbatim}
+\usepackage{comment}
+\usepackage{tabularx}
+\usepackage{listings}
+\lstset{basicstyle=\ttfamily}
+\beamertemplatetransparentcovereddynamic
+\setbeamercovered{invisible}
+\newcommand{\br}{\vskip 1em}
+\newcommand{\hbr}{\vskip 0.5em}
+\newcommand{\hhbr}{\vskip 0.25em}
+\newcommand{\Arr}{\textbf{$\Rightarrow$}\xspace}
+\newcommand{\arr}{\textbf{$\rightarrow$}\xspace}
+\newcommand{\fixme}[1]{ {\color{red}\footnotesize\bf #1}}
+\usepackage{listings}
+\usepackage{tikz}
+\usepackage{pgfplots}
+\usetikzlibrary{dateplot}
+\newcommand{\textttc}[1]{\texttt{\color{rouge}#1}}
+
+\renewcommand{\ttdefault}{aett}
+\usepackage{aecompl}
+
+\newcommand{\pedp}{\NoAutoSpaceBeforeFDP}
+
+\usebackgroundtemplate{\includegraphics[width=\paperwidth]{figs/dslide8.pdf}}
+\logo{\includegraphics[viewport=274 335 360 440,width=0.5cm]{figs/openlogo-nd.pdf}}
+\newcommand{\nospace}[1]{{\NoAutoSpaceBeforeFDP{}#1}}%
+
+\AtBeginSection[]
+{
+  \begin{frame}
+    \frametitle{Outline}
+    \tableofcontents[hideothersubsections]
+  \end{frame}
+}
+
+
index 8e93714..d091dbf 100644 (file)
@@ -1,57 +1,14 @@
 \documentclass[10pt,final]{beamer}
 \mode<presentation>
 \usetheme{lucasdeb}
-\usepackage{wasysym}
-\definecolor{darkgreen}{rgb}{0,.7,0}
-\definecolor{darkred}{rgb}{.7,0,0}
-\newcommand{\Smiley}{{\color{darkgreen}\smiley}}
-\newcommand{\Frownie}{{\color{darkred}\frownie}}
-\usepackage[utf8]{inputenc}
-\usepackage{helvet}
-\usepackage[OT1]{fontenc}
-\usepackage{xspace}
-\usepackage{verbatim}
-\usepackage{comment}
-\usepackage{tabularx}
-\usepackage{listings}
-\lstset{basicstyle=\ttfamily}
-\beamertemplatetransparentcovereddynamic
-\setbeamercovered{invisible}
-\newcommand{\br}{\vskip 1em}
-\newcommand{\hbr}{\vskip 0.5em}
-\newcommand{\hhbr}{\vskip 0.25em}
-\newcommand{\Arr}{\textbf{$\Rightarrow$}\xspace}
-\newcommand{\arr}{\textbf{$\rightarrow$}\xspace}
-\newcommand{\fixme}[1]{ {\color{red}\footnotesize\bf #1}}
-\usepackage{listings}
-\usepackage{tikz}
-\usepackage{pgfplots}
-\usetikzlibrary{dateplot}
-\newcommand{\textttc}[1]{\texttt{\color{rouge}#1}}
-
-\renewcommand{\ttdefault}{aett}
-\usepackage{aecompl}
-
-\newcommand{\pedp}{\NoAutoSpaceBeforeFDP}
-
-\usebackgroundtemplate{\includegraphics[width=\paperwidth]{figs/dslide8.pdf}}
-\logo{\includegraphics[viewport=274 335 360 440,width=0.5cm]{figs/openlogo-nd.pdf}}
+\usepackage{debiantutorial}
+
 \hypersetup{pdftitle={An Introduction to Debian Packaging},bookmarks}
 \title{An Introduction to Debian Packaging}
 \author[]{Lucas Nussbaum\\{\small\texttt{lucas@debian.org}}}
 \institute{\includegraphics[viewport=274 335 360 440,width=1cm]{figs/openlogo-nd.pdf}}
 \date{}
 
-\newcommand{\nospace}[1]{{\NoAutoSpaceBeforeFDP{}#1}}%
-
-\AtBeginSection[]
-{
-  \begin{frame}
-    \frametitle{Outline}
-    \tableofcontents[hideothersubsections]
-  \end{frame}
-}
-
 \begin{document}
 
 \frame{\titlepage}
@@ -157,7 +114,7 @@ rw-r--r-- 0/0 751613 Sep  5 15:43 2010 data.tar.gz
 \subsection{Tools you will need}
 \begin{frame}{Tools you will need}
        \begin{itemize}
-               \item A Debian (or Ubuntu) system
+               \item A Debian (or Ubuntu) system (with root access)
                        \br
                \item Some packages:
        \begin{itemize}
@@ -167,13 +124,12 @@ rw-r--r-- 0/0 751613 Sep  5 15:43 2010 data.tar.gz
                \end{itemize}
                \hbr
        \item \textbf{devscripts}: contains many useful scripts for Debian maintainers
-               \hbr
-       \item \textbf{lintian}: package checker (static analyzer)
        \end{itemize}
        \end{itemize}
 
        \br
-       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
+       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\\
+       Install them when you need them.
 \end{frame}
 
 \subsection{General packaging workflow}
@@ -680,17 +636,20 @@ Plain debhelper: 45\% \hskip 1em CDBS: 24\% \hskip 1em  debhelper7: 29\%
        \item List the content of the package: \texttt{{\color{rouge}debc} ../mypackage<TAB>.changes}
                \br
        \item Compare the package with a previous version:\\
-               \texttt{{\color{rouge}debdiff} ../mypackage\_1\_*.changes ../mypackage\_2\_*.changes}
+               \texttt{{\color{rouge}debdiff} ../mypackage\_1\_*.changes ../mypackage\_2\_*.changes}\\
+               or to compare the sources:\\
+               \texttt{{\color{rouge}debdiff} ../mypackage\_1\_*.dsc ../mypackage\_2\_*.dsc}\\
                \br
        \item Check the package with \texttt{lintian} (static analyzer):\\
-               \texttt{{\color{rouge}lintian} ../mypackage<TAB>.changes}
+               \texttt{{\color{rouge}lintian} ../mypackage<TAB>.changes}\\
+               \texttt{lintian -i}: gives more information about the errors
 \end{itemize}
 \end{frame}
-\section{Practical session: modifying the wget package}
-\begin{frame}{Practical session: modifying the wget package}
+\section{Practical session: modifying the grep package}
+\begin{frame}{Practical session: modifying the grep package}
 \begin{enumerate}
-       \item Go to \url{http://ftp.debian.org/debian/pool/main/w/wget/} and
-               download version 1.12-2.1 of the package
+       \item Go to \url{http://ftp.debian.org/debian/pool/main/g/grep/} and
+               download version 2.6.3-3 of the package
        \item Look at the files in \texttt{debian/}.
                \begin{itemize}
                        \item           How many binary packages are generated by this source package?
@@ -698,11 +657,10 @@ Plain debhelper: 45\% \hskip 1em CDBS: 24\% \hskip 1em  debhelper7: 29\%
                \end{itemize}
        \item Build the package
        \item We are now going to modify the package. Add a changelog entry and increase the version number.
-       \item The lintian warning \textsl{more-than-one-patch-system} is caused by the build-dependency on \texttt{dpatch}. Remove it, and add an appropriate changelog entry.
-       \item Now disable IPv6 support (it is a \texttt{./configure} option)
+       \item Now disable perl-regexp support (it is a \texttt{./configure} option)
        \item Rebuild the package
-       \item Install the newly built package
        \item Compare the original and the new package with debdiff
+       \item Install the newly built package
 \end{enumerate}
 \end{frame}
 
@@ -857,6 +815,10 @@ Processes:
 \item Uploading debsign / dput -- private archive -- reprepro
 \item Packaging with VCSes debcheckout debcommit debrelease git-buildpackage svn-buildpackage
 \end{itemize}
+Various:
+\begin{itemize}
+\item debc and lintian should really pick-up the .changes file automatically
+\end{itemize}
 \end{frame}
 
 
diff --git a/pract1-grep.tex b/pract1-grep.tex
new file mode 100644 (file)
index 0000000..198c38c
--- /dev/null
@@ -0,0 +1,151 @@
+\documentclass[10pt,final]{beamer}
+\mode<presentation>
+\usetheme{lucasdeb}
+\usepackage{debiantutorial}
+
+\hypersetup{pdftitle={Practical session 1: grep},bookmarks}
+\title[Practical session 1: grep]{Practical session 1:\\ Modifying the grep package}
+\author[]{Lucas Nussbaum\\{\small\texttt{lucas@debian.org}}}
+\institute{\includegraphics[viewport=274 335 360 440,width=1cm]{figs/openlogo-nd.pdf}}
+\date{}
+
+\begin{document}
+
+\frame{\titlepage}
+
+\begin{frame}{Practical session: 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
+       \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}
+       \item Build the package
+       \item We are now going to modify the package. Add a changelog entry and increase the version number.
+       \item Now disable perl-regexp support (it is a \texttt{./configure} option)
+       \item Rebuild the package
+       \item Compare the original and the new package with debdiff
+       \item Install the newly built package
+\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{debhelper 7}. 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}
+\end{frame}
+
+
+
+\end{document}