gdal/gdal-cleaner.sh

38 lines
858 B
Bash
Raw Normal View History

#!/bin/bash
2020-06-30 09:53:07 +00:00
if [ $# -lt 1 ]; then
echo "Usage: $0 version"
exit 1
fi
VERSION="$1"
2022-05-20 20:56:49 +00:00
PRE="$2"
2020-06-30 09:53:07 +00:00
2022-05-20 20:56:49 +00:00
if [ ! -f "gdal-"${VERSION}${PRE}".tar.xz" ]; then
wget https://download.osgeo.org/gdal/${VERSION}/gdal-${VERSION}${PRE}.tar.xz
fi
2022-05-20 20:56:49 +00:00
if [ -d gdal-"${VERSION}" ] || [ -d gdal-"${VERSION}"-fedora ]; then
echo "gdal-${VERSION} or gdal-${VERSION}-fedora in the way, please remove and rerun this script"
exit 1
fi
2022-05-20 20:56:49 +00:00
tar xvf gdal-"${VERSION}${PRE}".tar.xz
mv gdal-"${VERSION}"{,-fedora} && pushd gdal-"${VERSION}"-fedora
rm data/cubewerx_extra.wkt
rm data/esri_StatePlane_extra.wkt
rm data/ecw_cs.wkt
2022-05-20 20:56:49 +00:00
sed -i 's|data/cubewerx_extra.wkt||' gdal.cmake
sed -i 's|data/esri_StatePlane_extra.wkt||' gdal.cmake
sed -i 's|data/ecw_cs.wkt||' gdal.cmake
popd
#TODO: Insert Provenance file
2022-05-20 20:56:49 +00:00
tar cvfJ gdal-"${VERSION}${PRE}"-fedora.tar.xz gdal-"${VERSION}"-fedora