OpenSDE Packages Database (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 lines
2.0 KiB

  1. #!/bin/sh
  2. # --- T2-COPYRIGHT-NOTE-BEGIN ---
  3. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  4. #
  5. # T2 SDE: package/.../apache-ant/apache-ant.conf
  6. # Copyright (C) 2004 - 2006 The T2 SDE Project
  7. #
  8. # More information can be found in the files COPYING and README.
  9. #
  10. # This program is free software; you can redistribute it and/or modify
  11. # it under the terms of the GNU General Public License as published by
  12. # the Free Software Foundation; version 2 of the License. A copy of the
  13. # GNU General Public License can be found in the file COPYING.
  14. # --- T2-COPYRIGHT-NOTE-END ---
  15. # Use jikes for faster compilation if it is available.
  16. if pkginstalled jikes; then
  17. export ANT_OPTS="-Dbuild.compiler=jikes -Djavac.source=1.3"
  18. fi
  19. # Check if a java development kit was installed.
  20. if [ -z $JAVA_HOME ]; then
  21. abort "JDK required for building $pkg"
  22. fi
  23. # We want Ant to be installed in its own directory.
  24. prefix=$prefix/apache-ant
  25. export ANT_HOME=$root/$prefix
  26. set_confopt
  27. # Custom package building and installation.
  28. ant_postmake() {
  29. # Todo check return value (building and installation success?).
  30. # The next command will start the build and when finished
  31. # it will automatically install the new build in ANT_HOME
  32. ./build.sh install
  33. if [ $? -ne 0 ]; then
  34. # Something went wrong.
  35. abort "Building $pkg failed."
  36. fi
  37. # Now the ant commands need to be made available. This can
  38. # be done is two ways. Add the bin directory to PATH or have
  39. # links to the ant commands somewhere in the existing PATH.
  40. # Here we choose the last option to prevent PATH becoming to
  41. # large. We will place the links in the default java/bin
  42. # directory.
  43. bin_path=$(pkgprefix bindir java-dirtree)
  44. for ant_command in $(find $ANT_HOME/bin -perm +o=x -type f); do
  45. # Create a link for the current ant command.
  46. ln -sf $ant_command $bin_path/$(basename $ant_command)
  47. done
  48. # Prepare necessary environment variables.
  49. cat <<-EOF > $root/etc/profile.d/ant
  50. ANT_HOME=/$prefix
  51. export ANT_HOME
  52. EOF
  53. }
  54. hook_add postmake 5 ant_postmake