четвер, 16 вересня 2010 р.

Install CMake 2.6/2.8 on Fedora 8 in EC2 environment

I'm working with EC2 environment on public AMI that has preinstalled Fedora 8. Little bit old, but for most tasks, that I do, this is more than enough.

Week or two ago, I have to build C++ module, developed by third-party and place it to the EC2 instance. This module use CMake 2.6 for building, but EC2 environment has only CMake 2.4 as latest version that available through standard Yum repositories. Currently (as of September 2010) available version 2.8 of CMake, but I choose stick with version which source code required. This was mostly client requirements. After hour or so trying put downloaded package to standard location for binaries and documentation, I wrote small script, which hopefully would be helpful for others.

Here the content of script that do the job and install 2.6 version of CMake that available from CMake download page

Version for installing 2.6

#!/bin/bash

# Download CMake package
wget http://www.cmake.org/files/v2.6/cmake-2.6.4-Linux-i386.tar.gz
# Extract content of archive
tar -xf cmake-2.6.4-Linux-i386.tar.gz

chmod 755 cmake-2.6.4-Linux-i386/bin/*

# Copy files to target location
cp cmake-2.6.4-Linux-i386/bin/* /usr/bin/
cp -R cmake-2.6.4-Linux-i386/doc/* /usr/share/doc/
cp -R cmake-2.6.4-Linux-i386/man/* /usr/share/man/
cp -R cmake-2.6.4-Linux-i386/share/* /usr/share/

# Cleanup original archive and extracted files
rm -f -R cmake-2.6.4-Linux-i386
rm -f cmake-2.6.4-Linux-i386.tar.gz


Version for installing 2.8

#!/bin/bash

# Download CMake package
wget http://www.cmake.org/files/v2.8/cmake-2.8.2-Linux-i386.tar.gz
# Extract content of archive
tar -xf cmake-2.8.2-Linux-i386.tar.gz

chmod 755 cmake-2.8.2-Linux-i386/bin/*

# Copy files to target location
cp cmake-2.8.2-Linux-i386/bin/* /usr/bin/
cp -R cmake-2.8.2-Linux-i386/doc/* /usr/share/doc/
cp -R cmake-2.8.2-Linux-i386/man/* /usr/share/man/
cp -R cmake-2.8.2-Linux-i386/share/* /usr/share/

# Cleanup original archive and extracted files
rm -f -R cmake-2.8.2-Linux-i386
rm -f cmake-2.8.2-Linux-i386.tar.gz



P.S.
Still not very familiar with Linux, so if you know best way of arrange files to standard Linux locations other then copying and setting permission, please let me know.
Any feedback are welcome.

Немає коментарів: