Sophie

Sophie

distrib > Mandriva > 2010.1 > x86_64 > by-pkgid > 262285d4422e3b979c3773e423a18bb7 > files > 14

cross-avr-binutils-2.20.51.0.4-1mnb2.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