From: Adam Dickmeiss Date: Wed, 9 May 2012 13:09:52 +0000 (+0200) Subject: id-pbuild.sh now builds for CentOS too X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=cf1c504d40f69b2d199922745ad85ae297b75810;p=git-tools-moved-to-github.git id-pbuild.sh now builds for CentOS too This means one command to build for all platforms (except for Windows, but that's hardly a platform). The same command (--upload) to upload for same platforms. By default, CentOS, building is disabled, but it's really just a matter adding 'CENTOS=centos5' in IDMETA. --- diff --git a/id-deb-build/id-pbuild.sh b/id-deb-build/id-pbuild.sh index 656b374..0230627 100755 --- a/id-deb-build/id-pbuild.sh +++ b/id-deb-build/id-pbuild.sh @@ -10,6 +10,7 @@ Usage: id-pbuild.sh [OPTIONS] Options: [--debian=distros] [--ubuntu=distros] + [--centos=distros] [--upload] [--concurrency=N] [--product=X] @@ -38,6 +39,9 @@ while test $# -gt 0; do --ubuntu=*) UBUNTU_DIST=$optarg ;; + --centos=*) + CENTOS_DIST=$optarg + ;; --upload) upload=true ;; @@ -117,6 +121,7 @@ fi echo "Dsc $PKG . Product $PRODUCT" echo "Ubuntu distros: $UBUNTU_DIST" echo "Debian distros: $DEBIAN_DIST" +echo "Centos distros: $CENTOS_DIST" if test "${SUDO_USER}"; then echo "Running as sudo." echo "Tip: You can avoid it by adding the following in /etc/sudoers" @@ -132,6 +137,16 @@ if test ! -f ${HOME_EXPORT}/.pbuilderrc; then fi if $upload; then + for dist in ${CENTOS_DIST}; do + arch=amd64 + prodver=${PRODUCT}-${VERSION} + if ssh $dist "cd rpmbuild/SOURCES/${prodver} && ../../../proj/git-tools/id-rpm-build/upload-rpms.sh ${PRODUCT}.spec"; then + : + else + echo "Upload failed for $dist" + exit 1 + fi + done for dist in ${UBUNTU_DIST}; do scp ${dist}-*/* ftp.indexdata.dk:/home/ftp/pub/${PRODUCT}/ubuntu/${dist} done @@ -140,17 +155,52 @@ if $upload; then done echo "" echo "====================================================" - echo "Remember to update APT on ftp.indexdata.dk !!!" + echo "Remember to update APT/YUM on ftp.indexdata.dk !!!" echo "" echo "ssh ftp.indexdata.dk" echo "cd ~/proj/git-tools/update-archive" echo "sudo su" echo "./update-archive.sh" + if test ${CENTOS_DIST}; then + echo "./update-yum-archive.sh" + fi echo "====================================================" exit 0 fi + rm -f *.log +# 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 && test -x proj/git-tools/id-rpm-build/upload-rpms.sh"; then + : + else + echo "Host $dist does not seem to be prepared with git-tools and 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 + # call our privileged wrapper to clean the directories, no --dsc option for dist in ${DEBIAN_DIST} ${UBUNTU_DIST}; do for arch in ${USE_ARCHS}; do @@ -195,6 +245,7 @@ for dist in ${DEBIAN_DIST} ${UBUNTU_DIST}; do fi done done + date echo "Done" # Local Variables: