diff options
-rw-r--r-- | CHANGES | 3 | ||||
-rw-r--r-- | Makefile.am | 11 | ||||
-rw-r--r-- | acconfig.h | 13 | ||||
-rw-r--r-- | configure.in | 92 | ||||
-rwxr-xr-x | db3/configure | 13 | ||||
-rw-r--r-- | lib/header.h | 2 | ||||
-rw-r--r-- | perl/Makefile.in | 4 | ||||
-rw-r--r-- | python/Makefile.in | 4 | ||||
-rw-r--r-- | rpm.spec | 9 | ||||
-rw-r--r-- | rpm.spec.in | 13 | ||||
-rw-r--r-- | tools/Makefile.am | 1 |
11 files changed, 113 insertions, 52 deletions
@@ -44,6 +44,9 @@ - enough lclint annotations and fiddles already. - fix: specfile queries with BuildArch: (#27589). - fix: debugging message displays header keys (#38454). + - fix: specfile queries with BuildArch: (#27589). + - use internal db-3.2.9 sources to build by default. + - don't build db1 by default. 4.0 -> 4.0.[12] - add doxygen and lclint annotations most everywhere. diff --git a/Makefile.am b/Makefile.am index 478697570..a731be5ff 100644 --- a/Makefile.am +++ b/Makefile.am @@ -5,12 +5,12 @@ AUTOMAKE_OPTIONS = 1.4 foreign 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* \ + db db3/configure gendiff installplatform platform* \ po/*.in po/*.po po/rpm.pot \ rpm.magic rpmpopt-$(VERSION) rpmqv.c # XXX TODO: perl -SUBDIRS = intl po popt rpmio lib build misc @WITH_PYTHON_SUBDIR@ tools scripts tests doc . +SUBDIRS = intl po @WITH_DB_SUBDIR@ popt rpmio lib build misc @WITH_PYTHON_SUBDIR@ tools scripts tests doc . INCLUDES = -I$(top_srcdir)/build -I$(top_srcdir)/lib -I$(top_srcdir)/rpmio \ -I$(top_srcdir)/popt @INCPATH@ @@ -23,8 +23,11 @@ myLDFLAGS = # -L$(top_builddir)/build/.libs -L$(top_builddir)/lib/.libs \ # XXX libtool can/should generate dependent libs. # XXX solaris2.6 cannot use *.la with --all-static (downrev binutils/egcs?) # XXX top_builddir ldpaths are wrong building in tree -myLDADD = $(top_builddir)/build/librpmbuild.la $(top_builddir)/lib/librpm.la \ - $(top_builddir)/rpmio/librpmio.la $(top_builddir)/popt/libpopt.la \ +myLDADD = $(top_builddir)/build/librpmbuild.la \ + $(top_builddir)/lib/librpm.la \ + @libdb3a@ \ + $(top_builddir)/rpmio/librpmio.la \ + $(top_builddir)/popt/libpopt.la \ @INTLLIBS@ @LIBMISC@ rpmbindir = `echo $(bindir) | sed -e s,usr/bin,bin,` diff --git a/acconfig.h b/acconfig.h index cc832ec36..43e60a26c 100644 --- a/acconfig.h +++ b/acconfig.h @@ -132,15 +132,6 @@ /* define if the statfs() call takes 4 arguments */ #undef STAT_STATFS4 -/* Absolute path to rpm top_sourcedir. */ -#undef TOP_SOURCEDIR - -/* define if support rpm-1.0 packages is desired */ -#undef ENABLE_V1_PACKAGES - -/* define if experimental support rpm-4.0 packages is desired */ -#undef ENABLE_V5_PACKAGES - /* Use the included glob.c? */ #undef USE_GNU_GLOB @@ -153,8 +144,8 @@ /* Use the Berkeley db1 retrofit to db2/db3 API? */ #undef USE_DB1 -/* Use the Berkeley db1 API from glibc? */ -#undef USE_DB0 +/* Define if you have the <db3/db.h> header file. */ +#undef HAVE_DB3_DB_H /* Build with dmalloc support? */ #undef DMALLOC diff --git a/configure.in b/configure.in index bea687db0..038df62d8 100644 --- a/configure.in +++ b/configure.in @@ -266,14 +266,14 @@ dnl dnl Check for features dnl -### use option --enable-v5-packages to turn on support for rpm-5.x packages -AC_MSG_CHECKING(if you want experimental rpm-5.0 packages) -AC_ARG_ENABLE(v5-packages, - [ --enable-v5-packages[=no] [experimental] support for rpm-5.x packages], - [with_v5_packages=$enableval], - [with_v5_packages=no]) -AC_MSG_RESULT($with_v5_packages) -test "$with_v5_packages" = yes && AC_DEFINE(ENABLE_V5_PACKAGES) +dnl ### use option --enable-v5-packages to turn on support for rpm-5.x packages +dnl AC_MSG_CHECKING(if you want experimental rpm-5.0 packages) +dnl AC_ARG_ENABLE(v5-packages, +dnl [ --enable-v5-packages[=no] [experimental] support for rpm-5.x packages], +dnl [with_v5_packages=$enableval], +dnl [with_v5_packages=no]) +dnl AC_MSG_RESULT($with_v5_packages) +dnl test "$with_v5_packages" = yes && AC_DEFINE(ENABLE_V5_PACKAGES) dnl Checks for libraries. @@ -315,11 +315,25 @@ if test "x$libthread" = "x"; then AC_CHECK_LIB(thread, mutex_lock, [libthread="-lthread"]) fi +WITH_DB_SUBDIR= +WITH_INTERNAL_DB=0 DBLIBSRCS="" libdb3="" +libdb3a="" libdb2="" libdb1="" +dnl +dnl Detect whether internal Berkeley DB should be built. +dnl +withval=yes +AC_ARG_WITH(db, [ --without-db do not use internal Berkeley db]) + +if test $withval = no ; then +dnl ------------------ without internal db + +AC_CHECK_HEADERS(db_185.h db1/db.h db3/db.h) + dnl Check for Berkeley db3 API. AC_CHECK_FUNC(db_create, [DBLIBSRCS="$DBLIBSRCS db3.c"], AC_CHECK_LIB(db-3.2, db_create, [DBLIBSRCS="$DBLIBSRCS db3.c"; libdb3="-ldb-3.2"], @@ -362,15 +376,6 @@ AC_MSG_RESULT(no) usedb1=no ]) -if test "$usedb1" = "yes"; then - dnl Check for Berkeley db1 API in glibc. - AC_CHECK_FUNC(dbopen, [DBLIBSRCS="$DBLIBSRCS db3.c"], - AC_CHECK_LIB(db1, dbopen, [DBLIBSRCS="$DBLIBSRCS db1.c falloc.c" ; libdb1="-ldb1"], - AC_CHECK_LIB(db, dbopen, [DBLIBSRCS="$DBLIBSRCS db1.c falloc.c" ; libdb1="-ldb"]) - ) - ) -fi - if test X"$DBLIBSRCS" = X; then AC_MSG_ERROR([sorry rpm requires libdb-3.x.a (from the Berkeley db package)]) fi @@ -384,11 +389,36 @@ if test -n "$libdb3" -a -n "$libthread" ; then LIBS="$saveLIBS" fi +else +dnl ------------------ with internal db + AC_DEFINE(HAVE_DB3_DB_H) + WITH_DB_SUBDIR=db3 + WITH_INTERNAL_DB=1 + DBLIBSRCS="db3.c" + usedb1=no + libdb3="# \$(top_builddir)/db3/libdb.la" + libdb3a="\$(top_builddir)/db3/libdb.a" +dnl INCPATH="-I\$(top_builddir)/$(WITH_DB_SUBDIR) $INCPATH" +fi + +if test "$usedb1" = "yes"; then + dnl Check for Berkeley db1 API in glibc. + AC_CHECK_FUNC(dbopen, [DBLIBSRCS="$DBLIBSRCS db3.c"], + AC_CHECK_LIB(db1, dbopen, [DBLIBSRCS="$DBLIBSRCS db1.c falloc.c" ; libdb1="-ldb1"], + AC_CHECK_LIB(db, dbopen, [DBLIBSRCS="$DBLIBSRCS db1.c falloc.c" ; libdb1="-ldb"]) + ) + ) +fi + +AC_SUBST(WITH_DB_SUBDIR) +AC_SUBST(WITH_INTERNAL_DB) + DBLIBOBJS=`echo $DBLIBSRCS | sed -e "s/\.c/\.lo/g"` AC_SUBST(DBLIBSRCS) AC_SUBST(DBLIBOBJS) AC_SUBST(libdb3) +AC_SUBST(libdb3a) AC_SUBST(libdb2) AC_SUBST(libdb1) @@ -456,7 +486,6 @@ AC_HEADER_MAJOR AC_HEADER_DIRENT AC_HEADER_TIME -AC_CHECK_HEADERS(db_185.h db1/db.h db3/db.h) AC_CHECK_HEADERS(fcntl.h getopt.h grp.h memory.h netdb.h pwd.h utime.h) AC_CHECK_HEADERS(sys/socket.h sys/select.h) @@ -1065,9 +1094,6 @@ AC_SUBST(FINDREQUIRES) FINDPROVIDES="${RPMCONFIGDIR}/find-provides" AC_DEFINE_UNQUOTED(FINDPROVIDES, "$FINDPROVIDES") AC_SUBST(FINDPROVIDES) -TOP_SOURCEDIR="`pwd`" -AC_DEFINE_UNQUOTED(TOP_SOURCEDIR, "$TOP_SOURCEDIR") -AC_SUBST(TOP_SOURCEDIR) testdir="`pwd`/tests" dnl AC_DEFINE_UNQUOTED(testdir, "$testdir") @@ -1088,17 +1114,29 @@ 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 rpm.spec scripts/brp-redhat +AC_CONFIG_SUBDIRS(popt $WITH_DB_SUBDIR) + +AC_OUTPUT([ Doxyfile Makefile rpmrc macros platform rpmpopt rpm.spec rpmio/Makefile lib/Makefile build/Makefile tools/Makefile - scripts/Makefile + scripts/Makefile scripts/brp-redhat tests/Makefile tests/rpmrc tests/macros tests/hello-test/Makefile misc/Makefile po/Makefile.in intl/Makefile doc/Makefile doc/manual/Makefile doc/ja/Makefile doc/pl/Makefile doc/ru/Makefile doc/sk/Makefile - python/Makefile perl/Makefile perl/Makefile.PL], - [echo timestamp > popt/stamp-h.in - echo timestamp > stamp-h.in]) + python/Makefile perl/Makefile perl/Makefile.PL ], + [ +dnl rm -f db/build_unix/configure +dnl echo "set -x ; exec ../dist/configure \$(echo \$* | sed -e 's% --srcdir=\[^ \]*% --srcdir=../dist%')" > db/build_unix/configure +dnl chmod +x db/build_unix/configure +dnl if test -n "$WITH_DB_SUBDIR"; then +dnl ( cd $WITH_DB_SUBDIR +dnl CFLAGS="$CFLAGS" ../dist/configure --prefix="$prefix" --enable-shared --enable-static + dnl ) +dnl fi + echo timestamp > popt/stamp-h.in + echo timestamp > stamp-h.in + ] +) dnl touch Makefile.in dnl sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile]) diff --git a/db3/configure b/db3/configure new file mode 100755 index 000000000..ebfcacfcb --- /dev/null +++ b/db3/configure @@ -0,0 +1,13 @@ +#!/bin/sh +#set -x +db_dist="../db/dist" +$db_dist/configure \ + $(echo $* | sed -e "s% --srcdir=[^ ]*% --srcdir=$db_dist%") + +mv Makefile Makefile.orig +cat Makefile.orig | sed -e '/^install:/c\ +distdir:\ +\ +install:\ +\ +db3_install: all install_setip \\' > Makefile diff --git a/lib/header.h b/lib/header.h index 727115638..c566904eb 100644 --- a/lib/header.h +++ b/lib/header.h @@ -208,7 +208,9 @@ unsigned int headerSizeof(/*@null@*/ Header h, enum hMagic magicp) * @param p on-disk header (with offsets) * @return header */ +/*@-exportlocal@*/ /*@null@*/ Header headerLoad(/*@kept@*/ void * p) /*@*/; +/*@=exportlocal@*/ /** \ingroup header * Make a copy and convert header to in-memory representation. diff --git a/perl/Makefile.in b/perl/Makefile.in index 292bac12c..547b2bb4b 100644 --- a/perl/Makefile.in +++ b/perl/Makefile.in @@ -124,7 +124,6 @@ RPMCANONOS = @RPMCANONOS@ RPMCANONVENDOR = @RPMCANONVENDOR@ RPMCONFIGDIR = @RPMCONFIGDIR@ SYSCONFIGDIR = @SYSCONFIGDIR@ -TOP_SOURCEDIR = @TOP_SOURCEDIR@ U = @U@ UNZIPBIN = @UNZIPBIN@ USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ @@ -133,6 +132,8 @@ VERSION = @VERSION@ WITH_APIDOCS = @WITH_APIDOCS@ WITH_APIDOCS_TARGET = @WITH_APIDOCS_TARGET@ WITH_BZIP2 = @WITH_BZIP2@ +WITH_DB_SUBDIR = @WITH_DB_SUBDIR@ +WITH_INTERNAL_DB = @WITH_INTERNAL_DB@ WITH_PYTHON_SUBDIR = @WITH_PYTHON_SUBDIR@ WITH_PYTHON_SUBPACKAGE = @WITH_PYTHON_SUBPACKAGE@ __CAT = @__CAT@ @@ -168,6 +169,7 @@ l = @l@ libdb1 = @libdb1@ libdb2 = @libdb2@ libdb3 = @libdb3@ +libdb3a = @libdb3a@ testdir = @testdir@ tmpdir = @tmpdir@ varprefix = @varprefix@ diff --git a/python/Makefile.in b/python/Makefile.in index c5d893dda..03f12dfda 100644 --- a/python/Makefile.in +++ b/python/Makefile.in @@ -124,7 +124,6 @@ RPMCANONOS = @RPMCANONOS@ RPMCANONVENDOR = @RPMCANONVENDOR@ RPMCONFIGDIR = @RPMCONFIGDIR@ SYSCONFIGDIR = @SYSCONFIGDIR@ -TOP_SOURCEDIR = @TOP_SOURCEDIR@ U = @U@ UNZIPBIN = @UNZIPBIN@ USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ @@ -133,6 +132,8 @@ VERSION = @VERSION@ WITH_APIDOCS = @WITH_APIDOCS@ WITH_APIDOCS_TARGET = @WITH_APIDOCS_TARGET@ WITH_BZIP2 = @WITH_BZIP2@ +WITH_DB_SUBDIR = @WITH_DB_SUBDIR@ +WITH_INTERNAL_DB = @WITH_INTERNAL_DB@ WITH_PYTHON_SUBDIR = @WITH_PYTHON_SUBDIR@ WITH_PYTHON_SUBPACKAGE = @WITH_PYTHON_SUBPACKAGE@ __CAT = @__CAT@ @@ -168,6 +169,7 @@ l = @l@ libdb1 = @libdb1@ libdb2 = @libdb2@ libdb3 = @libdb3@ +libdb3a = @libdb3a@ testdir = @testdir@ tmpdir = @tmpdir@ varprefix = @varprefix@ @@ -1,6 +1,7 @@ -%define with_python_subpackage 1 -%define with_bzip2 1 -%define with_apidocs 1 +%define with_python_subpackage 1 %{nil} +%define with_bzip2 1 %{nil} +%define with_apidocs 1 %{nil} +%define with_internal_db 1 %{nil} %define strip_binaries 1 # XXX legacy requires './' payload prefix to be omitted from rpm packages. @@ -23,6 +24,7 @@ Prereq: gawk fileutils textutils mktemp Requires: popt %endif +%if !%{with_internal_db} BuildRequires: db3-devel # XXX glibc-2.1.92 has incompatible locale changes that affect statically @@ -32,6 +34,7 @@ Requires: glibc >= 2.1.92 # XXX needed to avoid libdb.so.2 satisfied by compat/libc5 provides. Requires: db1 = 1.85 %endif +%endif # XXX Red Hat 5.2 has not bzip2 or python %if %{with_bzip2} diff --git a/rpm.spec.in b/rpm.spec.in index 6f4da2db3..f37fee959 100644 --- a/rpm.spec.in +++ b/rpm.spec.in @@ -1,6 +1,7 @@ -%define with_python_subpackage @WITH_PYTHON_SUBPACKAGE@ -%define with_bzip2 @WITH_BZIP2@ -%define with_apidocs @WITH_APIDOCS@ +%define with_python_subpackage @WITH_PYTHON_SUBPACKAGE@ %{nil} +%define with_bzip2 @WITH_BZIP2@ %{nil} +%define with_apidocs @WITH_APIDOCS@ %{nil} +%define with_internal_db @WITH_INTERNAL_DB@ %{nil} %define strip_binaries 1 # XXX legacy requires './' payload prefix to be omitted from rpm packages. @@ -23,6 +24,7 @@ Prereq: gawk fileutils textutils mktemp Requires: popt %endif +%if !%{with_internal_db} BuildRequires: db3-devel # XXX glibc-2.1.92 has incompatible locale changes that affect statically @@ -32,6 +34,7 @@ Requires: glibc >= 2.1.92 # XXX needed to avoid libdb.so.2 satisfied by compat/libc5 provides. Requires: db1 = 1.85 %endif +%endif # XXX Red Hat 5.2 has not bzip2 or python %if %{with_bzip2} @@ -116,9 +119,9 @@ capabilities. %build %ifos linux -CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%{__prefix} --sysconfdir=/etc --localstatedir=/var --infodir='${prefix}%{__share}/info' --mandir='${prefix}%{__share}/man' +CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%{__prefix} --sysconfdir=/etc --localstatedir=/var --infodir='${prefix}%{__share}/info' --mandir='${prefix}%{__share}/man' # --enable-db1 %else -CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%{__prefix} +CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%{__prefix} # --enable-db1 %endif make diff --git a/tools/Makefile.am b/tools/Makefile.am index 1f7527e36..b4b5d7c5d 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -15,6 +15,7 @@ EXTRA_PROGRAMS = rpminject rpmsort myLDADD = $(top_builddir)/build/librpmbuild.la \ $(top_builddir)/lib/librpm.la \ + @libdb3a@ \ $(top_builddir)/rpmio/librpmio.la \ $(top_builddir)/popt/libpopt.la \ @INTLLIBS@ |