
 \documentclass[11pt]{article}

   \usepackage[T1]{fontenc}
   \usepackage[utf8x]{inputenc}
   \usepackage{ifthen}
   \usepackage{palatino}
   \usepackage{marvosym}
   \usepackage{pifont}
   \usepackage{xspace}
   \usepackage{longtable}
   \usepackage{array}
   \usepackage{fancyhdr}
   \usepackage[sf,bf]{titlesec}
   \usepackage{titletoc}
   \usepackage{float}
   \usepackage[dvips]{graphicx}
   \usepackage{listings}
   \usepackage[dvips]{hyperref}
   \usepackage[paper=a4paper
              ,headheight=30pt
              ]{geometry}
  %\usepackage{layouts}

   \newboolean{toHtml}
   \input{media.tex}
   \newcommand{\latexhtml}[2]{\ifthenelse{\boolean{toHtml}}{#2}{#1}}

   \newcommand{\slsocFtpUrl}[1]{http://ftp.lip6.fr/pub/linux/distributions/slsoc/soc/#1}
   \newcommand{\dimFtpUrl}[1]{http://ftp.lip6.fr/pub/linux/distributions/slsoc/6x/dim/#1}

   \latexhtml{
    %% LaTeX specific code.
     \newcommand{\xhref}           [2]{\href{#2}{#1}}
     \newcommand{\dimFtpXRef}      [1]{\href{\dimFtpUrl  {#1}}{\texttt{\footnotesize #1}}}
     \newcommand{\slsocSrpmFtpXRef}[1]{\href{\slsocFtpUrl{SRPMS/#1}}{\texttt{\footnotesize #1}}}
     \newcommand{\slsocRpmiFtpXRef}[1]{\href{\slsocFtpUrl{i386/RPMS/#1}}{\texttt{\footnotesize #1}}}
     \newcommand{\slsocRpmxFtpXRef}[1]{\href{\slsocFtpUrl{x86\_64/RPMS/#1}}{\texttt{\footnotesize #1}}}
   }{
    %% LaTeX2HTML specific code.
     \newcommand{\xhref}           [2]{\htmladdnormallink{#1}{#2}}
     \newcommand{\dimFtpXRef}      [1]{\htmladdnormallink{#1}{\dimFtpUrl{#1}}}
     \newcommand{\slsocSrpmFtpXRef}[1]{\htmladdnormallink{#1}{\slsocFtpUrl{SRPMS/#1}}}
     \newcommand{\slsocRpmiFtpXRef}[1]{\htmladdnormallink{#1}{\slsocFtpUrl{i386/RPMS/#1}}}
     \newcommand{\slsocRpmxFtpXRef}[1]{\htmladdnormallink{#1}{\slsocFtpUrl{x86\_64/RPMS/#1}}}
   }

   \newcommand {\Chaput}             {\textsc{Chaput}\xspace}
   \newcommand {\LIP}                {\textsc{lip6}\xspace}
   \newcommand {\SoC}                {\textsc{S}o\textsc{C}\xspace}
   \newcommand {\JNovy}              {\xhref{Jindrich \textsc{Novy}}{http://jnovy.fedorapeople.org/}\xspace}
                                     
   \newcommand {\LGPL}               {\textsc{lgpl}\xspace}
   \newcommand {\GPL}                {\textsc{gpl}\xspace}
   \newcommand {\GPG}                {\textsc{gpg}\xspace}
   \newcommand {\ANSI}               {\textsc{ansi}\xspace}
   \newcommand {\XML}                {\textsc{xml}\xspace}
   \newcommand {\VHDL}               {\textsc{vhdl}\xspace}
   \newcommand {\FEL}                {\xhref{\textsc{fel}}{http://spins.fedoraproject.org/fel/}\xspace}
   \newcommand {\LEFDEF}             {\textsc{lef/def}\xspace}
   \newcommand {\RHELV}              {\textsc{rhel 5}\xspace}
   \newcommand {\CentOSV}            {\textsc{CentOS 5}\xspace}
   \newcommand {\SL}                 {\textsc{SL}\xspace}
   \newcommand {\SLV}                {\textsc{SL 5}\xspace}
   \newcommand {\Fedora}             {\textsc{Fedora}\xspace}
   \newcommand {\FedoraXII}          {\textsc{Fedora 12}\xspace}
   \newcommand {\FedoraXIII}         {\textsc{Fedora 13}\xspace}
   \newcommand {\Karmik}             {\textsc{Ubuntu Karmik}\xspace}
   \newcommand {\Lucid}              {\textsc{Ubuntu Lucid}\xspace}
   \newcommand {\ATrpms}             {\textsf{ATrpms}\xspace}
   \newcommand {\TeXLive}            {\texttt{\TeX\ Live}\xspace}
   \newcommand {\QtIV}               {\textsc{Qt 4}\xspace}
   \newcommand {\CTAN}               {\textsc{ctan}\xspace}
   \newcommand {\Python}             {\textsc{Python}\xspace}
   \newcommand {\rpm}                {\texttt{rpm}\xspace}
   \newcommand {\tty}                {\texttt{tty}\xspace}
   \newcommand {\rdist}              {\texttt{rdist}\xspace}
   \newcommand {\rpmbuild}           {\texttt{rpmbuild}\xspace}
   \newcommand {\spec}               {\texttt{spec}\xspace}
   \newcommand {\specs}              {\texttt{specs}\xspace}
   \newcommand {\tlrpm}              {\texttt{tl2rpm}\xspace}
   \newcommand {\tlrpmc}             {\xhref{tl2rpm.c}{http://jnovy.fedorapeople.org/texlive/tl2rpm.c}\xspace}
                                     
   \newcommand {\id}                 {\texttt{id}\xspace}
   \newcommand {\comps}              {\texttt{comps}\xspace}
   \newcommand {\SocDim}             {\textbf{\texttt{Dim}}\xspace}
   \newcommand {\socDim}             {\textbf{\texttt{dim}}\xspace}
   \newcommand {\yum}                {\texttt{yum}\xspace}
   \newcommand {\depsolve}           {\texttt{depsolve}\xspace}
   \newcommand {\yumsync}            {\textbf{\texttt{yumsync}}\xspace}
   \newcommand {\Yumsync}            {\textbf{\texttt{Yumsync}}\xspace}
   \newcommand {\yumsyncpy}          {\texttt{yumsync.py}\xspace}
   \newcommand {\Yumsyncpy}          {\texttt{Yumsync.py}\xspace}
   \newcommand {\yumsyncconf}        {\texttt{yumsync.conf}\xspace}
   \newcommand {\yumsyncpyDL}        {\dimFtpXRef{yumsync.py}\xspace}
   \newcommand {\yumsyncconfDL}      {\dimFtpXRef{yumsync.conf}\xspace}
   \newcommand {\yumport}            {\textbf{\texttt{yumport}}\xspace}
   \newcommand {\createrepo}         {\textbf{\texttt{createrepo}}\xspace}
   \newcommand {\repoview}           {\textbf{\texttt{repoview}}\xspace}
   \newcommand {\dotcls}             {\texttt{.cls}\xspace}
   \newcommand {\dotsty}             {\texttt{.sty}\xspace}
   \newcommand {\dottex}             {\texttt{.tex}\xspace}

   \pagestyle{fancy}

  %\renewcommand{\headheight}{14pt}
   \renewcommand{\headrulewidth}{0.2mm}
   \renewcommand{\footrulewidth}{0.2mm}
   \renewcommand{\sectionmark}[1]{\markboth{\thesection\ #1}{\thesection\ #1}}
   \renewcommand{\subsectionmark}[1]{}
   \lhead[]{Dim User's Manual}
   \rhead[]{June 6, 2011}
   \lfoot[]{\LIP/\SoC}
   \rfoot[]{\thepage}
   \cfoot[]{}

  %% The LaTeX Companion -- p. 204.
  %% Miniature display of the page layout.
  %\newcommand{\showpage}{%
  %  \setlayoutscale{0.65}\setlabelfont{\tiny}%
  %  \printheadingsfalse\printparametersfalse%
  %  \currentpage\pagedesign%
  %}

   \titlecontents{section}[1pc]
     {\sffamily\bfseries}                                   % above code.
     {\contentslabel{1pc}}                                  % numbered entry format.
     {The Numberless Entry Format}                          % numberless entry format.
     {\titlerule*[8pt]{.}\textsc{\textbf{{\contentspage}}}} % page format.
   \titlecontents{subsection}[3pc]
     {\sffamily}                                            % above code.
     {\contentslabel{2pc}}                                  % numbered entry format.
     {The Numberless Entry Format}                          % numberless entry format.
     {\titlerule*[8pt]{.}\textsc{\textbf{{\contentspage}}}} % page format.


 \begin{document}

 \title{Dim User's Manual}
 \author{Jean-Paul Chaput \\
         \texttt{Jean-Paul.Chaput@lip6.fr}}
 \date{June 2011}

 \maketitle

 \thispagestyle{fancy}

 \tableofcontents

 \section{Introduction}

 The \SocDim package  provides three tools: \SocDim, \yumport  and \yumsync.  \yumsync and
 \SocDim are independant but \yumport depends on \SocDim.

 Thoses tools  are mainly aimed  at system administrators  with a background  in \rpm/\yum
 based distributions and \rpm building.

 \SocDim  and  \yumport  must  be  run  on  machine with  the  same  architecture  as  the
 distribution. That is 32 bits for \texttt{i386}\ and 64 bits for \texttt{x86\_64}.


 \subsection{Getting Dim}

 Source and binary of \socDim \rpm packages can be downloadeds from here:

 \begin{center}
   \begin{tabular}{|p{3.0cm}|p{.5\textwidth}|}
     \hline
     source & \slsocSrpmFtpXRef{dim-1.0.7-1.slsoc6.src.rpm}
     \\ \hline
     binary & \slsocRpmiFtpXRef{dim-1.0.7-1.slsoc6.noarch.rpm}
     \\ \hline
   \end{tabular}
 \end{center}


 \section{\SocDim}

 \subsection{Goals of \SocDim}

 Starting from a medium size computer network, it is often useful to set up a local mirror
 of the distribution, so not to overload  the bandwidth towards the outside of the network
 and not  saturate the public servers.  Besides having a  complete local copy can  come in
 handy. When setting up the local mirror,  the straighforward approach is to do a complete
 copy. Which  means at least  two repositories: the  base distribution, then  the security
 updates.   As the  repository  holding the  security  updates contains  all the  previous
 outdated version  of a  package, it can  grow big  over time. Another  aspect is  that by
 keeping the repositories separated you have a "two step" install mode: first step install
 the base  (outdated) distribution,  then the updates  are applieds.  It is now  less true
 because the installer (from SL6) automatically perform the update.

 The second mirror  approach is to merge  the base distribution and it's  updates and keep
 only  the latest  version of  a package.  The result  is a  distribution behaving  like a
 \textit{rolling}\ one, but only with the official updates.

 This is  mainly what \SocDim  does: merge repositories  and prune outdated  packages.  In
 addition, it embbeds \createrepo, \repoview, and can add \GPG signature to packages  that
 are lacking it.


 \subsection{Configuring \SocDim}

 Configuration is  stored in  \texttt{/etc/yum/dim.conf}.  The file  is in  python format,
 allowing  any legal  python  construct. The  file  consist in  a series  of  call to  the
 \texttt{addRepository()}\  method, which  basically tells  the repository  into  which we
 merge packages and from which repositories.

 {\scriptsize
 \begin{verbatim}
configuration.addRepository
   ( repoid     ="sl-local"
   , optionHelp ="Applies on SL 6 distribution repository."
   , comps      ="repodata/comps-sl6-%(basearch)s.xml"
   , rpmSubdir  ="Packages"
   , updateRepos=["sl-security"]
   )
configuration.addRepository
   ( repoid     ="sl-source-local"
   , optionHelp ="Applies on SL 6 source distribution repository."
   , updateRepos=["sl-source"]
   )
configuration.addRepository
   ( repoid     ="my-addons"
   , optionHelp ="Applies on <My Addons> repository."
   , updateRepos=[]
   )
configuration.addRepository
   ( repoid     ="my-addons-source"
   , optionHelp ="Applies on <My Addons> source repository."
   , updateRepos=[]
   )
 \end{verbatim}}

 \begin{center}
   \begin{tabular}{|p{3.0cm}|p{.7\textwidth}|}
     \hline
     \multicolumn{2}{|c|}{\texttt{addRepository()} parameters}
     \\ \hline\hline
     \texttt{repoid}      & The target repository \id (into which we merge).
     \\ \hline
     \texttt{updateRepos} & The list of repositories \id from which to get the
                            updates.
     \\ \hline
     \texttt{comps}       & A \comps file for \createrepo and \repoview (optional).
                            The \texttt{\%(basearch)s}\ may be used to be architecture
                            independant.
     \\ \hline
     \texttt{rpmSubDir}   & By default, \SocDim copies \rpm in the same relative
                            location as in the source repositories. But sometimes
                            we need to insert an extra path, like in the base
                            distribution.
     \\ \hline
     \texttt{optionHelp}  & The help message that will be displayed by \SocDim
                            when help is requested
     \\ \hline
   \end{tabular}
 \end{center}

 On the machine hosting  the distribution and on which dim is run,  there must be two sets
 of repositories.

 \begin{enumerate}
   \item The \textit{normal}\ repositories, used for the host maintenance.
   \item The repositories used by \SocDim to update the distribution.
 \end{enumerate}

 Those two different  sets must not be mixeds. To achieve  the separation, \SocDim changes
 the root of  the filesystem hierarchy from which \yum  operates. The \SocDim repositories
 are located in \texttt{/home/dim/yum.root/etc/yum.repos.d/}. For the same reason, to tune
 \yum behavior when it's used by \SocDim, modify \texttt{/home/dim/etc/yum.conf}.


 \subsection*{Using \SocDim}

 The \SocDim command line:
 \begin{verbatim}
dim [--repoview] [--addsign] [--clean-cache] [--check-update] \\
    <repoid1> [repoid2 ...]
    
 \end{verbatim}

 The default behavior of \SocDim is to merge the update and call \createrepo
 on the selecteds repositories.

 \begin{center}
   \begin{tabular}{|p{4.0cm}|p{.6\textwidth}|}
     \hline
     \multicolumn{2}{|c|}{\SocDim parameters}
     \\ \hline\hline
     \texttt{repoid}           & Specifies on which repository to run. This is the
                                 \texttt{repoid}\ given in the configuration file.
     \\ \hline
     \texttt{---repoview}      & Run \repoview (not run by default).
     \\ \hline
     \texttt{---check-updates} & Reports for avalaible updates. Do not merge them.
     \\ \hline
     \texttt{---addsign}       & Look for packages missing a signature and try to
                                 add one. This option disable the updating.
     \\ \hline
     \texttt{---clean-cache}   & Clear all cached \yum data (equivalent to
                                 \texttt{yum clean all}).
     \\ \hline
   \end{tabular}
 \end{center}

 \textbf{Note 1:}\ \SocDim  will only look for update of package  that are already present
 in  the target repository.   That is,  if completly  new packages  appears in  the source
 repository, they will not be added. You have to if manually the first time.

 \textbf{Note  2:}\ Deprecated  packages are  not  erased. They  are moved  into a  backup
 directory,  \texttt{/home/dim/backup/<repoid>/} so if  something goes  wrong they  can be
 restored. This directory should be cleaned from time to time.


 \subsection*{Other Uses}

 Another application is to create local repository that merge vendors \rpm.  You could for
 instance   create   a  \texttt{vendor}\   repository   that   merges   the  contents   of
 \texttt{Adobe}\ and \texttt{VirtualBox}.


 \section{\yumport}

 \yumport is  an utility to ease the  task of porting packages  from sibling distributions
 like \Fedora or  third party repositories like \ATrpms. \yumport  is aimed at simplicity,
 it do  not uses  \texttt{chrooted}\ environment or  sophisticated scheduled  rebuilds and
 report systems.

 \yumport  is  able to  recursively  pull/install dependencies  needed  to  build a  given
 package. \yumport is to perform the more tedious task of porting, but il will not correct
 the code for  you or adjust dependency name changes.  Nevertheless, many \Fedora packages
 rebuild without problems under \SL 6 and it's for those that \yumport has been created.


 \subsection*{Using \yumport}

 The \yumport command line:
 \begin{verbatim}
yumport --package=<package1> [--package=<package2> ...]
 \end{verbatim}

 \begin{center}
   \begin{tabular}{|p{3.0cm}|p{.7\textwidth}|}
     \hline
     \multicolumn{2}{|c|}{\yumport parameters}
     \\ \hline\hline
     \texttt{---package} & The name of the package to be rebuild. Can be
                           used multiple times.
     \\ \hline
   \end{tabular}
 \end{center}

 If everything goes according to plan, the following cycle will be executed:
 \begin{enumerate}
   \item The source file is pulled from the source repository.
   \item The sources are unpacked in the \rpmbuild directory trees.
   \item The dependency are looked upon. Either they are avalaible, and are
         installed, or they must be compiled from source. In the later case
         insert them in the head of the rebuild list and continue.
   \item All dependencies are installed, the package is built.
   \item Source (if needed) and binary packages are moved into the target
         repository.
   \item \SocDim is called to update source \& target repository.
 \end{enumerate}

 Some important files and directories for \yumport:
 \begin{itemize}
   \item \texttt{/etc/yum/yumport.conf}~: the configuration file.
   \item \texttt{/home/dim/SRPMS.cache}~: the directory holdind the original source
         files (downloaded from the source repositories).
   \item \texttt{/home/dim/rpmbuild}~: the root directory of the \rpmbuild process.
   \item \texttt{/home/dim/rpmmacros}~: an on the fly generated file to configure
         \rpmbuild.
   \item \texttt{/home/dim/yum.root/etc/yum.repos.d/}~: the alternate \yum directory
         where \yumport get it's repositories (shared with \SocDim).
 \end{itemize}


 \subsection*{Configuring \yumport}

 \subsubsection*{First part: Repository Configuration.}

 {\scriptsize
 \begin{verbatim}
def guessFedoraDistTag ( release ):
    m = re.match(r".*\.fc(?P<fcversion>\d+)\..*",release)
    if m: return "fc%s" % (m.group("fcversion"))

    m = re.match(r".*\.(?P<disttag>[^.]+)$",release) # $
    if m: return m.group("disttag")

    return release

def guessPatchedDistTag ( release ):
    return "slsoc6"

configuration.addSourceRepo        ("my-addons-source",guessFedoraDistTag)
configuration.addSourceRepo        ("fedora-14-source",guessFedoraDistTag)
configuration.setTargetRpmsRepo    ("my-addons"       ,"RPMS")
configuration.setTargetSrpmsRepo   ("my-addons-source")
 \end{verbatim}}

 \begin{center}
   \begin{tabular}{|p{4.0cm}|p{.6\textwidth}|}
     \hline
     \multicolumn{2}{|c|}{\yumport configuration}
     \\ \hline\hline
     \texttt{addSourceRepo}     & Add a source repository (by \id). The second
                                  parameter must be a fonction indicating how to
                                  transform the \texttt{\%dist} tag (see below).
     \\ \hline
     \texttt{setTargetRpmsRepo} & The target binary repository, where the rebuild
                                  packages are to be put. The second parameter
                                  gives a subdirectory inside the repository.
     \\ \hline
     \texttt{setTargetSrpmRepo} & The target source repository.
     \\ \hline
   \end{tabular}
 \end{center}

 In order to keep track of the original source of a package, we customize the
 \texttt{\%dist}\ tag thanks to the \texttt{guessFedoraDistTag()} function.
 The convention implemented here is to add up the target distribution tag
 (\texttt{slsoc6}) with the source one (say: \texttt{fc14}), the result
 being \texttt{.slsoc6.fc14}. You may implement any convention you like.

 \subsubsection*{Second part: Dependency Resolution.}

 {\scriptsize
 \begin{verbatim}
def binaryToSource ( binary ):
    def rePerlSepar ( mo ):
        if   mo.group(0) == '(': return "-"
        elif mo.group(0) == ')': return ""
        elif mo.group(0) == "::": return "-"
        return ""

    matched = True
    source  = binary
    if   binary.startswith("libXvMCW"):             source = binary
    elif binary.startswith("qt-webkit"):            source = "qtwebkit"
    elif binary == "timidity++-patches":            source = "fluid-soundfont"
    elif binary == "soundfont-utils":               source = "gt"
    elif binary == "gnu.regexp":                    source = "gnu-regexp"
    elif binary == "msv-msv":                       source = "msv"
    elif binary == "msv-xsdlib":                    source = "msv"
    elif binary == "jakarta-commons-configuration": source = "apache-commons-configuration"
    elif binary == "jaxp":                          source = "xml-commons-apis"
    elif binary == "xfce4-doc":                     source = "xfce-utils"
    elif binary.startswith("libgoom2"):             source = "goom2k4"
    elif binary.startswith("bitstream-vera"):       source = "bitstream-vera-fonts"
    elif binary.startswith("netbeans-platform"):    source = "netbeans-platform"
    elif binary.startswith("perl("):
        print source
        source = re.sub(r"\(|\)|::",rePerlSepar,source)
    else:
        matched = False
    return (source,matched)

# Put the lookup fonction in place.
configuration.setBinaryToSourceHook(binaryToSource)
 \end{verbatim}}

 While a package is not yet in the \yum or \rpm database, we cannot guess what
 it provides. The \texttt{binaryToSource}\ function is a work around for this
 problem. It behave like a lookup table, returning the right source package
 name for a give dependency. Most of the time, the name of the dependency match
 the name of the source package, but when it's not the case, we put an explicit
 translation. The function shown above has been successfuly tested to recompile
 \texttt{mplayer}\ and \texttt{vlc}\ from \ATrpms.

 \subsubsection*{Third part: tricky packages.}

 {\scriptsize
 \begin{verbatim}
configuration.addExtraInfos("lash"   ,requires=["libuuid-devel"])
configuration.addExtraInfos("lirc"   ,builds  =[[] ,["--define", "kmdl_userland 1"]])
configuration.addExtraInfos("sdcc"   ,builds  =[["--define", "__strip /bin/true"]])
configuration.allowUpgrades(["libvpx", "libvpx-devel"])
 \end{verbatim}}

 \begin{center}
   \begin{tabular}{|p{3.0cm}|p{.7\textwidth}|}
     \hline
     \multicolumn{2}{|c|}{\texttt{addExtraInfos()} parameters}
     \\ \hline\hline
     \texttt{---requires} & A supplemental dependency which is missing in the
                            \spec file.
     \\ \hline
     \texttt{---builds}   & A list of list. Allows to perform multiple builds
                            with differents macro arguments. For instance \texttt{lirc}
                            will be built twice: the first tile without any arguments
                            (hence the \texttt{[]}) and the second time with a
                            \texttt{--define "kmdl\_userlan 1"} arguments. 
     \\ \hline
   \end{tabular}
 \end{center}

 By default, \yumport never override a package already present in the local
 repositories, but sometimes we have to allow an upgrade (this should be considered
 very carefully). \texttt{allowUpgrages()} takes a list of package that are alloweds
 to upgrade distributions ones.


 \section{\tlrpm}

 Automatic portage of \CTAN packages. This script is mostly a \Python rewrite of
 \tlrpmc from \JNovy. The main difference from the original program are:
 \begin{itemize}
   \item Package-oriented approach. Instead of generating all \specs files from
         a complete \TeXLive database (\texttt{texlive.tlpdb}), translate
         \texttt{<package>.tlpobj}.
   \item Fetch archive files from \CTAN if needed.
   \item Rebuild the \rpm package.
 \end{itemize}

 Configuration files of \tlrpm. They resides under \texttt{/etc/yum/tl2rpm/}.
 \begin{center}
   \begin{tabular}{|p{4.0cm}|p{.6\textwidth}|}
     \hline
     File                       & Function
     \\ \hline
     \texttt{changelog}         & The \texttt{changelog} section to be inserted in
                                  every \rpm (same for all).
     \\ \hline
     \texttt{cls.list}          & When looking inside \dottex or \dotcls file for
                                  dependency, we cannot known the kind of required file.
                                  This list contains all the dependencies that are
                                  \dotcls, otherwise they are considered to be \dotsty.
     \\ \hline
     \texttt{pkg-CTAN.list}     & The almost whole list of components in the \CTAN archive.
                                  You may feed it to \tlrpm with the \texttt{---packages}\ 
                                  option to rebuild the whole archive (took almost two
                                  hours on my computer).
     \\ \hline
     \texttt{pkg-SOURCES.map}   & In some rare case, the name of the \rpm package do not
                                  match the one of the \CTAN component. The correspondances
                                  are given here (\rpm name first, \CTAN component second).
     \\ \hline
     \texttt{req-blacklist.map} & Some dependency must not be took into account. They are
                                  listed in this file.
     \\ \hline
     \texttt{tl2rpm.conf}       & The main configuration file.
     \\ \hline
   \end{tabular}
 \end{center}

 The \tlrpm command line:
 \begin{verbatim}
tlrpm [--quiet] [--nocache] [--all-packages] \\
      [--max-fails=<number>][--report<report_file] \\
      [--packages=<package_list>] [package1 package2 ...]
 \end{verbatim}

 \begin{center}
   \begin{tabular}{|p{3.0cm}|p{.7\textwidth}|}
     \hline
     \multicolumn{2}{|c|}{\yumsync parameters}
     \\ \hline               
     \texttt{---quiet}        & Terse display. One line per package.
     \\ \hline               
     \texttt{---no-cache}     & Ignore already downloaded archives in \texttt{rpmbuild/SOURCES}.
     \\ \hline               
     \texttt{---max-fails=<>} & The number of packages allowed to fail before we stop the
                                run.
     \\ \hline
     \texttt{---packages=<>}  & A file containing a list of packages to rebuild.
                                One package per line, comment start by "\#".
     \\ \hline
     \texttt{---all-packages} & Rebuild the whole \CTAN archive.
     \\ \hline
     \texttt{---keep-cache}   & Keep previously cached datas. The default is to erase
                                everything from a previous run. This is may not be
                                convenient when updating big set of packages.
     \\ \hline
     \texttt{---report=<>}    & Write a report about what has been done in this file.
     \\ \hline
   \end{tabular}
 \end{center}

 \noindent
 \textbf{Note on package names:} When giving a package name to \tlrpm, remove the
 \texttt{texlive-}\ prefix. Saves some typing...


 \section{\yumsync}

 \Yumsync allows  you to keep a  computer \textit{striclty}\ synchronized  on a predefined
 set   of   packages.   It   is   different   from   the   \texttt{\textbf{distribution-}}
 \texttt{\textbf{synchronization}}\ mode  of \yum. The  \yum mode ensure that  versions of
 installed  packages  are  keep  in  sync with  the  distribution  repository,  performing
 downgrade if necessary.  It do not modify  the set of installed packages  (apart from the
 obsolete mechanism). The task of \yumsync is to keep in sync the set of package itself.


%\subsection*{Getting \Yumsync}
%
%\Yumsync is composed of two files: the python script itself \yumsyncpy
%and it's configuration file \yumsyncconf. They can be downloaded here:
%
%\begin{itemize}
%  \item \yumsyncpyDL
%  \item \yumsyncconfDL
%\end{itemize}
%
%
%\subsection*{Installing \Yumsync}
%
%Depending in which directory you install \yumsyncpy the script will look
%for it's configuration file in different directories.
%
%\begin{enumerate}
%  \item If you install \yumsyncpy in one of the standard binary directory
%        (\texttt{/bin}, \texttt{/sbin}, \texttt{/usr/bin} or \texttt{/usr/sbin}),
%        then the configuration file must be placed in the system-wide
%        \texttt{/etc/yum/}\ directory.
%  \item If installed in any other directory \yumsyncpy will read it's
%        configuration from \texttt{./etc/yumsync.conf}. That is an
%        \texttt{etc}\ directory relative to where \yumsyncpy is located.
%\end{enumerate}


 \subsection*{Using \yumsync}

 First, a schematic  description as how \yumsync work to help  you interpret the displayed
 outpout.  To  avoid running  on stalled  cached \yum datas,  the cache  is systematically
 cleared (equivalent to \verb+yum clean all+, so every time you run \yumsync, you will see
 the download of  the repositories metadatas.  Then, \yumsync  performs a first dependency
 solve  run, using an  empty \rpm  database to  compute the  exact set  of packages  to be
 installeds.  And finally,  it runs a second dependency solve on  the system \rpm database
 to align the installed package set on the requested one.

 The \yumsync command line:
 \begin{verbatim}
yumsync [--conf=<configuration>] [--profile=<profileid>] \\
        [--nogpgcheck] [--sync]
 \end{verbatim}

 \begin{center}
   \begin{tabular}{|p{3.0cm}|p{.7\textwidth}|}
     \hline
     \multicolumn{2}{|c|}{\yumsync parameters}
     \\ \hline\hline
     \texttt{---conf}       & Uses an alternate configuration file
     \\ \hline
     \texttt{---profile}    & Force the profile on which to synchronize. If not
                              specified try to match the host name against the
                              host patterns of each profiles
     \\ \hline
     \texttt{---sync}       & Perform the actual synchronization. By default 
                              the script is in dry run mode
     \\ \hline
     \texttt{---nogpgcheck} & Disable GPG checking
     \\ \hline
     \texttt{---keep-cache} & Keep previously cached datas. The default is to erase
                              everything from a previous run. This is may not be
                              convenient when updating big set of packages.
     \\ \hline
   \end{tabular}
 \end{center}

 Before performing the first synchronization you are strongly urged to run in dry mode and
 thorougly checks what packages are to be removed or installeds.

 As the aim  of \yumsync is to  synchronize each computer of a  network, the configuration
 file  has   to  be  distributed  over  the   network.  To  achieve  this   you  may  uses
 \texttt{---conf}\ to point on a configuration  file located on a networked file system or
 the system configuration could be synchronized with \rdist.


 \subsection*{Defining Profiles --- The Configuration File \yumsyncconf}
 
 The  configuration file is  in python  format, allowing  for any  python construct  to be
 used. The configuration file  define a list of profiles, each profile  supplies a list of
 hostname  patterns, a  list of  enabled  repositories and  a list  of groups/packages  to
 synchronize with.

 \begin{verbatim}
configuration.addProfile ( profileid = "lepka"
                         , hosts     = [ "lepka"
                                       , ".*\.soc.lip6.fr" ]
                         , repoids   = [ "sl", "epel" ]
                         , packages  = [ "@base"
                                       , "@core"
                                       , "zsh"
                                       ]
                         )
 \end{verbatim}

 Any number of profile  can be defined. Host pattern may be overlaping, in this case,
 the first to match is used. A complete example of configuration file  is given in
 subsection~\ref{ssec:yumconfex}.

 \begin{center}
   \begin{tabular}{|p{3.0cm}|p{.7\textwidth}|}
     \hline
     \multicolumn{2}{|c|}{\texttt{addProfile()} parameters} \\
     \hline\hline
     \texttt{profileid} & An unique identifier for the profile \\
     \hline
     \texttt{hosts}     & A python list of regular expressions that will
                          be matched against the host name \\
     \hline
     \texttt{repoids}   & A python list of repository to be enableds while 
                          synchronising \\
     \hline
     \texttt{packages}  & A python list of groups and/or single packages.
                          Names should be kept from the \texttt{comps}\ file,
                          like in \texttt{kickstart}. \\
     \hline
   \end{tabular}
 \end{center}

 A full  dependency check is performed on  the set of requested  groups/packages using the
 \yum  \depsolve  mechanism.  So  you  only  have  to put  in  the  list  the  \textit{top
   level}\ groups or  individual package. A good starting  point is the \texttt{\%package}
 section of \texttt{anaconda-ks.cfg} file left after any installation.

 
 \subsection*{Example of \yumsyncconf}

 \phantomsection
 \label{ssec:yumconfex}

 {\scriptsize
 \begin{verbatim}
# -*- Python -*-
#
# The configuration file of yumsync.
# It's a Python file (*not* a module).
#
# Packages names/group names as in yum command line (pattern) format.

sl6Desktop = [ "@additional-devel", "@base", "@core", "@debugging", "@basic-desktop"
             , "@desktop-debugging", "@desktop-platform",  "@desktop-platform-devel"
             , "@development", "@directory-client", "@eclipse",  "@emacs",  "@fonts"
             , "@french-support",    "@general-desktop",    "@graphical-admin-tools"
             , "@graphics",        "@input-methods",        "@internet-applications"
             , "@internet-browser",   "@java-platform",   "@legacy-x",    "@misc-sl"
             , "@network-file-system-client",    "@office-suite",     "@performance"
             , "@perl-runtime",      "@print-client",      "@remote-desktop-clients"
             , "@scalable-file-systems", "@server-platform", "@server-platform-devel"
             , "@tex",            "@technical-writing",            "@virtualization"
             , "@virtualization-client",  "@virtualization-platform",  "@web-server"
             , "@console-internet", "@x11"
            # End of groups.
             , "elrepo-release", "epel-release", "adobe-release-i386", "atrpms-repo"            
             , "sl-release-notes",   "zsh",   "xfig",   "graphviz",    "ImageMagick"
             , "inkscape",  "latex2html",  "thunderbird",  "createrepo",   "urlview"
             , "rsh",  "procmail",  "fetchmail",  "mutt",   "rdesktop",   "tigervnc"
             , "tigervnc-server", "gconf-editor", "vim-X11", "python-docs", "qt-doc"
             , "libXpm-devel",  "libXmu-devel",   "libXp-devel",   "openmotif-devel"
             , "rdist", "screen", "lm_sensors", "yum-plugin-versionlock"
            # End of individual packages.
             ]

configuration.addProfile ( profileid = "lepka"
                         , hosts     = [ "lepka", "shadock" ]
                         , repoids   = [ "sl", "elrepo", "epel" ]
                         , packages  = sl6Desktop + \
                                       [ "a2ps"               # From <r:epel>
                                       , "repoview"           # From <r:epel>
                                       , "fuse-sshfs"         # From <r:epel>
                                       , "mod_python"         # From <r:epel>
                                       , "trac"               # From <r:epel>
                                       ]
                         )

configuration.addProfile ( profileid = "sl6-64"
                         , hosts     = [ "sl6-64" ]
                         , repoids   = [ "sl", "elrepo", "epel" ]
                         , packages  = sl6Desktop + \
                                       [ "a2ps"               # From <r:epel>
                                       , "repoview"           # From <r:epel>
                                       , "fuse-sshfs"         # From <r:epel>
                                       , "mod_python"         # From <r:epel>
                                       ]
                         )
 \end{verbatim}}

 \end{document}
