From e336d97f6365b5ea7f0032861d943cf08fe92d9a Mon Sep 17 00:00:00 2001 From: Adam Retter Date: Wed, 10 May 2017 08:54:46 -0700 Subject: [PATCH] Fixes the CentOS 5 cross-building of RocksJava Summary: Updates to CentOS 5 have been archived as CentOS 5 is EOL. We now pull the updates from the vault. This is a stop gap solution, I will send a PR in a couple days which uses fixed Docker containers (with the updates pre-installed) instead. sagar0 Here you go :-) Closes https://github.com/facebook/rocksdb/pull/2270 Differential Revision: D5033637 Pulled By: sagar0 fbshipit-source-id: a9312dd1bc18bfb8653f06ffa0a1512b4415720d --- java/crossbuild/Vagrantfile | 4 ++-- java/crossbuild/build-linux-centos.sh | 22 ++++++++++++++++++++-- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/java/crossbuild/Vagrantfile b/java/crossbuild/Vagrantfile index 21cce1201..65bb8f447 100644 --- a/java/crossbuild/Vagrantfile +++ b/java/crossbuild/Vagrantfile @@ -7,11 +7,11 @@ VAGRANTFILE_API_VERSION = "2" Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.define "linux32" do |linux32| - linux32.vm.box = "hansode/centos-5.6-i386" + linux32.vm.box = "hansode/centos-5.11-i386" end config.vm.define "linux64" do |linux64| - linux64.vm.box = "hansode/centos-5.6-x86_64" + linux64.vm.box = "hansode/centos-5.11-x86_64" end config.vm.provider "virtualbox" do |v| diff --git a/java/crossbuild/build-linux-centos.sh b/java/crossbuild/build-linux-centos.sh index 7112ad319..fd8119bdc 100755 --- a/java/crossbuild/build-linux-centos.sh +++ b/java/crossbuild/build-linux-centos.sh @@ -1,17 +1,35 @@ #!/usr/bin/env bash + +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 + # install all required packages for rocksdb that are available through yum ARCH=$(uname -i) -sudo yum -y install openssl java-1.7.0-openjdk-devel.$ARCH +sudo yum -y install openssl java-1.7.0-openjdk-devel.$ARCH zlib-devel bzip2-devel lz4-devel snappy-devel # install gcc/g++ 4.8.2 via CERN (http://linux.web.cern.ch/linux/devtoolset/) sudo wget -O /etc/yum.repos.d/slc5-devtoolset.repo http://linuxsoft.cern.ch/cern/devtoolset/slc5-devtoolset.repo -sudo wget -O /etc/pki/rpm-gpg/RPM-GPG-KEY-cern http://ftp.mirrorservice.org/sites/ftp.scientificlinux.org/linux/scientific/51/i386/RPM-GPG-KEYs/RPM-GPG-KEY-cern +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 sudo yum -y install devtoolset-2 +# install gflags 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 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib +# 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 + # set java home so we can build rocksdb jars export JAVA_HOME=/usr/lib/jvm/java-1.7.0