Blame view

install/install-3rdparty-linux-ubuntu-16.04.sh 33.6 KB
Carolina Galvão committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148
#!/bin/bash
#
#  Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
#
#  This file is part of the TerraLib - a Framework for building GIS enabled applications.
#
#  TerraLib is free software: you can redistribute it and/or modify
#  it under the terms of the GNU Lesser General Public License as published by
#  the Free Software Foundation, either version 3 of the License,
#  or (at your option) any later version.
#
#  TerraLib is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#  GNU Lesser General Public License for more details.
#
#  You should have received a copy of the GNU Lesser General Public License
#  along with TerraLib. See COPYING. If not, write to
#  TerraLib Team at <terralib-team@terralib.org>.
#
#
#  Description: Install all required software for TerraLib on Linux Ubuntu 16.04.
#
#  Author: Gilberto Ribeiro de Queiroz
#          Paulo R. M. Oliveira
#
#
#  Example:
#  $ TERRALIB_DEPENDENCIES_DIR="/home/gribeiro/MyLibs" ./install-3rdparty-linux-ubuntu-16.04.sh
#

echo "*****************************************************************"
echo "* TerraLib 3rd-party Libraries Installer for Linux Ubuntu 16.04 *"
echo "*****************************************************************"
echo ""
sleep 1s

#
# Valid parameter val or abort script
#
function valid()
{
  if [ $1 -ne 0 ]; then
    echo $2
    echo ""
    exit
  fi
}


#
# Update Ubuntu install list
#
sudo apt-get update

#
# gcc
#
gcpp_test=`dpkg -s g++ | grep Status`

if [ "$gcpp_test" != "Status: install ok installed" ]; then
  sudo  apt-get -y install g++
  valid $? "Error: could not install g++! Please, install g++: sudo apt-get -y install g++"
  echo "g++ installed!"
else
  echo "g++ already installed!"
fi


#
# zlibdevel
#
zlibdevel_test=`dpkg -s zlib1g-dev | grep Status`

if [ "$zlibdevel_test" != "Status: install ok installed" ]; then
  sudo apt-get -y install zlib1g-dev
  valid $? "Error: could not install zlib1g-dev! Please, install g++: sudo apt-get -y install zlib1g-dev"
  echo "zlib1g-dev installed!"
else
  echo "zlib1g-dev already installed!"
fi


#
# libreadline-dev
#
readline_test=`dpkg -s libreadline-dev | grep Status`

if [ "$readline_test" != "Status: install ok installed" ]; then
  sudo apt-get -y install libreadline-dev
  valid $? "Error: could not install libreadline-dev! Please, install readline: sudo apt-get -y install libreadline-dev"
  echo "libreadline-dev installed!"
else
  echo "libreadline-dev already installed!"
fi


#
# python support
#
pysetup_test=`dpkg -s python-setuptools | grep Status`

if [ "$gcpp_test" != "Status: install ok installed" ]; then
  sudo apt-get -y install python-setuptools
  valid $? "Error: could not install python-setuptools! Please, install readline: sudo apt-get -y install python-setuptools"
  echo "python-setuptools installed!"
else
  echo "python-setuptools already installed!"
fi

pypip_test=`dpkg -s python-pip | grep Status`

if [ "$pypip_test" != "Status: install ok installed" ]; then
  sudo apt-get -y install python-pip
  valid $? "Error: could not install python-pip! Please, install readline: sudo apt-get -y install python-pip"
  echo "python-pip installed!"
else
  echo "python-pip already installed!"
fi

pydev_test=`dpkg -s python-dev | grep Status`

if [ "$pydev_test" != "Status: install ok installed" ]; then
  sudo apt-get -y install python-dev
  valid $? "Error: could not install python-dev! Please, install readline: sudo apt-get -y install python-dev"
  echo "python-dev installed!"
else
  echo "python-dev already installed!"
fi

numpy_test=`dpkg -s python-numpy | grep Status`

if [ "$numpy_test" != "Status: install ok installed" ]; then
  sudo apt-get -y install python-numpy
  valid $? "Error: could not install python-numpy! Please, install readline: sudo apt-get -y install python-numpy"
  echo "python-numpy installed!"
else
  echo "python-numpy already installed!"
fi


#
# autoconf
#
autoconf_test=`dpkg -s autoconf | grep Status`

if [ "$autoconf_test" != "Status: install ok installed" ]; then
  sudo apt-get -y install autoconf
Hugo Richard Gomes Vieira committed
149
  valid $? "Error: could not install autoconf! Please, install readline: sudo apt-get -y install autoconf"
Carolina Galvão committed
150 151 152 153 154 155 156 157 158 159 160 161 162
  echo "autoconf installed!"
else
  echo "autoconf already installed!"
fi


#
# GNU gettext
#
gettext_test=`dpkg -s gettext | grep Status`

if [ "$gettext_test" != "Status: install ok installed" ]; then
  sudo apt-get -y install gettext
Hugo Richard Gomes Vieira committed
163
  valid $? "Error: could not install gettext! Please, install readline: sudo apt-get -y install gettext"
Carolina Galvão committed
164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214
  echo "gettext installed!"
else
  echo "gettext already installed!"
fi


#
# flex
#
flex_test=`dpkg -s flex | grep Status`

if [ "$flex_test" != "Status: install ok installed" ]; then
  sudo apt-get -y install flex
  valid $? "Error: could not install flex! Please, install readline: sudo apt-get -y install flex"
  echo "flex installed!"
else
  echo "flex already installed!"
fi


#
# bison
#
bison_test=`dpkg -s bison | grep Status`

if [ "$bison_test" != "Status: install ok installed" ]; then
  sudo apt-get -y install bison
  valid $? "Error: could not install bison! Please, install readline: sudo apt-get -y install bison"
  echo "bison installed!"
else
  echo "bison already installed!"
fi


#
# qt5-default qttools5-dev qttools5-dev-tools libqt5svg5-dev libqt5designer5
#
qt5_dev_test=`dpkg -s qt5-default qttools5-dev qttools5-dev-tools libqt5svg5-dev libqt5designer5 | grep Status`

if [ "$qt5_dev_test" != "Status: install ok installed" ]; then
  sudo apt-get -y install qt5-default qttools5-dev qttools5-dev-tools libqt5svg5-dev libqt5designer5
  valid $? "Error: could not install qt5-default! Please, install Qt 5 support: sudo apt-get -y install qt5-default qttools5-dev qttools5-dev-tools libqt5svg5-dev libqt5designer5"
  echo "qt5-dev-tools installed!"
else
  echo "qt5-dev-tools already installed!"
fi


#
# CMake
#
Hugo Richard Gomes Vieira committed
215 216 217 218

