diff --git a/CHANGES b/CHANGES index fe14cc57e..abffc7b83 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,5 @@ 2.91 -> 2.92 + - fix: with --target=i686, pass macro %_arch=i386. - fix: rpm --target=arch ... resurrected. - fix: rpm -q --specfile --specedit now works even with BuildArch:. diff --git a/configure.in b/configure.in index 9bf6db894..931891831 100644 --- a/configure.in +++ b/configure.in @@ -578,6 +578,22 @@ else ln -s ${srcdir}/autodeps/none ./find-requires fi +dnl Determine the canonical arch-vendor-os for the build machine +case "${build_cpu}" in +i[x3456789]86) RPMCANONARCH=i386 ;; +alpha*) RPMCANONARCH=alpha ;; +sparc*) RPMCANONARCH=sparc ;; +*) RPMCANONARCH=unknown ;; +esac +RPMCANONVENDOR="$build_vendor" +case "${build_vendor}" in +unknown) test -f /etc/redhat-release && RPMCANONVENDOR=redhat ;; +esac +RPMCANONOS="$build_os_noversion" +AC_SUBST(RPMCANONARCH) +AC_SUBST(RPMCANONVENDOR) +AC_SUBST(RPMCANONOS) + if test -n "$LIBOBJS" ; then LIBMISC="$(top_builddir)/misc/libmisc.a" fi diff --git a/macros.in b/macros.in index 8a5e88aae..5eaada8d2 100644 --- a/macros.in +++ b/macros.in @@ -37,9 +37,7 @@ # These are the default values that will be overridden by any # explicit values found in /usr/lib/rpm/rpmrc or /etc/rpmrc. # -%_buildarch Unknown %_builddir %{_topdir}/BUILD -%_buildos Linux %_bzip2bin @BZIP2BIN@ %_dbpath %{_var}/lib/rpm %_defaultdocdir /usr/doc @@ -52,6 +50,14 @@ %_srcrpmdir %{_topdir}/SRPMS %_tmppath %{_var}/tmp %_topdir %{_usrsrc}/redhat + +#============================================================================== +# ---- rpm per-platform macros. +# Per-platform macros. +%_arch @RPMCANONARCH@ +%_vendor @RPMCANONVENDOR@ +%_os @RPMCANONOS@ +%_target_platform %{_target_cpu}-%{_vendor}-%{_target_os} # # XXX use the rpmrc instantiated macro for now #%optflags -O2 @@ -104,10 +110,10 @@ # (Note: Above is the goal, below are the macros under development) # # The configure macro does the following: -# optionally change to a subdirectory. -# attempt to update onfig.guess and config.sub. +# optionally change to a subdirectory (not implemented). +# attempt to update config.guess and config.sub. # run configure with correct prefix, platform, and CFLAGS. -# optionally restore current directory. +# optionally restore current directory (not implemented). # The configure macro should be invoked as %configure (rather than %{configure}) # because the rest of the arguments will be expanded using %*. Another # gotcha is that arguments, if present, should be on the same line as the @@ -115,4 +121,4 @@ # %configure \ %{?__libtoolize:[ -f configure.in ] && %{__libtoolize} --copy --force} \ - CFLAGS="%{optflags}" ./configure %{_target} --prefix=%{_prefix} + CFLAGS="%{optflags}" ../configure %{_target_platform} --prefix=%{_prefix} diff --git a/rpm.spec b/rpm.spec index 6d20f77ff..045b4c803 100644 --- a/rpm.spec +++ b/rpm.spec @@ -2,7 +2,7 @@ Summary: The Red Hat package management system. Name: rpm %define version 2.92 Version: %{version} -Release: 6 +Release: 7 Group: System Environment/Base Source: ftp://ftp.rpm.org/pub/rpm/dist/rpm-2.5.x/rpm-%{version}.tar.gz Copyright: GPL diff --git a/scripts/Makefile.in b/scripts/Makefile.in index 8dfdffe70..7c3a3fa97 100644 --- a/scripts/Makefile.in +++ b/scripts/Makefile.in @@ -114,6 +114,9 @@ POSUB = @POSUB@ RANLIB = @RANLIB@ ROOT_GROUP = @ROOT_GROUP@ RPM = @RPM@ +RPMCANONARCH = @RPMCANONARCH@ +RPMCANONOS = @RPMCANONOS@ +RPMCANONVENDOR = @RPMCANONVENDOR@ RPMCONFIGDIR = @RPMCONFIGDIR@ TARGET = @TARGET@ U = @U@ diff --git a/tests/macros.in b/tests/macros.in index e44952879..4e67e8ec3 100644 --- a/tests/macros.in +++ b/tests/macros.in @@ -37,9 +37,7 @@ # These are the default values that will be overridden by any # explicit values found in /usr/lib/rpm/rpmrc or /etc/rpmrc. # -%_buildarch Unknown %_builddir %{_topdir}/BUILD -%_buildos Linux %_bzip2bin @BZIP2BIN@ %_dbpath %{_var}/lib/rpm %_defaultdocdir /usr/doc @@ -52,6 +50,14 @@ %_srcrpmdir %{_topdir}/SRPMS %_tmppath %{_var}/tmp %_topdir %{_usrsrc}/redhat + +#============================================================================== +# ---- rpm per-platform macros. +# Per-platform macros. +%_arch @RPMCANONARCH@ +%_vendor @RPMCANONVENDOR@ +%_os @RPMCANONOS@ +%_target_platform %{_target_cpu}-%{_vendor}-%{_target_os} # # XXX use the rpmrc instantiated macro for now #%optflags -O2 @@ -93,10 +99,10 @@ %_host_vendor @host_vendor@ %_host_os @host_os@ %_target %{_host} -%_target_alias %{_host_alias) -%_target_cpu %{_host_cpu) -%_target_vendor %{_host_vendor) -%_target_os %{_host_os) +%_target_alias %{_host_alias} +%_target_cpu %{_host_cpu} +%_target_vendor %{_host_vendor} +%_target_os %{_host_os} #============================================================================== # ---- specfile macros. @@ -104,10 +110,10 @@ # (Note: Above is the goal, below are the macros under development) # # The configure macro does the following: -# optionally change to a subdirectory. -# attempt to update onfig.guess and config.sub. +# optionally change to a subdirectory (not implemented). +# attempt to update config.guess and config.sub. # run configure with correct prefix, platform, and CFLAGS. -# optionally restore current directory. +# optionally restore current directory (not implemented). # The configure macro should be invoked as %configure (rather than %{configure}) # because the rest of the arguments will be expanded using %*. Another # gotcha is that arguments, if present, should be on the same line as the @@ -115,4 +121,4 @@ # %configure \ %{?__libtoolize:[ -f configure.in ] && %{__libtoolize} --copy --force} \ - CFLAGS="%{optflags}" ./configure %{_target} --prefix=%{_prefix} + CFLAGS="%{optflags}" ../configure %{_target_platform} --prefix=%{_prefix}