blob: 165ac42605bb1f81f446992d7567b18c243fd8fc [file] [log] [blame]
Heewon Park5e19b192021-06-18 16:00:50 +09001#!/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 E2AP headers and shared-object libraries from PackageCloud
20# on a Debian; does NOT install or assume NNG.
21# Reads E2AP version number from repo file e2ap-version.yaml like this:
22# ---
23# version: 1.1.0 (this entry is required)
24
25echo "---> install-deb-e2ap.sh"
26# stop on error or unbound var, and be chatty
27set -eux
28
29version_file=e2ap-version.yaml
30if [[ -f $version_file ]]; then
31 # pipeline is less elegant than yq but that requires venv and pip install
32 repo=$(grep "^repo:" "$version_file" | cut -d: -f2 | xargs )
33 ver=$(grep "^version:" "$version_file" | cut -d: -f2 | xargs)
34else
35 echo "File $version_file not found."
36 exit 1
37fi
38if [[ -z $ver ]]; then
39 echo "Failed to get E2AP version string from file $version_file"
40 exit 1
41fi
42# default to release repo; accept override to use staging repo
43repo=${repo:-"release"}
Anil Belur439502c2023-05-07 12:39:38 +100044#
Heewon Park5e19b192021-06-18 16:00:50 +090045for deb in "riclibe2ap_${ver}_amd64.deb" "riclibe2ap-dev_${ver}_amd64.deb"; do
46 wget -nv --content-disposition "https://packagecloud.io/o-ran-sc/${repo}/packages/debian/stretch/${deb}/download.deb"
47 sudo dpkg -i "${deb}"
48 rm -f "${deb}"
49done
50
51echo "---> install-deb-e2ap.sh ends"