# CMake from dpkg
cmake_version_first_dig=`dpkg -s cmake | grep Version | awk 'NR ==1{print substr($2,1,1)}'`
cmake_version_second_dig=`dpkg -s cmake | grep Version | awk 'NR ==1{print substr($2,3,1)}'`
Carolina Galvão committed
219 220
cmake_test=`dpkg -s cmake | grep Status`

Hugo Richard Gomes Vieira committed
221 222 223 224 225 226
# CMake installed
cmake_installed_version_first_dig=`cmake --version | grep version | awk 'NR ==1{print substr($3,1,1)}'`
cmake_installed_version_second_dig=`cmake --version | grep version | awk 'NR ==1{print substr($3,3,2)}'`

# Verify the first digit
if [[ "$cmake_installed_version_first_dig" == *"."* ]]; then
Hugo Richard Gomes Vieira committed
227
  cmake_installed_version_first_dig=`cmake --version | grep version | awk 'NR ==1{print substr($3,1,2)}'`
Hugo Richard Gomes Vieira committed
228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244
fi

if [[ "$cmake_version_first_dig" == *"."* ]]; then
  cmake_version_first_dig=`dpkg -s cmake | grep Version | awk 'NR ==1{print substr($2,1,2)}'`
fi

# Verify the second digit
if [[ "$cmake_installed_version_second_dig" == *"."* ]]; then
  cmake_installed_version_second_dig=`cmake --version | grep version | awk 'NR ==1{print substr($3,3,1)}'`
fi

if [[ "$cmake_version_second_dig" == *"."* ]]; then
  cmake_version_second_dig=`dpkg -s cmake | grep Version | awk 'NR ==1{print substr($2,3,2)}'`
fi

# Checking if the CMake is already installed
echo "Checking if the CMake is already installed..."
Hugo Richard Gomes Vieira committed
245
if [ "$cmake_installed_version_first_dig" -gt "3" -o "$cmake_installed_version_first_dig" -eq "3" -a "$cmake_installed_version_second_dig" -ge "11" ]; then
Hugo Richard Gomes Vieira committed
246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271
    echo "CMake already installed!"
elif [ "$cmake_installed_version_first_dig" -lt "3" ]; then
      echo "The version of CMake installed is not compatible with terralib!"
      echo "Minimum version required is 3.11*"
      echo ""
      exit
else
  echo "Checking CMake version from repository..."
  if [ "$cmake_version_first_dig" -lt "3" -o "$cmake_version_first_dig" -eq "3" -a "$cmake_version_second_dig" -lt "11" ]; then
    echo "The CMake from dpkg is not compatible with terralib"
    echo "Minimum version required is 3.11*"
    echo ""
    exit
  else
    sudo apt-get -y install cmake cmake-qt-gui
    valid $? "Error: could not install CMake! Please, install CMake: sudo apt-get -y install cmake"
    echo "CMake has been installed!"
  fi
fi

# Checking if the CMake is in PATH
echo "Checking if the CMake is in PATH..."
if [ ! command -v cmake --version >/dev/null 2>&1 ]; then
    valid 1 "CMake already installed but not found in PATH!"
    echo ""
    exit
Carolina Galvão committed
272
else
Hugo Richard Gomes Vieira committed
273
  echo "CMake already in PATH!"
Carolina Galvão committed
274 275
fi

Carolina Galvão committed
276

Carolina Galvão committed
277 278 279 280 281 282 283 284 285 286 287 288 289
#
# libkml
#
libkml_test=`dpkg -s libkml-dev | grep Status`

if [ "$libkml_test" != "Status: install ok installed" ]; then
  sudo apt-get -y install libkml-dev
  valid $? "Error: could not install libkml-dev! Please, install libkml-dev: sudo apt-get -y install libkml-dev"
  echo "libkml-dev installed!"
else
  echo "libkml-dev already installed!"
fi

Carolina Galvão committed
290

Carolina Galvão committed
291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353
#
# libssl
#
libssl_test=`dpkg -s libssl-dev | grep Status`

if [ "$libssl_test" != "Status: install ok installed" ]; then
  sudo apt-get -y install libssl-dev
  valid $? "Error: could not install libssl-dev! Please, install libssl-dev: sudo apt-get -y install libssl-dev"
  echo "libssl-dev installed!"
else
  echo "libssl-dev already installed!"
fi


#
# Check for terralib-3rdparty-linux-ubuntu-16.04.tar.gz
#
if [ ! -f ./terralib-3rdparty-linux-ubuntu-16.04.tar.gz ]; then
  echo "Please, make sure to have terralib-3rdparty-linux-ubuntu-16.04.tar.gz in the current directory!"
  echo ""
  exit
fi


#
# Extract packages
#
echo "extracting packages..."
echo ""
sleep 1s

tar xzvf terralib-3rdparty-linux-ubuntu-16.04.tar.gz
valid $? "Error: could not extract 3rd party libraries (terralib-3rdparty-linux-ubuntu-16.04.tar.gz)"

echo "packages extracted!"
echo ""
sleep 1s


#
# Go to 3rd party libraries dir
#
cd terralib-3rdparty-linux-ubuntu-16.04
valid $? "Error: could not enter 3rd-party libraries dir (terralib-3rdparty-linux-ubuntu-16.04)"


#
# Check installation dir
#
if [ "$TERRALIB_DEPENDENCIES_DIR" == "" ]; then
  TERRALIB_DEPENDENCIES_DIR="/opt/terralib"
fi

export PATH="$PATH:$TERRALIB_DEPENDENCIES_DIR/bin"
export LD_LIBRARY_PATH="$PATH:$TERRALIB_DEPENDENCIES_DIR/lib"
export LDFLAGS=-Wl,-rpath=$TERRALIB_DEPENDENCIES_DIR/lib,--enable-new-dtags

echo "installing 3rd-party libraries to '$TERRALIB_DEPENDENCIES_DIR' ..."
echo ""
sleep 1s


#
Carolina Galvão committed
354
# PCRE version 8.37
Carolina Galvão committed
355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380
#
if [ ! -f "$TERRALIB_DEPENDENCIES_DIR/lib/libpcre.a" ]; then
  echo "installing PCRE..."
  echo ""
  sleep 1s

  tar xzvf pcre-8.37.tar.gz
  valid $? "Error: could not uncompress pcre-8.37.tar.gz!"

  cd pcre-8.37
  valid $? "Error: could not enter pcre-8.37 dir!"

  ./configure --prefix=$TERRALIB_DEPENDENCIES_DIR
  valid $? "Error: could not configure PCRE!"

  make -j 4
  valid $? "Error: could not make PCRE!"

  make install
  valid $? "Error: Could not install PCRE!"

  cd ..
fi


