Sophie

Sophie

distrib > Mandriva > 2011.0 > x86_64 > by-pkgid > b2f40b220cf77575f04d940c7c72e9b1 > files > 8

cross-sun4-binutils-2.17.50.0.9-2mdv2008.0.src.rpm

#!/bin/sh
RPM_TOP_DIR=${RPM_TOP_DIR=$(rpm --eval %_topdir)}

specfile=$1
[[ -z "$specfile" ]] && { echo "ERROR: undefined specfile"; exit 1; }

ARCH=$2
[[ -z "$ARCH" ]] && { echo "ERROR: undefined architecture"; exit 1; }

SPECFILE=$RPM_TOP_DIR/SPECS/cross-$ARCH-$specfile
cat - $specfile > $SPECFILE << EOF
##
## This a generated specfile from ${specfile##*/}
##
%define cross $ARCH
##
EOF
exec rpm -ba $SPECFILE