blob: 1bf68522a8ab5d483832aece55488b8d60c30d6b [file] [log] [blame]
Louis Ryanc42c8c42015-03-18 16:31:38 -07001#!/bin/bash
2#
3# Build protoc & netty
4set -ev
5
Louis Ryanc42c8c42015-03-18 16:31:38 -07006# Make protoc
Eric Andersona0acb9b2015-03-20 10:26:00 -07007# Can't check for presence of directory as cache auto-creates it.
Kun Zhanga2511712015-06-05 14:55:26 -07008if [ -f /tmp/proto3-a3/bin/protoc ]; then
Eric Andersona0acb9b2015-03-20 10:26:00 -07009 echo "Not building protobuf. Already built"
10else
Kun Zhangaf9fb6d2015-06-30 16:08:46 -070011 wget -O - https://github.com/google/protobuf/archive/v3.0.0-alpha-3.1.tar.gz | tar xz -C /tmp
12 pushd /tmp/protobuf-3.0.0-alpha-3.1
Eric Andersona0acb9b2015-03-20 10:26:00 -070013 ./autogen.sh
14 # install here so we don't need sudo
Kun Zhanga2511712015-06-05 14:55:26 -070015 ./configure --prefix=/tmp/proto3-a3
Eric Andersona0acb9b2015-03-20 10:26:00 -070016 make -j2
17 make install
18 popd
19fi
Louis Ryanc42c8c42015-03-18 16:31:38 -070020
21# Make and install netty
Eric Andersona0acb9b2015-03-20 10:26:00 -070022pushd lib/netty
23BUILD_NETTY=1
Eric Anderson16055782015-03-20 12:03:48 -070024NETTY_REV_FILE="$HOME/.m2/repository/io/netty/netty-ver"
Eric Andersona0acb9b2015-03-20 10:26:00 -070025REV="$(git rev-parse HEAD)"
26if [ -f "$NETTY_REV_FILE" ]; then
27 REV_LAST="$(cat "$NETTY_REV_FILE")"
28 if [ z"$REV" = z"$REV_LAST" ]; then
29 BUILD_NETTY=0
30 echo "Not building Netty; already at $REV"
31 fi
32fi
33if [ $BUILD_NETTY = 1 ]; then
34 mvn install -pl codec-http2 -am -DskipTests=true
35 echo "$REV" > "$NETTY_REV_FILE"
36fi
37popd