#
Carolina Galvão committed
381
# SWIG version 3.0.12
Carolina Galvão committed
382 383 384 385 386 387 388
# Site: http://www.swig.org
#
if [ ! -f "$TERRALIB_DEPENDENCIES_DIR/bin/swig" ]; then
  echo "installing SWIG..."
  echo ""
  sleep 1s

Carolina Galvão committed
389 390
  tar xzvf swig-3.0.12.tar.gz
  valid $? "Error: could not uncompress swig-3.0.12.tar.gz!"
Carolina Galvão committed
391

Carolina Galvão committed
392 393
  cd swig-3.0.12
  valid $? "Error: could not enter swig-3.0.12 dir!"
Carolina Galvão committed
394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435

  ./configure --prefix=$TERRALIB_DEPENDENCIES_DIR --with-pcre-prefix=$TERRALIB_DEPENDENCIES_DIR
  valid $? "Error: could not configure SWIG!"

  make -j 4
  valid $? "Error: could not make SWIG!"

  make install
  valid $? "Error: Could not install SWIG!"

  cd ..
fi


#
# FreeXL version 1.0.1
# Site: https://www.gaia-gis.it/fossil/freexl/index
#
if [ ! -f "$TERRALIB_DEPENDENCIES_DIR/lib/libfreexl.so" ]; then
  echo "installing FreeXL..."
  sleep 1s

  tar xzvf freexl-1.0.1.tar.gz
  valid $? "Error: could not uncompress freexl-1.0.1.tar.gz!"

  cd freexl-1.0.1
  valid $? "Error: could not enter freexl-1.0.1 dir!"

  CPPFLAGS=-I$TERRALIB_DEPENDENCIES_DIR/include LDFLAGS=-L$TERRALIB_DEPENDENCIES_DIR/lib ./configure --prefix=$TERRALIB_DEPENDENCIES_DIR
  valid $? "Error: could not configure FreeXL!"

  make -j 4
  valid $? "Error: could not make FreeXL!"

  make install
  valid $? "Error: Could not install FreeXL!"

  cd ..
fi


#
Carolina Galvão committed
436
# OOSP-UUID version 1.6.2
Carolina Galvão committed
437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462
#
if [ ! -f "$TERRALIB_DEPENDENCIES_DIR/lib/libuuid.so" ]; then
  echo "installing OOSP-UUID..."
  echo ""
  sleep 1s

  tar xvf uuid-1.6.2.tar
  valid $? "Error: could not uncompress uuid-1.6.2.tar!"

  cd uuid-1.6.2
  valid $? "Error: could not enter uuid-1.6.2 dir!"

  ./configure --prefix=$TERRALIB_DEPENDENCIES_DIR --with-cxx
  valid $? "Error: could not configure OOSP-UUID!"

  make -j 4
  valid $? "Error: could not make OOSP-UUID!"

  make install
 valid $? "Error: Could not install OOSP-UUID!"

  cd ..
fi


#
Carolina Galvão committed
463
# BZIP2 version 1.0.6
Carolina Galvão committed
464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513
#
if [ ! -f "$TERRALIB_DEPENDENCIES_DIR/lib/libbz2.a" ]; then
  echo "installing bzip2..."
  echo ""
  sleep 1s

  tar xzvf bzip2-1.0.6-ubuntu.tar.gz
  valid $? "Error: could not uncompress bzip2-1.0.6-ubuntu.tar.gz!"

  cd bzip2-1.0.6
  valid $? "Error: could not enter bzip2-1.0.6 dir!"

  make
  valid $? "Error: could not make BZIP2!"

  make install PREFIX=$TERRALIB_DEPENDENCIES_DIR
  valid $? "Error: Could not install BZIP2!"

  cd ..
fi


#
# Proj4 version 4.9.1 (with proj-datumgrid version 1.5)
# Site: https://trac.osgeo.org/proj/
#
if [ ! -f "$TERRALIB_DEPENDENCIES_DIR/lib/libproj.so" ]; then
  echo "installing Proj4..."
  sleep 1s

  tar xzvf proj-4.9.1.tar.gz
  valid $? "Error: could not uncompress proj-4.9.1.tar.gz!"

  cd proj-4.9.1
  valid $? "Error: could not enter proj-4.9.1 dir!"

  ./configure --prefix=$TERRALIB_DEPENDENCIES_DIR
  valid $? "Error: could not configure Proj4!"

  make -j 4
  valid $? "Error: could not make Proj4!"

  make install
  valid $? "Error: Could not install Proj4!"

  cd ..
fi


#
Rodrigo Avancini committed
514
# GEOS version 3.5.0
Carolina Galvão committed
515 516 517 518 519 520
#
if [ ! -f "$TERRALIB_DEPENDENCIES_DIR/lib/libgeos.so" ]; then
  echo "installing GEOS..."
  echo ""
  sleep 1s

Rodrigo Avancini committed
521 522
  tar xjvf geos-3.5.0.tar.bz2
  valid $? "Error: could not uncompress geos-3.5.0.tar.bz2!"
Carolina Galvão committed
523

Rodrigo Avancini committed
524 525
  cd geos-3.5.0
  valid $? "Error: could not enter geos-3.5.0 dir!"
Carolina Galvão committed
526 527 528 529 530 531 532 533 534 535 536 537 538 539 540

  ./configure --prefix=$TERRALIB_DEPENDENCIES_DIR
  valid $? "Error: could not configure GEOS!"

  make -j 4
  valid $? "Error: could not make GEOS!"

  make install
  valid $? "Error: Could not install GEOS!"

  cd ..
fi


#
Carolina Galvão committed
541
# libPNG version 1.5.17
Carolina Galvão committed
542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565
#
if [ ! -f "$TERRALIB_DEPENDENCIES_DIR/lib/libpng.so" ]; then
  echo "installing libPNG..."
  echo ""
  sleep 1s

  tar xzvf libpng-1.5.17.tar.gz
  valid $? "Error: could not uncompress libpng-1.5.17.tar.gz!"

  cd libpng-1.5.17
  valid $? "Error: could not enter libpng-1.5.17 dir!"

  ./configure --prefix=$TERRALIB_DEPENDENCIES_DIR
  valid $? "Error: could not configure libPNG!"

  make -j 4
  valid $? "Error: could not make libPNG!"

  make install
 valid $? "Error: Could not install libPNG!"

  cd ..
fi

Hugo Richard Gomes Vieira committed
566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593
#
# lib openjpeg version 2.1.2
# Site: https://www.openjpeg.org/
#

if [ ! -f "$TERRALIB_DEPENDENCIES_DIR/lib/libopenjp2.so" ]; then
  echo "installing openjpeg..."
  echo ""
  sleep 1s

  tar xzvf openjpeg-2.1.2.tar.gz
  valid $? "Error: could not uncompress openjpeg-2.1.2.tar.gz!"

  cd openjpeg-2.1.2
  valid $? "Error: could not enter openjpeg-2.1.2 dir!"

  cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE="Release" -DCMAKE_INSTALL_PREFIX=${TERRALIB_DEPENDENCIES_DIR}
  valid $? "Error: could not configure openjpeg!"

  make -j 4
  valid $? "Error: could not make openjpeg!"

  make install
  valid $? "Error: Could not install openjpeg!"

  cd ..
