get-deps.sh (286506) | get-deps.sh (289180) |
---|---|
1#!/bin/sh 2# 3# 4# Licensed to the Apache Software Foundation (ASF) under one 5# or more contributor license agreements. See the NOTICE file 6# distributed with this work for additional information 7# regarding copyright ownership. The ASF licenses this file 8# to you under the Apache License, Version 2.0 (the --- 22 unchanged lines hidden (view full) --- 31# features already used in the file. Reviewing the history of changes 32# may be useful as well. 33 34APR_VERSION=${APR_VERSION:-"1.4.6"} 35APU_VERSION=${APU_VERSION:-"1.5.1"} 36SERF_VERSION=${SERF_VERSION:-"1.3.8"} 37ZLIB_VERSION=${ZLIB_VERSION:-"1.2.8"} 38SQLITE_VERSION=${SQLITE_VERSION:-"3.7.15.1"} | 1#!/bin/sh 2# 3# 4# Licensed to the Apache Software Foundation (ASF) under one 5# or more contributor license agreements. See the NOTICE file 6# distributed with this work for additional information 7# regarding copyright ownership. The ASF licenses this file 8# to you under the Apache License, Version 2.0 (the --- 22 unchanged lines hidden (view full) --- 31# features already used in the file. Reviewing the history of changes 32# may be useful as well. 33 34APR_VERSION=${APR_VERSION:-"1.4.6"} 35APU_VERSION=${APU_VERSION:-"1.5.1"} 36SERF_VERSION=${SERF_VERSION:-"1.3.8"} 37ZLIB_VERSION=${ZLIB_VERSION:-"1.2.8"} 38SQLITE_VERSION=${SQLITE_VERSION:-"3.7.15.1"} |
39GTEST_VERSION=${GTEST_VERSION:-"1.6.0"} | 39GMOCK_VERSION=${GMOCK_VERSION:-"1.6.0"} |
40HTTPD_VERSION=${HTTPD_VERSION:-"2.4.10"} 41APR_ICONV_VERSION=${APR_ICONV_VERSION:-"1.2.1"} 42 43APR=apr-${APR_VERSION} 44APR_UTIL=apr-util-${APU_VERSION} 45SERF=serf-${SERF_VERSION} 46ZLIB=zlib-${ZLIB_VERSION} 47SQLITE_VERSION_LIST=`echo $SQLITE_VERSION | sed -e 's/\./ /g'` 48SQLITE=sqlite-amalgamation-`printf %d%02d%02d%02d $SQLITE_VERSION_LIST` | 40HTTPD_VERSION=${HTTPD_VERSION:-"2.4.10"} 41APR_ICONV_VERSION=${APR_ICONV_VERSION:-"1.2.1"} 42 43APR=apr-${APR_VERSION} 44APR_UTIL=apr-util-${APU_VERSION} 45SERF=serf-${SERF_VERSION} 46ZLIB=zlib-${ZLIB_VERSION} 47SQLITE_VERSION_LIST=`echo $SQLITE_VERSION | sed -e 's/\./ /g'` 48SQLITE=sqlite-amalgamation-`printf %d%02d%02d%02d $SQLITE_VERSION_LIST` |
49GTEST=gtest-${GTEST_VERSION} 50GTEST_URL=http://googletest.googlecode.com/files/ | 49GMOCK=gmock-${GMOCK_VERSION} 50GMOCK_URL=https://googlemock.googlecode.com/files/ |
51 52HTTPD=httpd-${HTTPD_VERSION} 53APR_ICONV=apr-iconv-${APR_ICONV_VERSION} 54 55BASEDIR=`pwd` 56TEMPDIR=$BASEDIR/temp 57 58HTTP_FETCH= 59[ -z "$HTTP_FETCH" ] && type wget >/dev/null 2>&1 && HTTP_FETCH="wget -q -nc" 60[ -z "$HTTP_FETCH" ] && type curl >/dev/null 2>&1 && HTTP_FETCH="curl -sOL" 61[ -z "$HTTP_FETCH" ] && type fetch >/dev/null 2>&1 && HTTP_FETCH="fetch -q" 62 63# Need this uncommented if any of the specific versions of the ASF tarballs to 64# be downloaded are no longer available on the general mirrors. 65APACHE_MIRROR=http://archive.apache.org/dist 66 67# helpers 68usage() { 69 echo "Usage: $0" | 51 52HTTPD=httpd-${HTTPD_VERSION} 53APR_ICONV=apr-iconv-${APR_ICONV_VERSION} 54 55BASEDIR=`pwd` 56TEMPDIR=$BASEDIR/temp 57 58HTTP_FETCH= 59[ -z "$HTTP_FETCH" ] && type wget >/dev/null 2>&1 && HTTP_FETCH="wget -q -nc" 60[ -z "$HTTP_FETCH" ] && type curl >/dev/null 2>&1 && HTTP_FETCH="curl -sOL" 61[ -z "$HTTP_FETCH" ] && type fetch >/dev/null 2>&1 && HTTP_FETCH="fetch -q" 62 63# Need this uncommented if any of the specific versions of the ASF tarballs to 64# be downloaded are no longer available on the general mirrors. 65APACHE_MIRROR=http://archive.apache.org/dist 66 67# helpers 68usage() { 69 echo "Usage: $0" |
70 echo "Usage: $0 [ apr | serf | zlib | sqlite | gtest ] ..." | 70 echo "Usage: $0 [ apr | serf | zlib | sqlite | gmock ] ..." |
71 exit $1 72} 73 74# getters 75get_apr() { 76 cd $TEMPDIR 77 test -d $BASEDIR/apr || $HTTP_FETCH $APACHE_MIRROR/apr/$APR.tar.bz2 78 test -d $BASEDIR/apr-util || $HTTP_FETCH $APACHE_MIRROR/apr/$APR_UTIL.tar.bz2 --- 38 unchanged lines hidden (view full) --- 117 cd $BASEDIR 118 119 unzip -q $TEMPDIR/$SQLITE.zip 120 121 mv $SQLITE sqlite-amalgamation 122 123} 124 | 71 exit $1 72} 73 74# getters 75get_apr() { 76 cd $TEMPDIR 77 test -d $BASEDIR/apr || $HTTP_FETCH $APACHE_MIRROR/apr/$APR.tar.bz2 78 test -d $BASEDIR/apr-util || $HTTP_FETCH $APACHE_MIRROR/apr/$APR_UTIL.tar.bz2 --- 38 unchanged lines hidden (view full) --- 117 cd $BASEDIR 118 119 unzip -q $TEMPDIR/$SQLITE.zip 120 121 mv $SQLITE sqlite-amalgamation 122 123} 124 |
125get_gtest() { 126 test -d $BASEDIR/gtest && return | 125get_gmock() { 126 test -d $BASEDIR/gmock-fused && return |
127 128 cd $TEMPDIR | 127 128 cd $TEMPDIR |
129 $HTTP_FETCH ${GTEST_URL}/${GTEST}.zip | 129 $HTTP_FETCH ${GMOCK_URL}/${GMOCK}.zip |
130 cd $BASEDIR 131 | 130 cd $BASEDIR 131 |
132 unzip -q $TEMPDIR/$GTEST.zip | 132 unzip -q $TEMPDIR/$GMOCK.zip |
133 | 133 |
134 mv $GTEST gtest | 134 mv $GMOCK/fused-src gmock-fused 135 rm -fr $GMOCK |
135} 136 137# main() 138get_deps() { 139 mkdir -p $TEMPDIR 140 | 136} 137 138# main() 139get_deps() { 140 mkdir -p $TEMPDIR 141 |
141 for i in zlib serf sqlite-amalgamation apr apr-util gtest; do | 142 for i in zlib serf sqlite-amalgamation apr apr-util gmock-fused; do |
142 if [ -d $i ]; then 143 echo "Local directory '$i' already exists; the downloaded copy won't be used" >&2 144 fi 145 done 146 147 if [ $# -gt 0 ]; then 148 for target in "$@"; do 149 if [ "$target" != "deps" ]; then --- 24 unchanged lines hidden --- | 143 if [ -d $i ]; then 144 echo "Local directory '$i' already exists; the downloaded copy won't be used" >&2 145 fi 146 done 147 148 if [ $# -gt 0 ]; then 149 for target in "$@"; do 150 if [ "$target" != "deps" ]; then --- 24 unchanged lines hidden --- |