- tsort prefers presentation order.
[platform/upstream/rpm.git] / rpm.spec.in
1 %define with_python_subpackage  @WITH_PYTHON_SUBPACKAGE@
2 %define with_bzip2              @WITH_BZIP2@
3 %define with_apidocs            @WITH_APIDOCS@
4 %define strip_binaries          1
5
6 # XXX legacy requires './' payload prefix to be omitted from rpm packages.
7 %define _noPayloadPrefix        1
8
9 %define __prefix        /usr
10 %{expand:%%define __share %(if [ -d %{__prefix}/share/man ]; then echo /share ; else echo %%{nil} ; fi)}
11
12 Summary: The Red Hat package management system.
13 Name: rpm
14 %define version @VERSION@
15 Version: %{version}
16 Release: 0.27
17 Group: System Environment/Base
18 Source: ftp://ftp.rpm.org/pub/rpm/dist/rpm-4.0.x/rpm-%{version}.tar.gz
19 Copyright: GPL
20 Conflicts: patch < 2.5
21 %ifos linux
22 Prereq: gawk fileutils textutils mktemp
23 Requires: popt
24 %endif
25
26 BuildRequires: db3-devel
27
28 # XXX glibc-2.1.92 has incompatible locale changes that affect statically
29 # XXX linked binaries like /bin/rpm.
30 %ifnarch ia64
31 Requires: glibc >= 2.1.92
32 # XXX needed to avoid libdb.so.2 satisfied by compat/libc5 provides.
33 Requires: db1 = 1.85
34 %endif
35
36 # XXX Red Hat 5.2 has not bzip2 or python
37 %if %{with_bzip2}
38 BuildRequires: bzip2 >= 0.9.0c-2
39 %endif
40 %if %{with_python_subpackage}
41 BuildRequires: python-devel >= 1.5.2
42 %endif
43
44 BuildRoot: %{_tmppath}/%{name}-root
45
46 %description
47 The RPM Package Manager (RPM) is a powerful command line driven
48 package management system capable of installing, uninstalling,
49 verifying, querying, and updating software packages.  Each software
50 package consists of an archive of files along with information about
51 the package like its version, a description, etc.
52
53 %package devel
54 Summary: Development files for applications which will manipulate RPM packages.
55 Group: Development/Libraries
56 Requires: rpm = %{version}, popt
57
58 %description devel
59 This package contains the RPM C library and header files.  These
60 development files will simplify the process of writing programs which
61 manipulate RPM packages and databases. These files are intended to
62 simplify the process of creating graphical package managers or any
63 other tools that need an intimate knowledge of RPM packages in order
64 to function.
65
66 This package should be installed if you want to develop programs that
67 will manipulate RPM packages and databases.
68
69 %package build
70 Summary: Scripts and executable programs used to build packages.
71 Group: Development/Tools
72 Requires: rpm = %{version}
73
74 %description build
75 This package contains scripts and executable programs that are used to
76 build packages using RPM.
77
78 %if %{with_python_subpackage}
79 %package python
80 Summary: Python bindings for apps which will manipulate RPM packages.
81 Group: Development/Libraries
82 BuildRequires: popt >= 1.5
83 Requires: popt >= 1.5
84 Requires: python >= 1.5.2
85
86 %description python
87 The rpm-python package contains a module which permits applications
88 written in the Python programming language to use the interface
89 supplied by RPM (RPM Package Manager) libraries.
90
91 This package should be installed if you want to develop Python
92 programs that will manipulate RPM packages and databases.
93 %endif
94
95 %package -n popt
96 Summary: A C library for parsing command line parameters.
97 Group: Development/Libraries
98 Version: 1.6.2
99
100 %description -n popt
101 Popt is a C library for parsing command line parameters.  Popt was
102 heavily influenced by the getopt() and getopt_long() functions, but it
103 improves on them by allowing more powerful argument expansion.  Popt
104 can parse arbitrary argv[] style arrays and automatically set
105 variables based on command line arguments.  Popt allows command line
106 arguments to be aliased via configuration files and includes utility
107 functions for parsing arbitrary strings into argv[] arrays using
108 shell-like rules.
109
110 Install popt if you're a C programmer and you'd like to use its
111 capabilities.
112
113 %prep
114 %setup -q
115
116 %build
117 %ifos linux
118 CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%{__prefix} --sysconfdir=/etc --localstatedir=/var --infodir='${prefix}%{__share}/info' --mandir='${prefix}%{__share}/man'
119 %else
120 CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%{__prefix}
121 %endif
122
123 make
124
125 %install
126 rm -rf $RPM_BUILD_ROOT
127
128 make DESTDIR="$RPM_BUILD_ROOT" install
129
130 mkdir -p $RPM_BUILD_ROOT/etc/rpm
131 cat << E_O_F > $RPM_BUILD_ROOT/etc/rpm/macros.db1
132 %%_dbapi                1
133 E_O_F
134
135 %if %{strip_binaries}
136 { cd $RPM_BUILD_ROOT
137   strip ./bin/rpm
138   strip .%{__prefix}/bin/rpm2cpio
139 }
140 %endif
141
142 %if %{with_apidocs}
143 gzip -9n apidocs/man/man*/* || :
144 %endif
145
146 %clean
147 rm -rf $RPM_BUILD_ROOT
148
149 %pre
150 if [ -f /var/lib/rpm/Packages -a -f /var/lib/rpm/packages.rpm ]; then
151 #    echo "
152 #You have both
153 #       /var/lib/rpm/packages.rpm       db1 format installed package headers
154 #       /var/lib/rpm/Packages           db3 format installed package headers
155 #Please remove (or at least rename) one of those files, and re-install.
156 #"
157     exit 1
158 fi
159
160 %post
161 %ifos linux
162 /sbin/ldconfig
163 %endif
164 if [ -f /var/lib/rpm/packages.rpm ]; then
165     : # do nothing
166 elif [ -f /var/lib/rpm/Packages ]; then
167     # undo db1 configuration
168     rm -f /etc/rpm/macros.db1
169 else
170     # initialize db3 database
171     rm -f /etc/rpm/macros.db1
172     /bin/rpm --initdb
173 fi
174
175 %ifos linux
176 %postun -p /sbin/ldconfig
177
178 %post devel -p /sbin/ldconfig
179 %postun devel -p /sbin/ldconfig
180
181 %post -n popt -p /sbin/ldconfig
182 %postun -n popt -p /sbin/ldconfig
183 %endif
184
185 %if %{with_python_subpackage}
186 %post python -p /sbin/ldconfig
187 %postun python -p /sbin/ldconfig
188 %endif
189
190 %files
191 %defattr(-,root,root)
192 %doc RPM-PGP-KEY RPM-GPG-KEY CHANGES GROUPS doc/manual/[a-z]*
193 /bin/rpm
194 %dir                    /etc/rpm
195 %config(missingok)      /etc/rpm/macros.db1
196 %{__prefix}/bin/rpm2cpio
197 %{__prefix}/bin/gendiff
198 %{__prefix}/bin/rpmdb
199 %{__prefix}/bin/rpm[eiukqv]
200 %{__prefix}/bin/rpmsign
201 %{__prefix}/bin/rpmquery
202 %{__prefix}/bin/rpmverify
203 %{__prefix}/lib/librpm.so.*
204 %{__prefix}/lib/librpmio.so.*
205 %{__prefix}/lib/librpmbuild.so.*
206
207 %{__prefix}/lib/rpm/config.guess
208 %{__prefix}/lib/rpm/config.sub
209 %{__prefix}/lib/rpm/convertrpmrc.sh
210 %{__prefix}/lib/rpm/macros
211 %{__prefix}/lib/rpm/mkinstalldirs
212 %{__prefix}/lib/rpm/rpmdb
213 %{__prefix}/lib/rpm/rpm[eiukqv]
214 %{__prefix}/lib/rpm/rpmpopt*
215 %{__prefix}/lib/rpm/rpmrc
216
217 %ifarch i386 i486 i586 i686
218 %{__prefix}/lib/rpm/i[3456]86*
219 %endif
220 %ifarch alpha
221 %{__prefix}/lib/rpm/alpha*
222 %endif
223 %ifarch sparc sparc64
224 %{__prefix}/lib/rpm/sparc*
225 %endif
226 %ifarch ia64
227 %{__prefix}/lib/rpm/ia64*
228 %endif
229 %ifarch powerpc ppc
230 %{__prefix}/lib/rpm/ppc*
231 %endif
232 %ifarch armv3l armv4l
233 %{__prefix}/lib/rpm/armv[34][lb]*
234 %endif
235
236 %{__prefix}/*/locale/*/LC_MESSAGES/rpm.mo
237 %{__prefix}%{__share}/man/man[18]/*.[18]*
238 %lang(pl) %{__prefix}%{__share}/man/pl/man[18]/*.[18]*
239 %lang(ru) %{__prefix}%{__share}/man/ru/man[18]/*.[18]*
240 %lang(sk) %{__prefix}%{__share}/man/sk/man[18]/*.[18]*
241
242 %files build
243 %defattr(-,root,root)
244 %dir %{__prefix}/src/redhat
245 %dir %{__prefix}/src/redhat/BUILD
246 %dir %{__prefix}/src/redhat/SPECS
247 %dir %{__prefix}/src/redhat/SOURCES
248 %dir %{__prefix}/src/redhat/SRPMS
249 %dir %{__prefix}/src/redhat/RPMS
250 %{__prefix}/src/redhat/RPMS/*
251 %{__prefix}/bin/rpmbuild
252 %{__prefix}/lib/rpm/brp-*
253 %{__prefix}/lib/rpm/check-prereqs
254 %{__prefix}/lib/rpm/cpanflute
255 %{__prefix}/lib/rpm/find-lang.sh
256 %{__prefix}/lib/rpm/find-prov.pl
257 %{__prefix}/lib/rpm/find-provides
258 %{__prefix}/lib/rpm/find-provides.perl
259 %{__prefix}/lib/rpm/find-req.pl
260 %{__prefix}/lib/rpm/find-requires
261 %{__prefix}/lib/rpm/find-requires.perl
262 %{__prefix}/lib/rpm/get_magic.pl
263 %{__prefix}/lib/rpm/getpo.sh
264 %{__prefix}/lib/rpm/http.req
265 %{__prefix}/lib/rpm/javadeps
266 %{__prefix}/lib/rpm/magic.prov
267 %{__prefix}/lib/rpm/magic.req
268 %{__prefix}/lib/rpm/perl.prov
269 %{__prefix}/lib/rpm/perl.req
270 %{__prefix}/lib/rpm/rpm[bt]
271 %{__prefix}/lib/rpm/rpmdiff
272 %{__prefix}/lib/rpm/rpmdiff.cgi
273 %{__prefix}/lib/rpm/u_pkg.sh
274 %{__prefix}/lib/rpm/vpkg-provides.sh
275 %{__prefix}/lib/rpm/vpkg-provides2.sh
276
277 %if %{with_python_subpackage}
278 %files python
279 %defattr(-,root,root)
280 %{__prefix}/lib/python1.5/site-packages/rpmmodule.so
281 %endif
282
283 %files devel
284 %defattr(-,root,root)
285 %if %{with_apidocs}
286 %doc @WITH_APIDOCS_TARGET@
287 %endif
288 %{__prefix}/include/rpm
289 %{__prefix}/lib/librpm.a
290 %{__prefix}/lib/librpm.la
291 %{__prefix}/lib/librpm.so
292 %{__prefix}/lib/librpmio.a
293 %{__prefix}/lib/librpmio.la
294 %{__prefix}/lib/librpmio.so
295 %{__prefix}/lib/librpmbuild.a
296 %{__prefix}/lib/librpmbuild.la
297 %{__prefix}/lib/librpmbuild.so
298
299 %files -n popt
300 %defattr(-,root,root)
301 %{__prefix}/lib/libpopt.so.*
302 %{__prefix}/*/locale/*/LC_MESSAGES/popt.mo
303 %{__prefix}%{__share}/man/man3/popt.3*
304
305 # XXX These may end up in popt-devel but it hardly seems worth the effort now.
306 %{__prefix}/lib/libpopt.a
307 %{__prefix}/lib/libpopt.la
308 %{__prefix}/lib/libpopt.so
309 %{__prefix}/include/popt.h
310
311 %changelog
312 * Tue Jan 16 2001 Jeff Johnson <jbj@redhat.com>
313 - tsort prefers presentation order.
314
315 * Mon Jan 15 2001 Jeff Johnson <jbj@redhat.com>
316 - fix: extra newline in many error messages (#23947).
317 - fix: rpm -Va with db1 needs per-iterator, not per-index, offset.
318 - add install/remove transaction id tags.
319
320 * Sat Jan 13 2001 Jeff Johnson <jbj@redhat.com>
321 - fix the hack.
322
323 * Fri Jan 12 2001 Jeff Johnson <jbj@redhat.com>
324 - hack: permit installer to determine package ordering using 1000003 tag.
325
326 * Thu Jan 11 2001 Jeff Johnson <jbj@redhat.com>
327 - fix: don't hang on build error.
328 - fix: remove "error: " prefix from signature verification message.
329
330 * Wed Jan 10 2001 Jeff Johnson <jbj@redhat.com>
331 - successors from tsort are processed in presentation order.
332 - fix: find-requires.perl needed update (#23450).
333
334 * Tue Jan  9 2001 Jeff Johnson <jbj@redhat.com>
335 - fix: digests on input FD_t dinna work.
336 - fix: remove rebuilddb debugging leakage.
337
338 * Mon Jan  8 2001 Jeff Johnson <jbj@redhat.com>
339 - tsorted packages processed in successor count order.
340 - fix: resurrect --excludepath (#19666).
341
342 * Fri Jan  5 2001 Jeff Johnson <jbj@redhat.com>
343 - fix: 3 packages from Red Hat 5.2 had bogus %verifyscript tag.
344
345 * Wed Jan  3 2001 Jeff Johnson <jbj@redhat.com>
346 - fix: avoid locale issues with strcasecmp/strncasecmp (#23199).
347 - remove almost all explicit uses of stderr in rpmlib using rpmError().
348 - fix: pass scriptlet args, as in %post -p "/sbin/ldconfig -n /lib".
349         (Rodrigo Barbosa)
350
351 * Tue Jan  2 2001 Jeff Johnson <jbj@redhat.com>
352 - fix apidocs.
353
354 * Mon Jan  1 2001 Jeff Johnson <jbj@redhat.com>
355 - use popt autohelp for rpm helper binaries.
356
357 * Sun Dec 31 2000 Jeff Johnson <jbj@redhat.com>
358 - (popt): fix float/double handling (#19701).
359 - (popt): non-linux needs <float.h> (#22732).
360 - (popt): add POPT_ARGFLAG_OPTIONAL for long options with optional arg.
361 - (popt): diddle auto-help to include type of arg expected.
362
363 * Sat Dec 30 2000 Jeff Johnson <jbj@redhat.com>
364 - (non-linux): move stubs.c to rpmio (#21132).
365 - (python): bind initdb (#20988).
366
367 * Fri Dec 29 2000 Jeff Johnson <jbj@redhat.com>
368 - fix: hack around alpha mis-compilation signature problems.
369 - rpmmodule.c(handleDbResult): return empty list when nothing matches.
370
371 * Thu Dec 28 2000 Jeff Johnson <jbj@redhat.com>
372 - fix: avoid FAT and other brain-dead file systems that have not inodes.
373
374 * Wed Dec 27 2000 Jeff Johnson <jbj@redhat.com>
375 - use malloc'ed buffer for large queries.
376
377 * Tue Dec 26 2000 Jeff Johnson <jbj@redhat.com>
378 - send query/verify output through rpmlog().
379 - resurrect rpmErrorSetCallback() and rpmErrorString().
380
381 * Thu Dec 21 2000 Jeff Johnson <jbj@redhat.com>
382 - immutable headers, once installed by rpm3, need to lose immutablity.
383 - fix: removed headers from db need a headerCopy().
384
385 * Wed Dec 20 2000 Jeff Johnson <jbj@redhat.com>
386 - whiteout mozilla loop for 7.1.
387
388 * Tue Dec 19 2000 Jeff Johnson <jbj@redhat.com>
389 - gendiff: generate ChangeLog patches more intelligently (#22356).
390 - identify install scriptlet failures with the name of the scriptlet.
391 - handle install chroot's identically throughout the install process.
392 - add rpmlib(HeaderLoadSortsTags) for tracking header regions "just in case".
393 - create _tmppath on the fly if not present.
394 - remove /etc/rpm/macros.db1 configuration file if db3 rebuilt.
395
396 * Wed Dec 13 2000 Jeff Johnson <jbj@redhat.com>
397 - bump popt version.
398 - fix: (transaction.c) assume file state normal if tag is missing.
399 - fix: failed signature read headerFree segfault.
400 - fix: revert ALPHA_LOSSAGE, breaks 6.2/i386.
401 - fix: segfault on build path, ignore deleted drips.
402 - fix: synthesized callbacks for removed packages have not a pkgkey.
403
404 * Tue Dec 12 2000 Jeff Johnson <jbj@redhat.com>
405 - bail on header regions.
406 - change dependency loop message to RPMMESS_WARNING to use stderr, not stdout.
407
408 * Sun Dec 10 2000 Jeff Johnson <jbj@redhat.com>
409 - handle added dirtoken tags (mostly) correctly with header regions.
410 - add FHS doc/man/info dirs, diddle autoconf goo.
411 - fix: headerUnload handles headers w/o regions correctly on rebuilddb.
412
413 * Thu Dec  7 2000 Jeff Johnson <jbj@redhat.com>
414 - add rpmtransGetKeys() to retrieve transaction keys in tsort'ed order.
415 - python bindings for rpmtransGetKeys().
416 - fix: include alignment in count when swabbing header region.
417
418 * Wed Dec  6 2000 Jeff Johnson <jbj@redhat.com>
419 - improved find-{requires,provides} for aix4/hpux/irix6/osf.
420                 Tim Mooney<mooney@dogbert.cc.ndsu.NoDak.edu>
421 - portability: remove use of GNU make subst in lib/Makefile (Joe Orton).
422 - python: bind package removal (#21274).
423 - autoconfigure building python bindings.
424 - autoconfigure generating rpm API doco rpm-devel package.
425 - fix: don't fdFree in rpmVerifyScript, rpmtransFree does already.
426 - unify rpmError and rpmMessge interfaces through rpmlog.
427 - collect and display rpm build error messages at end of build.
428 - use package version 3 if --nodirtokens is specified.
429 - add package names to problem sets early, don't save removed header.
430 - make sure that replaced tags in region are counted in headerSizeof().
431 - support for dmalloc debugging.
432 - filter region tags in headerNextIterator, exit throut headerReload.
433
434 * Thu Nov 30 2000 Jeff Johnson <jbj@redhat.com>
435 - add missing headerFree for legacy signature header.
436 - fix: removed packages leaked DIRINDEXES tag data.
437 - reload tags added during install when loading header from rpmdb.
438 - avoid brp-compress hang with both compressed/uncompressed man pages.
439
440 * Tue Nov 21 2000 Jeff Johnson <jbj@redhat.com>
441 - add brp-strip-shared script <rodrigob@conectiva.com.br>.
442 - better item/task progress bars <rodrigob@conectiva.com.br>.
443 - load headers as single contiguous region.
444 - add region marker as RPM_BIN_TYPE in packages and database.
445 - fix: don't headerCopy() relocateable packages if not relocating.
446 - merge signatures into header after reading from package.
447
448 * Mon Nov 20 2000 Jeff Johnson <jbj@redhat.com>
449 - add doxygen and lclint annotations most everywhere.
450 - consistent return for all signature verification.
451 - use enums for almost all rpmlib #define's.
452 - API: change rpmProblem typedef to pass by reference, not value.
453 - don't trim leading ./ in rpmCleanPath() (#14961).
454 - detect (still need to test) rdonly linux file systems.
455 - check available inodes as well as blocks on mounted file systems.
456 - pass rpmTransactionSet, not elements, to installBinaryPackage et al.
457 - add cscope/ctags (Rodrigo Barbosa<rodrigob@conectiva.com.br>).
458 - remove getMacroBody() from rpmio API.
459 - add support for unzip <rodrigob@conectiva.com.br>
460
461 * Thu Nov 16 2000 Jeff Johnson <jbj@redhat.com>
462 - don't verify src rpm MD5 sums (yet).
463 - md5 sums are little endian (no swap) so big endian needs the swap.
464
465 * Wed Nov 15 2000 Jeff Johnson <jbj@redhat.com>
466 - fix: segfault on exit of "rpm -qp --qf '%{#fsnames}' pkg" (#20595).
467 - hpux w/o -D_OPEN_SOURCE has not h_errno.
468 - verify MD5 sums of payload files when unpacking archive.
469 - hide libio lossage in prototype, not API.
470 - add support for SHA1 as well as MD5 message digests.
471
472 * Mon Nov 13 2000 Jeff Johnson <jbj@redhat.com>
473 - fix: work around for (mis-compilation?!) segfaults on signature paths.
474
475 * Sun Nov 12 2000 Jeff Johnson <jbj@redhat.com>
476 - fix: duplicate headerFree() on instalBinaryPackage() error return.
477
478 * Sat Nov 11 2000 Jeff Johnson <jbj@redhat.com>
479 - fix: runTriggers was not adding countCorrection.
480 - add rpmGetRpmlibProvides() to retrieve rpmlib(...) provides
481         "Pawel A. Gajda" <mis@k2.net.pl>.
482 - syntax to specify source of Requires: (PreReq: now legacy).
483 - rip out rpm{get,put}text, use getpo.sh and specspo instead.
484 - fine-grained Requires, remove install PreReq's from Requires db.
485
486 * Wed Oct 11 2000 Jeff Johnson <jbj@redhat.com>
487 - fix: rpm2cpio error check wrong on non-libio platforms.
488
489 * Fri Sep 29 2000 Jeff Johnson <jbj@redhat.com>
490 - fix: more (possible) xstrdup side effects.
491
492 * Wed Sep 27 2000 Jeff Johnson <jbj@redhat.com>
493 - bump popt version to 1.6.1.
494
495 * Tue Sep 26 2000 Jeff Johnson <jbj@redhat.com>
496 - fix: avoid calling getpass twice as side effect of xstrdup macro (#17672).
497 - order packages using tsort, clipping PreReq:'s in dependency loops.
498 - handle possible db3 dependency on -lpthread more gracefully.
499
500 * Thu Sep 14 2000 Jeff Johnson <jbj@redhat.com>
501 - start rpm-4.0.1.