]> git.proxmox.com Git - ceph.git/blame - ceph/src/civetweb/ci/travis/setup_lua.sh
buildsys: switch source download to quincy
[ceph.git] / ceph / src / civetweb / ci / travis / setup_lua.sh
CommitLineData
11fdf7f2 1#!/usr/bin/env /bash
7c673cae
FG
2set -ev
3
4# this script installs a lua / luarocks environment in .travis/lua
5# this is necessary because travis docker architecture (the fast way)
6# does not permit sudo, and does not contain a useful lua installation
7
8# After this script is finished, you can configure your environment to
9# use it by sourcing lua_env.sh
10
11source ci/travis/platform.sh
12
13# The current versions when this script was written
14LUA_VERSION=5.2.4
15LUAROCKS_VERSION=2.2.2
16
17# directory where this script is located
18SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
19
20# civetweb base dir
21PROJECT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )"/../.. && pwd )
22
23# fetch and unpack lua src
24cd $SCRIPT_DIR
25LUA_BASE=lua-$LUA_VERSION
26rm -rf $LUA_BASE
27curl http://www.lua.org/ftp/$LUA_BASE.tar.gz | tar zx
28
29# build lua
30cd $LUA_BASE
31make $PLATFORM
32make local
33
34# mv built lua install to target Lua dir
35LUA_DIR=$PROJECT_DIR/ci/lua
36rm -rf $LUA_DIR
37mv $SCRIPT_DIR/$LUA_BASE/install $LUA_DIR
38
39# add to path required by luarocks installer
40export PATH=$LUA_DIR/bin:$PATH
41
42
43# fetch and unpack luarocks
44cd $SCRIPT_DIR
45LUAROCKS_BASE=luarocks-$LUAROCKS_VERSION
46rm -rf ${LUAROCKS_BASE}
47LUAROCKS_URL=http://luarocks.org/releases/${LUAROCKS_BASE}.tar.gz
48# -L because it's a 302 redirect
49curl -L $LUAROCKS_URL | tar xzp
50cd $LUAROCKS_BASE
51
52# build luarocks
53./configure --prefix=$LUA_DIR
54make build
55make install
56
57# cleanup source dirs
58cd $SCRIPT_DIR
59rm -rf $LUAROCKS_BASE
60rm -rf $LUA_BASE
61