+if test ! -f /etc/redhat-release; then
+ echo "/etc/redhat-release missing"
+ exit 1
+fi
+if test -z "$DISTRO"; then
+ if grep 'release 6' /etc/redhat-release >/dev/null; then
+ DISTRO="centos/6"
+ else
+ DISTRO="centos/5.5"
+ fi
+fi
+topdir=`rpm --eval "%{_topdir}"`
+BUILD_DIR=${BUILD_DIR:=${topdir}}
+pkg_names=`rpm -q --specfile ${specfile} --queryformat "%{NAME}-%{VERSION}-%{RELEASE}\n"`
+pkg_short=`rpm -q --specfile ${specfile} --queryformat "%{NAME};" | cut -d ";" -f1`
+
+UPLOAD_DIR=${UPLOAD_DIR:=${pkg_short}}
+UPLOAD_URI=${UPLOAD_HOST}:${UPLOAD_PATH}/${UPLOAD_DIR}
+echo "Uploading to ${UPLOAD_URI}..."