\documentclass{beamer}

%\usepackage{beamerthemesplit}
\usepackage{upquote}

\mode<presentation>
{ \usetheme{boxes} }

\title{Debian Packages}
\author{Evan Broder \\ broder@mit.edu \\ (Thanks to Tim Abbott for the slides)}

\begin{document}

\frame{\titlepage}

\section{Debian Packages}

\subsection{Setting up}
\begin{frame}
  \frametitle{Setting up}
  \begin{itemize}
  \item linerva or XVM
  \item {\tt aptitude install build-essential cdbs debhelper wdiff
      devscripts dh-make dpatch dpkg-awk dpkg-dev equivs fakeroot
      lintian quilt}
  \item {\tt debian-el devscripts-el dpkg-dev-el}
  \end{itemize}
\end{frame}

\subsection{Debian binary packages}

\begin{frame}
  \frametitle{.deb file format}
  A .deb file is an ar archive of two .tar.gz files.
  \begin{itemize}
    \item The control information (accessed with dpkg -e)
    \item A filesystem tree to be unpacked (accessed with dpkg -x)
  \end{itemize}
\end{frame}

\begin{frame}[fragile]
  \frametitle{The control information}
  \begin{itemize}
  \item control file (contains package system metadata: dependencies,
  description, priority, section, etc.)
  \item maintainer scripts (preinst,postinst,prerm,postrm), run by
    dpkg when installing/uninstalling the package.
  \item conffiles file (lists configuration files and their md5sums)
  \item md5sums file (contains the md5sums of non-configuration files)
  \end{itemize}
\end{frame}

\subsection{Debian source packages}
\begin{frame}[fragile]
\frametitle{Debian source packages}
Most Debian source packages consist of 3 files.
  \begin{itemize}
  \item A .orig.tar.gz file, which contains the upstream source.
  \item A .diff.gz file, a patch that contains the Debian changes
  (including the debian/ directory)
  \item A .dsc file, which contains the metadata about the source
    package: it's build dependencies, version, architecture,
    maintainer, etc., and the md5sums of the other files.
  \end{itemize}
\end{frame}

\frame{
  \frametitle{The debian/ directory}
  \begin{itemize}
    \item debian/compat: debhelper compatability level.  Currently 6.
    \item debian/copyright: human-readable copyright information.
    \item debian/changelog: authoritative source of version information.
    \item debian/control: metadata describing the packages built.
    \item debian/rules: executable makefile for that builds package
    \item Potentially, various other files; maintainer scripts to be
    installed, init scripts, files telling debhelper how to install
    things, patches applied during the build process, etc.
  \end{itemize}
}

\frame{
  \frametitle{The debian/rules file}
  The rules file is where all the work happens.
  \begin{itemize}
    \item Older debhelper-based debian/rules files are around 100 lines long.
    \item We'll use CDBS, which makes typical rules files under 10
      lines
  \end{itemize}
}

\frame{
  The rest of this session is organized as follows:
  \begin{itemize}
    \item Examples
    \item Exercises (/mit/sipb-iap/www/debpackaging/EXERCISES)
  \end{itemize}
}

\end{document}
