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 Debian package 'pistache' to support building RPMs
21 echo "---> install-git-pistache.sh"
23 # stop on error or unbound var, and be chatty
25 echo "---> install Pistache dependencies..."
27 if type -P python3 > /dev/null 2>&1
29 echo "Python3 is installed"
31 sudo apt-get install python3
34 sudo apt-get update && sudo apt-get -y install rapidjson-dev libssl-dev
35 python3 -m pip install meson
37 echo "---> install Pistache library.."
39 LIBRARY_PATH=/usr/lib/x86_64-linux-gnu
41 git clone https://github.com/pistacheio/pistache.git && cd pistache && meson setup build \
43 -DPISTACHE_USE_SSL=true \
44 -DPISTACHE_BUILD_EXAMPLES=false \
45 -DPISTACHE_BUILD_TESTS=false \
46 -DPISTACHE_BUILD_DOCS=false \
47 --prefix="$PWD/prefix" \
48 meson install -C build && \
49 sudo cp -rf prefix/include/pistache /usr/include/pistache && \
50 sudo cp prefix/lib/x86_64-linux-gnu/libpistache.so.0.0.3 $LIBRARY_PATH && \
51 sudo ln -s $LIBRARY_PATH/libpistache.so.0.0.3 $LIBRARY_PATH/libpistache.so.0 && \
52 sudo ln -s $LIBRARY_PATH/libpistache.so.0 $LIBRARY_PATH/libpistache.so && \
55 echo "---> install-git-pistache.sh ends"