File build.diff of Package rpm

Many changes to Makefiles/autogen and the like to make it build
on SUSE systems.

---
 autogen.sh           |   16 +++--
 build/Makefile.am    |    2 
 configure.ac         |  153 ++++++++++++++++++++++++++++++++-------------------
 db3/configure        |    6 +-
 file/src/Makefile.am |    2 
 installplatform      |    9 ++-
 lib/Makefile.am      |    2 
 popt/autogen.sh      |    2 
 rpmdb/Makefile.am    |    4 -
 rpmio/Makefile.am    |   10 +--
 scripts/Makefile.am  |    8 ++
 11 files changed, 132 insertions(+), 82 deletions(-)

Index: autogen.sh
===================================================================
--- autogen.sh.orig
+++ autogen.sh
@@ -26,12 +26,12 @@ case $libtoolize in
     esac
 esac
 
-[ "`$libtoolize --version | head -1`" != "$LTV" ] && echo "$USAGE" # && exit 1
-[ "`autoconf --version | head -1`" != "$ACV" ] && echo "$USAGE" # && exit 1
-[ "`automake --version | head -1 | sed -e 's/1\.4[a-z]/1.4/'`" != "$AMV" ] && echo "$USAGE" # && exit 1
+#[ "`$libtoolize --version | head -1`" != "$LTV" ] && echo "$USAGE" # && exit 1
+#[ "`autoconf --version | head -1`" != "$ACV" ] && echo "$USAGE" # && exit 1
+#[ "`automake --version | head -1 | sed -e 's/1\.4[a-z]/1.4/'`" != "$AMV" ] && echo "$USAGE" # && exit 1
 
 myopts=
-if [ X"$@" = X  -a "X`uname -s`" = "XDarwin" -a -d /opt/local ]; then
+if [ X"$*" = X  -a "X`uname -s`" = "XDarwin" -a -d /opt/local ]; then
     export myopts="--prefix=/usr --disable-nls"
     export CPPFLAGS="-I${myprefix}/include"
 fi
@@ -49,10 +49,11 @@ if [ -d zlib ]; then
     (echo "--- zlib"; cd zlib; ./autogen.sh --noconfigure "$@")
 fi
 if [ -d beecrypt ]; then
-    (echo "--- beecrypt"; cd beecrypt; ./autogen.sh --noconfigure "$@")
+    #(echo "--- beecrypt"; cd beecrypt; ./autogen.sh --noconfigure "$@")
+    (echo "--- beecrypt"; cd beecrypt; ./autogen.sh --without-cplusplus --without-java --without-python "$@")
 fi
 if [ -d elfutils ]; then
-    (echo "--- elfutils"; cd elfutils; ./autogen.sh --noconfigure "$@")
+    (echo "--- elfutils"; cd elfutils; ./autogen.sh "$@")
 fi
 if [ -d file ]; then
     (echo "--- file"; cd file; ./autogen.sh --noconfigure "$@")
@@ -60,6 +61,7 @@ fi
 if [ -d neon ]; then
     (echo "--- neon"; cd neon; ./autogen.sh "$@")
 fi
+(echo "--- db"; cd db/dist; libtoolize --copy --force ; rm aclocal/libtool.ac ; ./s_config )
 
 echo "--- rpm"
 $libtoolize --copy --force
@@ -72,7 +74,7 @@ if [ "$1" = "--noconfigure" ]; then
     exit 0;
 fi
 
-if [ X"$@" = X  -a "X`uname -s`" = "XLinux" ]; then
+if [ X"$*" = X  -a "X`uname -s`" = "XLinux" ]; then
     if [ -d /usr/share/man ]; then
 	mandir=/usr/share/man
 	infodir=/usr/share/info
Index: build/Makefile.am
===================================================================
--- build/Makefile.am.orig
+++ build/Makefile.am
@@ -22,7 +22,7 @@ pkgincdir = $(pkgincludedir)
 pkginc_HEADERS = rpmbuild.h rpmfc.h rpmfile.h rpmspec.h
 noinst_HEADERS = buildio.h
 
-LDFLAGS = -L$(RPM_BUILD_ROOT)$(usrlibdir) -L$(DESTDIR)$(usrlibdir)
+LDFLAGS =
 
 usrlibdir = $(libdir)@MARK64@
 usrlib_LTLIBRARIES = librpmbuild.la
