Skip to content

Instantly share code, notes, and snippets.

@movitto
Last active May 19, 2019 17:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save movitto/a08d30cd80f70b0d952cd3c9765eece6 to your computer and use it in GitHub Desktop.
Save movitto/a08d30cd80f70b0d952cd3c9765eece6 to your computer and use it in GitHub Desktop.
Commands needed to build the rippled RPM on a fresh CentOS 7 install
# Setup rippled RPM build environemnt on CentOS
# From a fresh CentOS install
# Update system, reboot
sudo yum update
sudo reboot
# Install deps
sudo yum install protobuf-static openssl-static zlib-static
# Install rpm-build, git, wget, g++
sudo yum install rpm-build git wget gcc-c++
# Install ninja build, cmake3
sudo yum install epel-release
sudo yum install ninja-build cmake3
# Install devtools
sudo yum install centos-release-scl yum-utils
sudo yum-config-manager --enable rhel-server-rhscl-7-rpms
sudo yum install devtoolset-7
scl enable devtoolset-7 bash
# Create requried directories
sudo mkdir /opt/rippled_build/
sudo chmod 777 /opt/rippled_build
mkdir -p /opt/rippled_build/pkg/rpmbuild/SOURCES
# Download boost
cd /opt/rippled_build/pkg
wget https://dl.bintray.com/boostorg/release/1.67.0/source/boost_1_67_0.tar.gz
tar xzvf boost_16_0.tar.gz
cd boost_1_67_0
./bootstrap.sh
./b2 -jN # where N is the number of CPUs you have
# Download kerberos
sudo yum install byacc
wget http://web.mit.edu/kerberos/dist/krb5/1.17/krb5-1.17.tar.gz
tar xzvf krb5-1.17.tar.gz
cd krb5-1.17/src
./configure --enable-static --disable-shared
make
# Checkout rippled
git clone https://github.com/ripple/rippled.git
ln -s rippled/Builds/containers/packaging/rpm/rippled.spec .
cd rippled
git apply custom-build.patch
cd Builds/containers/shared
BOOST_ROOT='/opt/rippled_bld/pkg/boost_1_67_0' ../packaging/rpm/build_rpm.sh
###
# custom-build.patch (apply above)
diff --git a/Builds/containers/packaging/rpm/rippled.spec b/Builds/containers/packaging/rpm/rippled.spec
index cf9b144..5cb98c2 100644
--- a/Builds/containers/packaging/rpm/rippled.spec
+++ b/Builds/containers/packaging/rpm/rippled.spec
@@ -33,21 +33,21 @@ core library for development of standalone applications that sign transactions.
cd rippled
mkdir -p bld.release
cd bld.release
-cmake .. -G Ninja -DCMAKE_INSTALL_PREFIX=%{_prefix} -DCMAKE_BUILD_TYPE=Release -Dstatic=true -DCMAKE_VERBOSE_MAKEFILE=ON -Dlocal_protobuf=ON
+cmake3 .. -G Ninja -DCMAKE_INSTALL_PREFIX=%{_prefix} -DCMAKE_BUILD_TYPE=Release -Dstatic=true -DCMAKE_VERBOSE_MAKEFILE=ON -Dlocal_protobuf=ON
rm -rf $RPM_BUILD_ROOT
-DESTDIR=$RPM_BUILD_ROOT cmake --build . --parallel --target install -- -v
+DESTDIR=$RPM_BUILD_ROOT cmake3 --build . --parallel --target install -- -v
cd ../../validator-keys-tool
mkdir -p bld.release
cd bld.release
-cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=$RPM_BUILD_ROOT%{_prefix}/ -Dstatic=true -DCMAKE_VERBOSE_MAKEFILE=ON
-cmake --build . --parallel -- -v
+cmake3 .. -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=$RPM_BUILD_ROOT%{_prefix}/ -Dstatic=true -DCMAKE_VERBOSE_MAKEFILE=ON
+cmake3 --build . --parallel -- -v
%pre
test -e /etc/pki/tls || { mkdir -p /etc/pki; ln -s /usr/lib/ssl /etc/pki/tls; }
%install
-DESTDIR=$RPM_BUILD_ROOT cmake --build rippled/bld.release --target install -- -v
+DESTDIR=$RPM_BUILD_ROOT cmake3 --build rippled/bld.release --target install -- -v
install -d ${RPM_BUILD_ROOT}/etc/opt/ripple
install -d ${RPM_BUILD_ROOT}/usr/local/bin
ln -s %{_prefix}/etc/rippled.cfg ${RPM_BUILD_ROOT}/etc/opt/ripple/rippled.cfg
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 513eb3d..fb12733 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -19,7 +19,7 @@ if (POLICY CMP0074)
cmake_policy(SET CMP0074 NEW)
endif ()
#[===================================================================[
- convenience variables and sanity checks
+# convenience variables and sanity checks
#]===================================================================]
if (NOT ep_procs)
@@ -1406,18 +1406,18 @@ exclude_if_included (rocksdb_lib)
if (is_root_project) # NuDB not needed in the case of xrpl_core inclusion build
add_library (nudb INTERFACE)
- if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.11)
- FetchContent_Declare(
- nudb_src
- GIT_REPOSITORY https://github.com/vinniefalco/NuDB.git
- GIT_TAG 1.0.0
- )
- FetchContent_GetProperties(nudb_src)
- if(NOT nudb_src_POPULATED)
- message (STATUS "Pausing to download NuDB...")
- FetchContent_Populate(nudb_src)
- endif()
- else ()
+ #if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.11)
+ # FetchContent_Declare(
+ # nudb_src
+ # GIT_REPOSITORY https://github.com/vinniefalco/NuDB.git
+ # GIT_TAG 1.0.0
+ # )
+ # FetchContent_GetProperties(nudb_src)
+ # if(NOT nudb_src_POPULATED)
+ # message (STATUS "Pausing to download NuDB...")
+ # FetchContent_Populate(nudb_src)
+ # endif()
+ #else ()
ExternalProject_Add (nudb_src
PREFIX ${nih_cache_path}
GIT_REPOSITORY https://github.com/vinniefalco/NuDB.git
@@ -1431,7 +1431,7 @@ if (is_root_project) # NuDB not needed in the case of xrpl_core inclusion build
set (nudb_src_SOURCE_DIR "${SOURCE_DIR}")
file (MAKE_DIRECTORY ${nudb_src_SOURCE_DIR}/include)
add_dependencies (nudb nudb_src)
- endif ()
+ #endif ()
file(TO_CMAKE_PATH "${nudb_src_SOURCE_DIR}" nudb_src_SOURCE_DIR)
# specify as system includes so as to avoid warnings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment