+# copy tars to centos build hosts
+for dist in ${CENTOS_DIST}; do
+ arch=amd64
+ prodver=${PRODUCT}-${VERSION}
+ tarname=${prodver}.tar.gz
+ if test ! -f ../${tarname}; then
+ echo "$tarname: missing"
+ exit 1
+ fi
+
+ if ssh $dist "test -f .rpmmacros && test -d rpmbuild/SOURCES && test -d rpmbuild/RPMS && test -d rpmbuild/SRPMS"; then
+ :
+ else
+ echo "Host $dist does not seem to be prepared with rpmbuild directories"
+ exit 1
+ fi
+
+ if scp ../${tarname} $dist:rpmbuild/SOURCES/ ; then
+ :
+ else
+ echo "Could not copy $tarname to $dist"
+ exit 1
+ fi
+ if ssh $dist "cd rpmbuild/SOURCES && rm -fr $prodver && tar zxf $tarname && cd ${prodver} && rpmbuild -ba ${PRODUCT}.spec" >${dist}-${arch}.log 2>&1; then
+ :
+ else
+ echo "FAILED: See ${dist}-${arch}.log"
+ exit 1
+ fi
+done
+