# TODO -- upload install-deps.sh script that installs the setup time deps
# to upstream repo or update this section to install these packages
-# We need this for mk-build-deps
-sudo apt-get install -y equivs cmake git
+# 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 install -y equivs cmake git libkrb5-dev bison flex librgw2-dev libcephfs-dev
## Setup the pbuilder
# TODO remove if you do not want to use pbuilders
cd build
# make source tarball
-cmake -DCMAKE_BUILD_TYPE=Maintainer $WORKSPACE/nfs-ganesha/src && make dist || exit 0
+cmake -DCMAKE_BUILD_TYPE=Maintainer $WORKSPACE/nfs-ganesha/src && make dist || exit 1
+
+# move unpacked tarball code into nfs-ganesha-debian/src
+NFS_GANESHA_SOURCE_DIR=`grep -om 1 "nfs-ganesha-[0-9].[0-9]-dev-[0-9]-[0-9].[0-9].[0-9]-Source" CPackSourceConfig.cmake`
+tar xf ${NFS_GANESHA_SOURCE_DIR}.tar.gz
+mv ${NFS_GANESHA_SOURCE_DIR} src
+cp -r src $WORKSPACE/nfs-ganesha-debian/
## Get some basic information about the system and the repository
DEB_ARCH=$(dpkg-architecture -qDEB_BUILD_ARCH)
VERSION=`grep -om 1 "[0-9]\.[0-9]-dev-[0-9]" include/config.h`
-# terrible hack
cd $WORKSPACE/nfs-ganesha-debian
-mv $WORKSPACE/nfs-ganesha/build/nfs-ganesha-*.tar.gz .
-tar -xvf nfs-ganesha-*.tar.gz
-rm *.tar.gz
-mv nfs-ganesha* src
## Prepare the debian files
# Bump the changelog
mkdir -p $WORKSPACE/dist/deb
+# use libcephfs and librgw from shaman
REPO_URL="https://shaman.ceph.com/api/repos/ceph/$CEPH_BRANCH/$CEPH_SHA1/$DISTRO/$DIST/repo"
-echo "EXTRAPACKAGES=\"libcephfs-dev\"" >> ~/.pbuilderrc
+echo "EXTRAPACKAGES=\"libcephfs-dev librgw-dev\"" >> ~/.pbuilderrc
echo "OTHERMIRROR=deb ${REPO_URL}" >> ~/.pbuildrrc
echo "Building debs for $DIST"
[ "$FORCE" = true ] && chacra_flags="--force" || chacra_flags=""
# push binaries to chacra
-find ../*.deb | $VENV/chacractl binary ${chacra_flags} create ${chacra_endpoint}/${DEB_ARCH}/
+find $WORKSPACE/dist/deb -name "*.deb" | $VENV/chacractl binary ${chacra_flags} create ${chacra_endpoint}/${DEB_ARCH}/
# start repo creation
$VENV/chacractl repo update ${chacra_endpoint}
# Get .repo file from appropriate shaman build
REPO_URL="https://shaman.ceph.com/api/repos/ceph/$CEPH_BRANCH/$CEPH_SHA1/$DISTRO/$RELEASE/flavors/default/repo"
-if `curl --fail -L $REPO_URL > $WORKSPACE/libcephfs.repo`; then
+if `curl --fail -L $REPO_URL > $WORKSPACE/shaman.repo`; then
echo "Ceph repo file has been added from shaman"
else
echo "Ceph repo file was NOT added from shaman"
- exit 0
+ exit 1
fi
-## Install any setup-time deps (to make dist package)
-# We need this to get the major version from lsb_release
-# ALI TO DO: find out if all these packages are necessary
+# install ceph libraries so enable FSAL_CEPH and FSAL_RGW in the .spec file
+# when cmake command runs
xargs sudo yum install -y <<< "
-redhat-lsb-core
-mock
-cmake
-git
+librgw2-devel
+libcephfs1
"
+
cd $WORKSPACE/nfs-ganesha
git submodule update --init || git submodule sync
cd build
# generate .spec file and make source tarball
-cmake -DCMAKE_BUILD_TYPE=Maintainer $WORKSPACE/nfs-ganesha/src && make dist || exit 0
+cmake -DCMAKE_BUILD_TYPE=Maintainer $WORKSPACE/nfs-ganesha/src && make dist || exit 1
## Create the source rpm
echo "Building SRPM"
--define "_srcrpmdir $WORKSPACE/dist" \
--define "_rpmdir $WORKSPACE/dist" \
--nodeps -bs $WORKSPACE/nfs-ganesha/src/nfs-ganesha.spec
-SRPM=$(readlink -f *.src.rpm)
+SRPM=$(readlink -f $WORKSPACE/dist/*.src.rpm)
# add repo file to mock config
sudo head -n -1 /etc/mock/${MOCK_TARGET}-${RELEASE}-${ARCH}.cfg > temp.cfg
echo >> temp
-sudo cat temp.cfg $WORKSPACE/libcephfs.repo > nfs-ganesha.cfg
+sudo cat temp.cfg $WORKSPACE/shaman.repo > nfs-ganesha.cfg
echo "\"\"\"" >> nfs-ganesha.cfg
## Build the binaries with mock
echo "Building RPMs"
-sudo mock -r nfs-ganesha.cfg --resultdir=$WORKSPACE/dist/rpm/ ${SRPM}
+sudo mock -r nfs-ganesha.cfg --resultdir=$WORKSPACE/dist/rpm/ ${SRPM} || ( tail -n +1 $WORKSPACE/dist/rpm/{root,build}.log && exit 1 )
## Upload the created RPMs to chacra
- string:
name: DISTROS
- description: "A list of distros to build for. Available options are: xenial, centos7, centos6, trusty, precise, wheezy, and jessie"
- default: "centos7 precise xenial"
+ description: "A list of distros to build for. Available options are: xenial, centos7"
+ default: "centos7 xenial"
- string:
name: ARCHS
- centos7
- trusty
- xenial
- - axis:
- type: dynamic
- name: DIST
- axis:
type: dynamic
name: DIST