Also build a package for python-six.
[arvados-dev.git] / jenkins / run-build-packages.sh
index 7f8e711c13bcb3d856923d8174933cc46c9ac604..621df9676c5d4453eca9c8bdac263ac72c90e041 100755 (executable)
@@ -5,7 +5,7 @@ read -rd "\000" helpmessage <<EOF
 $(basename $0): Build Arvados packages and (optionally) upload them.
 
 Syntax:
-        $(basename $0) WORKSPACE=/path/to/arvados [options]
+        WORKSPACE=/path/to/arvados $(basename $0) [options]
 
 Options:
 
@@ -70,6 +70,17 @@ if ! [[ -n "$WORKSPACE" ]]; then
   exit 1
 fi
 
+# Test for fpm
+fpm --version >/dev/null 2>&1
+
+if [[ "$?" != 0 ]]; then
+  echo >&2 "$helpmessage"
+  echo >&2
+  echo >&2 "Error: fpm not found"
+  echo >&2
+  exit 1
+fi
+
 if [[ "$DEBUG" != 0 ]]; then
   echo "Workspace is $WORKSPACE"
 fi
@@ -114,7 +125,7 @@ build_and_scp_deb () {
     PACKAGE_TYPE='python'
   fi
 
-  declare -a COMMAND_ARR=("fpm" "--maintainer=Ward Vandewege <ward@curoverse.com>" "-s" "$PACKAGE_TYPE" "-t" "deb")
+  declare -a COMMAND_ARR=("fpm" "--maintainer=Ward Vandewege <ward@curoverse.com>" "-s" "$PACKAGE_TYPE" "-t" "deb" "-x" "usr/local/lib/python2.7/dist-packages/tests")
 
   if [[ "$PACKAGE_NAME" != "$PACKAGE" ]]; then
     COMMAND_ARR+=('-n' "$PACKAGE_NAME")
@@ -150,7 +161,7 @@ build_and_scp_deb () {
 
   if [[ "$FPM_PACKAGE_NAME" == "" ]]; then
     EXITCODE=1
-    echo "Error: Unable to figure out package name from fpm results:"
+    echo "Error: $PACKAGE: Unable to figure out package name from fpm results:"
     echo
     echo $FPM_RESULTS
     echo
@@ -176,6 +187,9 @@ source /etc/profile.d/rvm.sh
 # out our git tree here
 chmod o+r "$WORKSPACE" -R
 
+# More cleanup - make sure all executables that we'll package are 755
+find -type d -name 'bin' |xargs -I {} find {} -type f |xargs -I {} chmod 755 {}
+
 # Now fix our umask to something better suited to building and publishing
 # gems and packages
 umask 0022
@@ -280,7 +294,7 @@ fi
 
 # Build arvados src deb package
 cd $WORKSPACE/debs
-build_and_scp_deb $WORKSPACE/src-build-dir/=/usr/local/arvados/src arvados-src 'Curoverse, Inc.' 'dir' "0.1.$GIT_HASH" "-x 'usr/local/arvados/src/.git*'" "--url=https://arvados.org" "--license=GNU Affero General Public License, version 3.0" "--description=The Arvados source code" "--architecture=all"
+build_and_scp_deb $WORKSPACE/src-build-dir/=/usr/local/arvados/src arvados-src 'Curoverse, Inc.' 'dir' "0.1.$GIT_HASH" "--exclude=usr/local/arvados/src/.git" "--url=https://arvados.org" "--license=GNU Affero General Public License, version 3.0" "--description=The Arvados source code" "--architecture=all"
 
 # clean up, check out master and step away from detached-head state
 cd "$WORKSPACE/src-build-dir"
@@ -331,12 +345,11 @@ cd $WORKSPACE/debs
 build_and_scp_deb $WORKSPACE/services/nodemanager arvados-node-manager 'Curoverse, Inc.' 'python' "$(awk '($1 == "Version:"){print $2}' $WORKSPACE/services/nodemanager/arvados_node_manager.egg-info/PKG-INFO)" "--url=https://arvados.org" "--description=The Arvados node manager"
 
 # A few dependencies
-build_and_scp_deb python-gflags
-build_and_scp_deb pyvcf
-build_and_scp_deb google-api-python-client
-build_and_scp_deb httplib2
-build_and_scp_deb ws4py
-build_and_scp_deb virtualenv
+for deppkg in python-gflags pyvcf google-api-python-client oauth2client \
+      pyasn1 pyasn1-modules rsa uritemplate httplib2 ws4py virtualenv \
+      pykka apache-libcloud requests six; do
+    build_and_scp_deb "$deppkg"
+done
 
 # Finally, publish the packages, if necessary
 if [[ "$UPLOAD" != 0 && "$CALL_FREIGHT" != 0 ]]; then