fi

Carolina Galvão committed
594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622

#
# Independent JPEG Group version v9a
# Site: http://www.ijg.org
#
if [ ! -f "$TERRALIB_DEPENDENCIES_DIR/lib/libjpeg.so" ]; then
  echo "installing Independent JPEG Group Library..."
  sleep 1s

  tar xzvf jpegsrc.v9a.tar.gz
  valid $? "Error: could not uncompress jpegsrc.v9a.tar.gz!"

  cd jpeg-9a
  valid $? "Error: could not enter jpeg-9a dir!"

  ./configure --prefix=$TERRALIB_DEPENDENCIES_DIR
  valid $? "Error: could not configure JPEG!"

  make -j 4
  valid $? "Error: could not make JPEG!"

  make install
  valid $? "Error: Could not install JPEG!"

  cd ..
fi


#
Carolina Galvão committed
623
# TIFF version 4.0.3
Carolina Galvão committed
624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649
#
if [ ! -f "$TERRALIB_DEPENDENCIES_DIR/lib/libtiff.so" ]; then
  echo "installing TIFF..."
  echo ""
  sleep 1s

  tar xzvf tiff-4.0.3.tar.gz
  valid $? "Error: could not uncompress tiff-4.0.3.tar.gz!"

  cd tiff-4.0.3
  valid $? "Error: could not enter tiff-4.0.3!"

  ./configure --enable-cxx --with-jpeg-include-dir=$TERRALIB_DEPENDENCIES_DIR/include --with-jpeg-lib-dir=$TERRALIB_DEPENDENCIES_DIR/lib --prefix=$TERRALIB_DEPENDENCIES_DIR
  valid $? "Error: could not configure TIFF!"

  make -j 4
  valid $? "Error: could not make TIFF!"

  make install
  valid $? "Error: Could not install TIFF!"

  cd ..
fi


#
Carolina Galvão committed
650
# GeoTIFF version 1.4.0
Carolina Galvão committed
651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676
#
if [ ! -f "$TERRALIB_DEPENDENCIES_DIR/lib/libgeotiff.so" ]; then
  echo "installing GeoTIFF..."
  echo ""
  sleep 1s

  tar xzvf libgeotiff-1.4.0.tar.gz
  valid $? "Error: could not uncompress libgeotiff-1.4.0.tar.gz!"

  cd libgeotiff-1.4.0
  valid $? "Error: could not enter libgeotiff-1.4.0!"

  ./configure --with-jpeg=$TERRALIB_DEPENDENCIES_DIR --with-zlib --with-libtiff=$TERRALIB_DEPENDENCIES_DIR --with-proj=$TERRALIB_DEPENDENCIES_DIR --prefix=$TERRALIB_DEPENDENCIES_DIR
  valid $? "Error: could not configure GeoTIFF!"

  make -j 4
  valid $? "Error: could not make GeoTIFF!"

  make install
  valid $? "Error: Could not install GeoTIFF!"

  cd ..
fi


#
Carolina Galvão committed
677
# SZIP version 2.1
Carolina Galvão committed
678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730
#
if [ ! -f "$TERRALIB_DEPENDENCIES_DIR/lib/libsz.so" ]; then
  echo "installing SZIP..."
  echo ""
  sleep 1s

  tar xzvf szip-2.1.tar.gz
  valid $? "Error: could not uncompress szip-2.1.tar.gz!"

  cd szip-2.1
  valid $? "Error: could not enter szip-2.1!"

  ./configure --prefix=$TERRALIB_DEPENDENCIES_DIR
  valid $? "Error: could not configure SZIP!"

  make -j 4
  valid $? "Error: could not make SZIP!"

  make install
  valid $? "Error: Could not install SZIP!"

  cd ..
fi


#
# CURL version 7.42.1
# Site: http://curl.haxx.se/libcurl/
#
if [ ! -f "$TERRALIB_DEPENDENCIES_DIR/lib/libcurl.so" ]; then
  echo "installing CURL..."
  sleep 1s

  tar xzvf curl-7.42.1.tar.gz
  valid $? "Error: could not uncompress curl-7.42.1.tar.gz!"

  cd curl-7.42.1
  valid $? "Error: could not enter curl-7.42.1!"

  ./configure --prefix=$TERRALIB_DEPENDENCIES_DIR
  valid $? "Error: could not configure CURL!"

  make -j 4
  valid $? "Error: could not make CURL!"

  make install
  valid $? "Error: Could not install CURL!"

  cd ..
fi


#
Carolina Galvão committed
731
# ICU version 52.1
Carolina Galvão committed
732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760
#
if [ ! -f "$TERRALIB_DEPENDENCIES_DIR/lib/libicuuc.so" ]; then
  echo "installing ICU..."
  echo ""
  sleep 1s

  tar xzvf icu4c-52_1-src.tgz
  valid $? "Error: could not uncompress icu4c-52_1-src.tgz!"

  cd icu/source
  valid $? "Error: could not enter icu/source!"

  chmod +x runConfigureICU configure install-sh
  valid $? "Error: could not set runConfigureICU to execute mode!"

  CPPFLAGS="-DU_USING_ICU_NAMESPACE=0 -DU_CHARSET_IS_UTF8=1 -DU_NO_DEFAULT_INCLUDE_UTF_HEADERS=1" ./runConfigureICU Linux/gcc --prefix=$TERRALIB_DEPENDENCIES_DIR
  valid $? "Error: could not runConfigureICU!"

  make -j 4
  valid $? "Error: could not make ICU!"

  make install
  valid $? "Error: Could not install ICU!"

  cd ../..
fi


#
Carolina Galvão committed
761
# Xerces-c version 3.1.1
Carolina Galvão committed
762 763 764 765 766 767 768
#
if [ ! -f "$TERRALIB_DEPENDENCIES_DIR/lib/libxerces-c.so" ]; then
  echo "installing Xerces..."
  echo ""
  sleep 1s

  tar xzvf xerces-c-3.1.1.tar.gz
Carolina Galvão committed
769
  valid $? "Error: could not uncompress xerces-c-3.1.1.tar.gz!"
Carolina Galvão committed
770 771

  cd xerces-c-3.1.1
Carolina Galvão committed
772
  valid $? "Error: could not enter Xerces-c!"
