Sophie

Sophie

distrib > Mageia > 3 > i586 > media > core-release-src > by-pkgid > 755752c38db416180fc9b5c3fe6322c9 > files > 15

binutils-2.23.51.0.8-3.mga3.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