Ilya Shipitsin | 73c3ed9 | 2021-05-18 09:46:43 +0000 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | # |
| 4 | # OT helper. script built from documentation: https://github.com/haproxytech/opentracing-c-wrapper |
| 5 | # |
| 6 | |
| 7 | set -e |
| 8 | |
| 9 | export OT_CPP_VERSION=1.5.0 |
| 10 | |
| 11 | if [ ! -f "download-cache/v${OT_CPP_VERSION}.tar.gz" ]; then |
| 12 | wget -P download-cache/ \ |
| 13 | "https://github.com/opentracing/opentracing-cpp/archive/v${OT_CPP_VERSION}.tar.gz" |
| 14 | fi |
| 15 | |
| 16 | if [ "$(cat ${HOME}/opt/.ot-cpp-version)" != "${OT_CPP_VERSION}" ]; then |
| 17 | tar xf download-cache/v${OT_CPP_VERSION}.tar.gz |
| 18 | cd opentracing-cpp-${OT_CPP_VERSION} |
| 19 | mkdir build |
| 20 | cd build |
| 21 | cmake -DCMAKE_INSTALL_PREFIX=${HOME}/opt -DBUILD_STATIC_LIBS=OFF -DBUILD_MOCKTRACER=OFF -DBUILD_TESTING=OFF .. |
| 22 | make |
| 23 | make install |
| 24 | echo "${OT_CPP_VERSION}" > "${HOME}/opt/.ot-cpp-version" |
| 25 | fi |
| 26 | |
| 27 | git clone https://github.com/haproxytech/opentracing-c-wrapper.git |
| 28 | cd opentracing-c-wrapper |
| 29 | ./scripts/bootstrap |
| 30 | ./configure --prefix=${HOME}/opt --with-opentracing=${HOME}/opt |
| 31 | make |
| 32 | make install |
| 33 | |
| 34 | |