% $Id$ \documentclass[blends,slideColor,colorBG,pdf,ps2pdf]{prosper} \usepackage[frenchb]{babel} \usepackage[T1]{fontenc} %\usepackage{multicol} \usepackage{moreverb} \title{RPM and policy for packaging} \subtitle{Adapt a rpm to a GNU/Linux distribution} \author{Olivier Thauvin} \email{olivier.thauvin@aerov.jussieu.fr} %%\institution{ %% \includegraphics*[height=0.3\textheight]{gnutux.eps} %%} \NoFrenchBabelItemize \begin{document} \maketitle \part{Introduction} \begin{slide}{Plan} \end{slide} \part{RPM reminder} \overlays{2}{ \begin{slide}{RPM: Rpm Package Manager} What is it ? \begin{itemize} \item a set of tools \item an archive format (.rpm) \item files in rpm format \end{itemize} \bigskip \FromSlide{2} Role: \begin{itemize} \item install \item list \item control %\item make easier software installation %\item versioning (evr) %\item ensure that the environment is compatible with the software %\item ensure system's integrity \end{itemize} \end{slide} } \begin{slide}{the package} An .rpm file containing: \begin{itemize} \item{entête} informations about the rpm \begin{itemize} \item practical informations about the software (name, version, url, \ldots) \item to make the rpm \item a list of dependances \item a list of files provided \item history of the package (changelog) \end{itemize} \item an archive containing the files \end{itemize} \end{slide} \begin{slide}{making an rpm} \begin{center} \includegraphics*[height=1\textheight]{rpm-building-en} \end{center} \end{slide} \begin{slide}{the spec file} It describes: \begin{itemize} \item the rpm(s) produced(s) \item the compiling of the software \end{itemize} \bigskip There are the following sections: \begin{itemize} \item header, \%description \item \%package \item \%prep, \%build, \%install, \%check \item \%files \item \%verify, \%pre, \%preun, \%post, \%postun, \%posttrans, \ldots \item \%changelog \end{itemize} \end{slide} \begin{slide}{specfile: example} \begin{small} \verbatiminput{simple.spec} \bigskip \begin{verbatim} $ rpm -ba simple.spec Write: /home/users/olivier/RPM/SRPMS/simple-1-1.src.rpm \o/ \end{verbatim} \end{small} \end{slide} \begin{slide}{macros} RPM specific variables. Origine: \begin{tabular}{|l|l|} \hline where&provider\\ \hline \hline system macros files&rpm\\ \hline system macros files&distribution\\ \hline \verb+~/.rpmmacros+&user\\ \hline spec file&packager\\ \hline \end{tabular} \bigskip They provide values or functions. \end{slide} \part{Policy: introduction} \overlays{2}{ \begin{slide}{Why defining a policy} \begin{itemize} \item homogeneity \item work factorisation \item quality \item ease the work \end{itemize} \bigskip In brief, that's good (tm) \bigskip \FromSlide{2} It must be: \begin{itemize} \item justified \item explained \item argumented \item documented \item approved \end{itemize} \end{slide} } \begin{slide}{Root is evil} Do not build as root,\\ Do not build as root,\\ And do not build as root.\\ \bigskip Risks : \begin{itemize} \item pollute your system \item skip errors unwillingly \item compromission, corruption of your system \item cannot be done on the compile-server \item it gives buttons %\item It makes you impotent \end{itemize} \end{slide} \begin{slide}{do not change the config} The environment provided with rpm adapts the rpms one to each other. You notably find: \begin{itemize} \item default paths \item dependances generation \item post-installation \end{itemize} \end{slide} \begin{slide}{Summary of basic rules} \begin{itemize} \item document yourself \item ask people used to making packages for their distribution \item understand rather than work-around \item a package well done for a distribution often becomes uncompatible with others \item get your package integrated to the distribution (it's worth doing for other things than rpm) \end{itemize} \end{slide} \part{Matter of fact case: Mandriva} \overlays{2}{ \begin{slide}{User configuration} \begin{itemize} \item define your rpm environment \item define the packager tag \end{itemize} \FromSlide{2} .rpmmacros: \bigskip \begin{small} \listinginput[5]{1}{rpmmacros} \end{small} \end{slide} } \begin{slide}{package naming policy} \begin{itemize} \item package name are lowercase (there are some exceptions) \item package name should match software name \item language modules have package name prefixed by language name \end{itemize} Example: \begin{itemize} \item perl \item rpm \item perl-POE \end{itemize} \end{slide} \overlays{2}{ \begin{slide}{mkrel} Problems with backport: \begin{tabular}{|l|l|c|l|} \hline &cooker&&stable\\ \hline \hline without&1mdv&==&1mdv\\ \hline with&1mdk&>&0.1.20060mdk\\ &1mdv2007.0&>&1mdv2006.0\\ \hline \end{tabular} \bigskip \FromSlide{2} Release: 1mdk becomes: Release: \%mkrel 1 \end{slide} } \begin{slide}{path for files} \begin{itemize} \item Prefix has a specific meaning, do not use it \item respect the standard paths \item prefer macros \item /usr/local is reserved for softwares installed without rpm \end{itemize} \end{slide} \begin{slide}{standard path} \bigskip \begin{small} \begin{tabular}{|l|l|l|} \hline path¯o&usage\\ \hline \hline /usr&\%\_prefix&general path\\ \hline /etc&\%\_sysconfdir&configuration\\ \hline /usr/bin&\%\_bindir&application\\ \hline /usr/sbin&\%\_sbindir&app. for root\\ \hline /usr/lib&\%\_libdir&libraries\\ /usr/lib64&&\\ \hline /usr/share&\%\_datadir&data\\ \hline /usr/share/man&\%\_mandir&man pages\\ \hline \end{tabular} \end{small} \end{slide} \begin{slide}{compilation and installation} Compiling a software: \begin{itemize} \item use the appropriate options (\%optflags) \item take care to paths \item install files in \%buildroot \end{itemize} \bigskip Simple case with autotools {\scriptsize\begin{verbatim} %build %configure %make %install %makeinstall_std \end{verbatim} } \end{slide} \begin{slide}{spec extracts} Example of a complicated case: {\tiny\begin{verbatim} export CFLAGS="%optflags" ./configure \ --prefix %_prefix \ --bindir %_bindir \ --libdir %_libdir # parallel make do not work make %install make install DEST=%buildroot #install one file: cat > %buildroot%_sysconfdir/%name.cfg <