fix: grrr, post increment off by 1 iterator.
[platform/upstream/rpm.git] / rpm.spec
1 %define with_python_subpackage  1
2 %define with_bzip2              1
3 %define with_apidocs            1
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 4.0.3
15 Version: %{version}
16 Release: 0.1
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 exit 0
160
161 %post
162 %ifos linux
163 /sbin/ldconfig
164 %endif
165 if [ -f /var/lib/rpm/packages.rpm ]; then
166     : # do nothing
167 elif [ -f /var/lib/rpm/Packages ]; then
168     # undo db1 configuration
169     rm -f /etc/rpm/macros.db1
170 else
171     # initialize db3 database
172     rm -f /etc/rpm/macros.db1
173     /bin/rpm --initdb
174 fi
175
176 %ifos linux
177 %postun -p /sbin/ldconfig
178
179 %post devel -p /sbin/ldconfig
180 %postun devel -p /sbin/ldconfig
181
182 %post -n popt -p /sbin/ldconfig
183 %postun -n popt -p /sbin/ldconfig
184 %endif
185
186 %if %{with_python_subpackage}
187 %post python -p /sbin/ldconfig
188 %postun python -p /sbin/ldconfig
189 %endif
190
191 %files
192 %defattr(-,root,root)
193 %doc RPM-PGP-KEY RPM-GPG-KEY CHANGES GROUPS doc/manual/[a-z]*
194 /bin/rpm
195 %dir                    /etc/rpm
196 %config(missingok)      /etc/rpm/macros.db1
197 %{__prefix}/bin/rpm2cpio
198 %{__prefix}/bin/gendiff
199 %{__prefix}/bin/rpmdb
200 %{__prefix}/bin/rpm[eiukqv]
201 %{__prefix}/bin/rpmsign
202 %{__prefix}/bin/rpmquery
203 %{__prefix}/bin/rpmverify
204 %{__prefix}/lib/librpm.so.*
205 %{__prefix}/lib/librpmio.so.*
206 %{__prefix}/lib/librpmbuild.so.*
207
208 %{__prefix}/lib/rpm/config.guess
209 %{__prefix}/lib/rpm/config.sub
210 %{__prefix}/lib/rpm/convertrpmrc.sh
211 %{__prefix}/lib/rpm/macros
212 %{__prefix}/lib/rpm/mkinstalldirs
213 %{__prefix}/lib/rpm/rpmdb
214 %{__prefix}/lib/rpm/rpm[eiukqv]
215 %{__prefix}/lib/rpm/rpmpopt*
216 %{__prefix}/lib/rpm/rpmrc
217
218 %ifarch i386 i486 i586 i686
219 %{__prefix}/lib/rpm/i[3456]86*
220 %endif
221 %ifarch alpha
222 %{__prefix}/lib/rpm/alpha*
223 %endif
224 %ifarch sparc sparc64
225 %{__prefix}/lib/rpm/sparc*
226 %endif
227 %ifarch ia64
228 %{__prefix}/lib/rpm/ia64*
229 %endif
230 %ifarch powerpc ppc
231 %{__prefix}/lib/rpm/ppc*
232 %endif
233 %ifarch armv3l armv4l
234 %{__prefix}/lib/rpm/armv[34][lb]*
235 %endif
236
237 %{__prefix}/*/locale/*/LC_MESSAGES/rpm.mo
238 %{__prefix}%{__share}/man/man[18]/*.[18]*
239 %lang(pl) %{__prefix}%{__share}/man/pl/man[18]/*.[18]*
240 %lang(ru) %{__prefix}%{__share}/man/ru/man[18]/*.[18]*
241 %lang(sk) %{__prefix}%{__share}/man/sk/man[18]/*.[18]*
242
243 %files build
244 %defattr(-,root,root)
245 %dir %{__prefix}/src/redhat
246 %dir %{__prefix}/src/redhat/BUILD
247 %dir %{__prefix}/src/redhat/SPECS
248 %dir %{__prefix}/src/redhat/SOURCES
249 %dir %{__prefix}/src/redhat/SRPMS
250 %dir %{__prefix}/src/redhat/RPMS
251 %{__prefix}/src/redhat/RPMS/*
252 %{__prefix}/bin/rpmbuild
253 %{__prefix}/lib/rpm/brp-*
254 %{__prefix}/lib/rpm/check-prereqs
255 %{__prefix}/lib/rpm/cpanflute
256 %{__prefix}/lib/rpm/find-lang.sh
257 %{__prefix}/lib/rpm/find-prov.pl
258 %{__prefix}/lib/rpm/find-provides
259 %{__prefix}/lib/rpm/find-provides.perl
260 %{__prefix}/lib/rpm/find-req.pl
261 %{__prefix}/lib/rpm/find-requires
262 %{__prefix}/lib/rpm/find-requires.perl
263 %{__prefix}/lib/rpm/get_magic.pl
264 %{__prefix}/lib/rpm/getpo.sh
265 %{__prefix}/lib/rpm/http.req
266 %{__prefix}/lib/rpm/javadeps
267 %{__prefix}/lib/rpm/magic.prov
268 %{__prefix}/lib/rpm/magic.req
269 %{__prefix}/lib/rpm/perl.prov
270 %{__prefix}/lib/rpm/perl.req
271 %{__prefix}/lib/rpm/rpm[bt]
272 %{__prefix}/lib/rpm/rpmdiff
273 %{__prefix}/lib/rpm/rpmdiff.cgi
274 %{__prefix}/lib/rpm/u_pkg.sh
275 %{__prefix}/lib/rpm/vpkg-provides.sh
276 %{__prefix}/lib/rpm/vpkg-provides2.sh
277
278 %if %{with_python_subpackage}
279 %files python
280 %defattr(-,root,root)
281 %{__prefix}/lib/python1.5/site-packages/rpmmodule.so
282 %endif
283
284 %files devel
285 %defattr(-,root,root)
286 %if %{with_apidocs}
287 %doc apidocs
288 %endif
289 %{__prefix}/include/rpm
290 %{__prefix}/lib/librpm.a
291 %{__prefix}/lib/librpm.la
292 %{__prefix}/lib/librpm.so
293 %{__prefix}/lib/librpmio.a
294 %{__prefix}/lib/librpmio.la
295 %{__prefix}/lib/librpmio.so
296 %{__prefix}/lib/librpmbuild.a
297 %{__prefix}/lib/librpmbuild.la
298 %{__prefix}/lib/librpmbuild.so
299
300 %files -n popt
301 %defattr(-,root,root)
302 %{__prefix}/lib/libpopt.so.*
303 %{__prefix}/*/locale/*/LC_MESSAGES/popt.mo
304 %{__prefix}%{__share}/man/man3/popt.3*
305
306 # XXX These may end up in popt-devel but it hardly seems worth the effort now.
307 %{__prefix}/lib/libpopt.a
308 %{__prefix}/lib/libpopt.la
309 %{__prefix}/lib/libpopt.so
310 %{__prefix}/include/popt.h
311
312 %changelog
313 * Fri Jan 19 2001 Jeff Johnson <jbj@redhat.com>
314 - ewt's cpio.c hack.
315 - ewt's cpio.c hack reverted.
316
317 * Thu Jan 18 2001 Matt Wilson <msw@redhat.com>
318 - fix: exit 0 at the end of %pre
319
320 * Thu Jan 18 2001 Jeff Johnson <jbj@redhat.com>
321 - fix: insure that %lang scopes over hard links correctly.
322 - fix: rpmCleanPath was nibbling at .. in macrofiles incorrectly.
323
324 * Wed Jan 17 2001 Jeff Johnson <jbj@redhat.com>
325 - 1st crack at Mandrake specific per-platform macros.
326
327 * Tue Jan 16 2001 Jeff Johnson <jbj@redhat.com>
328 - tsort prefers presentation order.
329
330 * Mon Jan 15 2001 Jeff Johnson <jbj@redhat.com>
331 - fix: extra newline in many error messages (#23947).
332 - fix: rpm -Va with db1 needs per-iterator, not per-index, offset.
333 - add install/remove transaction id tags.
334
335 * Sat Jan 13 2001 Jeff Johnson <jbj@redhat.com>
336 - fix the hack.
337
338 * Fri Jan 12 2001 Jeff Johnson <jbj@redhat.com>
339 - hack: permit installer to determine package ordering using 1000003 tag.
340
341 * Thu Jan 11 2001 Jeff Johnson <jbj@redhat.com>
342 - fix: don't hang on build error.
343 - fix: remove "error: " prefix from signature verification message.
344
345 * Wed Jan 10 2001 Jeff Johnson <jbj@redhat.com>
346 - successors from tsort are processed in presentation order.
347 - fix: find-requires.perl needed update (#23450).
348
349 * Tue Jan  9 2001 Jeff Johnson <jbj@redhat.com>
350 - fix: digests on input FD_t dinna work.
351 - fix: remove rebuilddb debugging leakage.
352
353 * Mon Jan  8 2001 Jeff Johnson <jbj@redhat.com>
354 - tsorted packages processed in successor count order.
355 - fix: resurrect --excludepath (#19666).
356
357 * Fri Jan  5 2001 Jeff Johnson <jbj@redhat.com>
358 - fix: 3 packages from Red Hat 5.2 had bogus %verifyscript tag.
359
360 * Wed Jan  3 2001 Jeff Johnson <jbj@redhat.com>
361 - fix: avoid locale issues with strcasecmp/strncasecmp (#23199).
362 - remove almost all explicit uses of stderr in rpmlib using rpmError().
363 - fix: pass scriptlet args, as in %post -p "/sbin/ldconfig -n /lib".
364         (Rodrigo Barbosa)
365
366 * Tue Jan  2 2001 Jeff Johnson <jbj@redhat.com>
367 - fix apidocs.
368
369 * Mon Jan  1 2001 Jeff Johnson <jbj@redhat.com>
370 - use popt autohelp for rpm helper binaries.
371
372 * Sun Dec 31 2000 Jeff Johnson <jbj@redhat.com>
373 - (popt): fix float/double handling (#19701).
374 - (popt): non-linux needs <float.h> (#22732).
375 - (popt): add POPT_ARGFLAG_OPTIONAL for long options with optional arg.
376 - (popt): diddle auto-help to include type of arg expected.
377
378 * Sat Dec 30 2000 Jeff Johnson <jbj@redhat.com>
379 - (non-linux): move stubs.c to rpmio (#21132).
380 - (python): bind initdb (#20988).
381
382 * Fri Dec 29 2000 Jeff Johnson <jbj@redhat.com>
383 - fix: hack around alpha mis-compilation signature problems.
384 - rpmmodule.c(handleDbResult): return empty list when nothing matches.
385
386 * Thu Dec 28 2000 Jeff Johnson <jbj@redhat.com>
387 - fix: avoid FAT and other brain-dead file systems that have not inodes.
388
389 * Wed Dec 27 2000 Jeff Johnson <jbj@redhat.com>
390 - use malloc'ed buffer for large queries.
391
392 * Tue Dec 26 2000 Jeff Johnson <jbj@redhat.com>
393 - send query/verify output through rpmlog().
394 - resurrect rpmErrorSetCallback() and rpmErrorString().
395
396 * Thu Dec 21 2000 Jeff Johnson <jbj@redhat.com>
397 - immutable headers, once installed by rpm3, need to lose immutablity.
398 - fix: removed headers from db need a headerCopy().
399
400 * Wed Dec 20 2000 Jeff Johnson <jbj@redhat.com>
401 - whiteout mozilla loop for 7.1.
402
403 * Tue Dec 19 2000 Jeff Johnson <jbj@redhat.com>
404 - gendiff: generate ChangeLog patches more intelligently (#22356).
405 - identify install scriptlet failures with the name of the scriptlet.
406 - handle install chroot's identically throughout the install process.
407 - add rpmlib(HeaderLoadSortsTags) for tracking header regions "just in case".
408 - create _tmppath on the fly if not present.
409 - remove /etc/rpm/macros.db1 configuration file if db3 rebuilt.
410
411 * Wed Dec 13 2000 Jeff Johnson <jbj@redhat.com>
412 - bump popt version.
413 - fix: (transaction.c) assume file state normal if tag is missing.
414 - fix: failed signature read headerFree segfault.
415 - fix: revert ALPHA_LOSSAGE, breaks 6.2/i386.
416 - fix: segfault on build path, ignore deleted drips.
417 - fix: synthesized callbacks for removed packages have not a pkgkey.
418
419 * Tue Dec 12 2000 Jeff Johnson <jbj@redhat.com>
420 - bail on header regions.
421 - change dependency loop message to RPMMESS_WARNING to use stderr, not stdout.
422
423 * Sun Dec 10 2000 Jeff Johnson <jbj@redhat.com>
424 - handle added dirtoken tags (mostly) correctly with header regions.
425 - add FHS doc/man/info dirs, diddle autoconf goo.
426 - fix: headerUnload handles headers w/o regions correctly on rebuilddb.
427
428 * Thu Dec  7 2000 Jeff Johnson <jbj@redhat.com>
429 - add rpmtransGetKeys() to retrieve transaction keys in tsort'ed order.
430 - python bindings for rpmtransGetKeys().
431 - fix: include alignment in count when swabbing header region.
432
433 * Wed Dec  6 2000 Jeff Johnson <jbj@redhat.com>
434 - improved find-{requires,provides} for aix4/hpux/irix6/osf.
435                 Tim Mooney<mooney@dogbert.cc.ndsu.NoDak.edu>
436 - portability: remove use of GNU make subst in lib/Makefile (Joe Orton).
437 - python: bind package removal (#21274).
438 - autoconfigure building python bindings.
439 - autoconfigure generating rpm API doco rpm-devel package.
440 - fix: don't fdFree in rpmVerifyScript, rpmtransFree does already.
441 - unify rpmError and rpmMessge interfaces through rpmlog.
442 - collect and display rpm build error messages at end of build.
443 - use package version 3 if --nodirtokens is specified.
444 - add package names to problem sets early, don't save removed header.
445 - make sure that replaced tags in region are counted in headerSizeof().
446 - support for dmalloc debugging.
447 - filter region tags in headerNextIterator, exit throut headerReload.
448
449 * Thu Nov 30 2000 Jeff Johnson <jbj@redhat.com>
450 - add missing headerFree for legacy signature header.
451 - fix: removed packages leaked DIRINDEXES tag data.
452 - reload tags added during install when loading header from rpmdb.
453 - avoid brp-compress hang with both compressed/uncompressed man pages.
454
455 * Tue Nov 21 2000 Jeff Johnson <jbj@redhat.com>
456 - add brp-strip-shared script <rodrigob@conectiva.com.br>.
457 - better item/task progress bars <rodrigob@conectiva.com.br>.
458 - load headers as single contiguous region.
459 - add region marker as RPM_BIN_TYPE in packages and database.
460 - fix: don't headerCopy() relocateable packages if not relocating.
461 - merge signatures into header after reading from package.
462
463 * Mon Nov 20 2000 Jeff Johnson <jbj@redhat.com>
464 - add doxygen and lclint annotations most everywhere.
465 - consistent return for all signature verification.
466 - use enums for almost all rpmlib #define's.
467 - API: change rpmProblem typedef to pass by reference, not value.
468 - don't trim leading ./ in rpmCleanPath() (#14961).
469 - detect (still need to test) rdonly linux file systems.
470 - check available inodes as well as blocks on mounted file systems.
471 - pass rpmTransactionSet, not elements, to installBinaryPackage et al.
472 - add cscope/ctags (Rodrigo Barbosa<rodrigob@conectiva.com.br>).
473 - remove getMacroBody() from rpmio API.
474 - add support for unzip <rodrigob@conectiva.com.br>
475
476 * Thu Nov 16 2000 Jeff Johnson <jbj@redhat.com>
477 - don't verify src rpm MD5 sums (yet).
478 - md5 sums are little endian (no swap) so big endian needs the swap.
479
480 * Wed Nov 15 2000 Jeff Johnson <jbj@redhat.com>
481 - fix: segfault on exit of "rpm -qp --qf '%{#fsnames}' pkg" (#20595).
482 - hpux w/o -D_OPEN_SOURCE has not h_errno.
483 - verify MD5 sums of payload files when unpacking archive.
484 - hide libio lossage in prototype, not API.
485 - add support for SHA1 as well as MD5 message digests.
486
487 * Mon Nov 13 2000 Jeff Johnson <jbj@redhat.com>
488 - fix: work around for (mis-compilation?!) segfaults on signature paths.
489
490 * Sun Nov 12 2000 Jeff Johnson <jbj@redhat.com>
491 - fix: duplicate headerFree() on instalBinaryPackage() error return.
492
493 * Sat Nov 11 2000 Jeff Johnson <jbj@redhat.com>
494 - fix: runTriggers was not adding countCorrection.
495 - add rpmGetRpmlibProvides() to retrieve rpmlib(...) provides
496         "Pawel A. Gajda" <mis@k2.net.pl>.
497 - syntax to specify source of Requires: (PreReq: now legacy).
498 - rip out rpm{get,put}text, use getpo.sh and specspo instead.
499 - fine-grained Requires, remove install PreReq's from Requires db.
500
501 * Wed Oct 11 2000 Jeff Johnson <jbj@redhat.com>
502 - fix: rpm2cpio error check wrong on non-libio platforms.
503
504 * Fri Sep 29 2000 Jeff Johnson <jbj@redhat.com>
505 - fix: more (possible) xstrdup side effects.
506
507 * Wed Sep 27 2000 Jeff Johnson <jbj@redhat.com>
508 - bump popt version to 1.6.1.
509
510 * Tue Sep 26 2000 Jeff Johnson <jbj@redhat.com>
511 - fix: avoid calling getpass twice as side effect of xstrdup macro (#17672).
512 - order packages using tsort, clipping PreReq:'s in dependency loops.
513 - handle possible db3 dependency on -lpthread more gracefully.
514
515 * Thu Sep 14 2000 Jeff Johnson <jbj@redhat.com>
516 - start rpm-4.0.1.