From: Regina Obe Date: Sat, 13 Jan 2018 18:01:51 +0000 (+0000) Subject: revise make_dist.sh to allow overriding the package name, and create debbie make... X-Git-Tag: 2.4.3rc1~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5382b9d1a5abfa1f97dd7564d605b6cd7754d4b9;p=postgis 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 git-svn-id: http://svn.osgeo.org/postgis/branches/2.4@16284 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/ci/debbie/postgis_make_dist.sh b/ci/debbie/postgis_make_dist.sh new file mode 100644 index 000000000..4f45c9dd6 --- /dev/null +++ b/ci/debbie/postgis_make_dist.sh @@ -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 diff --git a/make_dist.sh b/make_dist.sh index cbc77fb61..f1a61c4d9 100755 --- a/make_dist.sh +++ b/make_dist.sh @@ -18,7 +18,8 @@ # # 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 @@ if [ -n "$1" ]; then 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 @@ if test "$version" = "dev"; then 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" -