From 0d5ea219853edb5872fff3b5145ccd1c5783df14 Mon Sep 17 00:00:00 2001 From: jbj Date: Mon, 4 Dec 2000 00:55:17 +0000 Subject: [PATCH] Sync with rpm-4_0 branch. CVS patchset: 4315 CVS date: 2000/12/04 00:55:17 --- .cvsignore | 1 + CHANGES | 3 + Doxyfile.in | 4 +- Doxyheader | 2 - Makefile.am | 17 ++- configure.in | 66 +++++++++- lib/rpmlib.h | 2 +- lib/rpmrc.c | 2 + lib/verify.c | 1 - macros.in | 3 +- perl/Makefile.in | 7 + po/rpm.pot | 44 +++---- python/Makefile.in | 7 + python/upgrade.c | 32 ++--- rpm.spec | 150 +++++++++++++++++---- rpm.spec.in | 379 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 16 files changed, 638 insertions(+), 82 deletions(-) create mode 100644 rpm.spec.in diff --git a/.cvsignore b/.cvsignore index f5ae788..e617aed 100644 --- a/.cvsignore +++ b/.cvsignore @@ -5,6 +5,7 @@ Doxyfile Makefile Makefile.in +apidocs config.cache config.guess config.h diff --git a/CHANGES b/CHANGES index d6c6599..b66d775 100644 --- a/CHANGES +++ b/CHANGES @@ -47,6 +47,9 @@ Tim Mooney - portability: remove use of GNU make subst in lib/Makefile (Joe Orton). - python: bind package removal (#21274). + - autoconfigure building python bindings. + - autoconfigure generating rpm API doco. + - fix: don't fdFree in rpmVerifyScript, rpmtransFree does already. 3.0.6 -> 4.0 - use DIRNAMES/BASENAMES/DIRINDICES not FILENAMES in packages and db. diff --git a/Doxyfile.in b/Doxyfile.in index e2b1c22..ef39676 100644 --- a/Doxyfile.in +++ b/Doxyfile.in @@ -29,7 +29,7 @@ PROJECT_NUMBER = @VERSION@ # If a relative path is entered, it will be relative to the location # where doxygen was started. If left blank the current directory will be used. -OUTPUT_DIRECTORY = doxygen +OUTPUT_DIRECTORY = @WITH_APIDOCS_TARGET@ # The OUTPUT_LANGUAGE tag is used to specify the language in which all # documentation generated by doxygen is written. Doxygen will use this @@ -277,7 +277,6 @@ INPUT = \ ./lib/cpio.c \ ./lib/cpio.h \ ./lib/db1.c \ - ./lib/db2.c \ ./lib/db3.c \ ./lib/depends.c \ ./lib/depends.h \ @@ -324,6 +323,7 @@ INPUT = \ ./lib/verify.c \ ./rpmio/base64.c \ ./rpmio/base64.h \ + ./rpmio/digest.c \ ./rpmio/macro.c \ ./rpmio/md5.c \ ./rpmio/rpmlog.c \ diff --git a/Doxyheader b/Doxyheader index 0b59280..c47a840 100644 --- a/Doxyheader +++ b/Doxyheader @@ -24,8 +24,6 @@ */ /** \defgroup db1 DB1. */ -/** \defgroup db2 DB2. - */ /** \defgroup db3 DB3. */ /** \defgroup rpmrpc RPMRPC. diff --git a/Makefile.am b/Makefile.am index 178182f..ddd3544 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2,13 +2,13 @@ AUTOMAKE_OPTIONS = 1.4 foreign -EXTRA_DIST = CHANGES CREDITS GROUPS README.amiga INSTALL \ +EXTRA_DIST = CHANGES CREDITS Doxyheader GROUPS README.amiga INSTALL \ RPM-GPG-KEY RPM-PGP-KEY \ autodeps/none autodeps/*.prov autodeps/*.req autogen.sh \ gendiff installplatform platform* \ po/*.in po/*.po po/rpm.pot \ python/*.am python/*.in python/*.c python/*.h python/testit \ - rpm.magic rpmpopt-$(VERSION) rpmqv.c rpm.spec + rpm.magic rpmpopt-$(VERSION) rpmqv.c # XXX TODO: python perl SUBDIRS = intl po popt rpmio lib build misc tools scripts tests doc . @@ -81,10 +81,10 @@ rpmq.o: rpmqv.c $(COMPILE) -DIAM_RPMQV -o $@ -c $< rpm2cpio_SOURCES = rpm2cpio.c -rpm2cpio_LDFLAGS = $(myLDFLAGS) +rpm2cpio_LDFLAGS = @LDFLAGS_STATIC@ $(myLDFLAGS) rpm2cpio_LDADD = $(myLDADD) @LIBMISC@ -$(PROGRAMS): $(myLDADD) +$(PROGRAMS): $(myLDADD) @WITH_APIDOCS_TARGET@ .PHONY: lclint lclint: @@ -145,7 +145,6 @@ install-data-local: @$(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/SRPMS @$(mkinstalldirs) $(DESTDIR)/var/tmp - .PHONY: tar tar: rm -rf /tmp/rpm-$(VERSION) @@ -177,10 +176,10 @@ archive: nextsrpm: all archive @sudo ./rpm -ta rpm-$(VERSION).tar.gz -.PHONY: doxygen -doxygen: Doxyfile - rm -rf doxygen - mkdir -p doxygen +.PHONY: doxygen +doxygen @WITH_APIDOCS_TARGET@: Doxyfile + rm -rf $@ + mkdir -p $@ doxygen ctags: diff --git a/configure.in b/configure.in index 5a730bb..530954a 100644 --- a/configure.in +++ b/configure.in @@ -197,6 +197,7 @@ dnl XXX Watchout for square brackets fed to m4. AC_PATH_PROG(__PERL, perl, /usr/bin/perl, $MYPATH) AC_PATH_PROG(PGPBIN, pgp, /usr/bin/pgp, $MYPATH) + AC_PATH_PROG(__PYTHON, python, /usr/bin/python, $MYPATH) AC_PATH_PROG(__RM, rm, /bin/rm, $MYPATH) AC_PATH_PROG(__RSH, rsh, /usr/bin/rsh, $MYPATH) AC_PATH_PROG(__SED, sed, /bin/sed, $MYPATH) @@ -391,9 +392,11 @@ AC_CHECK_LIB(${zlib}, gzseek, [AC_DEFINE(HAVE_GZSEEK)]) AC_CHECK_LIB(bz2, bzread, [LIBS="$LIBS -lbz2"], AC_CHECK_LIB(bz2, BZ2_bzread, [ + WITH_BZIP2=1 LIBS="$LIBS -lbz2" AC_DEFINE(HAVE_BZ2_1_0) ], - AC_MSG_WARN([rpm needs libbz2.a (from the bzip2 package)]))) + WITH_BZIP2=0)) +AC_SUBST(WITH_BZIP2) dnl Red Hat 4.x has not personality AC_CHECK_FUNCS(personality) @@ -684,7 +687,6 @@ dnl XXX Glob *is* broken on linux with libc5, solaris and possibly aix when dnl %files gets something like dnl /usr/*/locale/*/LC_MESSAGES/*.mo dnl (Note: more than one asterisk in glob pattern.) -dnl The next version of rpm is going to need GNU extensions anyways, so ... dnl AC_ARG_WITH(glob, [ --with-glob use the internal GNU glob ], [rpm_cv_glob=yes], @@ -718,6 +720,60 @@ if test $rpm_cv_glob = yes; then LIBOBJS="$LIBOBJS glob.o fnmatch.o" fi +dnl +dnl Auto-detect whether python bindings should be built. +dnl +AC_ARG_WITH(python, [ --with-python build rpm python bindings ], + rpm_cv_python=yes, rpm_cv_python=no) + +if test $rpm_cv_python = no ; then + AC_MSG_CHECKING(for python 1.5.2) + AC_TRY_RUN([ +#include +main() { + exit(strcmp("1.5.2", PY_VERSION)); +} ], + rpm_cv_python=yes, rpm_cv_python=no, rpm_cv_python=no) + AC_MSG_RESULT([$rpm_cv_python]) +fi + +if test $rpm_cv_python = yes; then + WITH_PYTHON_SUBDIR=python + WITH_PYTHON_SUBPACKAGE=1 +else + WITH_PYTHON_SUBDIR= + WITH_PYTHON_SUBPACKAGE=0 +fi +AC_SUBST(WITH_PYTHON_SUBDIR) +AC_SUBST(WITH_PYTHON_SUBPACKAGE) + +AC_PATH_PROG(__DOXYGEN, doxygen, no, $PATH) +dnl +dnl Auto-detect whether doxygen generated API docs should be included. +dnl +AC_ARG_WITH(apidocs, [ --with-apidocs build rpm API docs ], + [ if test __DOXYGEN = no; then + AC_MSG_ERROR(--> rpm API docs need doxygen in PATH) + fi + rpm_cv_apidocs=yes + ], + [ if test __DOXYGEN = no; then + rpm_cv_apidocs=no + else + rpm_cv_apidocs=yes + fi + ] +) + +if test $rpm_cv_apidocs = yes; then + WITH_APIDOCS_TARGET=apidocs + WITH_APIDOCS=1 +else + WITH_APIDOCS=0 +fi +AC_SUBST(WITH_APIDOCS_TARGET) +AC_SUBST(WITH_APIDOCS) + AC_CHECK_FUNCS(setlocale) dnl XXX Solaris <= 2.6 only permits 8 chars in password. @@ -940,7 +996,7 @@ SYSCONFIGDIR="`echo /etc/rpm`" AC_DEFINE_UNQUOTED(SYSCONFIGDIR, "$SYSCONFIGDIR") AC_SUBST(SYSCONFIGDIR) -MACROFILES="${RPMCONFIGDIR}/macros:${RPMCONFIGDIR}/%{_target_platform}/macros:${SYSCONFIGDIR}/macros:${SYSCONFIGDIR}/macros.specspo:${SYSCONFIGDIR}/%{_target_platform}/macros:~/.rpmmacros" +MACROFILES="${RPMCONFIGDIR}/macros:${RPMCONFIGDIR}/%{_target_platform}/macros:${SYSCONFIGDIR}/macros:${SYSCONFIGDIR}/macros.specspo:${SYSCONFIGDIR}/macros.db1:${SYSCONFIGDIR}/%{_target_platform}/macros:~/.rpmmacros" AC_DEFINE_UNQUOTED(MACROFILES, "$MACROFILES") AC_SUBST(MACROFILES) @@ -974,12 +1030,14 @@ AC_SUBST(LIBS) AC_SUBST(RPM) +AC_SUBST(OBJDUMP) + dnl XXX this causes popt to depend on zlib et al dnl # XXX Propagate -lucb to popt ... dnl export LIBS INCPATH CONFIG_SITE AC_CONFIG_SUBDIRS(popt) -AC_OUTPUT([Doxyfile Makefile rpmrc macros platform rpmpopt scripts/brp-redhat +AC_OUTPUT([Doxyfile Makefile rpmrc macros platform rpmpopt rpm.spec scripts/brp-redhat rpmio/Makefile lib/Makefile build/Makefile tools/Makefile scripts/Makefile tests/Makefile tests/rpmrc tests/macros tests/hello-test/Makefile diff --git a/lib/rpmlib.h b/lib/rpmlib.h index be9f0b9..541d1af 100644 --- a/lib/rpmlib.h +++ b/lib/rpmlib.h @@ -424,7 +424,7 @@ void rpmSetVar(int var, const char *val); * This is a colon separated list of files. URI's are permitted as well, * identified by the token '://', so file paths must not begin with '//'. */ -const char * macrofiles; +extern const char * macrofiles; /** \ingroup rpmrc * Build and install arch/os table identifiers. diff --git a/lib/rpmrc.c b/lib/rpmrc.c index cf8878a..188529f 100644 --- a/lib/rpmrc.c +++ b/lib/rpmrc.c @@ -15,6 +15,8 @@ static const char *defrcfiles = LIBRPMRC_FILENAME ":/etc/rpmrc:~/.rpmrc"; +const char * macrofiles = MACROFILES; + typedef /*@owned@*/ const char * cptr_t; struct machCacheEntry { diff --git a/lib/verify.c b/lib/verify.c index 6bb063e..60de1c4 100644 --- a/lib/verify.c +++ b/lib/verify.c @@ -259,7 +259,6 @@ int rpmVerifyScript(const char * rootDir, rpmdb rpmdb, Header h, FD_t scriptFd) ts->scriptFd = fdLink(scriptFd, "rpmVerifyScript"); rc = runInstScript(ts, h, RPMTAG_VERIFYSCRIPT, RPMTAG_VERIFYSCRIPTPROG, 0, 0); - ts->scriptFd = fdFree(ts->scriptFd, "rpmVerifyScript"); rpmtransFree(ts); return rc; } diff --git a/macros.in b/macros.in index 25075ce..dd6bfa3 100644 --- a/macros.in +++ b/macros.in @@ -1,4 +1,4 @@ -# $Id: macros.in,v 1.69 2000/11/02 17:57:26 jbj Exp $ +# $Id: macros.in,v 1.70 2000/12/04 00:55:17 jbj Exp $ # # This is a global RPM configuration file. All changes made here will # be lost when the rpm package is upgraded. Any per-system configuration @@ -50,6 +50,7 @@ %__patch @__PATCH@ %__perl @__PERL@ %__pgp %{_pgpbin} +%__python @__PYTHON@ %__rm @__RM@ %__rsh @__RSH@ %__sed @__SED@ diff --git a/perl/Makefile.in b/perl/Makefile.in index 220546e..292bac1 100644 --- a/perl/Makefile.in +++ b/perl/Makefile.in @@ -130,6 +130,11 @@ UNZIPBIN = @UNZIPBIN@ USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ +WITH_APIDOCS = @WITH_APIDOCS@ +WITH_APIDOCS_TARGET = @WITH_APIDOCS_TARGET@ +WITH_BZIP2 = @WITH_BZIP2@ +WITH_PYTHON_SUBDIR = @WITH_PYTHON_SUBDIR@ +WITH_PYTHON_SUBPACKAGE = @WITH_PYTHON_SUBPACKAGE@ __CAT = @__CAT@ __CHGRP = @__CHGRP@ __CHGRP_RHF = @__CHGRP_RHF@ @@ -138,6 +143,7 @@ __CHOWN = @__CHOWN@ __CHOWN_RHF = @__CHOWN_RHF@ __CP = @__CP@ __CPIO = @__CPIO@ +__DOXYGEN = @__DOXYGEN@ __GREP = @__GREP@ __ID = @__ID@ __ID_U = @__ID_U@ @@ -151,6 +157,7 @@ __OBJCOPY = @__OBJCOPY@ __OBJDUMP = @__OBJDUMP@ __PATCH = @__PATCH@ __PERL = @__PERL@ +__PYTHON = @__PYTHON@ __RM = @__RM@ __RSH = @__RSH@ __SED = @__SED@ diff --git a/po/rpm.pot b/po/rpm.pot index 09fd005..e0ab20f 100644 --- a/po/rpm.pot +++ b/po/rpm.pot @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2000-12-02 16:47-0500\n" +"POT-Creation-Date: 2000-12-03 19:48-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -3485,98 +3485,98 @@ msgstr "" msgid "read failed: %s (%d)" msgstr "" -#: lib/rpmrc.c:147 +#: lib/rpmrc.c:149 #, c-format msgid "missing second ':' at %s:%d" msgstr "" -#: lib/rpmrc.c:150 +#: lib/rpmrc.c:152 #, c-format msgid "missing architecture name at %s:%d" msgstr "" -#: lib/rpmrc.c:310 +#: lib/rpmrc.c:312 #, c-format msgid "Incomplete data line at %s:%d" msgstr "" -#: lib/rpmrc.c:314 +#: lib/rpmrc.c:316 #, c-format msgid "Too many args in data line at %s:%d" msgstr "" -#: lib/rpmrc.c:321 +#: lib/rpmrc.c:323 #, c-format msgid "Bad arch/os number: %s (%s:%d)" msgstr "" -#: lib/rpmrc.c:356 +#: lib/rpmrc.c:358 #, c-format msgid "Incomplete default line at %s:%d" msgstr "" -#: lib/rpmrc.c:361 +#: lib/rpmrc.c:363 #, c-format msgid "Too many args in default line at %s:%d" msgstr "" -#: lib/rpmrc.c:551 +#: lib/rpmrc.c:553 #, c-format msgid "Cannot expand %s" msgstr "" -#: lib/rpmrc.c:556 +#: lib/rpmrc.c:558 #, c-format msgid "Cannot read %s, HOME is too large." msgstr "" -#: lib/rpmrc.c:573 +#: lib/rpmrc.c:575 #, c-format msgid "Unable to open %s for reading: %s." msgstr "" #. XXX Feof(fd) -#: lib/rpmrc.c:618 +#: lib/rpmrc.c:620 #, c-format msgid "Failed to read %s: %s." msgstr "" -#: lib/rpmrc.c:655 +#: lib/rpmrc.c:657 #, c-format msgid "missing ':' (found 0x%02x) at %s:%d" msgstr "" -#: lib/rpmrc.c:672 lib/rpmrc.c:746 +#: lib/rpmrc.c:674 lib/rpmrc.c:748 #, c-format msgid "missing argument for %s at %s:%d" msgstr "" -#: lib/rpmrc.c:689 lib/rpmrc.c:711 +#: lib/rpmrc.c:691 lib/rpmrc.c:713 #, c-format msgid "%s expansion failed at %s:%d \"%s\"" msgstr "" -#: lib/rpmrc.c:698 +#: lib/rpmrc.c:700 #, c-format msgid "cannot open %s at %s:%d: %s" msgstr "" -#: lib/rpmrc.c:738 +#: lib/rpmrc.c:740 #, c-format msgid "missing architecture for %s at %s:%d" msgstr "" -#: lib/rpmrc.c:805 +#: lib/rpmrc.c:807 #, c-format msgid "bad option '%s' at %s:%d" msgstr "" -#: lib/rpmrc.c:1202 +#: lib/rpmrc.c:1204 #, c-format msgid "Unknown system: %s\n" msgstr "" -#: lib/rpmrc.c:1203 +#: lib/rpmrc.c:1205 msgid "Please contact rpm-list@redhat.com\n" msgstr "" @@ -3783,12 +3783,12 @@ msgstr "" msgid "package lacks both group name and id lists (this should never happen)" msgstr "" -#: lib/verify.c:286 +#: lib/verify.c:285 #, c-format msgid "missing %s\n" msgstr "" -#: lib/verify.c:348 +#: lib/verify.c:347 #, c-format msgid "Unsatisfied dependencies for %s-%s-%s: " msgstr "" diff --git a/python/Makefile.in b/python/Makefile.in index 639aa67..f676d13 100644 --- a/python/Makefile.in +++ b/python/Makefile.in @@ -130,6 +130,11 @@ UNZIPBIN = @UNZIPBIN@ USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ +WITH_APIDOCS = @WITH_APIDOCS@ +WITH_APIDOCS_TARGET = @WITH_APIDOCS_TARGET@ +WITH_BZIP2 = @WITH_BZIP2@ +WITH_PYTHON_SUBDIR = @WITH_PYTHON_SUBDIR@ +WITH_PYTHON_SUBPACKAGE = @WITH_PYTHON_SUBPACKAGE@ __CAT = @__CAT@ __CHGRP = @__CHGRP@ __CHGRP_RHF = @__CHGRP_RHF@ @@ -138,6 +143,7 @@ __CHOWN = @__CHOWN@ __CHOWN_RHF = @__CHOWN_RHF@ __CP = @__CP@ __CPIO = @__CPIO@ +__DOXYGEN = @__DOXYGEN@ __GREP = @__GREP@ __ID = @__ID@ __ID_U = @__ID_U@ @@ -151,6 +157,7 @@ __OBJCOPY = @__OBJCOPY@ __OBJDUMP = @__OBJDUMP@ __PATCH = @__PATCH@ __PERL = @__PERL@ +__PYTHON = @__PYTHON@ __RM = @__RM@ __RSH = @__RSH@ __SED = @__SED@ diff --git a/python/upgrade.c b/python/upgrade.c index fe45e46..29da37d 100644 --- a/python/upgrade.c +++ b/python/upgrade.c @@ -122,11 +122,11 @@ static void addLostFiles(rpmdb db, struct pkgSet *psp, struct hash_table *ht) sizeof(*psp->packages), (void *)pkgCompare); if (!pack) { if (headerGetEntryMinMemory(h, RPMTAG_BASENAMES, NULL, - (void **) &installedFiles, &installedFileCount)) { + (const void **) &installedFiles, &installedFileCount)) { headerGetEntryMinMemory(h, RPMTAG_DIRINDEXES, NULL, - (void **) &installedDirIndexes, NULL); + (const void **) &installedDirIndexes, NULL); headerGetEntryMinMemory(h, RPMTAG_DIRNAMES, NULL, - (void **) &installedDirs, NULL); + (const void **) &installedDirs, NULL); compareFileList(0, NULL, NULL, NULL, installedFileCount, installedFiles, installedDirs, @@ -156,7 +156,7 @@ static int findPackagesWithObsoletes(rpmdb db, struct pkgSet *psp) } if (headerGetEntryMinMemory((*pip)->h, RPMTAG_OBSOLETENAME, NULL, - (void **) &obsoletes, &obsoletesCount)) { + (const void **) &obsoletes, &obsoletesCount)) { while (obsoletesCount--) { if (rpmdbCountPackages(db, obsoletes[obsoletesCount]) > 0) { (*pip)->selected = 1; @@ -231,26 +231,26 @@ static int findUpgradePackages(rpmdb db, struct pkgSet *psp, (*pip)->selected = 1; if (!headerGetEntryMinMemory(h, RPMTAG_BASENAMES, NULL, - (void **) &availFiles, &availFileCount)) { + (const void **) &availFiles, &availFileCount)) { availFiles = NULL; availFileCount = 0; } else { headerGetEntryMinMemory(h, RPMTAG_DIRNAMES, NULL, - (void **) &availDirs, NULL); + (const void **) &availDirs, NULL); headerGetEntryMinMemory(h, RPMTAG_DIRINDEXES, NULL, - (void **) &availDirIndexes, NULL); + (const void **) &availDirIndexes, NULL); } { rpmdbMatchIterator mi; mi = rpmdbInitIterator(db, RPMTAG_NAME, name, 0); while((installedHeader = rpmdbNextIterator(mi)) != NULL) { if (headerGetEntryMinMemory(installedHeader, RPMTAG_BASENAMES, - NULL, (void **) &installedFiles, + NULL, (const void **) &installedFiles, &installedFileCount)) { headerGetEntryMinMemory(installedHeader, RPMTAG_DIRNAMES, - NULL, (void **) &installedDirs, NULL); + NULL, (const void **) &installedDirs, NULL); headerGetEntryMinMemory(installedHeader, RPMTAG_DIRINDEXES, - NULL, (void **) &installedDirIndexes, NULL); + NULL, (const void **) &installedDirIndexes, NULL); compareFileList(availFileCount, availFiles, availDirs, availDirIndexes, @@ -299,12 +299,12 @@ static int removeMovedFilesAlreadyHandled(struct pkgSet *psp, headerGetEntry(h, RPMTAG_NAME, NULL, (void **) &name, NULL); if (headerGetEntryMinMemory(h, RPMTAG_BASENAMES, NULL, - (void **) &availFiles, &availFileCount)) { + (const void **) &availFiles, &availFileCount)) { headerGetEntryMinMemory(h, RPMTAG_DIRNAMES, NULL, - (void **) &availDirs, NULL); + (const void **) &availDirs, NULL); headerGetEntryMinMemory(h, RPMTAG_DIRINDEXES, NULL, - (void **) &availDirIndexes, NULL); + (const void **) &availDirIndexes, NULL); for (i = 0; i < availFileCount; i++) { if (htInTable(ht, availDirs[availDirIndexes[i]], @@ -351,11 +351,11 @@ static int findPackagesWithRelocatedFiles(struct pkgSet *psp, if (headerGetEntry(h, RPMTAG_BASENAMES, NULL, (void **) &availFiles, &availFileCount)) { headerGetEntryMinMemory(h, RPMTAG_DIRNAMES, NULL, - (void **) &availDirs, NULL); + (const void **) &availDirs, NULL); headerGetEntryMinMemory(h, RPMTAG_DIRINDEXES, NULL, - (void **) &availDirIndexes, NULL); + (const void **) &availDirIndexes, NULL); headerGetEntryMinMemory(h, RPMTAG_FILEMODES, NULL, - (void **) &availFileModes, NULL); + (const void **) &availFileModes, NULL); for (i = 0; i < availFileCount; i++) { if (S_ISDIR(availFileModes[i])) continue; diff --git a/rpm.spec b/rpm.spec index 965e188..72c2b9f 100644 --- a/rpm.spec +++ b/rpm.spec @@ -1,3 +1,7 @@ +%define with_python_subpackage 1 +%define with_bzip2 1 +%define with_apidocs 1 + # XXX legacy requires './' payload prefix to be omitted from rpm packages. %define _noPayloadPrefix 1 @@ -8,25 +12,34 @@ Summary: The Red Hat package management system. Name: rpm %define version 4.1 Version: %{version} -Release: 0.1 +Release: 0.15 Group: System Environment/Base Source: ftp://ftp.rpm.org/pub/rpm/dist/rpm-4.0.x/rpm-%{version}.tar.gz Copyright: GPL Conflicts: patch < 2.5 %ifos linux Prereq: gawk fileutils textutils sh-utils mktemp -Requires: popt, bzip2 >= 0.9.0c-2 +Requires: popt +%endif + +BuildRequires: db3-devel + # XXX glibc-2.1.92 has incompatible locale changes that affect statically # XXX linked binaries like /bin/rpm. %ifnarch ia64 Requires: glibc >= 2.1.92 -%endif # XXX needed to avoid libdb.so.2 satisfied by compat/libc5 provides. Requires: db1 = 1.85 -BuildRequires: db3-devel +%endif + +# XXX Red Hat 5.2 has not bzip2 or python +%if %{with_bzip2} BuildRequires: bzip2 >= 0.9.0c-2 +%endif +%if %{with_python_subpackage} BuildRequires: python-devel >= 1.5.2 %endif + BuildRoot: %{_tmppath}/%{name}-root %description @@ -61,7 +74,7 @@ Requires: rpm = %{version} This package contains scripts and executable programs that are used to build packages using RPM. -%ifos linux +%if %{with_python_subpackage} %package python Summary: Python bindings for apps which will manipulate RPM packages. Group: Development/Libraries @@ -81,7 +94,7 @@ programs that will manipulate RPM packages and databases. %package -n popt Summary: A C library for parsing command line parameters. Group: Development/Libraries -Version: 1.7 +Version: 1.6.1 %description -n popt Popt is a C library for parsing command line parameters. Popt was @@ -108,18 +121,16 @@ CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%{__prefix} make -%ifos linux -make -C python -%endif - %install rm -rf $RPM_BUILD_ROOT make DESTDIR="$RPM_BUILD_ROOT" install -%ifos linux -make DESTDIR="$RPM_BUILD_ROOT" install -C python -%endif + mkdir -p $RPM_BUILD_ROOT/etc/rpm +cat << E_O_F > $RPM_BUILD_ROOT/etc/rpm/macros.db1 +%_dbpath 1 +%_dbpath_rebuild 1 +E_O_F { cd $RPM_BUILD_ROOT strip ./bin/rpm @@ -129,20 +140,32 @@ mkdir -p $RPM_BUILD_ROOT/etc/rpm %clean rm -rf $RPM_BUILD_ROOT +%pre +if [ -f /var/lib/rpm/Packages -a -f /var/lib/rpm/packages.rpm ]; then +# echo " +#You have both +# /var/lib/rpm/packages.rpm db1 format installed package headers +# /var/lib/rpm/Packages db3 format installed package headers +#Please remove (or at least rename) one of those files, and re-install. +#" + exit 1 +fi + %post -/sbin/ldconfig %ifos linux -if [ ! -e /etc/rpm/macros -a -e /etc/rpmrc -a -f %{__prefix}/lib/rpm/convertrpmrc.sh ] -then +/sbin/ldconfig +if [ ! -e /etc/rpm/macros -a -e /etc/rpmrc -a -f %{__prefix}/lib/rpm/convertrpmrc.sh ]; then sh %{__prefix}/lib/rpm/convertrpmrc.sh > /dev/null 2>&1 fi -%else -/bin/rpm --initdb %endif +/bin/rpm --initdb +if [ -f /var/lib/rpm/Packages]; then + rm -f /etc/rpm/macros.db1 +fi +%ifos linux %postun -p /sbin/ldconfig -%ifos linux %post devel -p /sbin/ldconfig %postun devel -p /sbin/ldconfig @@ -150,7 +173,7 @@ fi %postun -n popt -p /sbin/ldconfig %endif -%ifos linux +%if %{with_python_subpackage} %post python -p /sbin/ldconfig %postun python -p /sbin/ldconfig %endif @@ -159,7 +182,8 @@ fi %defattr(-,root,root) %doc RPM-PGP-KEY RPM-GPG-KEY CHANGES GROUPS doc/manual/[a-z]* /bin/rpm -%dir /etc/rpm +%dir /etc/rpm +%config(missingok) /etc/rpm/macros.db1 %{__prefix}/bin/rpm2cpio %{__prefix}/bin/gendiff %{__prefix}/bin/rpmdb @@ -229,6 +253,7 @@ fi %{__prefix}/lib/rpm/get_magic.pl %{__prefix}/lib/rpm/getpo.sh %{__prefix}/lib/rpm/http.req +%{__prefix}/lib/rpm/javadeps %{__prefix}/lib/rpm/magic.prov %{__prefix}/lib/rpm/magic.req %{__prefix}/lib/rpm/perl.prov @@ -240,7 +265,7 @@ fi %{__prefix}/lib/rpm/vpkg-provides.sh %{__prefix}/lib/rpm/vpkg-provides2.sh -%ifos linux +%if %{with_python_subpackage} %files python %defattr(-,root,root) %{__prefix}/lib/python1.5/site-packages/rpmmodule.so @@ -248,6 +273,9 @@ fi %files devel %defattr(-,root,root) +%if %{with_apidocs} +%doc apidocs +%endif %{__prefix}/include/rpm %{__prefix}/lib/librpm.a %{__prefix}/lib/librpm.la @@ -272,5 +300,79 @@ fi %{__prefix}/include/popt.h %changelog -* Wed Aug 16 2000 Jeff Johnson -- start rpm 4.1 development. +* Sun Dec 3 2000 Jeff Johnson +- improved find-{requires,provides} for aix4/hpux/irix6/osf. + Tim Mooney +- portability: remove use of GNU make subst in lib/Makefile (Joe Orton). +- python: bind package removal (#21274). +- autoconfigure building python bindings. +- autoconfigure generating rpm API doco rpm-devel package. + +* Thu Nov 30 2000 Jeff Johnson +- add missing headerFree for legacy signature header. +- fix: removed packages leaked DIRINDEXES tag data. +- reload tags added during install when loading header from rpmdb. +- avoid brp-compress hang with both compressed/uncompressed man pages. + +* Tue Nov 21 2000 Jeff Johnson +- add brp-strip-shared script . +- better item/task progress bars . +- load headers as single contiguous region. +- add region marker as RPM_BIN_TYPE in packages and database. +- fix: don't headerCopy() relocateable packages if not relocating. +- merge signatures into header after reading from package. + +* Mon Nov 20 2000 Jeff Johnson +- add doxygen and lclint annotations most everywhere. +- consistent return for all signature verification. +- use enums for almost all rpmlib #define's. +- API: change rpmProblem typedef to pass by reference, not value. +- don't trim leading ./ in rpmCleanPath() (#14961). +- detect (still need to test) rdonly linux file systems. +- check available inodes as well as blocks on mounted file systems. +- pass rpmTransactionSet, not elements, to installBinaryPackage et al. +- add cscope/ctags (Rodrigo Barbosa). +- remove getMacroBody() from rpmio API. +- add support for unzip + +* Thu Nov 16 2000 Jeff Johnson +- don't verify src rpm MD5 sums (yet). +- md5 sums are little endian (no swap) so big endian needs the swap. + +* Wed Nov 15 2000 Jeff Johnson +- fix: segfault on exit of "rpm -qp --qf '%{#fsnames}' pkg" (#20595). +- hpux w/o -D_OPEN_SOURCE has not h_errno. +- verify MD5 sums of payload files when unpacking archive. +- hide libio lossage in prototype, not API. +- add support for SHA1 as well as MD5 message digests. + +* Mon Nov 13 2000 Jeff Johnson +- fix: work around for (mis-compilation?!) segfaults on signature paths. + +* Sun Nov 12 2000 Jeff Johnson +- fix: duplicate headerFree() on instalBinaryPackage() error return. + +* Sat Nov 11 2000 Jeff Johnson +- fix: runTriggers was not adding countCorrection. +- add rpmGetRpmlibProvides() to retrieve rpmlib(...) provides + "Pawel A. Gajda" . +- syntax to specify source of Requires: (PreReq: now legacy). +- rip out rpm{get,put}text, use getpo.sh and specspo instead. +- fine-grained Requires, remove install PreReq's from Requires db. + +* Wed Oct 11 2000 Jeff Johnson +- fix: rpm2cpio error check wrong on non-libio platforms. + +* Fri Sep 29 2000 Jeff Johnson +- fix: more (possible) xstrdup side effects. + +* Wed Sep 27 2000 Jeff Johnson +- bump popt version to 1.6.1. + +* Tue Sep 26 2000 Jeff Johnson +- fix: avoid calling getpass twice as side effect of xstrdup macro (#17672). +- order packages using tsort, clipping PreReq:'s in dependency loops. +- handle possible db3 dependency on -lpthread more gracefully. + +* Thu Sep 14 2000 Jeff Johnson +- start rpm-4.0.1. diff --git a/rpm.spec.in b/rpm.spec.in new file mode 100644 index 0000000..63072f3 --- /dev/null +++ b/rpm.spec.in @@ -0,0 +1,379 @@ +%define with_python_subpackage @WITH_PYTHON_SUBPACKAGE@ +%define with_bzip2 @WITH_BZIP2@ +%define with_apidocs @WITH_APIDOCS@ + +# XXX legacy requires './' payload prefix to be omitted from rpm packages. +%define _noPayloadPrefix 1 + +%define __prefix /usr +%{expand:%%define __share %(if [ -d %{__prefix}/share/man ]; then echo /share ; else echo %%{nil} ; fi)} + +Summary: The Red Hat package management system. +Name: rpm +%define version @VERSION@ +Version: %{version} +Release: 0.15 +Group: System Environment/Base +Source: ftp://ftp.rpm.org/pub/rpm/dist/rpm-4.0.x/rpm-%{version}.tar.gz +Copyright: GPL +Conflicts: patch < 2.5 +%ifos linux +Prereq: gawk fileutils textutils sh-utils mktemp +Requires: popt +%endif + +BuildRequires: db3-devel + +# XXX glibc-2.1.92 has incompatible locale changes that affect statically +# XXX linked binaries like /bin/rpm. +%ifnarch ia64 +Requires: glibc >= 2.1.92 +# XXX needed to avoid libdb.so.2 satisfied by compat/libc5 provides. +Requires: db1 = 1.85 +%endif + +# XXX Red Hat 5.2 has not bzip2 or python +%if %{with_bzip2} +BuildRequires: bzip2 >= 0.9.0c-2 +%endif +%if %{with_python_subpackage} +BuildRequires: python-devel >= 1.5.2 +%endif + +BuildRoot: %{_tmppath}/%{name}-root + +%description +The RPM Package Manager (RPM) is a powerful command line driven +package management system capable of installing, uninstalling, +verifying, querying, and updating software packages. Each software +package consists of an archive of files along with information about +the package like its version, a description, etc. + +%package devel +Summary: Development files for applications which will manipulate RPM packages. +Group: Development/Libraries +Requires: rpm = %{version}, popt + +%description devel +This package contains the RPM C library and header files. These +development files will simplify the process of writing programs which +manipulate RPM packages and databases. These files are intended to +simplify the process of creating graphical package managers or any +other tools that need an intimate knowledge of RPM packages in order +to function. + +This package should be installed if you want to develop programs that +will manipulate RPM packages and databases. + +%package build +Summary: Scripts and executable programs used to build packages. +Group: Development/Tools +Requires: rpm = %{version} + +%description build +This package contains scripts and executable programs that are used to +build packages using RPM. + +%if %{with_python_subpackage} +%package python +Summary: Python bindings for apps which will manipulate RPM packages. +Group: Development/Libraries +BuildRequires: popt >= 1.5 +Requires: popt >= 1.5 +Requires: python >= 1.5.2 + +%description python +The rpm-python package contains a module which permits applications +written in the Python programming language to use the interface +supplied by RPM (RPM Package Manager) libraries. + +This package should be installed if you want to develop Python +programs that will manipulate RPM packages and databases. +%endif + +%package -n popt +Summary: A C library for parsing command line parameters. +Group: Development/Libraries +Version: 1.6.1 + +%description -n popt +Popt is a C library for parsing command line parameters. Popt was +heavily influenced by the getopt() and getopt_long() functions, but it +improves on them by allowing more powerful argument expansion. Popt +can parse arbitrary argv[] style arrays and automatically set +variables based on command line arguments. Popt allows command line +arguments to be aliased via configuration files and includes utility +functions for parsing arbitrary strings into argv[] arrays using +shell-like rules. + +Install popt if you're a C programmer and you'd like to use its +capabilities. + +%prep +%setup -q + +%build +%ifos linux +CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%{__prefix} --sysconfdir=/etc --localstatedir=/var --infodir='${prefix}%{__share}/info' --mandir='${prefix}%{__share}/man' +%else +CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%{__prefix} +%endif + +make + +%install +rm -rf $RPM_BUILD_ROOT + +make DESTDIR="$RPM_BUILD_ROOT" install + +mkdir -p $RPM_BUILD_ROOT/etc/rpm +cat << E_O_F > $RPM_BUILD_ROOT/etc/rpm/macros.db1 +%_dbpath 1 +%_dbpath_rebuild 1 +E_O_F + +{ cd $RPM_BUILD_ROOT + strip ./bin/rpm + strip .%{__prefix}/bin/rpm2cpio +} + +%clean +rm -rf $RPM_BUILD_ROOT + +%pre +if [ -f /var/lib/rpm/Packages -a -f /var/lib/rpm/packages.rpm ]; then +# echo " +#You have both +# /var/lib/rpm/packages.rpm db1 format installed package headers +# /var/lib/rpm/Packages db3 format installed package headers +#Please remove (or at least rename) one of those files, and re-install. +#" + exit 1 +fi + +%post +%ifos linux +/sbin/ldconfig +if [ ! -e /etc/rpm/macros -a -e /etc/rpmrc -a -f %{__prefix}/lib/rpm/convertrpmrc.sh ]; then + sh %{__prefix}/lib/rpm/convertrpmrc.sh > /dev/null 2>&1 +fi +%endif +/bin/rpm --initdb +if [ -f /var/lib/rpm/Packages]; then + rm -f /etc/rpm/macros.db1 +fi + +%ifos linux +%postun -p /sbin/ldconfig + +%post devel -p /sbin/ldconfig +%postun devel -p /sbin/ldconfig + +%post -n popt -p /sbin/ldconfig +%postun -n popt -p /sbin/ldconfig +%endif + +%if %{with_python_subpackage} +%post python -p /sbin/ldconfig +%postun python -p /sbin/ldconfig +%endif + +%files +%defattr(-,root,root) +%doc RPM-PGP-KEY RPM-GPG-KEY CHANGES GROUPS doc/manual/[a-z]* +/bin/rpm +%dir /etc/rpm +%config(missingok) /etc/rpm/macros.db1 +%{__prefix}/bin/rpm2cpio +%{__prefix}/bin/gendiff +%{__prefix}/bin/rpmdb +%{__prefix}/bin/rpm[eiukqv] +%{__prefix}/bin/rpmsign +%{__prefix}/bin/rpmquery +%{__prefix}/bin/rpmverify +%{__prefix}/lib/librpm.so.* +%{__prefix}/lib/librpmio.so.* +%{__prefix}/lib/librpmbuild.so.* + +%{__prefix}/lib/rpm/config.guess +%{__prefix}/lib/rpm/config.sub +%{__prefix}/lib/rpm/convertrpmrc.sh +%{__prefix}/lib/rpm/macros +%{__prefix}/lib/rpm/mkinstalldirs +%{__prefix}/lib/rpm/rpmdb +%{__prefix}/lib/rpm/rpm[eiukqv] +%{__prefix}/lib/rpm/rpmpopt* +%{__prefix}/lib/rpm/rpmrc + +%ifarch i386 i486 i586 i686 +%{__prefix}/lib/rpm/i[3456]86* +%endif +%ifarch alpha +%{__prefix}/lib/rpm/alpha* +%endif +%ifarch sparc sparc64 +%{__prefix}/lib/rpm/sparc* +%endif +%ifarch ia64 +%{__prefix}/lib/rpm/ia64* +%endif +%ifarch powerpc ppc +%{__prefix}/lib/rpm/ppc* +%endif +%ifarch armv3l armv4l +%{__prefix}/lib/rpm/armv[34][lb]* +%endif + +%dir %{__prefix}/src/redhat +%dir %{__prefix}/src/redhat/BUILD +%dir %{__prefix}/src/redhat/SPECS +%dir %{__prefix}/src/redhat/SOURCES +%dir %{__prefix}/src/redhat/SRPMS +%dir %{__prefix}/src/redhat/RPMS +%{__prefix}/src/redhat/RPMS/* +%{__prefix}/*/locale/*/LC_MESSAGES/rpm.mo +%{__prefix}%{__share}/man/man[18]/*.[18]* +%lang(pl) %{__prefix}%{__share}/man/pl/man[18]/*.[18]* +%lang(ru) %{__prefix}%{__share}/man/ru/man[18]/*.[18]* +%lang(sk) %{__prefix}%{__share}/man/sk/man[18]/*.[18]* + +%files build +%defattr(-,root,root) +%{__prefix}/bin/rpmbuild +%{__prefix}/lib/rpm/brp-* +%{__prefix}/lib/rpm/check-prereqs +%{__prefix}/lib/rpm/cpanflute +%{__prefix}/lib/rpm/find-lang.sh +%{__prefix}/lib/rpm/find-prov.pl +%{__prefix}/lib/rpm/find-provides +%{__prefix}/lib/rpm/find-provides.perl +%{__prefix}/lib/rpm/find-req.pl +%{__prefix}/lib/rpm/find-requires +%{__prefix}/lib/rpm/find-requires.perl +%{__prefix}/lib/rpm/get_magic.pl +%{__prefix}/lib/rpm/getpo.sh +%{__prefix}/lib/rpm/http.req +%{__prefix}/lib/rpm/javadeps +%{__prefix}/lib/rpm/magic.prov +%{__prefix}/lib/rpm/magic.req +%{__prefix}/lib/rpm/perl.prov +%{__prefix}/lib/rpm/perl.req +%{__prefix}/lib/rpm/rpm[bt] +%{__prefix}/lib/rpm/rpmdiff +%{__prefix}/lib/rpm/rpmdiff.cgi +%{__prefix}/lib/rpm/u_pkg.sh +%{__prefix}/lib/rpm/vpkg-provides.sh +%{__prefix}/lib/rpm/vpkg-provides2.sh + +%if %{with_python_subpackage} +%files python +%defattr(-,root,root) +%{__prefix}/lib/python1.5/site-packages/rpmmodule.so +%endif + +%files devel +%defattr(-,root,root) +%if %{with_apidocs} +%doc @WITH_APIDOCS_TARGET@ +%endif +%{__prefix}/include/rpm +%{__prefix}/lib/librpm.a +%{__prefix}/lib/librpm.la +%{__prefix}/lib/librpm.so +%{__prefix}/lib/librpmio.a +%{__prefix}/lib/librpmio.la +%{__prefix}/lib/librpmio.so +%{__prefix}/lib/librpmbuild.a +%{__prefix}/lib/librpmbuild.la +%{__prefix}/lib/librpmbuild.so + +%files -n popt +%defattr(-,root,root) +%{__prefix}/lib/libpopt.so.* +%{__prefix}/*/locale/*/LC_MESSAGES/popt.mo +%{__prefix}%{__share}/man/man3/popt.3* + +# XXX These may end up in popt-devel but it hardly seems worth the effort now. +%{__prefix}/lib/libpopt.a +%{__prefix}/lib/libpopt.la +%{__prefix}/lib/libpopt.so +%{__prefix}/include/popt.h + +%changelog +* Sun Dec 3 2000 Jeff Johnson +- improved find-{requires,provides} for aix4/hpux/irix6/osf. + Tim Mooney +- portability: remove use of GNU make subst in lib/Makefile (Joe Orton). +- python: bind package removal (#21274). +- autoconfigure building python bindings. +- autoconfigure generating rpm API doco rpm-devel package. +- fix: don't fdFree in rpmVerifyScript, rpmtransFree does already. + +* Thu Nov 30 2000 Jeff Johnson +- add missing headerFree for legacy signature header. +- fix: removed packages leaked DIRINDEXES tag data. +- reload tags added during install when loading header from rpmdb. +- avoid brp-compress hang with both compressed/uncompressed man pages. + +* Tue Nov 21 2000 Jeff Johnson +- add brp-strip-shared script . +- better item/task progress bars . +- load headers as single contiguous region. +- add region marker as RPM_BIN_TYPE in packages and database. +- fix: don't headerCopy() relocateable packages if not relocating. +- merge signatures into header after reading from package. + +* Mon Nov 20 2000 Jeff Johnson +- add doxygen and lclint annotations most everywhere. +- consistent return for all signature verification. +- use enums for almost all rpmlib #define's. +- API: change rpmProblem typedef to pass by reference, not value. +- don't trim leading ./ in rpmCleanPath() (#14961). +- detect (still need to test) rdonly linux file systems. +- check available inodes as well as blocks on mounted file systems. +- pass rpmTransactionSet, not elements, to installBinaryPackage et al. +- add cscope/ctags (Rodrigo Barbosa). +- remove getMacroBody() from rpmio API. +- add support for unzip + +* Thu Nov 16 2000 Jeff Johnson +- don't verify src rpm MD5 sums (yet). +- md5 sums are little endian (no swap) so big endian needs the swap. + +* Wed Nov 15 2000 Jeff Johnson +- fix: segfault on exit of "rpm -qp --qf '%{#fsnames}' pkg" (#20595). +- hpux w/o -D_OPEN_SOURCE has not h_errno. +- verify MD5 sums of payload files when unpacking archive. +- hide libio lossage in prototype, not API. +- add support for SHA1 as well as MD5 message digests. + +* Mon Nov 13 2000 Jeff Johnson +- fix: work around for (mis-compilation?!) segfaults on signature paths. + +* Sun Nov 12 2000 Jeff Johnson +- fix: duplicate headerFree() on instalBinaryPackage() error return. + +* Sat Nov 11 2000 Jeff Johnson +- fix: runTriggers was not adding countCorrection. +- add rpmGetRpmlibProvides() to retrieve rpmlib(...) provides + "Pawel A. Gajda" . +- syntax to specify source of Requires: (PreReq: now legacy). +- rip out rpm{get,put}text, use getpo.sh and specspo instead. +- fine-grained Requires, remove install PreReq's from Requires db. + +* Wed Oct 11 2000 Jeff Johnson +- fix: rpm2cpio error check wrong on non-libio platforms. + +* Fri Sep 29 2000 Jeff Johnson +- fix: more (possible) xstrdup side effects. + +* Wed Sep 27 2000 Jeff Johnson +- bump popt version to 1.6.1. + +* Tue Sep 26 2000 Jeff Johnson +- fix: avoid calling getpass twice as side effect of xstrdup macro (#17672). +- order packages using tsort, clipping PreReq:'s in dependency loops. +- handle possible db3 dependency on -lpthread more gracefully. + +* Thu Sep 14 2000 Jeff Johnson +- start rpm-4.0.1. -- 2.7.4