Carolina Galvão committed
773 774 775 776 777 778 779 780 781 782 783 784 785 786 787

  CPPFLAGS=-I$TERRALIB_DEPENDENCIES_DIR/include LDFLAGS=-L$TERRALIB_DEPENDENCIES_DIR/lib ./configure --prefix=$TERRALIB_DEPENDENCIES_DIR --enable-netaccessor-curl --disable-static --enable-msgloader-icu --with-icu=$TERRALIB_DEPENDENCIES_DIR
  valid $? "Error: could not configure Xerces-c!"

  make -j 4
  valid $? "Error: could not make Xerces-c!"

  make install
  valid $? "Error: Could not install Xerces-c!"

  cd ..
fi


#
Carolina Galvão committed
788
# libxml2 version 2.9.1
Carolina Galvão committed
789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814
#
if [ ! -f "$TERRALIB_DEPENDENCIES_DIR/lib/libxml2.so" ]; then
  echo "installing libxml2..."
  echo ""
  sleep 1s

  tar xzvf libxml2-2.9.1.tar.gz
  valid $? "Error: could not uncompress libxml2-2.9.1.tar.gz!"

  cd libxml2-2.9.1
  valid $? "Error: could not enter libxml2-2.9.1!"

  CPPFLAGS=-I$TERRALIB_DEPENDENCIES_DIR/include LDFLAGS=-L$TERRALIB_DEPENDENCIES_DIR/lib ./configure --prefix=$TERRALIB_DEPENDENCIES_DIR --with-icu --without-python
  valid $? "Error: could not configure libxml2!"

  make -j 4
  valid $? "Error: could not make libxml2"

  make install
  valid $? "Error: Could not install libxml2"

  cd ..
fi


#
Carolina Galvão committed
815
# libxslt version 1.1.28
Carolina Galvão committed
816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841
#
if [ ! -f "$TERRALIB_DEPENDENCIES_DIR/lib/libxslt.so" ]; then
  echo "installing libxslt..."
  echo ""
  sleep 1s

  tar xzvf libxslt-1.1.28.tar.gz
  valid $? "Error: could not uncompress libxslt-1.1.28.tar.gz!"

  cd libxslt-1.1.28
  valid $? "Error: could not enter libxslt-1.1.28!"

  CPPFLAGS=-I$TERRALIB_DEPENDENCIES_DIR/include LDFLAGS=-L$TERRALIB_DEPENDENCIES_DIR/lib ./configure --prefix=$TERRALIB_DEPENDENCIES_DIR --with-libxml-prefix=$TERRALIB_DEPENDENCIES_DIR --without-debug
  valid $? "Error: could not configure libxslt!"

  make -j 4
  valid $? "Error: could not make libxslt"

  make install
  valid $? "Error: Could not install libxslt"

  cd ..
fi


#
Rodrigo Avancini committed
842
# Boost version 1.65.0
Carolina Galvão committed
843 844 845 846 847 848
#
if [ ! -f "$TERRALIB_DEPENDENCIES_DIR/lib/libboost_thread.so" ]; then
  echo "installing boost..."
  echo ""
  sleep 1s

Rodrigo Avancini committed
849 850
  tar xzvf boost_1_65_0.tar.gz
  valid $? "Error: could not uncompress boost_1_65_0.tar.gz!"
Carolina Galvão committed
851

Rodrigo Avancini committed
852 853
  cd boost_1_65_0
  valid $? "Error: could not enter boost_1_65_0!"
Carolina Galvão committed
854 855 856 857 858 859 860 861 862 863 864 865

  ./bootstrap.sh
  valid $? "Error: could not configure Boost!"

  ./b2 runtime-link=shared link=shared variant=release threading=multi --prefix=$TERRALIB_DEPENDENCIES_DIR -sICU_PATH=$TERRALIB_DEPENDENCIES_DIR -sICONV_PATH=/usr -sBZIP2_INCLUDE=$TERRALIB_DEPENDENCIES_DIR/include -sBZIP2_LIBPATH=$TERRALIB_DEPENDENCIES_DIR/lib install
  valid $? "Error: could not make boost"

  cd ..
fi


#
Carolina Galvão committed
866
# PostgreSQL version 9.4.1
Carolina Galvão committed
867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901
#
if [ ! -f "$TERRALIB_DEPENDENCIES_DIR/pgsql/lib/libpq.so" ]; then
  echo "installing PostgreSQL..."
  echo ""
  sleep 1s

  tar xjvf postgresql-9.4.1.tar.bz2
  valid $? "Error: could not uncompress postgresql-9.4.1.tar.bz2!"

  cd postgresql-9.4.1
  valid $? "Error: could not enter postgresql-9.4.1!"

  CPPFLAGS="-I$TERRALIB_DEPENDENCIES_DIR/include -I$TERRALIB_DEPENDENCIES_DIR/include/libxml2" LDFLAGS="-lstdc++ -L$TERRALIB_DEPENDENCIES_DIR/lib" ./configure --with-libxml2 --with-libxslt --with-ossp-uuid --with-openssl --prefix=$TERRALIB_DEPENDENCIES_DIR/pgsql --with-includes=$TERRALIB_DEPENDENCIES_DIR/include --with-libraries=$TERRALIB_DEPENDENCIES_DIR/lib
  valid $? "Error: could not configure postgresql!"

  make -j 4
  valid $? "Error: could not make postgresql"

  make install
  valid $? "Error: Could not install postgresql"

  cd contrib/uuid-ossp
  valid $? "Error: could not enter postgresql-9.4.1/contrib/uuid-ossp!"

  make
  valid $? "Error: could not make postgresql-9.4.1/contrib/uuid-ossp"

  make install
  valid $? "Error: Could not install postgresql-9.4.1/contrib/uuid-ossp"

  cd ../../..
fi


#
Carolina Galvão committed
902
# HDF4 version 4.2.9
Carolina Galvão committed
903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935
#
if [ ! -f "$TERRALIB_DEPENDENCIES_DIR/lib/libmfhdf.a" ]; then
  echo "installing HDF4..."
  echo ""
  sleep 1s

  tar xzvf hdf-4.2.9.tar.gz
  valid $? "Error: could not uncompress hdf-4.2.9.tar.gz!"

  cd hdf-4.2.9
  valid $? "Error: could not enter hdf-4.2.9!"

  CFLAGS=-fPIC ./configure --prefix=$TERRALIB_DEPENDENCIES_DIR --with-szlib=$TERRALIB_DEPENDENCIES_DIR --with-zlib --with-jpeg=$TERRALIB_DEPENDENCIES_DIR --enable-netcdf --disable-fortran
  valid $? "Error: could not configure hdf-4!"

  make -j 4
  valid $? "Error: could not make hdf-4"

  make install
  valid $? "Error: Could not install hdf-4"

  cd ..
fi


