source: trunk/fairerpms/presentation_en.tex @ 111

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

r1202@localhost: olivier | 2006-07-03 21:50:11 +0200

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