$OpenBSD$
--- scripts/valhalla_build_elevation.orig	Mon Jul 18 04:04:37 2016
+++ scripts/valhalla_build_elevation	Mon Jul 18 04:13:28 2016
@@ -1,5 +1,6 @@
-#!/bin/bash
+#!/bin/sh
 set -e
+python=${MODPYTHON_BIN}
 
 function usage() {
 	echo "Usage: $0 min_x max_x min_y max_y [target_dir=elevation] [parallelism=$(nproc)]"
@@ -10,10 +11,10 @@ function usage() {
 if [ -z "$4" ]; then
 	usage
 fi
-min_x=$(python -c "import math; print int(math.floor($1))")
-max_x=$(python -c "import math; print int(math.ceil($2) - 1)")
-min_y=$(python -c "import math; print int(math.floor($3))")
-max_y=$(python -c "import math; print int(math.ceil($4) - 1)")
+min_x=$(${python} -c "import math; print int(math.floor($1))")
+max_x=$(${python} -c "import math; print int(math.ceil($2) - 1)")
+min_y=$(${python} -c "import math; print int(math.floor($3))")
+max_y=$(${python} -c "import math; print int(math.ceil($4) - 1)")
 if [ $min_x -gt $max_x ] || [ $min_x -lt -180 ] || [ $max_x -gt 180 ]; then
 	usage
 fi
@@ -33,17 +34,17 @@ else
 fi
 
 #get dirs
-for y in $(seq ${min_y} 1 ${max_y}); do
-	dir=$(python -c "print '%s%02d' % ('S' if ${y} < 0 else 'N', abs(${y}))")
+for y in $(gseq ${min_y} 1 ${max_y}); do
+	dir=$(${python} -c "print '%s%02d' % ('S' if ${y} < 0 else 'N', abs(${y}))")
 	echo "${dest}/${dir}"
 done | while read d; do mkdir -p $d; done
 
 #get the data
 expected=$((($max_x - $min_x + 1)*($max_y - $min_y + 1)))
 echo "extracting $expected elevation tiles"
-for x in $(seq ${min_x} 1 ${max_x}); do
-        for y in $(seq ${min_y} 1 ${max_y}); do
-		file=$(python -c "print '%s%02d%s%03d.hgt' % ('S' if ${y} < 0 else 'N', abs(${y}), 'W' if ${x} < 0 else 'E', abs(${x}))")
+for x in $(gseq ${min_x} 1 ${max_x}); do
+        for y in $(gseq ${min_y} 1 ${max_y}); do
+		file=$(${python} -c "print '%s%02d%s%03d.hgt' % ('S' if ${y} < 0 else 'N', abs(${y}), 'W' if ${x} < 0 else 'E', abs(${x}))")
                 dir=$(echo ${file} | sed "s/^\([NS][0-9]\{2\}\).*/\1/g")
 		#if we dont already have it or its the wrong size
 		if [ ! -e ${dest}/${dir}/${file} ] || [ $(stat -c %s ${dest}/${dir}/${file}) -ne $((3601*3601*2)) ]; then