#
# SQLite version 3.8.10.1
# Site: https://www.sqlite.org
#
if [ ! -f "$TERRALIB_DEPENDENCIES_DIR/lib/libsqlite3.so" ]; then
  echo "installing SQLite..."
  sleep 1s

936 937
  tar xzvf sqlite-autoconf-3260000.tar.gz
  valid $? "Error: could not uncompress sqlite-autoconf-3260000.tar.gz!"
Carolina Galvão committed
938

939 940
  cd sqlite-autoconf-3260000
  valid $? "Error: could not enter sqlite-autoconf-3260000!"
Carolina Galvão committed
941 942 943 944 945 946 947 948 949 950 951 952 953 954 955

  CFLAGS="-Os -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_RTREE -DSQLITE_SOUNDEX -DSQLITE_OMIT_AUTOINIT" ./configure --prefix=$TERRALIB_DEPENDENCIES_DIR
  valid $? "Error: could not configure sqlite!"

  make -j 4
  valid $? "Error: could not make sqlite"

  make install
  valid $? "Error: Could not install sqlite"

  cd ..
fi


#
Rodrigo Avancini committed
956
# SpatiaLite version 4.3.0
Carolina Galvão committed
957 958 959 960 961 962 963
# Site: https://www.gaia-gis.it/fossil/libspatialite
# Obs.: In the future we should turn on libxml2 support.
#
if [ ! -f "$TERRALIB_DEPENDENCIES_DIR/lib/libspatialite.so" ]; then
  echo "installing SpatiaLite..."
  sleep 1s

Rodrigo Avancini committed
964 965
  tar xzvf libspatialite-4.3.0a.tar.gz
  valid $? "Error: could not uncompress libspatialite-4.3.0a.tar.gz!"
Carolina Galvão committed
966

Rodrigo Avancini committed
967 968
  cd libspatialite-4.3.0a
  valid $? "Error: could not enter libspatialite-4.3.0a!"
Carolina Galvão committed
969 970 971 972 973 974 975 976 977 978 979 980 981 982 983

  CPPFLAGS="-I$TERRALIB_DEPENDENCIES_DIR -I$TERRALIB_DEPENDENCIES_DIR/include -I$TERRALIB_DEPENDENCIES_DIR/include/libxml2 -I$TERRALIB_DEPENDENCIES_DIR/include/libxml2/libxml" LDFLAGS="-L$TERRALIB_DEPENDENCIES_DIR/lib"  ./configure --prefix=$TERRALIB_DEPENDENCIES_DIR --enable-proj --enable-geos --enable-geosadvanced --enable-iconv --enable-freexl --enable-geocallbacks --enable-epsg --enable-mathsql --enable-libxml2=no --enable-geopackage --with-geosconfig=$TERRALIB_DEPENDENCIES_DIR/bin/geos-config
  valid $? "Error: could not configure libspatialite!"

  make -j 4
  valid $? "Error: could not make libspatialite"

  make install
  valid $? "Error: Could not install libspatialite"

  cd ..
fi


#
Carolina Galvão committed
984
# GDAL/OGR version 2.1.3
Carolina Galvão committed
985
#
Carolina Galvão committed
986
if [ ! -f "$TERRALIB_DEPENDENCIES_DIR/lib/libgdal.so" ]; then
Carolina Galvão committed
987 988 989 990
  echo "installing GDAL/OGR..."
  echo ""
  sleep 1s

Carolina Galvão committed
991 992
  tar xzvf gdal-2.1.3.tar.gz
  valid $? "Error: could not uncompress gdal-2.1.3.tar.gz!"
Carolina Galvão committed
993

Carolina Galvão committed
994 995
  cd gdal-2.1.3
  valid $? "Error: could not enter gdal-2.1.3!"
Carolina Galvão committed
996

Hugo Richard Gomes Vieira committed
997
  CPPFLAGS="-I$TERRALIB_DEPENDENCIES_DIR/include -I$TERRALIB_DEPENDENCIES_DIR/include/libxml2" LDFLAGS="-L$TERRALIB_DEPENDENCIES_DIR/lib -Wl,-rpath,$TERRALIB_DEPENDENCIES_DIR/pgsql/lib" ./configure --with-pg=$TERRALIB_DEPENDENCIES_DIR/pgsql/bin/pg_config --with-png=$TERRALIB_DEPENDENCIES_DIR --with-libtiff=$TERRALIB_DEPENDENCIES_DIR --with-geotiff=$TERRALIB_DEPENDENCIES_DIR --with-jpeg=$TERRALIB_DEPENDENCIES_DIR  --with-gif --with-ecw=yes --with-xerces=$TERRALIB_DEPENDENCIES_DIR --with-expat=yes --with-openjpeg-2.0=$TERRALIB_DEPENDENCIES_DIR --with-curl=$TERRALIB_DEPENDENCIES_DIR/bin/curl-config --with-sqlite3=$TERRALIB_DEPENDENCIES_DIR --with-geos=$TERRALIB_DEPENDENCIES_DIR/bin/geos-config --with-threads --with-spatialite=$TERRALIB_DEPENDENCIES_DIR --with-freexl=$TERRALIB_DEPENDENCIES_DIR --without-python --prefix=$TERRALIB_DEPENDENCIES_DIR --with-xml2=$TERRALIB_DEPENDENCIES_DIR/bin/xml2-config --with-libkml --with-hdf4=$TERRALIB_DEPENDENCIES_DIR --without-netcdfd
Carolina Galvão committed
998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010
  valid $? "Error: could not configure gdal!"

  make -j 4 -s
  valid $? "Error: could not make gdal"

  make install
  valid $? "Error: Could not install gdal"

  cd ..
fi


#
Carolina Galvão committed
1011
# CppUnit version 1.12.1
Carolina Galvão committed
1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064
#
if [ ! -f "$TERRALIB_DEPENDENCIES_DIR/lib/libcppunit.so" ]; then
  echo "installing CppUnit.."
  echo ""
  sleep 1s

  tar xzvf cppunit-1.12.1.tar.gz
  valid $? "Error: could not uncompress cppunit-1.12.1.tar.gz!"

  cd cppunit-1.12.1
  valid $? "Error: could not enter cppunit-1.12.1!"

  LDFLAGS="-ldl" ./configure --prefix=$TERRALIB_DEPENDENCIES_DIR
  valid $? "Error: could not configure cppunit!"

  make -j 4
  valid $? "Error: could not make cppunit"

  make install
  valid $? "Error: Could not install cppunit"

  cd ..
fi


