librdkafka/packaging/alpine/build-alpine.sh

39 строки
975 B
Bash
Исходник Обычный вид История

#!/bin/sh
#
# Build librdkafka on Alpine.
#
set -x
if [ "$1" = "--in-docker" ]; then
# Runs in docker, performs the actual build.
2019-06-20 13:06:54 +03:00
shift
apk add bash curl gcc g++ make musl-dev linux-headers bsd-compat-headers git python3 perl patch
git clone /v /librdkafka
cd /librdkafka
2019-06-20 13:06:54 +03:00
./configure --install-deps --disable-gssapi --disable-lz4-ext --enable-static $*
make -j
examples/rdkafka_example -X builtin.features
CI=true make -C tests run_local_quick
# Create a tarball in artifacts/
cd src
ldd librdkafka.so.1
2020-12-23 11:54:04 +03:00
tar cvzf /v/artifacts/alpine-librdkafka.tgz librdkafka.so.1 librdkafka*.a rdkafka-static.pc
cd ../..
else
# Runs on the host, simply spins up the in-docker build.
if [ ! -f configure.self ]; then
echo "Must be run from the top-level librdkafka dir"
exit 1
fi
mkdir -p artifacts
exec docker run -v $PWD:/v alpine:3.12 /v/packaging/alpine/$(basename $0) --in-docker $*
fi