groovy.spec 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. ##
  2. ## groovy.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2022 OpenPKG Project <http://openpkg.org/>
  4. ##
  5. ## Permission to use, copy, modify, and distribute this software for
  6. ## any purpose with or without fee is hereby granted, provided that
  7. ## the above copyright notice and this permission notice appear in all
  8. ## copies.
  9. ##
  10. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  11. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  12. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  13. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  14. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  15. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  16. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  17. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  18. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  19. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  20. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  21. ## SUCH DAMAGE.
  22. ##
  23. # package information
  24. Name: groovy
  25. Summary: Groovy Java Scripting Language
  26. URL: https://groovy.apache.org/
  27. Vendor: Codehaus
  28. Packager: OpenPKG Project
  29. Distribution: OpenPKG Community
  30. Class: PLUS
  31. Group: Language
  32. License: BSD-style
  33. Version: 4.0.0
  34. Release: 20220128
  35. # list of sources
  36. Source0: https://groovy.jfrog.io/artifactory/dist-release-local/groovy-zips/apache-groovy-binary-%{version}.zip
  37. # build information
  38. BuildPreReq: OpenPKG, openpkg >= 20160101, infozip
  39. PreReq: OpenPKG, openpkg >= 20160101, java, JAVA-JDK
  40. %description
  41. Groovy is an agile and dynamic scripting language for the Java
  42. Virtual Machine (JVM). It builds upon the strengths of Java but has
  43. additional power features inspired by languages like Python, Ruby
  44. and Smalltalk. It can be used as a stand-alone or embedded scripting
  45. language for Java and provides full access to all existing Java
  46. class libraries.
  47. %track
  48. prog groovy = {
  49. version = %{version}
  50. url = https://groovy.apache.org/download.html
  51. regex = apache-groovy-binary-(\d+\.\d+(\.\d+)*)\.zip
  52. }
  53. %prep
  54. %setup -q -T -c
  55. ( cd ..
  56. %{l_prefix}/bin/unzip -q -x %{SOURCE0}
  57. ) || exit $?
  58. %build
  59. %install
  60. %{l_shtool} mkdir -f -p -m 755 \
  61. $RPM_BUILD_ROOT%{l_prefix}/bin \
  62. $RPM_BUILD_ROOT%{l_prefix}/libexec/groovy
  63. for program in grok groovy groovyConsole groovyc groovysh java2groovy; do
  64. ( echo "#!/bin/sh"
  65. echo "eval \`JAVA_PLATFORM=\"sun-jdk\" %{l_prefix}/bin/java-toolkit -e\`"
  66. echo "GROOVY_HOME=\"%{l_prefix}/libexec/groovy\"; export GROOVY_HOME"
  67. echo "exec %{l_prefix}/libexec/groovy/bin/$program \"\$@\""
  68. ) >$program.sh
  69. %{l_shtool} install -c -m 755 \
  70. $program.sh $RPM_BUILD_ROOT%{l_prefix}/bin/$program
  71. done
  72. rm -f bin/*.bat bin/*cygwin*
  73. cp -rp bin conf lib \
  74. $RPM_BUILD_ROOT%{l_prefix}/libexec/groovy/
  75. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  76. %files -f files
  77. %clean