From 7264185a20a63a38d45c4291ce36c58987e3af1e Mon Sep 17 00:00:00 2001 From: Ali Maredia Date: Tue, 10 Jan 2017 18:37:46 -0500 Subject: [PATCH] nfs-ganesha: Various fixes Install missing libraries make sure commands exit 1 move unpacked tarball into nfs-ganesha-debian remove duplicated axis trim down distros list to centos7 and xenial Signed-off-by: Ali Maredia --- nfs-ganesha/build/build_deb | 23 ++++++++++-------- nfs-ganesha/build/build_rpm | 24 +++++++++---------- .../config/definitions/nfs-ganesha.yml | 7 ++---- 3 files changed, 26 insertions(+), 28 deletions(-) diff --git a/nfs-ganesha/build/build_deb b/nfs-ganesha/build/build_deb index dfe443eb..85fcb939 100644 --- a/nfs-ganesha/build/build_deb +++ b/nfs-ganesha/build/build_deb @@ -11,8 +11,9 @@ fi # 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 @@ -29,18 +30,19 @@ mkdir build 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 @@ -58,8 +60,9 @@ sudo pbuilder --clean 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" @@ -77,7 +80,7 @@ chacra_endpoint="nfs-ganesha/${NFS_GANESHA_BRANCH}/${GIT_COMMIT}/${DISTRO}/${DIS [ "$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} diff --git a/nfs-ganesha/build/build_rpm b/nfs-ganesha/build/build_rpm index b17dcb44..97bd3966 100644 --- a/nfs-ganesha/build/build_rpm +++ b/nfs-ganesha/build/build_rpm @@ -11,23 +11,21 @@ RELEASE="$(lsb_release --short -r | cut -d '.' -f 1)" # sytem release # 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 @@ -36,7 +34,7 @@ mkdir build 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" @@ -47,17 +45,17 @@ rpmbuild \ --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 diff --git a/nfs-ganesha/config/definitions/nfs-ganesha.yml b/nfs-ganesha/config/definitions/nfs-ganesha.yml index 2a4a5c22..eca6d375 100644 --- a/nfs-ganesha/config/definitions/nfs-ganesha.yml +++ b/nfs-ganesha/config/definitions/nfs-ganesha.yml @@ -48,8 +48,8 @@ - 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 @@ -89,9 +89,6 @@ If this is checked, then the binaries will be built and pushed to chacra even if - centos7 - trusty - xenial - - axis: - type: dynamic - name: DIST - axis: type: dynamic name: DIST -- 2.39.5