fi
-## Install any setup-time deps
-# TODO: add file to /etc/apt/sources.list.d/ to get repos for librgw-dev and libcephfs-dev and run sudo apt-get update
-
# We need this for system, to build ganesha, and to enable FSAL_CEPH and
# FSAL_RGW in the .spec file when cmake command runs
-sudo apt-get -y install "cmake equivs libkrb5-dev bison flex quilt
-libdbus-1-dev libnfsidmap-dev libwbclient-dev libntirpc-dev (>= 1.4.3) libattr1-dev libacl1-dev libcap-dev glusterfs-common (>= 3.8.4) python-qt4 pyqt4-dev-tools pkgconf
-librgw-dev libcephfs-dev"
+sudo apt-get update
+sudo apt-get -y install cmake equivs libkrb5-dev bison flex quilt librgw-dev libcephfs-dev
# Normalize variables across rpm/deb builds
NORMAL_DISTRO=$DISTRO
cmake -DCMAKE_BUILD_TYPE=Maintainer -DUSE_FSAL_GLUSTER=OFF -DUSE_FSAL_CEPH=ON -DUSE_FSAL_RGW=ON $WORKSPACE/nfs-ganesha/src && make dist || exit 1
# move unpacked tarball code into nfs-ganesha-debian/src
-VERSION=`grep -om 1 '[[:digit:]]\+\.[[:digit:]]\+-dev-[[:digit:]]\+' $WORKSPACE/nfs-ganesha/build/CPackSourceConfig.cmake | sed s/-//g`
-BUILD=`grep -om 1 "[[:digit:]]\+-g\w\w\w\w\w\w\w" $WORKSPACE/nfs-ganesha/build/include/config.h`
-NFS_GANESHA_ORIG_TAR_GZ="nfs-ganesha_${VERSION}.orig.tar.gz"
NFS_GANESHA_SOURCE_DIR=`grep -om 1 'nfs-ganesha-[[:digit:]]\+\.[[:digit:]]\+-dev-[[:digit:]]\+-[[:digit:]]\+\.[[:digit:]]\+\.[[:digit:]]\+-Source' $WORKSPACE/nfs-ganesha/build/CPackSourceConfig.cmake`
+VERSION=`grep -om 1 '[[:digit:]]\+\.[[:digit:]]\+-dev-[[:digit:]]\+' $WORKSPACE/nfs-ganesha/build/CPackSourceConfig.cmake`
+TAR_VERSION=`grep -om 1 '[[:digit:]]\+\.[[:digit:]]\+-dev' $WORKSPACE/nfs-ganesha/build/CPackSourceConfig.cmake`
+NFS_GANESHA_ORIG_TAR_GZ="nfs-ganesha_${TAR_VERSION}.orig.tar.gz"
+mkdir nfs-ganesha-${VERSION}
tar xzf ${NFS_GANESHA_SOURCE_DIR}.tar.gz
-mv ${NFS_GANESHA_SOURCE_DIR}.tar.gz ${NFS_GANESHA_ORIG_TAR_GZ}
-mv ${NFS_GANESHA_SOURCE_DIR} nfs-ganesha-${VERSION}
-rm -rf $WORKSPACE/nfs-ganesha-debian/debian/patches
+mv ${NFS_GANESHA_SOURCE_DIR} nfs-ganesha-${VERSION}/src
+tar czf ${NFS_GANESHA_ORIG_TAR_GZ} nfs-ganesha-${VERSION}/src
mv $WORKSPACE/nfs-ganesha-debian/debian $WORKSPACE/nfs-ganesha/build/nfs-ganesha-${VERSION}/debian
+cd nfs-ganesha-${VERSION}
## Get some basic information about the system and the repository
DEB_ARCH=$(dpkg-architecture -qDEB_BUILD_ARCH)
-cd $WORKSPACE/nfs-ganesha-debian
-
## Prepare the debian files
# Bump the changelog
-dch -v "$VERSION-$BUILD" "New release ($VERSION)"
+dch -v "$VERSION" "Dev release ($VERSION)"
# Create .dsc and source tarball
sudo dpkg-buildpackage -S -us -uc -d
# use libcephfs and librgw from shaman
REPO_URL="https://shaman.ceph.com/api/repos/ceph/$CEPH_BRANCH/$CEPH_SHA1/$DISTRO/$DIST/repo"
+SHAMAN_MIRROR=`curl -L ${REPO_URL}`
echo "EXTRAPACKAGES=\"libcephfs-dev librgw-dev\"" >> ~/.pbuilderrc
-echo "OTHERMIRROR=deb ${REPO_URL}" >> ~/.pbuildrrc
+echo "OTHERMIRROR=\"${SHAMAN_MIRROR}\"" >> ~/.pbuilderrc
+cat ~/.pbuilderrc
echo "Building debs for $DIST"
sudo pbuilder build \
--basetgz $PBUILDDIR/$DIST.tgz \
--buildresult $WORKSPACE/dist/deb/ \
--debbuildopts "-j`grep -c processor /proc/cpuinfo`" \
- $WORKSPACE/dist/nfs-ganesha_$VERSION.dsc
+ $WORKSPACE/nfs-ganesha/build/nfs-ganesha_${VERSION}.dsc
## Upload the created RPMs to chacra
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
+
set -ex
# Make sure we execute at the top level directory before we do anything
pkgs=( "chacractl>=0.0.4" )
install_python_packages "pkgs[@]"
+NFS_GANESHA_BRANCH=`branch_slash_filter $NFS_GANESHA_BRANCH`
+CEPH_BRANCH=`branch_slash_filter $CEPH_BRANCH`
+
# ask shaman which chacra instance to use
chacra_url=`curl -f -u $SHAMAN_API_USER:$SHAMAN_API_KEY https://shaman.ceph.com/api/nodes/next/`
# create the .chacractl config file using global variables