-
Notifications
You must be signed in to change notification settings - Fork 173
/
freetds.sh
32 lines (27 loc) · 985 Bytes
/
freetds.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash
# Install a custom FreeTDS version - http://www.freetds.org
#
# Add the following environment variables to your project configuration
# (otherwise the default below will be used).
# * FREETDS_VERSION
#
# To run this script on Codeship, add the following
# command to your project's setup commands:
# \curl -sSL https://raw.githubusercontent.com/codeship/scripts/master/packages/freetds.sh | bash -s
#
FREETDS_VERSION=${FREETDS_VERSION:="1.1.17"}
TDS_DIR=${TDS_DIR:=$HOME/cache/freetds}
set -e
if [ ! -d "${TDS_DIR}" ]; then
CACHED_DOWNLOAD="${HOME}/cache/freetds.tar.gz"
mkdir -p "${HOME}/freetds"
wget --continue --output-document "${CACHED_DOWNLOAD}" "ftp://ftp.freetds.org/pub/freetds/stable/freetds-${FREETDS_VERSION}.tar.gz"
tar -xaf "${CACHED_DOWNLOAD}" --strip-components=1 --directory "${HOME}/freetds"
(
cd "${HOME}/freetds" || exit 1
./configure --prefix="${TDS_DIR}"
make
make install
)
fi
ln -s "${TDS_DIR}/bin/"* "${HOME}/bin"