Index: configure.ac
===================================================================
--- configure.ac.orig
+++ configure.ac
@@ -327,9 +327,9 @@ AC_SUBST(WITH_BZIP2)
 localdone=
 
 dirs=$prefix
-if test "$cross_compiling" != "yes"; then
-  dirs="$dirs /usr/local"
-fi
+#if test "$cross_compiling" != "yes"; then
+#  dirs="$dirs /usr/local"
+#fi
 for dir in $dirs
 do
 	case $dir in
@@ -430,9 +430,9 @@ WITH_LIBELF_LIB=
 AC_CHECK_HEADER([libelf.h])
 AC_CHECK_HEADER([gelf.h], [
 	AC_DEFINE(HAVE_GELF_H, 1, [Define to 1 if you have the <gelf.h> header file.])
-	AC_CHECK_LIB(elf, gelf_getvernaux, [
+	AC_CHECK_LIB(elf_pic, gelf_getvernaux, [
 	    AC_DEFINE(HAVE_LIBELF, 1, [Define to 1 if you have the 'elf' library (-lelf).])
-	    WITH_LIBELF_LIB="-lelf"
+	    WITH_LIBELF_LIB="-lelf_pic"
 	])
     ], [
 	if test -d elfutils/libelf ; then
@@ -440,7 +440,7 @@ AC_CHECK_HEADER([gelf.h], [
 	    AC_DEFINE(HAVE_LIBELF, 1, [Define to 1 if you have the 'elf' library (-lelf).])
 	    WITH_ELFUTILS_SUBDIR=elfutils
 	    WITH_LIBELF_INCLUDE="-I\${top_srcdir}/${WITH_ELFUTILS_SUBDIR}/libelf"
-	    WITH_LIBELF_LIB="\${top_builddir}/${WITH_ELFUTILS_SUBDIR}/libelf/libelf.a"
+	    WITH_LIBELF_LIB="\${top_builddir}/${WITH_ELFUTILS_SUBDIR}/libelf/libelf_pic.a"
 	fi
 ])
 AC_SUBST(WITH_ELFUTILS_SUBDIR)
@@ -481,12 +481,13 @@ AC_CHECK_HEADER([beecrypt/beecrypt.h], [
     AC_DEFINE(HAVE_LIBBEECRYPT, 1, [Define to 1 if you have the 'beecrypt' library (-lbeecrypt).])
     WITH_BEECRYPT_SUBDIR=beecrypt
     WITH_BEECRYPT_INCLUDE="-I\${top_srcdir}/${WITH_BEECRYPT_SUBDIR}"
-    WITH_BEECRYPT_LIB="\${top_builddir}/${WITH_BEECRYPT_SUBDIR}/libbeecrypt.la"
-  fi
-
+    dnl WITH_BEECRYPT_LIB="\${top_builddir}/${WITH_BEECRYPT_SUBDIR}/libbeecrypt.la"
+    AC_DEFINE(HAVE_BEECRYPT_API_H, 1, [Define to 1 if you have the <beecrypt/api.h> header file.])
+  else
    if test -z "${WITH_BEECRYPT_LIB}" ; then
        AC_MSG_ERROR([rpm requires beecrypt]) 
    fi
+  fi
 ])
 AC_SUBST(WITH_BEECRYPT_SUBDIR)
 AC_SUBST(WITH_BEECRYPT_INCLUDE)
@@ -861,8 +862,23 @@ withval=auto
 AC_ARG_WITH(python, [  --with-python           build rpm python bindings ])
 
 WITH_PYTHON_VERSION=$withval
+
 if test $withval = auto ; then
+AC_MSG_CHECKING(for python 2.6)
+AC_RUN_IFELSE([AC_LANG_SOURCE([[
+#include <python2.6/Python.h>
+main() {
+  exit(strncmp("2.6", PY_VERSION, 3));
+} ]])],[withval=yes],[withval=no],[withval=yes])
+  AC_MSG_RESULT($withval)
+  if test $withval = yes ; then
+    WITH_PYTHON_VERSION="2.6"
+  else
+    withval=auto
+  fi
+fi
 
+if test $withval = auto ; then
 AC_MSG_CHECKING(for python 2.5)
 AC_RUN_IFELSE([AC_LANG_SOURCE([[
 #include <python2.5/Python.h>
@@ -873,56 +889,74 @@ main() {
   if test $withval = yes ; then
     WITH_PYTHON_VERSION="2.5"
   else
+    withval=auto
+  fi
+fi
 
-  AC_MSG_CHECKING(for python 2.4)
-  AC_RUN_IFELSE([AC_LANG_SOURCE([[
-  #include <python2.4/Python.h>
-  main() {
-    exit(strncmp("2.4", PY_VERSION, 3));
-  } ]])],[withval=yes],[withval=no],[withval=yes])
-    AC_MSG_RESULT($withval)
-    if test $withval = yes ; then
-      WITH_PYTHON_VERSION="2.4"
-    else
-    
-    AC_MSG_CHECKING(for python 2.3)
-    AC_RUN_IFELSE([AC_LANG_SOURCE([[
-    #include <python2.3/Python.h>
-    main() {
-      exit(strncmp("2.3", PY_VERSION, 3));
-    } ]])],[withval=yes],[withval=no],[withval=yes])
-      AC_MSG_RESULT($withval)
-      if test $withval = yes ; then
-        WITH_PYTHON_VERSION="2.3"
-      else
-    
-        AC_MSG_CHECKING(for python 2.2)
-        AC_RUN_IFELSE([AC_LANG_SOURCE([[
-      #include <python2.2/Python.h>
-      main() {
-        exit(strncmp("2.2", PY_VERSION, 3));
-      } ]])],[withval=yes],[withval=no],[withval=yes])
-        AC_MSG_RESULT($withval)
-        if test $withval = yes ; then
-          WITH_PYTHON_VERSION="2.2"
-        else
-    
-          AC_MSG_CHECKING(for python 1.5.2)
-          AC_RUN_IFELSE([AC_LANG_SOURCE([[
-      #include <python1.5/Python.h>
-      main() {
-        exit(strcmp("1.5.2", PY_VERSION));
-      } ]])],[withval=yes],[withval=no],[withval=yes])
-          AC_MSG_RESULT($withval)
-          if test $withval = yes ; then
-            WITH_PYTHON_VERSION="1.5"
-          fi
-        fi
-      fi
-    fi
+if test $withval = auto ; then
+AC_MSG_CHECKING(for python 2.4)
+AC_RUN_IFELSE([AC_LANG_SOURCE([[
+#include <python2.4/Python.h>
+main() {
+  exit(strncmp("2.4", PY_VERSION, 3));
+} ]])],[withval=yes],[withval=no],[withval=yes])
+  AC_MSG_RESULT($withval)
+  if test $withval = yes ; then
+    WITH_PYTHON_VERSION="2.4"
+  else
+    withval=auto
+  fi
+fi
+
+if test $withval = auto ; then
+AC_MSG_CHECKING(for python 2.3)
+AC_RUN_IFELSE([AC_LANG_SOURCE([[
+#include <python2.3/Python.h>
+main() {
+  exit(strncmp("2.3", PY_VERSION, 3));
+} ]])],[withval=yes],[withval=no],[withval=yes])
+  AC_MSG_RESULT($withval)
+  if test $withval = yes ; then
+    WITH_PYTHON_VERSION="2.3"
+  else
+    withval=auto
+  fi
+fi
+
+if test $withval = auto ; then
+AC_MSG_CHECKING(for python 2.2)
+AC_RUN_IFELSE([AC_LANG_SOURCE([[
+#include <python2.2/Python.h>
+main() {
+  exit(strncmp("2.2", PY_VERSION, 3));
+} ]])],[withval=yes],[withval=no],[withval=yes])
+  AC_MSG_RESULT($withval)
+  if test $withval = yes ; then
+    WITH_PYTHON_VERSION="2.2"
+  else
+    withval=auto
   fi
 fi
 
+if test $withval = auto ; then
+AC_MSG_CHECKING(for python 1.5.2)
+AC_RUN_IFELSE([AC_LANG_SOURCE([[
+#include <python1.5/Python.h>
+main() {
+  exit(strcmp("1.5.2", PY_VERSION));
+} ]])],[withval=yes],[withval=no],[withval=yes])
+  AC_MSG_RESULT($withval)
+  if test $withval = yes ; then
+    WITH_PYTHON_VERSION="1.5"
+  else
+    withval=auto
+  fi
+fi
+
+if test $withval = auto ; then
+  WITH_PYTHON_VERSION="no"
+fi
+
 if test "$WITH_PYTHON_VERSION" != no ; then
   WITH_PYTHON_SUBDIR=python
   WITH_PYTHON_SUBPACKAGE=1
@@ -1218,6 +1252,7 @@ arm*)		RPMCANONCOLOR=0; RPMCANONARCH=arm
 mipsel*)	RPMCANONCOLOR=0; RPMCANONARCH=mipsel ;;
 mips*)		RPMCANONCOLOR=0; RPMCANONARCH=mips ;;
 m68k*)		RPMCANONCOLOR=0; RPMCANONARCH=m68k ;;
+parisc*|hppa*)	RPMCANONCOLOR=0; RPMCANONARCH=hppa ;;
 sh3*)		RPMCANONCOLOR=0; RPMCANONARCH=sh3 ;;
 sh4*)		RPMCANONCOLOR=0; RPMCANONARCH=sh4 ;;
 *)		RPMCANONCOLOR=0; RPMCANONARCH=unknown ;;
@@ -1227,7 +1262,8 @@ mint)		RPMCANONARCH=m68kmint ;;
 esac
 RPMCANONVENDOR="$build_vendor"
 case "${build_vendor}" in
-unknown|pc|ibm|redhat|pld|mandrake|conectiva|lvr|yellowdog|caos)
+unknown|pc|ibm|redhat|pld|mandrake|conectiva|lvr|yellowdog|caos|suse)
+	RPMCANONVENDOR=suse
 	test -f /etc/redhat-release &&		RPMCANONVENDOR=redhat
 	test -f /etc/pld-release &&		RPMCANONVENDOR=pld
 	test -f /etc/mandrake-release &&	RPMCANONVENDOR=mandrake
