source: trunk/fairerpms/presentation_en.tex @ 114

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

r1207@localhost: olivier | 2006-07-04 14:54:56 +0200

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