Sophie

Sophie

distrib > Mandriva > 10.2 > x86_64 > by-pkgid > b7b2393808ccab41b5535132e85cef27 > files > 24

binutils-2.15.92.0.2-6.2.102mdk.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