5 # Copyright (C) 2020 AT&T Intellectual Property and Nokia
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
11 # http://www.apache.org/licenses/LICENSE-2.0
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.
19 # Installs RMR ver 3.x headers and shared-object libraries
20 # from PackageCloud on a CentOS; does NOT install or assume NNG.
21 # Reads RMR version number from repo file rmr-version.yaml like this:
23 # repo: staging (this entry is optional)
24 # version: 3.6.1 (this entry is required)
26 echo "---> install-rpm-rmr3.sh"
27 # stop on error or unbound var, and be chatty
30 version_file=rmr-version.yaml
31 if [[ -f $version_file ]]; then
32 # pipeline is less elegant than yq but that requires venv and pip install
33 repo=$(grep "^repo:" "$version_file" | cut -d: -f2 | xargs )
34 ver=$(grep "^version:" "$version_file" | cut -d: -f2 | xargs )
36 echo "File $version_file not found."
39 if [[ -z $ver ]]; then
40 echo "Failed to get RMR version string from file $version_file"
43 # default to release repo; accept override to use staging repo
44 repo=${repo:-"release"}
45 # RPM packager adds suffix "-1" to version
46 for rpm in "rmr-${ver}-1.x86_64.rpm" "rmr-devel-${ver}-1.x86_64.rpm"; do
47 wget -nv --content-disposition "https://packagecloud.io/o-ran-sc/${repo}/packages/el/5/${rpm}/download.rpm"
52 echo "---> install-rpm-rmr3.sh ends"