2018-06-13 20:12:52 +02:00
|
|
|
#!/usr/bin/env bash
|
2018-04-13 20:56:49 +02:00
|
|
|
|
|
|
|
set -ex
|
2018-06-09 20:14:19 +02:00
|
|
|
set -o pipefail
|
|
|
|
|
|
|
|
ARCH="x86_64"
|
|
|
|
|
|
|
|
while [ $# -gt 0 ]; do
|
|
|
|
case "$1" in
|
|
|
|
-32)
|
|
|
|
ARCH="x86"
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "Usage: Usage: ${0##*/} [-32]"
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
shift
|
|
|
|
done
|
2018-04-13 20:56:49 +02:00
|
|
|
|
|
|
|
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
|
|
|
|
2021-06-27 19:59:12 +02:00
|
|
|
#Switch to newer version of CMake
|
|
|
|
#USER=dockbuild #Original user, change it when changed it when there will be a new update of CMake (3.17.1 on June 27, 2021)
|
|
|
|
|
|
|
|
USER=bensuperpc
|
|
|
|
|
|
|
|
OS=Centos7
|
|
|
|
|
|
|
|
CMAKE_ROOT=cmake-${CMAKE_VERSION}-${OS}-${ARCH}
|
|
|
|
url=https://github.com/${USER}/CMake/releases/download/v${CMAKE_VERSION}/${CMAKE_ROOT}.tar.gz
|
|
|
|
url_checksum=https://github.com/${USER}/CMake/releases/download/v${CMAKE_VERSION}/${CMAKE_ROOT}.tar.gz.sha256
|
|
|
|
|
2018-04-13 20:56:49 +02:00
|
|
|
echo "Downloading $url"
|
|
|
|
curl -# -LO $url
|
|
|
|
|
2021-06-27 19:59:12 +02:00
|
|
|
echo "Downloading $url_checksum"
|
|
|
|
curl -# -LO $url_checksum
|
|
|
|
|
|
|
|
#Checksum package
|
|
|
|
sha256sum -c ${CMAKE_ROOT}.tar.gz.sha256
|
|
|
|
|
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/{}" \;
|