github.com/confluentinc/confluent-kafka-go@v1.9.2/mk/bootstrap-librdkafka.sh (about)

     1  #!/bin/bash
     2  #
     3  #
     4  # Downloads, builds and installs librdkafka into <install-dir>
     5  #
     6  
     7  set -e
     8  
     9  VERSION=$1
    10  PREFIXDIR=$2
    11  
    12  if [[ -z "$VERSION" ]]; then
    13      echo "Usage: $0 <librdkafka-version> [<install-dir>]" 1>&2
    14      exit 1
    15  fi
    16  
    17  if [[ -z "$PREFIXDIR" ]]; then
    18      PREFIXDIR=tmp-build
    19  fi
    20  
    21  if [[ $PREFIXDIR != /* ]]; then
    22      PREFIXDIR="$PWD/$PREFIXDIR"
    23  fi
    24  
    25  mkdir -p "$PREFIXDIR/librdkafka"
    26  pushd "$PREFIXDIR/librdkafka"
    27  
    28  test -f configure ||
    29  curl -sL "https://github.com/edenhill/librdkafka/archive/${VERSION}.tar.gz" | \
    30      tar -xz --strip-components=1 -f -
    31  
    32  ./configure --prefix="$PREFIXDIR"
    33  make -j
    34  make install
    35  popd
    36