Last active
September 1, 2017 14:28
-
-
Save alexott/76847779adf8adb2a488d835f0eabb35 to your computer and use it in GitHub Desktop.
Rebuild C/C++ packages provided by Confluent
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# By default, Confluent provides Debian versions of their packages via APT - as result, they are linked | |
# to other versions of the libraries than in Ubuntu, ... | |
# This small script rebuilds them on Ubuntu, or Debian versions different from provided by default. | |
MY_BUILD_DIR="build-$$" | |
mkdir $MY_BUILD_DIR | |
cd $MY_BUILD_DIR | |
apt-get source librdkafka libavro-cpp-dev libavro-c-dev confluent-libserdes-dev | |
# install necessary build dependencies | |
apt-get -y install debhelper libsasl2-dev liblz4-dev libsnappy-dev liblzma-dev libjansson-dev libboost-dev \ | |
libboost-filesystem-dev libboost-system-dev libboost-program-options-dev libboost-iostreams-dev \ | |
libcurl4-openssl-dev cmake zlib1g-dev libssl-dev | |
# build librdkafka | |
cd `find . -maxdepth 1 -type d -a -name librdkafka\*` | |
dpkg-buildpackage -b -uc | |
cd .. | |
dpkg -i librdkafka*.deb | |
# build avro-c | |
cd `find . -maxdepth 1 -type d -a -name avro-c-\*` | |
dpkg-buildpackage -b -uc | |
cd .. | |
# build avro-cpp | |
cd `find . -maxdepth 1 -type d -a -name avro-cpp-\*` | |
dpkg-buildpackage -b -uc | |
cd .. | |
dpkg -i libavro-c*.deb | |
# build libserdes | |
cd `find . -maxdepth 1 -type d -a -name confluent-libserdes-\*` | |
dpkg-buildpackage -b -uc | |
cd .. | |
dpkg -i confluent-libserdes*.deb | |
# cleanup after build | |
cd .. | |
rm -rf $MY_BUILD_DIR | |
# Mark packages as not upgradable automatically | |
for i in confluent-libserdes++1 confluent-libserdes-dev confluent-libserdes1 librdkafka1 \ | |
librdkafka1-dbg libavro-c-dev libavro-cpp-dev librdkafka++1 librdkafka-dev ; do | |
apt-mark hold $i | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment