Lott, Christopher (cl778h) | bde567d | 2019-09-12 15:32:33 -0400 | [diff] [blame] | 1 | #!/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) | 557b88a | 2019-09-27 06:01:54 -0400 | [diff] [blame] | 19 | # Installs NNG from source and RMR from PackageCloud on Ubuntu18.04 |
| 20 | # Reads RMR version number from repo file rmr-version.yaml |
Lott, Christopher (cl778h) | bde567d | 2019-09-12 15:32:33 -0400 | [diff] [blame] | 21 | |
| 22 | echo "---> install-deb-nng-rmr.sh" |
| 23 | |
Lott, Christopher (cl778h) | d6723d8 | 2019-09-23 11:43:08 -0400 | [diff] [blame] | 24 | set -eu |
| 25 | |
Lott, Christopher (cl778h) | bde567d | 2019-09-12 15:32:33 -0400 | [diff] [blame] | 26 | echo "Install packages" |
Lott, Christopher (cl778h) | 557b88a | 2019-09-27 06:01:54 -0400 | [diff] [blame] | 27 | sudo apt-get update && \ |
| 28 | sudo apt-get install -y \ |
Lott, Christopher (cl778h) | bde567d | 2019-09-12 15:32:33 -0400 | [diff] [blame] | 29 | cmake \ |
| 30 | ninja-build |
| 31 | |
Lott, Christopher (cl778h) | 557b88a | 2019-09-27 06:01:54 -0400 | [diff] [blame] | 32 | echo "INFO: cd to tox-dir $TOX_DIR" |
| 33 | cd "$WORKSPACE/$TOX_DIR" |
| 34 | |
| 35 | version_file=rmr-version.yaml |
| 36 | if [[ -f $version_file ]]; then |
| 37 | # pipeline is less elegant than yq but that requires venv and pip install |
| 38 | ver=$(grep "^version:" "$version_file" | cut -d: -f2 | xargs ) |
| 39 | else |
| 40 | echo "File $version_file not found." |
| 41 | exit 1 |
| 42 | fi |
| 43 | if [[ -z $ver ]]; then |
| 44 | echo "Failed to get RMR version string from file $version_file" |
| 45 | exit 1 |
| 46 | else |
| 47 | echo "RMR version string is ${ver}" |
| 48 | fi |
| 49 | |
| 50 | # NNG repo is not frequently tagged so it's pinned to a commit hash. |
| 51 | # This commit provides fix to the proxy-reconnect |
| 52 | # bug that we identified: https://github.com/nanomsg/nng/issues/970 |
Lott, Christopher (cl778h) | bde567d | 2019-09-12 15:32:33 -0400 | [diff] [blame] | 53 | echo "Clone and build NNG" |
Lott, Christopher (cl778h) | 557b88a | 2019-09-27 06:01:54 -0400 | [diff] [blame] | 54 | git clone https://github.com/nanomsg/nng.git |
Lott, Christopher (cl778h) | bde567d | 2019-09-12 15:32:33 -0400 | [diff] [blame] | 55 | (cd nng \ |
Lott, Christopher (cl778h) | 557b88a | 2019-09-27 06:01:54 -0400 | [diff] [blame] | 56 | && git checkout e618abf8f3db2a94269a79c8901a51148d48fcc2 \ |
Lott, Christopher (cl778h) | bde567d | 2019-09-12 15:32:33 -0400 | [diff] [blame] | 57 | && mkdir build \ |
| 58 | && cd build \ |
| 59 | && cmake -DBUILD_SHARED_LIBS=1 -G Ninja .. \ |
| 60 | && ninja \ |
| 61 | && sudo ninja install) |
| 62 | |
Lott, Christopher (cl778h) | 557b88a | 2019-09-27 06:01:54 -0400 | [diff] [blame] | 63 | deb="rmr_${ver}_amd64.deb" |
| 64 | echo "Download RMR library ${ver} as file ${deb}" |
Lott, Christopher (cl778h) | f8e18d5 | 2020-03-25 13:20:04 -0400 | [diff] [blame] | 65 | wget -nv --content-disposition https://packagecloud.io/o-ran-sc/staging/packages/debian/stretch/${deb}/download.deb |
Lott, Christopher (cl778h) | 557b88a | 2019-09-27 06:01:54 -0400 | [diff] [blame] | 66 | echo "Install RMR library file ${deb}" |
| 67 | sudo dpkg -i ${deb} |
Lott, Christopher (cl778h) | 9a0c181 | 2020-03-26 20:42:14 -0400 | [diff] [blame] | 68 | rm -f ${deb} |
Lott, Christopher (cl778h) | 557b88a | 2019-09-27 06:01:54 -0400 | [diff] [blame] | 69 | |
| 70 | echo "---> install-deb-nng-rmr.sh ends" |