Index: rpm-4.9.1.2/autodeps/aix.prov
===================================================================
--- rpm-4.9.1.2.orig/autodeps/aix.prov	2011-07-12 13:28:13.000000000 +0200
+++ rpm-4.9.1.2/autodeps/aix.prov	2012-04-19 12:50:07.000000000 +0200
@@ -67,6 +67,8 @@
 }
 
 PATH=/usr/bin
+#Ensure we process 32-bit items
+export OBJECT_MODE=32
 
 machinetype=`uname -m`
 if [[ $machinetype = "ia64" ]]
Index: rpm-4.9.1.2/autodeps/aix.req
===================================================================
--- rpm-4.9.1.2.orig/autodeps/aix.req	2011-07-12 13:28:13.000000000 +0200
+++ rpm-4.9.1.2/autodeps/aix.req	2012-04-19 12:50:07.000000000 +0200
@@ -157,6 +157,9 @@
    done | sort -u
 }
 
+#Ensure we process 32-bit items
+export OBJECT_MODE=32
+
 machinetype=`uname -m`
 if [[ $machinetype = "ia64" ]]
 then
Index: rpm-4.9.1.2/macros.in
===================================================================
--- rpm-4.9.1.2.orig/macros.in	2011-07-15 11:32:41.000000000 +0200
+++ rpm-4.9.1.2/macros.in	2012-04-19 13:02:57.000000000 +0200
@@ -160,7 +160,7 @@
 %_bzip2bin		%{__bzip2}
 
 #	The location of the rpm database file(s).
-%_dbpath		%{_var}/lib/rpm
+%_dbpath		 %{_usr}/packages
 
 #	The location of the rpm database file(s) after "rpm --rebuilddb".
 %_dbpath_rebuild	%{_dbpath}
@@ -232,7 +232,7 @@
 %_tmppath		%{_var}/tmp
 
 #	Path to top of build area.
-%_topdir		%{getenv:HOME}/rpmbuild
+%_topdir		%{_usrsrc}/packages
 
 #	The path to the unzip executable (legacy, use %{__unzip} instead).
 %_unzipbin		%{__unzip}
@@ -585,7 +585,7 @@
 #	binary packages.
 #
 # XXX	Note: escaped %% for use in headerSprintf()
-%_build_name_fmt	%%{ARCH}/%%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm
+%_build_name_fmt	%%{ARCH}/%%{NAME}-%%{VERSION}-%%{RELEASE}.%%{OS}.%%{ARCH}.rpm
 
 #	The default transaction color. This value is a set of bits to
 #	determine file and dependency affinity for this arch.
Index: rpm-4.9.1.2/config.rpath
===================================================================
--- rpm-4.9.1.2.orig/config.rpath	2011-07-12 13:29:38.000000000 +0200
+++ rpm-4.9.1.2/config.rpath	2012-04-19 13:12:08.000000000 +0200
@@ -155,7 +155,7 @@
   # option of GNU ld is called -rpath, not --rpath.
   hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
   case "$host_os" in
-    aix3* | aix4* | aix5*)
+    aix3* | aix4* | aix5* | aix6* | aix7*)
       # On AIX/PPC, the GNU linker is very broken
       if test "$host_cpu" != ia64; then
         ld_shlibs=no
@@ -251,7 +251,7 @@
         hardcode_direct=unsupported
       fi
       ;;
-    aix4* | aix5*)
+    aix4* | aix5* | aix6* | aix7*)
       if test "$host_cpu" = ia64; then
         # On IA64, the linker does run time linking by default, so we don't
         # have to do anything special.
@@ -261,7 +261,7 @@
         # Test if we are trying to use run time linking or normal
         # AIX style linking. If -brtl is somewhere in LDFLAGS, we
         # need to do runtime linking.
-        case $host_os in aix4.[23]|aix4.[23].*|aix5*)
+        case $host_os in aix4.[23]|aix4.[23].*|aix5* |aix6* | aix7*)
           for ld_flag in $LDFLAGS; do
             if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
               aix_use_runtimelinking=yes
@@ -492,7 +492,7 @@
 case "$host_os" in
   aix3*)
     ;;
-  aix4* | aix5*)
+  aix4* | aix5* |aix6* | aix7*)
     ;;
   amigaos*)
     ;;
