2018-04-13 20:56:49 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -ex
|
|
|
|
|
|
|
|
if ! command -v curl &> /dev/null; then
|
|
|
|
echo >&2 'error: "curl" not found!'
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if ! command -v tar &> /dev/null; then
|
|
|
|
echo >&2 'error: "tar" not found!'
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ "${CMAKE_VERSION}" == "" ]]; then
|
|
|
|
echo >&2 'error: CMAKE_VERSION env. variable must be set to a non-empty value'
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2018-06-05 19:02:12 +02:00
|
|
|
cd /usr/src
|
2018-04-13 20:56:49 +02:00
|
|
|
|
2018-06-05 19:02:12 +02:00
|
|
|
CMAKE_ROOT=cmake-${CMAKE_VERSION}-Centos5-x86_64
|
|
|
|
url=https://github.com/dockbuild/CMake/releases/download/v${CMAKE_VERSION}/${CMAKE_ROOT}.tar.gz
|
2018-04-13 20:56:49 +02:00
|
|
|
echo "Downloading $url"
|
|
|
|
curl -# -LO $url
|
|
|
|
|
2018-06-05 19:02:12 +02:00
|
|
|
tar -xzvf ${CMAKE_ROOT}.tar.gz
|
|
|
|
rm -f ${CMAKE_ROOT}.tar.gz
|
2018-04-13 20:56:49 +02:00
|
|
|
|
2018-06-05 19:02:12 +02:00
|
|
|
cd ${CMAKE_ROOT}
|
2018-04-13 20:56:49 +02:00
|
|
|
|
|
|
|
rm -rf doc man
|
|
|
|
rm -rf bin/cmake-gui
|
|
|
|
|
|
|
|
find . -type f -exec install -D "{}" "/usr/{}" \;
|