2 # Copyright 2017 The Kyua Authors.
5 # Redistribution and use in source and binary forms, with or without
6 # modification, are permitted provided that the following conditions are
9 # * Redistributions of source code must retain the above copyright
10 # notice, this list of conditions and the following disclaimer.
11 # * Redistributions in binary form must reproduce the above copyright
12 # notice, this list of conditions and the following disclaimer in the
13 # documentation and/or other materials provided with the distribution.
14 # * Neither the name of Google Inc. nor the names of its contributors
15 # may be used to endorse or promote products derived from this software
16 # without specific prior written permission.
18 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 # \file admin/build-bintray-dist.sh
31 # Builds a full Kyua installation under /usr/local for Ubuntu.
33 # This script is used to create the bintray distribution packages in lieu
34 # of real Debian packages for Kyua. The result of this script is a
35 # tarball that provides the contents of /usr/local for Kyua.
45 sudo apt-get update -qq
49 packages="${packages} autoconf"
50 packages="${packages} automake"
51 packages="${packages} clang"
52 packages="${packages} g++"
53 packages="${packages} gdb"
54 packages="${packages} git"
55 packages="${packages} libtool"
56 packages="${packages} make"
57 if [ "${ARCH?}" = i386 ]; then
59 packages="${packages} gcc-multilib"
60 packages="${packages} g++-multilib"
62 packages="${packages} liblua5.2-0${pkgsuffix}"
63 packages="${packages} liblua5.2-dev${pkgsuffix}"
64 packages="${packages} libsqlite3-0${pkgsuffix}"
65 packages="${packages} libsqlite3-dev${pkgsuffix}"
66 packages="${packages} pkg-config${pkgsuffix}"
67 packages="${packages} sqlite3"
68 sudo apt-get install -y ${packages}
71 install_from_github() {
72 local name="${1}"; shift
73 local release="${1}"; shift
75 local distname="${name}-${release}"
77 local baseurl="https://github.com/jmmv/${name}"
78 wget --no-check-certificate \
79 "${baseurl}/releases/download/${distname}/${distname}.tar.gz"
80 tar -xzvf "${distname}.tar.gz"
83 [ "${ARCH?}" != i386 ] || archflags=-m32
91 CFLAGS="${archflags}" \
92 CPPFLAGS="-I/usr/local/include" \
94 CXXFLAGS="${archflags}" \
95 LDFLAGS="-L/usr/local/lib -Wl,-R/usr/local/lib" \
96 PKG_CONFIG_PATH="/usr/local/lib/pkgconfig"
101 rm -rf "${distname}" "${distname}.tar.gz"
105 [ "${ARCH+set}" = set ] || err "ARCH must be set in the environment"
106 [ "${CC+set}" = set ] || err "CC must be set in the environment"
107 [ "${CXX+set}" = set ] || err "CXX must be set in the environment"
109 [ ! -f /root/local.tgz ] || err "/root/local.tgz already exists"
110 tar -czf /root/local.tgz /usr/local
113 tar -xz -C / -f /root/local.tgz
121 install_from_github atf 0.21
122 install_from_github lutok 0.4
123 install_from_github kyua 0.13
125 local version="$(lsb_release -rs | cut -d . -f 1-2 | tr . -)"
126 local name="$(date +%Y%m%d)-usr-local-kyua"
127 name="${name}-ubuntu-${version}-${ARCH?}-${CC?}.tar.gz"
128 tar -czf "${name}" /usr/local