#
# Qt Property Browser
#
if [ ! -f "$TERRALIB_DEPENDENCIES_DIR/lib/libqt_property_browser.so" ]; then
  echo "installing Qt Property Browser..."
  echo ""
  sleep 1s

  tar xzvf qtpropertybrowser.tar.gz
  valid $? "Error: could not uncompress qtpropertybrowser.tar.gz!"

  cd qtpropertybrowser
  valid $? "Error: could not change dir to qtpropertybrowser!"

  qmake "TERRALIB_DIR=$TERRALIB_DEPENDENCIES_DIR"
  valid $? "Error: could not run qmake for qt-property-browser!"

  make -j 4
  valid $? "Error: could not make qt-property-browser!"

  make install
  valid $? "Error: Could not install qt-property-browser!"

  cd ..
fi


#
Matheus C. Zaglia committed
1065
# QScintilla version 2.10
Carolina Galvão committed
1066 1067 1068 1069 1070 1071
#
if [ ! -f "$TERRALIB_DEPENDENCIES_DIR/lib/libqscintilla2.so" ]; then
  echo "installing QScintilla..."
  echo ""
  sleep 1s

Matheus C. Zaglia committed
1072 1073
  tar xzvf QScintilla_gpl-2.10.tar.gz
  valid $? "Error: could not uncompress QScintilla_gpl-2.10.tar.gz!"
Carolina Galvão committed
1074

Matheus C. Zaglia committed
1075 1076
  cd QScintilla_gpl-2.10/Qt4Qt5
  valid $? "Error: could not change dir to QScintilla_gpl-2.10/Qt4Qt5!"
Carolina Galvão committed
1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091

  qmake "TERRALIB_DIR=$TERRALIB_DEPENDENCIES_DIR"
  valid $? "Error: could not prepare QScintilla build with qmake!"

  make -j 4
  valid $? "Error: could not make QScintilla!"

  make install
  valid $? "Error: Could not install QScintilla!"

  cd ../..
fi


#
Carolina Galvão committed
1092
# Lua version 5.3.4
Carolina Galvão committed
1093
#
Rodrigo Avancini committed
1094
if [ ! -f "$TERRALIB_DEPENDENCIES_DIR/lib/liblua.so" ]; then
Carolina Galvão committed
1095 1096 1097 1098
  echo "installing Lua..."
  echo ""
  sleep 1s

Carolina Galvão committed
1099 1100
  tar xzvf lua-5.3.4.tar.gz
  valid $? "Error: could not uncompress lua-5.3.4.tar.gz!"
Carolina Galvão committed
1101

Carolina Galvão committed
1102 1103
  cd lua-5.3.4
  valid $? "Error: could not change dir to lua-5.3.4!"
Carolina Galvão committed
1104

Carolina Galvão committed
1105
  mkdir cmake-build
Hugo Richard Gomes Vieira committed
1106 1107 1108
  cd cmake-build

  cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE="Release" -DCMAKE_INSTALL_PREFIX=${TERRALIB_DEPENDENCIES_DIR} -DINSTALL_INC=${TERRALIB_DEPENDENCIES_DIR}/include/lua ..
Carolina Galvão committed
1109
  valid $? "Error: could not configure Lua!"
Rodrigo Avancini committed
1110

Carolina Galvão committed
1111 1112
  make -j 4
  valid $? "Error: could not make Lua!"
Carolina Galvão committed
1113

Carolina Galvão committed
1114 1115
  make install
  valid $? "Error: could not install Lua!"
Hugo Richard Gomes Vieira committed
1116

Carolina Galvão committed
1117
  cd ../..
Carolina Galvão committed
1118
fi
Hugo Richard Gomes Vieira committed
1119

Carolina Galvão committed
1120

Carolina Galvão committed
1121
#
Carolina Galvão committed
1122
# QtLua version 2.0
Carolina Galvão committed
1123
#
Rodrigo Avancini committed
1124

Carolina Galvão committed
1125 1126 1127 1128 1129
if [ "$TE_USE_QT" != "qt4" ]; then
  if [ ! -f "$TERRALIB_DEPENDENCIES_DIR/lib/libqtlua.so" ]; then
    echo "installing QtLua..."
    echo ""
    sleep 1s
Hugo Richard Gomes Vieira committed
1130

Carolina Galvão committed
1131 1132
    tar xzvf libqtlua-2.0.tar.gz
    valid $? "Error: could not uncompress libqtlua-2.0.tar.gz!"
Carolina Galvão committed
1133

Carolina Galvão committed
1134 1135
    cd libqtlua-2.0
    valid $? "Error: could not change dir to libqtlua-2.0!"
Carolina Galvão committed
1136

Carolina Galvão committed
1137 1138
    mkdir cmake-build
    cd cmake-build
Carolina Galvão committed
1139

Carolina Galvão committed
1140 1141
    cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE="Release" -DCMAKE_INSTALL_PREFIX=${TERRALIB_DEPENDENCIES_DIR} -DCMAKE_PREFIX_PATH=${TERRALIB_DEPENDENCIES_DIR}/lib -DLUA_INCLUDE_DIR=${TERRALIB_DEPENDENCIES_DIR}/include/lua ..
    valid $? "Error: could not configure QtLua!"
Carolina Galvão committed
1142

Carolina Galvão committed
1143 1144
    make -j 4
    valid $? "Error: could not make QtLua!"
Carolina Galvão committed
1145

Carolina Galvão committed
1146 1147
    make install
    valid $? "Error: could not install QtLua!"
Rodrigo Avancini committed
1148

Carolina Galvão committed
1149
    cd ..
Carolina Galvão committed
1150

Carolina Galvão committed
1151 1152
    cp -r src/internal $TERRALIB_DEPENDENCIES_DIR/include/QtLua/
    valid $? "Error: could not copy QtLua internal folder!"
Carolina Galvão committed
1153

Carolina Galvão committed
1154 1155
    cd ..
  fi
Carolina Galvão committed
1156

Rodrigo Avancini committed
1157

Carolina Galvão committed
1158 1159 1160 1161 1162 1163 1164
  #
  # QtLuaExtras
  #
  if [ ! -f "$TERRALIB_DEPENDENCIES_DIR/lib/qtluae.so" ]; then
    echo "installing QtLuaExtras..."
    echo ""
    sleep 1s
Hugo Richard Gomes Vieira committed
1165

Carolina Galvão committed
1166 1167
    tar xzvf qtluae.tar.gz
    valid $? "Error: could not uncompress qtluae.tar.gz!"
Rodrigo Avancini committed
1168

Carolina Galvão committed
1169 1170
    cd qtluae
    valid $? "Error: could not change dir to qtluae!"
Rodrigo Avancini committed
1171

Carolina Galvão committed
1172 1173
    mkdir cmake-build
    cd cmake-build
Rodrigo Avancini committed
1174

