[postgis-tickets] r16283 - revise make_dist.sh to allow overriding the package name
Regina Obe
lr at pcorp.us
Sat Jan 13 09:48:28 PST 2018
Author: robe
Date: 2018-01-13 09:48:28 -0800 (Sat, 13 Jan 2018)
New Revision: 16283
Modified:
trunk/ci/debbie/postgis_make_dist.sh
trunk/make_dist.sh
Log:
revise make_dist.sh to allow overriding the package name
References #3985
Modified: trunk/ci/debbie/postgis_make_dist.sh
===================================================================
--- trunk/ci/debbie/postgis_make_dist.sh 2018-01-13 07:05:29 UTC (rev 16282)
+++ trunk/ci/debbie/postgis_make_dist.sh 2018-01-13 17:48:28 UTC (rev 16283)
@@ -8,22 +8,27 @@
# export POSTGIS_MAJOR_VERSION=2
# export POSTGIS_MINOR_VERSION=2
# export POSTGIS_MICRO_VERSION=0dev
-# export JENKINS_HOME=/var/lib/jenkins/workspace
-export GEOS_VER=3.6.2
+export PROJECTS=/var/lib/jenkins/workspace
+export GEOS_VER=3.6
export GDAL_VER=2.2
-export WEB_DIR=/var/www/postgis_stuff/
+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`
+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 \
- --without-interrupt-tests \
- --prefix=${PROJECTS}/pg/rel/pg${PG_VER}w${OS_BUILD}
+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: trunk/make_dist.sh
===================================================================
--- trunk/make_dist.sh 2018-01-13 07:05:29 UTC (rev 16282)
+++ trunk/make_dist.sh 2018-01-13 17:48:28 UTC (rev 16283)
@@ -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