2000-02-26 00:29:44 +08:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
DESTDIR="${DESTDIR:-/}"
|
|
|
|
pkglibdir="${pkglibdir:-/usr/lib/rpm}"
|
|
|
|
|
|
|
|
RPMRC="${1:-rpmrc}"
|
|
|
|
MACROS="${2:-macros}"
|
|
|
|
PLATFORM="${3:-platform}"
|
|
|
|
|
|
|
|
TEMPRC="/tmp/rpmrc.$$"
|
|
|
|
cat << E_O_F > $TEMPRC
|
|
|
|
include: $RPMRC
|
|
|
|
macrofiles: $MACROS
|
|
|
|
E_O_F
|
|
|
|
|
2000-02-28 02:52:30 +08:00
|
|
|
RPM="./rpm --rcfile $TEMPRC"
|
2000-02-26 00:29:44 +08:00
|
|
|
|
2000-02-28 02:52:30 +08:00
|
|
|
ARCH="`$RPM --eval '%{_arch}'`"
|
|
|
|
VENDOR="`$RPM --eval '%{_vendor}'`"
|
|
|
|
OS="`$RPM --eval '%{_os}'`"
|
|
|
|
TARGET_PLATFORM="`$RPM --eval '%{_target_platform}'`"
|
|
|
|
TARGET="`$RPM --eval '%{_target}'`"
|
2000-02-26 00:29:44 +08:00
|
|
|
|
|
|
|
PPD="${DESTDIR}/${pkglibdir}/${ARCH}-${VENDOR}-${OS}"
|
|
|
|
|
|
|
|
[ -d $PPD ] || mkdir $PPD
|
|
|
|
|
2000-02-28 02:52:30 +08:00
|
|
|
RPMRC_OPTFLAGS="`$RPM --eval '%{optflags}'`"
|
|
|
|
RPMRC_OPTFLAGS="`echo $RPMRC_OPTFLAGS | sed -e 's, ,\ ,g'`"
|
2000-02-26 00:29:44 +08:00
|
|
|
|
|
|
|
|
2000-02-28 02:52:30 +08:00
|
|
|
cat $PLATFORM | \
|
|
|
|
sed -e s,@RPMRC_OPTFLAGS@,$RPMRC_OPTFLAGS, -e 's,\${,%{_,' \
|
|
|
|
> ${PPD}/macros
|
|
|
|
|
|
|
|
#
|
|
|
|
# Better try to create these too until the smoke clears. Yuck.
|
|
|
|
[ "${ARCH}-${VENDOR}-${OS}" = "${TARGET}" ] || ln -sf ${ARCH}-${VENDOR}-${OS} ${DESTDIR}/${pkglibdir}/${TARGET}
|
|
|
|
[ "${ARCH}-${VENDOR}-${OS}" = "${TARGET_PLATFORM}" ] || ln -sf ${ARCH}-${VENDOR}-${OS} ${DESTDIR}/${pkglibdir}/${TARGET_PLATFORM}
|
2000-02-26 01:30:28 +08:00
|
|
|
|
2000-02-26 00:29:44 +08:00
|
|
|
rm $TEMPRC
|