File: install-protobuf.sh

package info (click to toggle)
golang-gogoprotobuf 1.0.0%2Bgit20180330.1ef32a8b-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 15,932 kB
  • sloc: makefile: 462; sh: 23
file content (28 lines) | stat: -rwxr-xr-x 643 bytes parent folder | download
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
#!/usr/bin/env bash

set -ex

die() {
    echo "$@" >&2
    exit 1
}

cd /home/travis

case "$PROTOBUF_VERSION" in
2*)
    basename=protobuf-$PROTOBUF_VERSION
    wget https://github.com/google/protobuf/releases/download/v$PROTOBUF_VERSION/$basename.tar.gz
    tar xzf $basename.tar.gz
    cd protobuf-$PROTOBUF_VERSION
    ./configure --prefix=/home/travis && make -j2 && make install
    ;;
3*)
    basename=protoc-$PROTOBUF_VERSION-linux-x86_64
    wget https://github.com/google/protobuf/releases/download/v$PROTOBUF_VERSION/$basename.zip
    unzip $basename.zip
    ;;
*)
    die "unknown protobuf version: $PROTOBUF_VERSION"
    ;;
esac