Carolina Galvão committed
1175
    cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE="Release" -DCMAKE_INSTALL_PREFIX=${TERRALIB_DEPENDENCIES_DIR} -DLUA_LIBRARY=${TERRALIB_DEPENDENCIES_DIR}/lib/liblua.so -DLUA_INCLUDE_DIR=${TERRALIB_DEPENDENCIES_DIR}/include/lua -DQTLUA_INCLUDE_DIR=${TERRALIB_DEPENDENCIES_DIR}/include -DQTLUA_LIBRARY=${TERRALIB_DEPENDENCIES_DIR}/lib/libqtlua.so ../build/cmake
Rodrigo Avancini committed
1176

Carolina Galvão committed
1177 1178
    make -j 4
    valid $? "Error: could not make QtLuaExtras!"
Rodrigo Avancini committed
1179

Carolina Galvão committed
1180 1181
    make install
    valid $? "Error: could not install QtLuaExtras!"
Rodrigo Avancini committed
1182

Carolina Galvão committed
1183 1184 1185 1186 1187 1188
    cp -a ${TERRALIB_DEPENDENCIES_DIR}/lib/libqtluae.so ${TERRALIB_DEPENDENCIES_DIR}/lib/qtluae.so
    valid $? "Error: could not copy QtLuaExtras internal folder!"

    cd ../..
  fi
fi # endif [ "$TE_USE_QT" != "qt4" ]; then
Rodrigo Avancini committed
1189 1190 1191


#
Carolina Galvão committed
1192
# Qwt version 6.1.2
Carolina Galvão committed
1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216
# Site: http://qwt.sourceforge.net
#
if [ ! -f "$TERRALIB_DEPENDENCIES_DIR/lib/libqwt.so" ]; then
  echo "installing Qwt..."
  sleep 1s

  tar xjvf qwt-6.1.2.tar.bz2
  valid $? "Error: could not uncompress qwt-6.1.2.tar.bz2!"

  cd qwt-6.1.2
  valid $? "Error: could not change dir to qwt-6.1.2!"

  qmake qwt.pro "QWT_INSTALL_PREFIX_TARGET=$TERRALIB_DEPENDENCIES_DIR"
  valid $? "Error: could not configure Qwt!"

  make -j 4
  valid $? "Error: could not make Qwt!"

  make install
  valid $? "Error: could not copy Qwt internal folder!"

  cd ..
fi

Rodrigo Avancini committed
1217

Carolina Galvão committed
1218 1219 1220 1221
#
# GTest and GMock
#
if [ ! -f "$TERRALIB_DEPENDENCIES_DIR/lib/libgmock.a" ]; then
Carolina Galvão committed
1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235
  echo "installing GTest and GMock..."
  sleep 1s

  unzip googletest-master.zip
  valid $? "Error: could not uncompress googletestmaster.zip!"

  cd googletest-master/googletest
  valid $? "Error: could not enter googletestmaster!"

  cmake .
  valid $? "Error: could not configure googletest!"

  make
  valid $? "Error: could not make googletest!"
Carolina Galvão committed
1236

Carolina Galvão committed
1237 1238
  cp libgtest.a $TERRALIB_DEPENDENCIES_DIR/lib/
  valid $? "Error: could not copy libgtest.a!"
Carolina Galvão committed
1239

Carolina Galvão committed
1240 1241
  cp libgtest_main.a $TERRALIB_DEPENDENCIES_DIR/lib/
  valid $? "Error: could not copy libgtest_main.a!"
Carolina Galvão committed
1242

Carolina Galvão committed
1243 1244
  cp -r include/gtest/ $TERRALIB_DEPENDENCIES_DIR/include/
  valid $? "Error: could not copy include dir!"
Carolina Galvão committed
1245

Carolina Galvão committed
1246
  cd ../googlemock
Carolina Galvão committed
1247

Carolina Galvão committed
1248 1249
  cmake .
  valid $? "Error: could not configure googlemock!"
Carolina Galvão committed
1250

Carolina Galvão committed
1251 1252 1253 1254 1255
  make
  valid $? "Error: could not make googlemock!"

  cp libgmock.a $TERRALIB_DEPENDENCIES_DIR/lib/
  valid $? "Error: could not copy libgmock.a!"
Carolina Galvão committed
1256

Carolina Galvão committed
1257 1258
  cp libgmock_main.a $TERRALIB_DEPENDENCIES_DIR/lib/
  valid $? "Error: could not copy libgmock_main.a!"
Carolina Galvão committed
1259

Carolina Galvão committed
1260 1261
  cp -r include/gmock $TERRALIB_DEPENDENCIES_DIR/include/
  valid $? "Error: could not copy include dir!"
Carolina Galvão committed
1262

Carolina Galvão committed
1263 1264
  cd ../..
fi
Carolina Galvão committed
1265

Carolina Galvão committed
1266
#
Carolina Galvão committed
1267
# Wtss Cxx version 0.4.0
Carolina Galvão committed
1268 1269 1270 1271 1272
#
if [ ! -f "$TERRALIB_DEPENDENCIES_DIR/lib/libwtss_cxx_client.so" ]; then
  echo "installing Cxx"
  echo ""
  sleep 1s
Hugo Richard Gomes Vieira committed
1273

Carolina Galvão committed
1274 1275
  tar xzvf wtss-cxx.tar.gz
  valid $? "Error: could not uncompress wtss-cxx.tar.gz!"
Carolina Galvão committed
1276

Carolina Galvão committed
1277 1278
  cd wtss-cxx
  valid $? "Error: could not change dir to wtss-cxx!"
Carolina Galvão committed
1279

Carolina Galvão committed
1280 1281
  cmake -G "Unix Makefiles" -DCMAKE_PREFIX_PATH:PATH=${TERRALIB_DEPENDENCIES_DIR} -DCMAKE_INSTALL_PREFIX:PATH=${TERRALIB_DEPENDENCIES_DIR} -DCMAKE_INSTALL_RPATH:PATH=${TERRALIB_DEPENDENCIES_DIR} -DCMAKE_SKIP_BUILD_RPATH:BOOL="OFF" -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL="OFF" -DCMAKE_INSTALL_RPATH_USE_LINK_PATH:BOOL="ON" -DCMAKE_BUILD_TYPE:STRING="Release" build/cmake
  valid $? "Error: could not configure wtss-cxx!"
Carolina Galvão committed
1282

Carolina Galvão committed
1283 1284
  make -j 4
  valid $? "Error: could not make wtss-cxx!"
Carolina Galvão committed
1285

Carolina Galvão committed
1286 1287
  make install
  valid $? "Error: could not install wtss-cxx!"
Carolina Galvão committed
1288

Carolina Galvão committed
1289
  cd ..
Carolina Galvão committed
1290 1291 1292 1293 1294 1295 1296 1297 1298 1299
fi

#
# Finished!
#
echo "*****************************************************************"
echo "* TerraLib 3rd-party Libraries Installer for Linux Ubuntu 16.04 *"
echo "*****************************************************************"
echo ""
echo "finished successfully!"