blob: af7d05a04cd603c8ebfcab0a7ddd579f4523010b [file] [log] [blame]
Lott, Christopher (cl778h)d6723d82019-09-23 11:43:08 -04001#!/bin/bash
2
3# O-RAN-SC
4#
5# Copyright (C) 2019 AT&T Intellectual Property and Nokia
6#
7# Licensed under the Apache License, Version 2.0 (the "License");
8# you may not use this file except in compliance with the License.
9# You may obtain a copy of the License at
10#
11# http://www.apache.org/licenses/LICENSE-2.0
12#
13# Unless required by applicable law or agreed to in writing, software
14# distributed under the License is distributed on an "AS IS" BASIS,
15# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16# See the License for the specific language governing permissions and
17# limitations under the License.
18
Lott, Christopher (cl778h)557b88a2019-09-27 06:01:54 -040019# Installs NNG from source and RMR from PackageCloud on CentOS7
20# Reads RMR version number from repo file rmr-version.yaml
Lott, Christopher (cl778h)d6723d82019-09-23 11:43:08 -040021
22echo "---> install-rpm-nng-rmr.sh"
23
24set -eu
25
26echo "Install packages"
27sudo yum install -y \
28 cmake3 \
29 ninja-build
30
Lott, Christopher (cl778h)557b88a2019-09-27 06:01:54 -040031echo "INFO: cd to tox-dir $TOX_DIR"
32cd "$WORKSPACE/$TOX_DIR"
33
34version_file=rmr-version.yaml
35if [[ -f $version_file ]]; then
36 # pipeline is less elegant than yq but that requires venv and pip install
37 ver=$(grep "^version:" "$version_file" | cut -d: -f2 | xargs )
38else
39 echo "File $version_file not found."
40 exit 1
41fi
42if [[ -z $ver ]]; then
43 echo "Failed to get RMR version string from file $version_file"
44 exit 1
45else
46 echo "RMR version string is ${ver}"
47fi
48
49# NNG repo is not frequently tagged so it's pinned to a commit hash.
50# This commit provides fix to the proxy-reconnect
51# bug that we identified: https://github.com/nanomsg/nng/issues/970
Lott, Christopher (cl778h)d6723d82019-09-23 11:43:08 -040052echo "Clone and build NNG"
Lott, Christopher (cl778h)557b88a2019-09-27 06:01:54 -040053git clone https://github.com/nanomsg/nng.git
Lott, Christopher (cl778h)d6723d82019-09-23 11:43:08 -040054(cd nng \
Lott, Christopher (cl778h)557b88a2019-09-27 06:01:54 -040055 && git checkout e618abf8f3db2a94269a79c8901a51148d48fcc2 \
Lott, Christopher (cl778h)d6723d82019-09-23 11:43:08 -040056 && mkdir build \
57 && cd build \
58 && cmake3 -DBUILD_SHARED_LIBS=1 -G Ninja .. \
59 && ninja-build \
60 && sudo ninja-build install)
61
Lott, Christopher (cl778h)557b88a2019-09-27 06:01:54 -040062# RPM packager adds suffix "-1" to version
63rpm="rmr-${ver}-1.x86_64.rpm"
64echo "Download RMR library ${ver} as file ${rpm}"
65wget --content-disposition https://packagecloud.io/o-ran-sc/staging/packages/el/5/${rpm}/download.rpm
66echo "Install RMR library file ${rpm}"
67sudo rpm -iv ${rpm}
68
69echo "---> install-rpm-nng-rmr.sh ends"