fi
TAR=${PRODUCT}-${VERSION}.tar.gz
+if test ! -f "$TAR"; then
+ echo "tar $TAR missing"
+ exit 1
+fi
if $upload; then
UPLOAD_URI=${UPLOAD_HOST}:${UPLOAD_PATH}/${PRODUCT}
echo "Uploading to ${UPLOAD_URI}"
+ if $centos; then
+ for dist in ${CENTOS_DIST}; do
+ case $dist in
+ centos6)
+ D=6;;
+ centos7)
+ D=7;;
+ *)
+ echo "$dist not supported"
+ exit 1
+ esac
+ ssh ${UPLOAD_HOST} "mkdir -p ${UPLOAD_PATH}/${PRODUCT}/redhat/centos/$D/RPMS"
+ ssh ${UPLOAD_HOST} "mkdir -p ${UPLOAD_PATH}/${PRODUCT}/redhat/centos/$D/SRPMS"
+ scp -r build/centos/$dist/rpmbuild/RPMS ${UPLOAD_URI}/redhat/centos/$D
+ scp -r build/centos/$dist/rpmbuild/SRPMS ${UPLOAD_URI}/redhat/centos/$D
+ done
+ if ! ssh ${UPLOAD_HOST} "sudo -n /home/indexdata/proj/git-tools/update-archive/update-yum-archive.sh" >yum-update.log 2>&1; then
+ echo "update-yum-archive.sh failed; inspect yum-update.log"
+ exit 1
+ fi
+ fi
if $debian; then
if test -n "${DEBIAN_DIST}"; then
for dist in ${DEBIAN_DIST}; do
exit 0
fi
-if $centos; then
- mkdir -p rpmbuild/BUILD
- mkdir -p rpmbuild/BUILDROOT
- mkdir -p rpmbuild/RPMS/noarch
- mkdir -p rpmbuild/RPMS/x86_64
- mkdir -p rpmbuild/SOURCES
- mkdir -p rpmbuild/SPECS
- mkdir -p rpmbuild/SRPMS
-
- echo "%_topdir /home/mock/rpmbuild" >rpmbuild/rpmmacros
- echo "%_source_filedigest_algorithm 0" >>rpmbuild/rpmmacros
- echo "%_binary_filedigest_algorithm 0" >>rpmbuild/rpmmacros
-
- cp ${ID_DEB_BUILD}/Dockerfile.mock rpmbuild
- cp ${TAR} rpmbuild/SOURCES
- SPEC=${PRODUCT}.spec
- cat ${SPEC}|sed "s/%define idmetaversion.*/%define idmetaversion ${VERSION}/" >rpmbuild/SPECS/${SPEC}
- if true; then
- for dist in ${CENTOS_DIST}; do
- case $dist in
- centos5)
- r=epel-5-x86_64 ;;
- centos6)
- r=epel-6-x86_64 ;;
- centos7)
- r=epel-7-x86_64 ;;
- *)
- r=$dist ;;
- esac
- echo -n "$r"
-
- rm -f rpmbuild/run.sh
- echo '#!/bin/sh' >rpmbuild/run.sh
- echo "rpmbuild -bs rpmbuild/SPECS/${SPEC}" >>rpmbuild/run.sh
- echo "/usr/bin/mock --resultdir=rpmbuild -r $r rpmbuild/SRPMS/${PRODUCT}-${VERSION}*src.rpm" >>rpmbuild/run.sh
+if $centos; then
+ for dist in ${CENTOS_DIST}; do
+ sudo rm -fr build/centos/$dist
+ mkdir -p build/centos/$dist/rpmbuild
+ mkdir -p build/centos/$dist/rpmbuild/BUILD
+ mkdir -p build/centos/$dist/rpmbuild/BUILDROOT
+ mkdir -p build/centos/$dist/rpmbuild/RPMS/noarch
+ mkdir -p build/centos/$dist/rpmbuild/RPMS/x86_64
+ mkdir -p build/centos/$dist/rpmbuild/SOURCES
+ mkdir -p build/centos/$dist/rpmbuild/SPECS
+ mkdir -p build/centos/$dist/rpmbuild/SRPMS
+ cp ${TAR} build/centos/$dist/rpmbuild/SOURCES
+ SPEC=${PRODUCT}.spec
+ cp ${SPEC} build/centos/$dist/rpmbuild/SPECS
+ cp IDMETA build/centos/$dist/rpmbuild
+ cp ${ID_DEB_BUILD}/in-docker-rpm.sh build/centos/$dist
+ done
- docker build -t indexdata-fedora-mock -f rpmbuild/Dockerfile.mock .
- docker run --privileged -it --rm indexdata-fedora-mock rpmbuild/run.sh
- echo "done"
- done
- fi
fi
+
if $debian; then
MKDEBSRC=${ID_DEB_BUILD}/id-mk-deb-src.sh
if test ! -x $MKDEBSRC; then
cp ${ID_DEB_BUILD}/in-docker.sh build/ubuntu/$dist
done
fi
- if test "${DEBIAN_DIST}"; then
- for dist in ${DEBIAN_DIST}; do
- cd build/debian/$dist
- docker run -it --rm -v "$PWD:/build" -w /build/$PRODUCT-$VERSION debian:$dist ../in-docker.sh debian $dist
- cd ../../..
- done
- fi
- if test "${UBUNTU_DIST}"; then
- for dist in ${UBUNTU_DIST}; do
- cd build/ubuntu/$dist
- docker run -it --rm -v "$PWD:/build" -w /build/$PRODUCT-$VERSION ubuntu:$dist ../in-docker.sh ubuntu $dist
- cd ../../..
- done
- fi
+fi
+
+if test "${CENTOS_DIST}"; then
+ for dist in ${CENTOS_DIST}; do
+ case $dist in
+ centos6)
+ D=6;;
+ centos7)
+ D=7;;
+ *)
+ echo "$dist not supported"
+ exit 1
+ esac
+ cd build/centos/$dist
+ docker run -it --rm -v "$PWD:/build" -w /build/rpmbuild centos:$D ../in-docker-rpm.sh centos $D
+ cd ../../..
+ done
+fi
+if test "${DEBIAN_DIST}"; then
+ for dist in ${DEBIAN_DIST}; do
+ cd build/debian/$dist
+ docker run -it --rm -v "$PWD:/build" -w /build/$PRODUCT-$VERSION debian:$dist ../in-docker.sh debian $dist
+ cd ../../..
+ done
+fi
+if test "${UBUNTU_DIST}"; then
+ for dist in ${UBUNTU_DIST}; do
+ cd build/ubuntu/$dist
+ docker run -it --rm -v "$PWD:/build" -w /build/$PRODUCT-$VERSION ubuntu:$dist ../in-docker.sh ubuntu $dist
+ cd ../../..
+ done
fi
# Local Variables: