static void addPackageProvides(Header h)
{
HAE_t hae = headerAddOrAppendEntry;
- const char *name = NULL;
- char *evr;
+ HGE_t hge = headerGetEntry;
+ const char *name = NULL, *arch = NULL;
+ char *evr, *isaprov;
rpmsenseFlags pflags = RPMSENSE_EQUAL;
+ int noarch = 0;
/* <name> = <evr> provide */
evr = headerGetEVR(h, &name);
hae(h, RPMTAG_PROVIDENAME, RPM_STRING_ARRAY_TYPE, &name, 1);
hae(h, RPMTAG_PROVIDEFLAGS, RPM_INT32_TYPE, &pflags, 1);
hae(h, RPMTAG_PROVIDEVERSION, RPM_STRING_ARRAY_TYPE, &evr, 1);
+
+ /*
+ * <name>(<isa>) = <evr> provide
+ * FIXME: noarch needs special casing for now as BuildArch: noarch doesn't
+ * cause reading in the noarch macros :-/
+ */
+ isaprov = rpmExpand(name, "%{?_isa}", NULL);
+ hge(h, RPMTAG_ARCH, NULL, (rpm_data_t *)&arch, NULL);
+ noarch = (strcmp(arch, "noarch") == 0);
+ if (!noarch && strcmp(name, isaprov)) {
+ hae(h, RPMTAG_PROVIDENAME, RPM_STRING_ARRAY_TYPE, &isaprov, 1);
+ hae(h, RPMTAG_PROVIDEFLAGS, RPM_INT32_TYPE, &pflags, 1);
+ hae(h, RPMTAG_PROVIDEVERSION, RPM_STRING_ARRAY_TYPE, &evr, 1);
+ }
+ free(isaprov);
+
free(evr);
}
x86_64-linux|amd64-linux|ia32e-linux) LIB=lib64; MULTILIBNO=2 ;;
esac
+ # XXX FIXME: incomplete and quite likely wrong too in places,
+ # consult various arch folks for correct names etc.
+ ISANAME=
+ ISABITS=
+ case "${ARCH}" in
+ sparc|sparcv8|sparcv9*)
+ ISANAME=sparc
+ ISABITS=32
+ ;;
+ sparc64|sparc64v)
+ ISANAME=sparc
+ ISABITS=64
+ ;;
+ s390)
+ ISANAME=s390
+ ISABITS=32
+ ;;
+ s390x)
+ ISANAME=s390
+ ISABITS=64
+ ;;
+ ppc)
+ ISANAME=ppc
+ ISABITS=32
+ ;;
+ ppc64)
+ ISANAME=ppc
+ ISABITS=64
+ ;;
+ i?86|pentium?|athlon|geode)
+ ISANAME=x86
+ ISABITS=32
+ ;;
+ x86_64|amd64|ia32e)
+ ISANAME=x86
+ ISABITS=64
+ ;;
+ esac
+
if [ -n "$MULTILIBNO" ]; then
MULTILIBSED='-e /^@MULTILIB/d -e s,@MULTILIBNO@,'$MULTILIBNO,
else
-e "s,@ARCH_INSTALL_POST@,$ARCH_INSTALL_POST," \
-e "s,@DEFAULTDOCDIR@,$DEFAULTDOCDIR," \
-e '/\${\w*:-/!s,\${,%{_,' \
+ -e "s,@ISANAME@,$ISANAME," \
+ -e "s,@ISABITS@,$ISABITS," \
$MULTILIBSED \
$VENDORSED \
| grep -v '^@' \
{ cd ${DESTDIR}/${platformdir}
[ -L noarch-${OS} ] && rm -f noarch-${OS} 2>/dev/null
mkdir -p noarch-${OS}
- sed -e "/^%_arch/s,${arch},noarch," ${arch}-${OS}/macros | grep -v '^%optflags' > noarch-${OS}/macros
+ sed -e "/^%_arch/s,${arch},noarch," ${arch}-${OS}/macros | grep -v '^%optflags' | grep -v "^%__isa" > noarch-${OS}/macros
# [ -d ${VENDOR} ] || mkdir ${VENDOR}
# for i in brp-* find-lang.sh find-provides find-requires perl.prov perl.req
# do
%optflags -O2
#
+# ISA dependency marker, none for noarch and name-bitness for others
+%_isa %{?__isa:(%{__isa})}%{!?__isa:%{nil}}
+
+#
# Define per-arch and per-os defaults. Normally overridden by per-target macros.
%__arch_install_post %{nil}
%__os_install_post %{___build_post}
%_target_platform %{_target_cpu}-%{_vendor}-%{_target_os}
%optflags @RPMRC_OPTFLAGS@
+%__isa_name @ISANAME@
+%__isa_bits @ISABITS@
+%__isa %{__isa_name}-%{__isa_bits}
+
#==============================================================================
# ---- configure macros.
#