From 15c5e168a55c3739bff1c1a15d27ac22ed1a67f1 Mon Sep 17 00:00:00 2001 From: Alfredo Deza Date: Mon, 3 Nov 2014 14:51:37 -0500 Subject: [PATCH] use the right order for deb/rpm Signed-off-by: Alfredo Deza --- python-bindings/config/definitions/build.sh | 140 ++++++++++---------- 1 file changed, 71 insertions(+), 69 deletions(-) diff --git a/python-bindings/config/definitions/build.sh b/python-bindings/config/definitions/build.sh index dcf0e267..3f1278ff 100644 --- a/python-bindings/config/definitions/build.sh +++ b/python-bindings/config/definitions/build.sh @@ -28,6 +28,77 @@ echo " BRANCH=$BRANCH" case $HOST in gitbuilder-*-rpm*) + pwd + rm -rf debian-repo + rm -rf dist + rm -f *.changes *.dsc *.gz *.diff + + # Tag tree and update version number in change log and + # in setup.py before building. + + REPO=rpm-repo + KEYID=${KEYID:-03C3951A} # Default is autobuild-key + BUILDAREA=./rpmbuild + DIST=el6 + RPM_BUILD=$(lsb_release -s -c) + + cd src/pybind/ceph + if [ ! -e setup.py ] ; then + echo "Are we in the right directory" + exit 1 + fi + + if gpg --list-keys 2>/dev/null | grep -q ${KEYID} ; then + echo "Signing packages and repo with ${KEYID}" + else + echo "Package signing key (${KEYID}) not found" + echo "Have you set \$GNUPGHOME ? " + exit 3 + fi + + if ! CREATEREPO=`which createrepo` ; then + echo "Please install the createrepo package" + exit 4 + fi + + # Create Tarball + python setup.py sdist --formats=bztar + + # Build RPM + mkdir -p rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS} + BUILDAREA=`readlink -fn ${BUILDAREA}` ### rpm wants absolute path + cp *.spec ${BUILDAREA}/SPECS + cp dist/*.tar.bz2 ${BUILDAREA}/SOURCES + echo "buildarea is: ${BUILDAREA}" + rpmbuild -ba --define "_topdir ${BUILDAREA}" --define "_unpackaged_files_terminate_build 0" ${BUILDAREA}/SPECS/ceph-deploy.spec + + # create repo + DEST=${REPO}/${DIST} + mkdir -p ${REPO}/${DIST} + cp -r ${BUILDAREA}/*RPMS ${DEST} + + # Sign all the RPMs for this release + rpm_list=`find ${REPO} -name "*.rpm" -print` + rpm --addsign --define "_gpg_name ${KEYID}" $rpm_list + + # Construct repodata + for dir in ${DEST}/SRPMS ${DEST}/RPMS/* + do + if [ -d $dir ] ; then + createrepo $dir + gpg --detach-sign --armor -u ${KEYID} $dir/repodata/repomd.xml + fi + done + + mv debian-repo $WORKSPACE/. + cd $WORKSPACE + mkdir -p dist + mv *.changes *.dsc *.deb *.tar.gz dist/. + ;; + + + ;; +gitbuilder-cdep-deb* | tala* | mira*) pwd rm -rf rpm-repo dist/* build/rpmbuild pwd @@ -108,75 +179,6 @@ EOF mv rpm-repo $WORKSPACE/. cd $WORKSPACE mkdir -p dist - - ;; -gitbuilder-cdep-deb* | tala* | mira*) - pwd - rm -rf debian-repo - rm -rf dist - rm -f *.changes *.dsc *.gz *.diff - - # Tag tree and update version number in change log and - # in setup.py before building. - - REPO=rpm-repo - KEYID=${KEYID:-03C3951A} # Default is autobuild-key - BUILDAREA=./rpmbuild - DIST=el6 - RPM_BUILD=$(lsb_release -s -c) - - cd src/pybind/ceph - if [ ! -e setup.py ] ; then - echo "Are we in the right directory" - exit 1 - fi - - if gpg --list-keys 2>/dev/null | grep -q ${KEYID} ; then - echo "Signing packages and repo with ${KEYID}" - else - echo "Package signing key (${KEYID}) not found" - echo "Have you set \$GNUPGHOME ? " - exit 3 - fi - - if ! CREATEREPO=`which createrepo` ; then - echo "Please install the createrepo package" - exit 4 - fi - - # Create Tarball - python setup.py sdist --formats=bztar - - # Build RPM - mkdir -p rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS} - BUILDAREA=`readlink -fn ${BUILDAREA}` ### rpm wants absolute path - cp *.spec ${BUILDAREA}/SPECS - cp dist/*.tar.bz2 ${BUILDAREA}/SOURCES - echo "buildarea is: ${BUILDAREA}" - rpmbuild -ba --define "_topdir ${BUILDAREA}" --define "_unpackaged_files_terminate_build 0" ${BUILDAREA}/SPECS/ceph-deploy.spec - - # create repo - DEST=${REPO}/${DIST} - mkdir -p ${REPO}/${DIST} - cp -r ${BUILDAREA}/*RPMS ${DEST} - - # Sign all the RPMs for this release - rpm_list=`find ${REPO} -name "*.rpm" -print` - rpm --addsign --define "_gpg_name ${KEYID}" $rpm_list - - # Construct repodata - for dir in ${DEST}/SRPMS ${DEST}/RPMS/* - do - if [ -d $dir ] ; then - createrepo $dir - gpg --detach-sign --armor -u ${KEYID} $dir/repodata/repomd.xml - fi - done - - mv debian-repo $WORKSPACE/. - cd $WORKSPACE - mkdir -p dist - mv *.changes *.dsc *.deb *.tar.gz dist/. ;; *) echo "Can't determine build host type" -- 2.39.5