@@ -1237,6 +1273,11 @@ unknown|pc|ibm|redhat|pld|mandrake|conec
 	test -f /etc/caos-release &&		RPMCANONVENDOR=caos
 	;;
 esac
+if test "$RPMCANONVENDOR" = suse ; then
+    RPMCANONCOLOR=0
+    autorelocate_path='%{nil}'
+    autorelocate_dcolor='0'
+fi
 RPMCANONOS="$build_os_noversion"
 RPMCANONGNU="$build_os_gnu"
 AC_SUBST(RPMCANONCOLOR)
Index: db3/configure
===================================================================
--- db3/configure.orig
+++ db3/configure
@@ -10,9 +10,9 @@ rm -f config.cache
 # XXX edit CFLAGS= ... out of invocation args ???
 ARGS="`echo $* | sed -e 's% [^ ]*CFLAGS=[^ ]*%%' -e 's% -[^-][^ ]*%%g' -e 's% --param=[^ ]*%%g' -e 's%--cache-file=.*$%%'`"
 
-CC="$CC" CFLAGS="$CFLAGS" $db_dist/configure $ARGS \
-	--enable-shared --enable-static --enable-rpc \
-	--with-uniquename=_rpmdb --srcdir=$db_dist
+CC="$CC" CFLAGS="$CFLAGS" $db_dist/configure \
+	--enable-shared --enable-static \
+	--with-uniquename=_rpmdb --srcdir=$db_dist $ARGS
 
 mv Makefile Makefile.orig
 cat Makefile.orig | sed -e '/^install[:-]/c\
Index: file/src/Makefile.am
===================================================================
--- file/src/Makefile.am.orig
+++ file/src/Makefile.am
@@ -26,7 +26,7 @@ libmagic_la_LDFLAGS = -version-info 1:0:
 
 noinst_PROGRAMS = file
 file_SOURCES = file.c
