]> git.apps.os.sepia.ceph.com Git - ceph-build.git/commitdiff
nfs-ganesha: Various fixes 617/head
authorAli Maredia <amaredia@redhat.com>
Tue, 10 Jan 2017 23:37:46 +0000 (18:37 -0500)
committerAli Maredia <amaredia@redhat.com>
Fri, 13 Jan 2017 15:34:02 +0000 (10:34 -0500)
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 <amaredia@redhat.com>
nfs-ganesha/build/build_deb
nfs-ganesha/build/build_rpm
nfs-ganesha/config/definitions/nfs-ganesha.yml

index dfe443eb6044fc04be83370c53b04fe25753fe60..85fcb93971a92a74555347e803fe193cd00682db 100644 (file)
@@ -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}
index b17dcb448c5ae945a5d2ac015874a5bf01dc96b8..97bd39668b127d08301d06e57d4b7a44113ad7a7 100644 (file)
@@ -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
index 2a4a5c22a9b6ec30b6c0abd29d2c7e764f69f6b1..eca6d375630f2770dd52130197fda3c703bd2f57 100644 (file)
@@ -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