#!/bin/bash
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$SCRIPT_DIR"

# 安装阿里云核心
mkdir tmp
cd tmp
git clone https://gitee.com/yobonianhua/aliyun-openapi-cpp-sdk.git
cd aliyun-openapi-cpp-sdk
sudo sh easyinstall.sh core
cd ${SCRIPT_DIR}

# 安装阿里云OSS
sudo apt-get install libcurl4-openssl-dev libapr1-dev libaprutil1-dev libmxml-dev -y
cd 3rdparty
rm -rf aliyun-oss-c-sdk-3.11.2
unzip aliyun-oss-c-sdk-3.11.2.zip
cd aliyun-oss-c-sdk-3.11.2
mkdir build
cd build
cmake ..
make
make install
cd ${SCRIPT_DIR}


# 安装ALIYUN
rm -rf build
mkdir build
cd build
cmake ..
make
cp -f libaliyunsdk.so ../target
