Skip to content

Commit

Permalink
Merge pull request bauerj#23 from bauerj/fedora-support
Browse files Browse the repository at this point in the history
Add support for Fedora
  • Loading branch information
bauerj committed Aug 8, 2018
2 parents 5780dc8 + 30cc0aa commit d5193a1
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 38 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Expand Up @@ -13,6 +13,7 @@ script:

env:
- IMAGE="ubuntu:16.04"
- IMAGE="fedora:28"
- IMAGE="debian:8"
- IMAGE="centos:7"
- IMAGE="debian:9"
Expand Down
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -32,6 +32,7 @@ The following operating systems are officially supported and automatically being
|----------|---:|
| Ubuntu 18.04 | [![ubuntu](https://badges.herokuapp.com/travis/bauerj/electrumx-installer?env=IMAGE=%22ubuntu:18.04%22&label=ubuntu:18.04)](https://travis-ci.org/bauerj/electrumx-installer/) |
| Debian Jessie | [![debian](https://badges.herokuapp.com/travis/bauerj/electrumx-installer?env=IMAGE=%22debian:8%22&label=debian:8)](https://travis-ci.org/bauerj/electrumx-installer/) |
| Fedora 29 | [![centos](https://badges.herokuapp.com/travis/bauerj/electrumx-installer?env=IMAGE=%22fedora:28%22&label=fedora:28)](https://travis-ci.org/bauerj/electrumx-installer/) |
| Ubuntu 16.04 | [![ubuntu](https://badges.herokuapp.com/travis/bauerj/electrumx-installer?env=IMAGE=%22ubuntu:16.04%22&label=ubuntu:16.04)](https://travis-ci.org/bauerj/electrumx-installer/) |
| CentOS 7 | [![centos](https://badges.herokuapp.com/travis/bauerj/electrumx-installer?env=IMAGE=%22centos:7%22&label=centos:7)](https://travis-ci.org/bauerj/electrumx-installer/) |
| Debian Stretch | [![debian](https://badges.herokuapp.com/travis/bauerj/electrumx-installer?env=IMAGE=%22debian:9%22&label=debian:9)](https://travis-ci.org/bauerj/electrumx-installer/) |
Expand Down
40 changes: 2 additions & 38 deletions distributions/CentOSLinux.sh
@@ -1,41 +1,5 @@
if [ "$VERSION_ID" != "7" ]; then
warning "Only the latest version (CentOS 7) is officially supported (but this might work)"
warning "Only the latest version (CentOS 7) is officially supported (but this might work)"
fi

function install_compiler {
yum -y update
yum -y install gcc-c++ bzip2 || _error "Could not install packages" 1
}

function install_script_dependencies {
yum -y install wget openssl
}

PATH=$PATH:/usr/local/bin
. distributions/base.sh
. distributions/base-systemd.sh
. distributions/base-conda.sh
. distributions/base-compile-rocksdb.sh


function install_leveldb {
yum -y install libleveldb-dev build-essential || _error "Could not install packages" 3
}

function install_git {
yum -y install git || _error "Could not install packages" 2
}

function install_rocksdb_dependencies {
# /usr/lib is not always included?
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib
yum -y install snappy snappy-devel zlib zlib-devel bzip2-libs bzip2-devel libgflags-dev cmake make || _error "Could not install packages" 4
_DIR=$(pwd)
git clone https://github.com/gflags/gflags /tmp/gflags
cd /tmp/gflags
mkdir build && cd build
_info "Compiling gflags"
export CXXFLAGS="-fPIC" && cmake .. && make VERBOSE=1
make && make install || _error "Error installing gflags" 1
cd $_DIR
}
. distributions/base-rhel.sh
19 changes: 19 additions & 0 deletions distributions/Fedora.sh
@@ -0,0 +1,19 @@
. distributions/base-rhel.sh

export PYTHONUSERBASE=/usr/local/lib/python3.6/site-packages

if [ "$VERSION_ID" != "28" ]; then
warning "Only the latest version (Fedora 28) is officially supported (but this might work)"
fi

has_rocksdb_binary=1
newer_rocksdb=1

function binary_install_rocksdb {
dnf -y install redhat-rpm-config python3-devel snappy-devel zlib-devel rocksdb-devel lz4-devel bzip2-devel gflags-devel gcc-c++ gcc || _error "Unable to install rocksdb" 1
}

function binary_uninstall_rocksdb {
$APT remove -y rocksdb rocksdb-devel || _error "Could not remove rocksdb" 1
}

37 changes: 37 additions & 0 deletions distributions/base-rhel.sh
@@ -0,0 +1,37 @@
function install_compiler {
yum -y update
yum -y install gcc-c++ bzip2 || _error "Could not install packages" 1
}

function install_script_dependencies {
yum -y install wget openssl
}

PATH=$PATH:/usr/local/bin
. distributions/base.sh
. distributions/base-systemd.sh
. distributions/base-conda.sh
. distributions/base-compile-rocksdb.sh


function install_leveldb {
yum -y install libleveldb-dev build-essential || _error "Could not install packages" 3
}

function install_git {
yum -y install git || _error "Could not install packages" 2
}

function install_rocksdb_dependencies {
# /usr/lib is not always included?
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib
yum -y install snappy snappy-devel zlib zlib-devel bzip2-libs bzip2-devel libgflags-dev cmake make || _error "Could not install packages" 4
_DIR=$(pwd)
git clone https://github.com/gflags/gflags /tmp/gflags
cd /tmp/gflags
mkdir build && cd build
_info "Compiling gflags"
export CXXFLAGS="-fPIC" && cmake .. && make VERBOSE=1
make && make install || _error "Error installing gflags" 1
cd $_DIR
}

0 comments on commit d5193a1

Please sign in to comment.