-file_LDFLAGS = -L../../zlib # -all-static
+file_LDFLAGS = # -L../../zlib # -all-static
 file_LDADD = libmagic.la
 
 listobjs:
Index: installplatform
===================================================================
--- installplatform.orig
+++ installplatform
@@ -68,11 +68,11 @@ for SUBST in $SUBSTS ; do
     sparc64-linux) ARCH_INSTALL_POST=${pkglibdir}/brp-sparc64-linux; LIB=lib64; MULTILIBNO=2 ;;
     sparc64v-linux) ARCH_INSTALL_PORT=${pkglibdir}/brp-sparc64-linux; LIB=lib64; MULTILIBNO=2 ;;
     s390-linux) MULTILIBNO=1 ;;
-    s390x-linux) LIB=lib64; MULTILIBNO=2 ;;
+    s390x-linux) ARCH_INSTALL_POST=${pkglibdir}/brp-lib64-linux; LIB=lib64; MULTILIBNO=2 ;;
     ppc-linux) MULTILIBNO=1 ;;
-    ppc64-linux) LIB=lib64; MULTILIBNO=2 ;;
+    ppc64-linux) ARCH_INSTALL_POST=${pkglibdir}/brp-lib64-linux; LIB=lib64; MULTILIBNO=2 ;;
     i?86-linux|pentium?-linux|athlon-linux|geode-linux) MULTILIBNO=1 ;;
