3 DESTDIR="${DESTDIR:-/}"
4 pkglibdir="${pkglibdir:-/usr/lib/rpm}"
8 PLATFORM="${3:-platform}"
10 TEMPRC="/tmp/rpmrc.$$"
11 cat << E_O_F > $TEMPRC
16 RPM="./rpm --rcfile $TEMPRC"
18 arch="`$RPM --eval '%{_arch}'`"
19 VENDOR="`$RPM --eval '%{_vendor}'`"
20 OS="`$RPM --eval '%{_os}'`"
21 target_platform="`$RPM --eval '%{_target_platform}'`"
22 target="`$RPM --eval '%{_target}'`"
25 sparc*) SUBSTS='s_sparc64_sparc_ s_sparc\([^6]\)_sparc64\1_' ;;
29 for SUBST in $SUBSTS; do
30 ARCH=`echo $arch | sed -e $SUBST`
31 TARGET_PLATFORM=`echo $target_platform | sed -e $SUBST`
32 TARGET=`echo $target | sed -e $SUBST`
35 PPD="${DESTDIR}/${pkglibdir}/${ARCH}-${VENDOR}-${OS}"
37 [ -d $PPD ] || mkdir $PPD
39 RPMRC_OPTFLAGS="`$RPM --eval '%{optflags}'`"
40 RPMRC_OPTFLAGS="`echo $RPMRC_OPTFLAGS | sed -e 's, ,\ ,g'`"
42 ARCH_INSTALL_POST='%{nil}'
43 case "${ARCH}-${OS}" in
44 sparc64-linux) ARCH_INSTALL_POST=${pkglibdir}/brp-sparc64-linux; LIB=lib64 ;;
48 sed -e "s,@RPMRC_OPTFLAGS@,$RPMRC_OPTFLAGS," \
49 -e "s,@RPMRC_ARCH@,$ARCH," \
51 -e "s,@ARCH_INSTALL_POST@,$ARCH_INSTALL_POST," \
56 # Better try to create these too until the smoke clears. Yuck.
57 [ "${ARCH}-${VENDOR}-${OS}" = "${TARGET}" ] || ln -sf ${ARCH}-${VENDOR}-${OS} ${DESTDIR}/${pkglibdir}/${TARGET}
58 [ "${ARCH}-${VENDOR}-${OS}" = "${TARGET_PLATFORM}" ] || ln -sf ${ARCH}-${VENDOR}-${OS} ${DESTDIR}/${pkglibdir}/${TARGET_PLATFORM}