tpch-build.sh 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. #!/bin/sh
  2. # Check for all the stuff I need to function.
  3. for f in gcc javac; do
  4. which $f > /dev/null 2>&1
  5. if [ $? -ne 0 ]; then
  6. echo "Required program $f is missing. Please install or fix your path and try again."
  7. exit 1
  8. fi
  9. done
  10. # Check if Maven is installed and install it if not.
  11. which mvn > /dev/null 2>&1
  12. if [ $? -ne 0 ]; then
  13. SKIP=0
  14. if [ -e "apache-maven-3.0.5-bin.tar.gz" ]; then
  15. SIZE=`du -b apache-maven-3.0.5-bin.tar.gz | cut -f 1`
  16. if [ $SIZE -eq 5144659 ]; then
  17. SKIP=1
  18. fi
  19. fi
  20. if [ $SKIP -ne 1 ]; then
  21. echo "Maven not found, automatically installing it."
  22. curl -O http://www.us.apache.org/dist/maven/maven-3/3.0.5/binaries/apache-maven-3.0.5-bin.tar.gz 2> /dev/null
  23. if [ $? -ne 0 ]; then
  24. echo "Failed to download Maven, check Internet connectivity and try again."
  25. exit 1
  26. fi
  27. fi
  28. tar -zxf apache-maven-3.0.5-bin.tar.gz > /dev/null
  29. CWD=$(pwd)
  30. export MAVEN_HOME="$CWD/apache-maven-3.0.5"
  31. export PATH=$PATH:$MAVEN_HOME/bin
  32. fi
  33. echo "Building TPC-H Data Generator"
  34. (cd tpch-gen; make)
  35. echo "TPC-H Data Generator built, you can now use tpch-setup.sh to generate data."