-    x86_64-linux|amd64-linux|ia32e-linux) LIB=lib64; MULTILIBNO=2 ;;
+    x86_64-linux|amd64-linux|ia32e-linux) ARCH_INSTALL_POST=${pkglibdir}/brp-lib64-linux; LIB=lib64; MULTILIBNO=2 ;;
   esac
 
   if [ -n "$MULTILIBNO" ]; then
@@ -102,6 +102,9 @@ for SUBST in $SUBSTS ; do
   apple)
     VENDORSED='-e s,^@apple@,,'
     ;;
+  suse)
+    VENDORSED='-e s,^@SuSE@,,'
+    ;;
   esac
 
   CANONARCH="`echo $ARCH|sed -e "$canonarch_sed"`"
Index: lib/Makefile.am
===================================================================
--- lib/Makefile.am.orig
+++ lib/Makefile.am
@@ -29,7 +29,7 @@ noinst_HEADERS = \
 mylibs = librpm.la
 LIBS =
 
-LDFLAGS = -L$(RPM_BUILD_ROOT)$(usrlibdir) -L$(DESTDIR)$(usrlibdir)
+LDFLAGS =
 
 usrlibdir = $(libdir)@MARK64@
 usrlib_LTLIBRARIES = librpm.la
Index: popt/autogen.sh
===================================================================
--- popt/autogen.sh.orig
+++ popt/autogen.sh
@@ -28,7 +28,7 @@ fi
 
 cd "$THEDIR"
 
-if [ X"$@" = X  -a "X`uname -s`" = "XLinux" ]; then
+if [ X"$*" = X  -a "X`uname -s`" = "XLinux" ]; then
     $srcdir/configure --prefix=/usr "$@"
 else
     $srcdir/configure "$@"
Index: rpmdb/Makefile.am
===================================================================
--- rpmdb/Makefile.am.orig
+++ rpmdb/Makefile.am
@@ -31,7 +31,7 @@ noinst_HEADERS = fprint.h header_interna
 pkgbindir = @RPMCONFIGDIR@
 pkgbin_PROGRAMS = \
 	rpmdb_archive rpmdb_checkpoint rpmdb_deadlock rpmdb_dump rpmdb_load \
-	rpmdb_printlog rpmdb_recover rpmdb_svc rpmdb_stat rpmdb_upgrade \
+	rpmdb_printlog rpmdb_recover rpmdb_stat rpmdb_upgrade \
 	rpmdb_verify 
 
 mylibs = librpmdb.la
@@ -42,7 +42,7 @@ LIBS =
 libdb_la = $(top_builddir)/$(WITH_DB_SUBDIR)/libdb.la
 
 # XXX grrr, RPM_BUILD_ROOT prevents build pollution if/when -lrpm different
-LDFLAGS = -L$(RPM_BUILD_ROOT)$(usrlibdir) -L$(DESTDIR)$(usrlibdir)
+LDFLAGS =
 
 usrlibdir = $(libdir)@MARK64@
 usrlib_LTLIBRARIES = librpmdb.la
Index: rpmio/Makefile.am
===================================================================
--- rpmio/Makefile.am.orig
+++ rpmio/Makefile.am
@@ -24,9 +24,9 @@ pkginc_HEADERS = \
 	rpmsq.h rpmsw.h ugid.h
 noinst_HEADERS = rpmio_internal.h rpmlua.h rpmhook.h
 
