source: trunk/fairerpms/presentation_en.tex @ 115

Last change on this file since 115 was 115, checked in by nanardon, 18 years ago

r2159@localhost: olivier | 2006-07-06 23:52:33 +0200

  • add plan
  • fix some typo
  • Property svn:keywords set to Id
File size: 8.8 KB
Line 
1% $Id$
2\documentclass[blends,slideColor,colorBG,pdf,ps2pdf]{prosper}
3\usepackage[frenchb]{babel}
4\usepackage[T1]{fontenc}
5%\usepackage{multicol}
6\usepackage{moreverb}
7
8
9\title{RPM and policy for packaging}
10\subtitle{Adapt a rpm to a GNU/Linux distribution}
11\author{Olivier Thauvin}
12\email{olivier.thauvin@aerov.jussieu.fr}
13%%\institution{
14%%  \includegraphics*[height=0.3\textheight]{gnutux.eps}
15%%}
16
17\NoFrenchBabelItemize
18
19\begin{document}
20\maketitle
21
22\part{Introduction}
23
24\begin{slide}{Plan}
25\bigskip
26\begin{itemize}
27\item{RPM reminder}
28\item{Policy: introduction}
29\item{Matter of fact case: Mandriva}
30\end{itemize}
31\end{slide}
32
33\part{RPM reminder}
34
35\overlays{2}{
36\begin{slide}{RPM: Rpm Package Manager}
37What is it ?
38\begin{itemize}
39    \item a set of tools
40    \item an archive format (.rpm)
41    \item files in rpm format
42\end{itemize}
43\bigskip
44
45\FromSlide{2}
46Roles:
47\begin{itemize}
48\item install
49\item list
50\item control
51%\item make easier software installation
52%\item versioning (evr)
53%\item ensure that the environment is compatible with the software
54%\item ensure system's integrity
55\end{itemize}
56\end{slide}
57}
58
59\begin{slide}{the package}
60An .rpm file containing:
61\begin{itemize}
62\item{entête} informations about the rpm
63    \begin{itemize}
64    \item practical informations about the software (name, version, url, \ldots)
65    \item to make the rpm
66    \item a list of dependances
67    \item a list of files provided
68    \item history of the package (changelog)
69    \end{itemize}
70\item an archive containing the files
71\end{itemize}
72\end{slide}
73
74\begin{slide}{making an rpm}
75\begin{center}
76\includegraphics*[height=1\textheight]{rpm-building-en}
77\end{center}
78\end{slide}
79
80\begin{slide}{the spec file}
81It describes:
82\begin{itemize}
83\item the rpm(s) produced(s)
84\item the compiling of the software
85\end{itemize}
86\bigskip
87There are the following sections:
88\begin{itemize}
89\item header, \%description
90\item \%package
91\item \%prep, \%build, \%install, \%check
92\item \%files
93\item \%verify, \%pre, \%preun, \%post, \%postun, \%posttrans, \ldots
94\item \%changelog
95\end{itemize}
96\end{slide}
97
98\begin{slide}{specfile: example}
99\begin{small}
100\verbatiminput{simple.spec}
101\bigskip
102\begin{verbatim}
103$ rpm -ba simple.spec
104Write: /home/users/olivier/RPM/SRPMS/simple-1-1.src.rpm
105\o/
106\end{verbatim}
107\end{small}
108\end{slide}
109
110\begin{slide}{macros}
111RPM specific variables.
112
113Origine:
114\begin{tabular}{|l|l|}
115\hline
116where&provider\\
117\hline
118\hline
119system macros files&rpm\\
120\hline
121system macros files&distribution\\
122\hline
123\verb+~/.rpmmacros+&user\\
124\hline
125spec file&packager\\
126\hline
127\end{tabular}
128
129\bigskip
130They provide values or functions.
131\end{slide}
132
133\part{Policy: introduction}
134
135\overlays{2}{
136\begin{slide}{What is a policy}
137To define rules.
138
139\FromSlide{2}
140\bigskip
141
142Goal:
143\bigskip
144\begin{itemize}
145\item homogeneity
146\item work factorisation
147\item quality
148\item ease the work
149\end{itemize}
150\bigskip
151In brief, that's good (tm)
152\bigskip
153
154\end{slide}
155}
156
157\begin{slide}{Root is evil}
158Do not build as root,\\
159Do not build as root,\\
160And do not build as root.\\
161\bigskip
162
163Risks :
164\begin{itemize}
165\item pollute your system
166\item skip errors unwillingly
167\item compromission, corruption of your system
168\item cannot be done on the compile-server
169\item it gives buttons
170%\item It makes you impotent
171\end{itemize}
172\end{slide}
173
174\begin{slide}{do not change the config}
175The environment provided with rpm adapts the rpms one to each other.
176
177You notably find:
178\begin{itemize}
179\item default paths
180\item dependances generation
181\item post-installation
182\end{itemize}
183\end{slide}
184
185\begin{slide}{Summary of basic rules}
186\begin{itemize}
187\item document yourself
188\item ask people used to making packages for their distribution
189\item understand rather than work-around
190\item a package well done for a distribution often becomes uncompatible
191with others
192\item get your package integrated to the distribution
193(it's worth doing for other things than rpm)
194\end{itemize}
195\end{slide}
196
197\part{Matter of fact case: Mandriva}
198
199\overlays{2}{
200\begin{slide}{User configuration}
201\begin{itemize}
202\item define your rpm environment
203\item define the packager tag
204\end{itemize}
205
206\FromSlide{2}
207.rpmmacros:
208\bigskip
209\begin{small}
210\listinginput[5]{1}{rpmmacros}
211\end{small}
212\end{slide}
213}
214
215\begin{slide}{package naming policy}
216\begin{itemize}
217\item package name are lowercase (there are some exceptions)
218\item package name should match software name
219\item language modules have package name prefixed by language name
220\end{itemize}
221
222Example:
223\begin{itemize}
224\item perl
225\item rpm
226\item perl-POE
227\end{itemize}
228\end{slide}
229
230\overlays{2}{
231\begin{slide}{mkrel}
232Problems with backport:
233
234\begin{tabular}{|l|l|c|l|}
235\hline
236&cooker&&stable\\
237\hline
238\hline
239without&1mdv&==&1mdv\\
240\hline
241with&1mdk&>&0.1.20060mdk\\
242&1mdv2007.0&>&1mdv2006.0\\
243\hline
244\end{tabular}
245\bigskip
246\FromSlide{2}
247
248Release: 1mdk
249
250becomes:
251
252Release: \%mkrel 1
253
254\end{slide}
255}
256
257\begin{slide}{path for files}
258\begin{itemize}
259\item Prefix has a specific meaning, do not use it
260\item respect the standard paths
261\item prefer macros
262\item /usr/local is reserved for softwares installed without rpm
263\end{itemize}
264\end{slide}
265
266\begin{slide}{standard path}
267\bigskip
268\begin{small}
269\begin{tabular}{|l|l|l|}
270\hline
271path&macro&usage\\
272\hline
273\hline
274/usr&\%\_prefix&general path\\
275\hline
276/etc&\%\_sysconfdir&configuration\\
277\hline
278/usr/bin&\%\_bindir&application\\
279\hline
280/usr/sbin&\%\_sbindir&app. for root\\
281\hline
282/usr/lib&\%\_libdir&libraries\\
283/usr/lib64&&\\
284\hline
285/usr/share&\%\_datadir&data\\
286\hline
287/usr/share/man&\%\_mandir&man pages\\
288\hline
289\end{tabular}
290\end{small}
291\end{slide}
292
293\begin{slide}{compilation and installation}
294Compiling a software:
295
296\begin{itemize}
297\item use the appropriate options (\%optflags)
298\item take care to paths
299\item install files in \%buildroot
300\end{itemize}
301\bigskip
302Simple case with autotools
303
304{\scriptsize\begin{verbatim}
305%build
306%configure
307%make
308
309%install
310%makeinstall_std
311\end{verbatim}
312}
313\end{slide}
314
315\begin{slide}{spec extracts}
316Example of a complicated case:
317
318{\tiny\begin{verbatim}
319export CFLAGS="%optflags"
320./configure \
321    --prefix %_prefix \
322    --bindir %_bindir \
323    --libdir %_libdir
324# parallel make do not work
325make
326
327%install
328make install DEST=%buildroot
329
330#install one file:
331cat > %buildroot%_sysconfdir/%name.cfg <<EOF
332blabla
333EOF
334\end{verbatim}%
335}
336
337\end{slide}
338
339\overlays{3}{
340\begin{slide}{include the files in the package}
341\begin{itemstep}
342\item all files must be listed
343\item use macros
344\item software-specific directories must be included
345\end{itemstep}
346\end{slide}
347}
348
349\overlays{3}{
350\begin{slide}{include the files in the package}
351\begin{itemstep}
352\item configuration files must not be replaced
353
354{\scriptsize%
355\%config(noreplace) \%\_sysconfdir/foo
356}
357
358\item documentations are included with \%doc
359{\scriptsize%
360\%doc README \ldots
361}
362
363\item use \%find\_lang for translations
364
365{\scriptsize%
366\%install\\
367\%find\_lang \%name\\
368\ldots\\
369\%files -f \%name.lang\\
370}
371
372\end{itemstep}
373\end{slide}
374}
375
376\begin{slide}{dependances}
377For binary packages: usually, nothing to do
378
379For sources:
380\begin{itemize}
381\item identical for all architectures
382\item suficient to build the packages
383\item no redundancy
384\end{itemize}
385\bigskip
386Example:
387\begin{verbatim}
388BuildRequires: libfoo-devel
389\end{verbatim}
390\end{slide}
391
392\begin{slide}{libidification}
393Goal:
394\begin{itemize}
395\item have many versions of a library\\
396Name packages using major number
397\item have many architectures\\
398Name package including a prefix
399\end{itemize}
400\bigskip
401{\begin{center}
402\scriptsize
403\begin{tabular}{|c|c|c|}
404\hline
405majeur:&0&1\\
406\hline
40732bits&libfoo0&libfoo1\\
408&lib/foo.so.0&lib/foo.so.1\\
409\hline
41064bits&lib64foo0&lib64foo1\\
411&lib64/foo.so.0&lib64/foo.so.1\\
412\hline
413\end{tabular}
414\end{center}
415}
416
417\end{slide}
418
419\begin{slide}{libidification: use case}
420
421\begin{verbatim}
422%define major 0
423#similar to %_lib%name%major
424%define libname %name %major
425\end{verbatim}
426\ldots
427\begin{verbatim}
428%package -n %libname
429Provide: lib%name = %version-%release
430\end{verbatim}
431\ldots
432\begin{verbatim}
433%files -n %libname
434%defattr(-, root, root, -)
435%_libdir/*.so.*
436\end{verbatim}
437\end{slide}
438
439\part{conclusion}
440
441\begin{slide}{rpmlint}
442Outil pour vérifier que les paquets sont conformes à la politique
443\begin{itemize}
444\item maintained by the wonderful Michaël Scherer
445\item available at \url{http://rpmlint.zarb.org/}
446\end{itemize}
447\bigskip
448{\tiny
449\begin{verbatim}
450$ rpmlint -i rpm-mandriva-setup-1.24-1mdv2007.0.i586.rpm
451E: rpm-mandriva-setup no-binary
452The package should be of the noarch architecture because it
453doesn't contain any binaries.
454
455E: rpm-mandriva-setup only-non-binary-in-usr-lib
456There are only non binary files in /usr/lib so they should
457be in /usr/share.
458
459\end{verbatim}
460}
461\end{slide}
462
463\begin{slide}{The End}
464This document is there: {\scriptsize\url{http://forge.ipsl.jussieu.fr/docipsl/}}.
465
466Mandriva's rpmhowto: {\scriptsize\url{http://qa.mandriva.com/twiki/bin/view/Main/RpmHowTo}}.
467
468\bigskip
469Thanks:
470\begin{itemize}
471\item Guillaume Rousse
472\item Benoît Audouard
473\item Eric Villard
474\item CNRS/ISPL for web hosting
475\end{itemize}
476
477\bigskip
478Questions ?
479
480\end{slide}
481\end{document}
Note: See TracBrowser for help on using the repository browser.