source: trunk/fairerpms/presentation_en.tex @ 116

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

r2160@localhost: olivier | 2006-07-07 00:08:59 +0200

  • uppercase slide title
  • translate a forgotten sentense
  • add an overlays
  • Property svn:keywords set to Id
File size: 8.9 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\overlays{2}{
158\begin{slide}{Root is evil}
159Do not build as root,\\
160Do not build as root,\\
161And do not build as root.\\
162\FromSlide{2}
163\bigskip
164
165Risks :
166\begin{itemize}
167\item pollute your system
168\item skip errors unwillingly
169\item compromission, corruption of your system
170\item cannot be done on the compile-server
171\item it gives buttons
172%\item It makes you impotent
173\end{itemize}
174\end{slide}
175}
176
177\begin{slide}{Do not change the config}
178The environment provided with rpm adapts the rpms one to each other.
179
180You notably find:
181\begin{itemize}
182\item default paths
183\item dependances generation
184\item post-installation
185\end{itemize}
186\end{slide}
187
188\begin{slide}{Summary of basic rules}
189\begin{itemize}
190\item document yourself
191\item ask people used to making packages for their distribution
192\item understand rather than work-around
193\item a package well done for a distribution often becomes uncompatible
194with others
195\item get your package integrated to the distribution
196(it's worth doing for other things than rpm)
197\end{itemize}
198\end{slide}
199
200\part{Matter of fact case: Mandriva}
201
202\overlays{2}{
203\begin{slide}{User configuration}
204\begin{itemize}
205\item define your rpm environment
206\item define the packager tag
207\end{itemize}
208
209\FromSlide{2}
210.rpmmacros:
211\bigskip
212\begin{small}
213\listinginput[5]{1}{rpmmacros}
214\end{small}
215\end{slide}
216}
217
218\begin{slide}{Package naming policy}
219\begin{itemize}
220\item package name are lowercase (there are some exceptions)
221\item package name should match software name
222\item language modules have package name prefixed by language name
223\end{itemize}
224
225Example:
226\begin{itemize}
227\item perl
228\item rpm
229\item perl-POE
230\end{itemize}
231\end{slide}
232
233\overlays{2}{
234\begin{slide}{\%mkrel}
235Problems with backport:
236
237\begin{tabular}{|l|l|c|l|}
238\hline
239&cooker&&stable\\
240\hline
241\hline
242without&1mdv&==&1mdv\\
243\hline
244with&1mdk&>&0.1.20060mdk\\
245&1mdv2007.0&>&1mdv2006.0\\
246\hline
247\end{tabular}
248\bigskip
249\FromSlide{2}
250
251Release: 1mdk
252
253becomes:
254
255Release: \%mkrel 1
256
257\end{slide}
258}
259
260\begin{slide}{Path for files}
261\begin{itemize}
262\item Prefix has a specific meaning, do not use it
263\item respect the standard paths
264\item prefer macros
265\item /usr/local is reserved for softwares installed without rpm
266\end{itemize}
267\end{slide}
268
269\begin{slide}{Standard path}
270\bigskip
271\begin{small}
272\begin{tabular}{|l|l|l|}
273\hline
274path&macro&usage\\
275\hline
276\hline
277/usr&\%\_prefix&general path\\
278\hline
279/etc&\%\_sysconfdir&configuration\\
280\hline
281/usr/bin&\%\_bindir&application\\
282\hline
283/usr/sbin&\%\_sbindir&app. for root\\
284\hline
285/usr/lib&\%\_libdir&libraries\\
286/usr/lib64&&\\
287\hline
288/usr/share&\%\_datadir&data\\
289\hline
290/usr/share/man&\%\_mandir&man pages\\
291\hline
292\end{tabular}
293\end{small}
294\end{slide}
295
296\begin{slide}{Compilation and installation}
297Compiling a software:
298
299\begin{itemize}
300\item use the appropriate options (\%optflags)
301\item take care to paths
302\item install files in \%buildroot
303\end{itemize}
304\bigskip
305Simple case with autotools
306
307{\scriptsize\begin{verbatim}
308%build
309%configure
310%make
311
312%install
313%makeinstall_std
314\end{verbatim}
315}
316\end{slide}
317
318\begin{slide}{Spec extracts}
319Example of a complicated case:
320
321{\tiny\begin{verbatim}
322export CFLAGS="%optflags"
323./configure \
324    --prefix %_prefix \
325    --bindir %_bindir \
326    --libdir %_libdir
327# parallel make do not work
328make
329
330%install
331make install DEST=%buildroot
332
333#install one file:
334cat > %buildroot%_sysconfdir/%name.cfg <<EOF
335blabla
336EOF
337\end{verbatim}%
338}
339
340\end{slide}
341
342\overlays{3}{
343\begin{slide}{Include the files in the package}
344\begin{itemstep}
345\item all files must be listed
346\item use macros
347\item software-specific directories must be included
348\end{itemstep}
349\end{slide}
350}
351
352\overlays{3}{
353\begin{slide}{Include the files in the package}
354\begin{itemstep}
355\item configuration files must not be replaced
356
357{\scriptsize%
358\%config(noreplace) \%\_sysconfdir/foo
359}
360
361\item documentations are included with \%doc
362{\scriptsize%
363\%doc README \ldots
364}
365
366\item use \%find\_lang for translations
367
368{\scriptsize%
369\%install\\
370\%find\_lang \%name\\
371\ldots\\
372\%files -f \%name.lang\\
373}
374
375\end{itemstep}
376\end{slide}
377}
378
379\begin{slide}{Dependances}
380For binary packages: usually, nothing to do
381
382For sources:
383\begin{itemize}
384\item identical for all architectures
385\item suficient to build the packages
386\item no redundancy
387\end{itemize}
388\bigskip
389Example:
390\begin{verbatim}
391BuildRequires: libfoo-devel
392\end{verbatim}
393\end{slide}
394
395\begin{slide}{Libidification}
396Goal:
397\begin{itemize}
398\item have many versions of a library\\
399Name packages using major number
400\item have many architectures\\
401Name package including a prefix
402\end{itemize}
403\bigskip
404{\begin{center}
405\scriptsize
406\begin{tabular}{|c|c|c|}
407\hline
408majeur:&0&1\\
409\hline
41032bits&libfoo0&libfoo1\\
411&lib/foo.so.0&lib/foo.so.1\\
412\hline
41364bits&lib64foo0&lib64foo1\\
414&lib64/foo.so.0&lib64/foo.so.1\\
415\hline
416\end{tabular}
417\end{center}
418}
419
420\end{slide}
421
422\begin{slide}{Libidification: use case}
423
424\begin{verbatim}
425%define major 0
426#similar to %_lib%name%major
427%define libname %name %major
428\end{verbatim}
429\ldots
430\begin{verbatim}
431%package -n %libname
432Provide: lib%name = %version-%release
433\end{verbatim}
434\ldots
435\begin{verbatim}
436%files -n %libname
437%defattr(-, root, root, -)
438%_libdir/*.so.*
439\end{verbatim}
440\end{slide}
441
442\part{conclusion}
443
444\begin{slide}{rpmlint}
445Tool to check packages complies to the policy
446\begin{itemize}
447\item maintained by the wonderful Michaël Scherer
448\item available at \url{http://rpmlint.zarb.org/}
449\end{itemize}
450\bigskip
451{\tiny
452\begin{verbatim}
453$ rpmlint -i rpm-mandriva-setup-1.24-1mdv2007.0.i586.rpm
454E: rpm-mandriva-setup no-binary
455The package should be of the noarch architecture because it
456doesn't contain any binaries.
457
458E: rpm-mandriva-setup only-non-binary-in-usr-lib
459There are only non binary files in /usr/lib so they should
460be in /usr/share.
461
462\end{verbatim}
463}
464\end{slide}
465
466\begin{slide}{The End}
467This document is there: {\scriptsize\url{http://forge.ipsl.jussieu.fr/docipsl/}}.
468
469Mandriva's rpmhowto: {\scriptsize\url{http://qa.mandriva.com/twiki/bin/view/Main/RpmHowTo}}.
470
471\bigskip
472Thanks:
473\begin{itemize}
474\item Guillaume Rousse
475\item Benoît Audouard
476\item Eric Villard
477\item CNRS/ISPL for web hosting
478\end{itemize}
479
480\bigskip
481Questions ?
482
483\end{slide}
484\end{document}
Note: See TracBrowser for help on using the repository browser.