-BEECRYPTLOBJS = $(shell test X"@WITH_BEECRYPT_SUBDIR@" != X && cat $(top_builddir)/@WITH_BEECTYPT_SUBDIR@/listobjs)
+BEECRYPTLOBJS = $(shell test X"@WITH_BEECRYPT_SUBDIR@" != X && cat $(top_builddir)/@WITH_BEECRYPT_SUBDIR@/listobjs)
 
-LDFLAGS = -L$(RPM_BUILD_ROOT)$(usrlibdir) -L$(DESTDIR)$(usrlibdir)
+LDFLAGS =
 
 usrlibdir = $(libdir)@MARK64@
 usrlib_LTLIBRARIES = librpmio.la
@@ -41,14 +41,14 @@ librpmio_la_LDFLAGS = -release 4.4 $(LDF
 	@WITH_MAGIC_LIB@ \
 	@WITH_ZLIB_LIB@ \
 	-lpthread
-librpmio_la_LIBADD = # $(BEECRYPTLOBJS)
-librpmio_la_DEPENDENCIES = # .created
+librpmio_la_LIBADD = $(BEECRYPTLOBJS)
+librpmio_la_DEPENDENCIES = .created
 
 .created:
 	if test X"@WITH_BEECRYPT_SUBDIR@" != X; then \
 	${MAKE} -C $(top_builddir)/@WITH_BEECRYPT_SUBDIR@ listobjs ; \
 	for lo in $(BEECRYPTLOBJS); do \
-	  [ -f $$lo ] || $(LN_S) $(top_builddir)/@WITH_BEECRYPT_SUBDIR@/$$lo $$lo ; \
+	  [ -f $$lo ] || sed -e "s!'!'$(top_builddir)/beecrypt/!" < $(top_builddir)/beecrypt/$$lo > $$lo ; \
 	done \
 	fi
 	touch $@
Index: scripts/Makefile.am
===================================================================
--- scripts/Makefile.am.orig
+++ scripts/Makefile.am
@@ -9,6 +9,7 @@ EXTRA_DIST = \
 	brp-compress brp-python-bytecompile brp-java-gcjcompile brp-redhat \
 	brp-strip brp-strip-comment-note \
 	brp-strip-shared brp-strip-static-archive brp-sparc64-linux \
+	brp-lib64-linux brp-symlink \
 	check-files check-prereqs convertrpmrc.sh cross-build \
 	check-buildroot check-rpaths check-rpaths-worker \
 	find-debuginfo.sh find-lang.sh find-prov.pl find-req.pl \
@@ -21,7 +22,8 @@ EXTRA_DIST = \
 	sql.prov sql.req tcl.req tgpg trpm u_pkg.sh \
 	vpkg-provides.sh vpkg-provides2.sh \
 	macros.perl* macros.python* \
-	macros.php* find-*.php find-php-* mono-find* osgideps.pl
+	macros.php* find-*.php find-php-* mono-find* osgideps.pl \
+	find-provides.ksyms find-requires.ksyms
 
 installprefix = $(DESTDIR)
 
@@ -32,6 +34,7 @@ config_SCRIPTS = \
 	brp-compress brp-python-bytecompile brp-java-gcjcompile brp-redhat \
 	brp-strip brp-strip-comment-note \
 	brp-strip-shared brp-strip-static-archive brp-sparc64-linux \
+	brp-lib64-linux brp-symlink \
 	check-files check-prereqs convertrpmrc.sh cross-build \
 	check-buildroot check-rpaths check-rpaths-worker \
 	find-debuginfo.sh find-lang.sh find-prov.pl find-req.pl \
@@ -42,4 +45,5 @@ config_SCRIPTS = \
 	rpmdb_loadcvt rpmdiff rpmdiff.cgi \
 	rpm.daily rpm.log rpm.xinetd rpm2cpio.sh \
 	sql.prov sql.req tcl.req tgpg trpm u_pkg.sh \
-	vpkg-provides.sh vpkg-provides2.sh
+	vpkg-provides.sh vpkg-provides2.sh \
+	find-provides.ksyms find-requires.ksyms
openSUSE Build Service is sponsored by