\documentclass[10pt]{article}

\newenvironment{nospdescr}{\begin{list}{}{
  \setlength{\itemsep}{0.01ex}
  \setlength{\parsep}{0.01ex}
  \renewcommand{\makelabel}[1]{\bf ##1\hfill}}}{\end{list}}
\pagestyle{empty}
\setlength{\textwidth}{7.4in}\setlength{\textheight}{9.5in}
% Needed for my weird printer
\setlength{\voffset}{-1.0in}
\setlength{\hoffset}{-1.4in}

\begin{document}

\begin{center}
\textbf{\Large An Overview of Debian Policy \quad
        \normalsize (version 2.5.0.0, 1998-10-30) \\
        Chris Fearnley \quad Chris@CJFearnley.com \quad
        http://www.CJFearnley.com }
\end{center}

\begin{nospdescr}
  \item[Related Policy Documents]  Debian Packaging Manual
        (in \textsl{packaging-manual}), FSSTND (in \textsl{debian-policy}),
        Authoritative List Of Virtual Package Names (in
        \textsl{debian-policy}), FHS 
        (\texttt{http://www.pathname.com/fhs/}), Debian Menu System
        (in \textsl{menu}).

  \item[The Debian Archive]  main, non-us, non-free, and contrib.

  \item[The Debian Free Software Guidelines (DFSG)] include source,
        be freely redistributable even with modifications, be
        nondiscriminatory.  E.g.,
        /usr/doc/copyright/\{Artistic,BSD,GPL,LGPL\}.

  \item[Package Control Data]  pkg name, maintainer, description,
        priority (required, important, standard, optional, extra),
        depends, recommends, suggests, essential flag, pre-dependencies,
        virtual packages (provides), conflicts, replaces (alternatively
        there is dpkg-divert or update-alternatives), conf\/f\/iles,
        maintainer scripts (\{post,pre\}\{inst,rm\}).

  \item[Source packages]  specify Standards-Version, modify upstream source
        as little as possible, modify Makefile.in rather than Makefile,
        trap makefile errors (sh generally ignores errors!), maintain
        debian/changelog and debian/copyright (which are installed in the
        binary package in /usr/doc).

  \item[Run Levels]  The scripts for each run level are located at
      /etc/rc?.d/[KS][0-9][0-9]pkg where ``?'' gives the run level (0-6,
      S), ``K'' or ``S'' tells weather to Kill or Start the service
      (K scripts run first), [0-9][0-9] specifies the order in which
      the scripts are run (lower numbers run first) and ``pkg'' is the
      name of the package that installed the script.  These scripts
      are actually symbolic links created by the package postinst
      (using update-rc.d(8)).  The scripts in init.d can take one of the
      following options: start, stop, restart, force-reload, and reload
      (optional).  These scripts should be robust in case the service is
      already running or not running and in case of package removal (use
      start-stop-daemon(8).  Scripts should follow the Debian format for
      console messages.  There is an example script: /etc/init.d/skeleton.

  \item[/etc/rc.boot] Scripts invoked once per machine boot.

  \item[Keyboard Configuration]  All keyboard events should be independent
      of terminal (the console, X11, telnet, etc.).  Delete and BS should
      work like it does on PCs.

  \item[Documentation] All executables in /\{usr,\}/\{s,\}bin should have a
      nroff source man page installed under /usr/man.  Info documentation
      (if available) is installed under /usr/info (use install-info to add
      to the info dir file).  If appropriate, packages should install a
      menu in /usr/lib/menu.  HTML is the preferred documentation format
      for Debian.  http://localhost/doc/ should provide access to the
      documentation under /usr/doc (if a web server is installed).

  \item[Binary Files]  Should be compiled with the make(1) variables
      ``CC = gcc CFLAGS = -O2 -g -Wall''.  Binaries should be striped using
      \texttt{install -s} or strip(1).

  \item[Libraries]  There must be two packages: the librarynamesoname
      package contains the shared library (compiled with -fPIC
      and stripped with \texttt{strip --strip-unneeded}) and the
      librarynamesoname-dev package containing the static version.
      Always use the gcc option -D\_REENTRANT when compiling libraries.

  \item[Package Maintainer Scripts]  The \{post,pre\}\{inst,rm\} scripts
      must be scripts and must fail if any error occurs (sh scripts
      should use \texttt{set -e} or check every command).  In order to
      use \#!/bin/sh, scripts must be POSIX compliant (ash(1)).  Must use
      tempfile(1) or mktemp(1) or compatible mechanism to write a file
      in /tmp or other world-writable directory.

  \item[Conf\/f\/iles]  Must live in /etc.  If more than one package uses a
      conf\/f\/ile, then only one can declare it as a conf\/f\/ile and it should
      provide a config script for editing the conf\/f\/ile.  It is best to
      put nothing in /etc/skel.

  \item[Cron]  Packages should not touch /etc/crontab (a conf\/f\/ile for the
      \textsl{cron} package).  Package provided cron jobs
      should be scripts, listed as conf\/f\/iles, and placed in
      /etc/cron.\-\{d,\-month\-ly,\-weekly,\-daily\}/pkgname.  Note:
      /etc/cron.d is not handled by \textsl{anacron}.  Scripts should be
      robust enough to handle the removal of the package.

  \item[File Permissions and Owners]  Generally, files should be owned by
      root.root.  Directories should be mode 755 or 2775 (for group
      writeability), executables should be mode 755, setuid or setgid
      executables should be mode 4755 or 2755, respectively.  Restricted
      setuid binaries should be mode 4754.  There are many exceptions.

  \item[/usr/local]  FSSTND: bin, doc, etc, games, lib, info, man, sbin,
        src; FHS:  remove doc, etc, info, man; and add include, share.
        Debian packages may not make subdirectories of /usr/local.
        Other than their postinst/prerm scripts adding/removing
        directories within the FSSTND specified ones, nothing in
        /usr/local may be touched.

\begin{center}
\begin{tabular}{ll}
  \multicolumn{2}{c}{\textbf{System UIDs and GIDs}} \\ \hline
  \textbf{0--99}         & Statically allocated system accounts \\
  \textbf{100--999}      & Dynamically allocated system accounts \\
  \textbf{1000--29999}   & Dynamically allocated user accounts \\
  \textbf{30000--59999}  & Reserved \\
  \textbf{60000--64999}  & Statically allocated by the Debian Project \\
  \textbf{65000--65533}  & Reserved \\
  \textbf{65534}         & nobody; nogroup \\
  \textbf{65535}         & $(\mathrm{uid\_t})(-1) = (\mathrm{gid\_t})(-1) \equiv$
                           The error return value \\
\end{tabular}
\end{center}

\end{nospdescr}

\end{document}
