aboutsummaryrefslogtreecommitdiffstats
path: root/win32/get-src
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2014-08-25 17:36:19 +0800
committerMilan Crha <mcrha@redhat.com>2014-08-25 17:36:19 +0800
commit396e5e82c16d3d81e1e575e02fe05a77149ed0ea (patch)
tree655b4918d46b56a1a638f6c4d4476c727530ea17 /win32/get-src
parent9a8604400946bf0fe5d1fa227fa2524e9baf4fb0 (diff)
downloadgsoc2013-evolution-396e5e82c16d3d81e1e575e02fe05a77149ed0ea.tar
gsoc2013-evolution-396e5e82c16d3d81e1e575e02fe05a77149ed0ea.tar.gz
gsoc2013-evolution-396e5e82c16d3d81e1e575e02fe05a77149ed0ea.tar.bz2
gsoc2013-evolution-396e5e82c16d3d81e1e575e02fe05a77149ed0ea.tar.lz
gsoc2013-evolution-396e5e82c16d3d81e1e575e02fe05a77149ed0ea.tar.xz
gsoc2013-evolution-396e5e82c16d3d81e1e575e02fe05a77149ed0ea.tar.zst
gsoc2013-evolution-396e5e82c16d3d81e1e575e02fe05a77149ed0ea.zip
Add Win32 build scripts into sources
See win32/readme.txt for more information.
Diffstat (limited to 'win32/get-src')
-rwxr-xr-xwin32/get-src83
1 files changed, 83 insertions, 0 deletions
diff --git a/win32/get-src b/win32/get-src
new file mode 100755
index 0000000000..7332815982
--- /dev/null
+++ b/win32/get-src
@@ -0,0 +1,83 @@
+#!/bin/bash
+
+OK=0
+MKPWD=$PWD
+URLLINK=$1
+DOWNLOADEDFILE=$2
+EXTRACTTO=$4
+EXTRACTEDDIR=$5
+
+if test "$DOWNLOADEDFILE" = "0" ; then
+ DOWNLOADEDFILE=$3 ;
+else
+ URLLINK="$URLLINK/$DOWNLOADEDFILE" ;
+fi
+
+if test ! -f "downloads/$DOWNLOADEDFILE" ; then
+ cd downloads && \
+ wget --no-check-certificate $URLLINK && \
+ cd .. && \
+ OK=1
+else
+ OK=1
+fi
+if test "$OK" = "0" ; then
+ exit 1;
+fi
+
+case "$DOWNLOADEDFILE" in
+ *.7z)
+ if test "$EXTRACTEDDIR" = "" ; then
+ EXTRACTEDDIR=${DOWNLOADEDFILE%%.7z}
+ fi
+ if test ! -d "src/${EXTRACTEDDIR}" ; then
+ echo " * Unpacking '$DOWNLOADEDFILE'..."
+ if test "$EXTRACTTO" != "" ; then
+ cd $EXTRACTTO &&
+ 7za x -y $MKPWD/downloads/$DOWNLOADEDFILE >/dev/null &&
+ cd $MKPWD
+ else
+ cd src && \
+ 7za x -y ../downloads/$DOWNLOADEDFILE >/dev/null && \
+ cd ..
+ fi
+ fi
+ ;;
+ *.zip)
+ if test "$EXTRACTEDDIR" = "" ; then
+ EXTRACTEDDIR=${DOWNLOADEDFILE%%.zip}
+ fi
+ if test ! -d "src/${EXTRACTEDDIR}" ; then
+ echo " * Unpacking '$DOWNLOADEDFILE'..."
+ if test "$EXTRACTTO" != "" ; then
+ cd $EXTRACTTO &&
+ unzip -o $MKPWD/downloads/$DOWNLOADEDFILE >/dev/null &&
+ cd $MKPWD
+ else
+ cd src && \
+ unzip -o ../downloads/$DOWNLOADEDFILE >/dev/null && \
+ cd ..
+ fi
+ fi
+ ;;
+ *.tar*|*.tgz)
+ if test "$EXTRACTEDDIR" = "" ; then
+ case "$DOWNLOADEDFILE" in
+ *.tar*) EXTRACTEDDIR=${DOWNLOADEDFILE%%.tar*} ;;
+ *.tgz) EXTRACTEDDIR=${DOWNLOADEDFILE%%.tgz*} ;;
+ *) echo "unknown archive type for tar case: '$DOWNLOADEDFILE'"; exit 1; ;;
+ esac
+ fi
+ if test ! -d "src/$EXTRACTEDDIR" ; then
+ echo " * Unpacking '$DOWNLOADEDFILE'..."
+ if test "$EXTRACTTO" = "" ; then
+ EXTRACTTO=src
+ fi
+ if test ! -d "$EXTRACTTO" ; then
+ mkdir -p "$EXTRACTTO";
+ fi
+ tar -xf downloads/$DOWNLOADEDFILE --directory=$EXTRACTTO
+ fi
+ ;;
+ *) echo "unknown archive type '$DOWNLOADEDFILE'"; exit 1; ;;
+esac