[postgis-tickets] r16284 - revise make_dist.sh to allow overriding the package name, and create debbie make dist script that calls the main one

Regina Obe lr at pcorp.us
Sat Jan 13 10:01:52 PST 2018


Author: robe
Date: 2018-01-13 10:01:51 -0800 (Sat, 13 Jan 2018)
New Revision: 16284

Added:
   branches/2.4/ci/debbie/postgis_make_dist.sh
Modified:
   branches/2.4/make_dist.sh
Log:
revise make_dist.sh to allow overriding the package name, and create debbie make dist script that calls the main one
References #3985 for PostGIS 2.4

Added: branches/2.4/ci/debbie/postgis_make_dist.sh
===================================================================
--- branches/2.4/ci/debbie/postgis_make_dist.sh	                        (rev 0)
+++ branches/2.4/ci/debbie/postgis_make_dist.sh	2018-01-13 18:01:51 UTC (rev 16284)
@@ -0,0 +1,34 @@
+#!/bin/bash
+set -e
+## begin variables passed in by jenkins
+
+export PG_VER=9.6
+# export PGPORT=8442
+export OS_BUILD=64
+# export POSTGIS_MAJOR_VERSION=2
+# export POSTGIS_MINOR_VERSION=2
+# export POSTGIS_MICRO_VERSION=0dev
+export PROJECTS=/var/lib/jenkins/workspace
+export GEOS_VER=3.6
+export GDAL_VER=2.2
+export WEB_DIR=/var/www/postgis_stuff
+export PATH="${PGPATH}/bin:$PATH"
+export LD_LIBRARY_PATH="${PROJECTS}/gdal/rel-${GDAL_VER}w${OS_BUILD}/lib:${PROJECTS}/geos/rel-${GEOS_VER}w${OS_BUILD}/lib:${PGPATH}/lib"
+
+POSTGIS_MAJOR_VERSION=`grep ^POSTGIS_MAJOR_VERSION Version.config | cut -d= -f2`
+POSTGIS_MINOR_VERSION=`grep ^POSTGIS_MINOR_VERSION Version.config | cut -d= -f2`
+POSTGIS_MICRO_VERSION=`grep ^POSTGIS_MICRO_VERSION Version.config | cut -d= -f2`
+
+export CONFIGURE_ARGS="--with-pgconfig=${PROJECTS}/pg/rel/pg${PG_VER}w${OS_BUILD}/bin/pg_config --with-geosconfig=${PROJECTS}/geos/rel-${GEOS_VER}w${OS_BUILD}/bin/geos-config --with-gdalconfig=${PROJECTS}/gdal/rel-${GDAL_VER}w${OS_BUILD}/bin/gdal-config --with-sfcgal=/usr/bin/sfcgal-config --prefix=${PROJECTS}/pg/rel/pg${PG_VER}w${OS_BUILD}"
+
+#override the checkout folder used for building tar ball
+export newoutdir="postgis-${POSTGIS_MAJOR_VERSION}.${POSTGIS_MINOR_VERSION}.${POSTGIS_MICRO_VERSION}"
+
+#fake production build
+#export newoutdir="postgis-${POSTGIS_MAJOR_VERSION}.${POSTGIS_MINOR_VERSION}.0"
+
+sh make_dist.sh
+export package=${newoutdir}.tar.gz
+echo "The package name is $package"
+
+cp $package $WEB_DIR

Modified: branches/2.4/make_dist.sh
===================================================================
--- branches/2.4/make_dist.sh	2018-01-13 17:48:28 UTC (rev 16283)
+++ branches/2.4/make_dist.sh	2018-01-13 18:01:51 UTC (rev 16284)
@@ -18,8 +18,9 @@
 #
 #   CONFIGURE_ARGS    passed to ./configure call
 #   MAKE              useed for builds (defaults to "make")
+#   newoutdir  this variable can be overriden to control the outdir and package name.
+#              package name will be set to {newoutdir}.tar.gz if this variabe is overridden
 #
-#
 
 version=dev
 
@@ -61,6 +62,11 @@
   fi
 fi
 
+if [ -v "$outdir" ]; then
+	echo "Output directory $outdir already exists."
+	exit 1
+fi
+
 outdir="postgis-$version"
 
 if [ -d "$outdir" ]; then
@@ -130,16 +136,23 @@
   VMIC=`grep ^POSTGIS_MICRO_VERSION "$outdir"/Version.config | cut -d= -f2`
   VREV=`cat "$outdir"/postgis_svn_revision.h | awk '{print $3}'`
   version="${VMAJ}.${VMIN}.${VMIC}-r${VREV}"
-  newoutdir=postgis-${version}
+  #if newoutdir is not already set, then set it
+  if test "x$newoutdir" = "x"; then
+      newoutdir=postgis-${version}
+  else
+      package=${newoutdir}.tar.gz
+  fi
   rm -rf ${newoutdir}
   mv -v "$outdir" "$newoutdir"
   outdir=${newoutdir}
 fi
 
-package="postgis-$version.tar.gz"
+#if package name is not already set then set it
+if test "x$package" = "x"; then
+    package="postgis-$version.tar.gz"
+fi
 echo "Generating $package file"
 tar czf "$package" "$outdir"
 
 #echo "Cleaning up"
 #rm -Rf "$outdir"
-



More information about the postgis-tickets mailing list