aboutsummaryrefslogtreecommitdiff
path: root/gis
diff options
context:
space:
mode:
authorBenjamin Trigona-Harany <bosth@alumni.sfu.ca>2018-03-13 19:52:50 -0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2018-03-17 08:51:44 +0700
commit4d1f56fbf99696345b8637ebd4c0d4ed7a3a28ca (patch)
tree6e887bb57c3f5e0c6399b7d691ce2e8ce2d037c9 /gis
parentf4425c49adc89aafa239b698b8455e4caa961f54 (diff)
gis/Geohash: Add Python 3 support.
Diffstat (limited to 'gis')
-rw-r--r--gis/Geohash/Geohash.SlackBuild16
1 files changed, 10 insertions, 6 deletions
diff --git a/gis/Geohash/Geohash.SlackBuild b/gis/Geohash/Geohash.SlackBuild
index 0f3dc7433f6f0..d89f1b7d4b92d 100644
--- a/gis/Geohash/Geohash.SlackBuild
+++ b/gis/Geohash/Geohash.SlackBuild
@@ -29,7 +29,7 @@ TAG=${TAG:-_SBo}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
- i?86) ARCH=i486 ;;
+ i?86) ARCH=i586 ;;
arm*) ARCH=arm ;;
*) ARCH=$( uname -m ) ;;
esac
@@ -40,8 +40,8 @@ TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
-if [ "$ARCH" = "i486" ]; then
- SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+if [ "$ARCH" = "i586" ]; then
+ SLKCFLAGS="-O2 -march=i586 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
@@ -67,12 +67,16 @@ find -L . \
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
-o -perm 511 \) -exec chmod 755 {} \; -o \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
- -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
+ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
python setup.py install --root=$PKG
+if $(python3 -c 'import sys' 2>/dev/null); then
+ sed -i "s/from geohash/from .geohash/" $PRGNAM/__init__.py
+ python3 setup.py install --root=$PKG
+fi
-find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | \
- grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
+find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
+ | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a LICENSE.txt README.rst $PKG/usr/doc/$PRGNAM-$VERSION