blob: 7406c03d5d9c27f9f261425300f3723d3d3fac30 [file] [log] [blame]
Lott, Christopher (cl778h)95cc0892020-03-25 09:20:01 -04001#!/bin/bash
2
3# O-RAN-SC
4#
5# Copyright (C) 2020 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
19# Installs RMR ver 3.x headers and shared-object libraries
20# from PackageCloud on a CentOS
21# Reads RMR version number from repo file rmr-version.yaml
22# Does NOT install or assume NNG
23
24echo "---> install-rpm-rmr3.sh"
25
26# stop on error or unbound var, and be chatty
27set -eux
28
29version_file=rmr-version.yaml
30if [[ -f $version_file ]]; then
31 # pipeline is less elegant than yq but that requires venv and pip install
32 ver=$(grep "^version:" "$version_file" | cut -d: -f2 | xargs )
33else
34 echo "File $version_file not found."
35 exit 1
36fi
37if [[ -z $ver ]]; then
38 echo "Failed to get RMR version string from file $version_file"
39 exit 1
40else
41 echo "RMR version string is ${ver}"
42fi
43
44# TODO use release repo, not staging
45# RPM packager adds suffix "-1" to version
46repo=staging
47for rpm in "rmr-${ver}-1.x86_64.rpm" "rmr-devel-${ver}-1.x86_64.rpm"; do
48 wget -q --content-disposition https://packagecloud.io/o-ran-sc/${repo}/packages/el/5/${rpm}/download.rpm
49 sudo rpm -iv ${rpm}
50done
51
52echo "---> install-rpm-rmr3.sh ends"