2014-09-30 01:58:16 +02:00
|
|
|
#!/usr/bin/env bash
|
2017-05-10 17:54:46 +02:00
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
# CentOS 5 is now end of life so we need to switch its repos over to the vault
|
|
|
|
sed -i -e '/^mirrorlist=/d' -e 's%^#baseurl=http://mirror.centos.org/centos/$releasever/%baseurl=http://vault.centos.org/5.11/%g' /etc/yum.repos.d/CentOS-Base.repo
|
|
|
|
sed -i -e '/^mirrorlist=/d' -e 's%^#baseurl=http://mirror.centos.org/centos/$releasever/%baseurl=http://vault.centos.org/5.11/%g' /etc/yum.repos.d/CentOS-fasttrack.repo
|
|
|
|
if [ -f /etc/yum.repos.d/libselinux.repo ]; then
|
|
|
|
sed -i -e '/^mirrorlist=/d' -e 's%^#baseurl=http://mirror.centos.org/centos/$releasever/%baseurl=http://vault.centos.org/5.11/%g' /etc/yum.repos.d/libselinux.repo
|
|
|
|
fi
|
|
|
|
|
|
|
|
# enable EPEL
|
|
|
|
sudo yum -y install epel-release
|
|
|
|
|
2014-09-30 01:58:16 +02:00
|
|
|
# install all required packages for rocksdb that are available through yum
|
|
|
|
ARCH=$(uname -i)
|
2017-05-10 17:54:46 +02:00
|
|
|
sudo yum -y install openssl java-1.7.0-openjdk-devel.$ARCH zlib-devel bzip2-devel lz4-devel snappy-devel
|
2014-09-30 01:58:16 +02:00
|
|
|
|
2015-09-01 20:07:43 +02:00
|
|
|
# install gcc/g++ 4.8.2 via CERN (http://linux.web.cern.ch/linux/devtoolset/)
|
2014-09-30 01:58:16 +02:00
|
|
|
sudo wget -O /etc/yum.repos.d/slc5-devtoolset.repo http://linuxsoft.cern.ch/cern/devtoolset/slc5-devtoolset.repo
|
2017-05-10 17:54:46 +02:00
|
|
|
sudo wget -O /etc/pki/rpm-gpg/RPM-GPG-KEY-cern http://ftp.mirrorservice.org/sites/ftp.scientificlinux.org/linux/scientific/obsolete/51/i386/RPM-GPG-KEYs/RPM-GPG-KEY-cern
|
2015-09-01 20:07:43 +02:00
|
|
|
sudo yum -y install devtoolset-2
|
|
|
|
|
2017-05-10 17:54:46 +02:00
|
|
|
# install gflags
|
2017-03-31 18:59:02 +02:00
|
|
|
wget https://github.com/gflags/gflags/archive/v2.0.tar.gz -O gflags-2.0.tar.gz
|
|
|
|
tar xvfz gflags-2.0.tar.gz; cd gflags-2.0; scl enable devtoolset-2 ./configure; scl enable devtoolset-2 make; sudo make install
|
2014-09-30 01:58:16 +02:00
|
|
|
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
|
|
|
|
|
2017-05-10 17:54:46 +02:00
|
|
|
# install zstandard
|
|
|
|
wget https://github.com/facebook/zstd/archive/v1.1.3.tar.gz -O zstd-1.1.3.tar.gz
|
|
|
|
tar zxvf zstd-1.1.3.tar.gz; cd zstd-1.1.3; scl enable devtoolset-2 make; sudo make install
|
|
|
|
|
2014-09-30 01:58:16 +02:00
|
|
|
# set java home so we can build rocksdb jars
|
2014-10-21 21:18:33 +02:00
|
|
|
export JAVA_HOME=/usr/lib/jvm/java-1.7.0
|
2014-09-30 01:58:16 +02:00
|
|
|
|
|
|
|
# build rocksdb
|
|
|
|
cd /rocksdb
|
2015-09-01 20:07:43 +02:00
|
|
|
scl enable devtoolset-2 'make jclean clean'
|
2015-10-09 20:41:40 +02:00
|
|
|
scl enable devtoolset-2 'PORTABLE=1 make rocksdbjavastatic'
|
2015-01-31 23:23:59 +01:00
|
|
|
cp /rocksdb/java/target/librocksdbjni-* /rocksdb-build
|
|
|
|
cp /rocksdb/java/target/rocksdbjni-* /rocksdb-build
|
2014-09-30 01:58:16 +02:00
|
|
|
|