ant.spec 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. ##
  2. ## ant.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2019 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 version
  24. %define V_opkg 1.10.7
  25. %define V_ant 1.10.7
  26. %define V_ivy 2.5.0
  27. %define V_maven 2.1.3
  28. %define V_junit 4.10
  29. # package information
  30. Name: ant
  31. Summary: Java Building Tool
  32. URL: http://ant.apache.org/
  33. Vendor: Apache Software Foundation
  34. Packager: OpenPKG Project
  35. Distribution: OpenPKG Community
  36. Class: PLUS
  37. Group: Building
  38. License: Apache Software License
  39. Version: %{V_opkg}
  40. Release: 20191025
  41. # package options
  42. %option with_docs no
  43. # list of sources
  44. Source0: http://www.apache.org/dist/ant/binaries/apache-ant-%{V_ant}-bin.tar.bz2
  45. Source1: http://www.apache.org/dist/ant/ivy/%{V_ivy}/apache-ivy-%{V_ivy}-bin-with-deps.tar.gz
  46. Source2: http://www.apache.org/dist/maven/binaries/maven-ant-tasks-%{V_maven}.jar
  47. Source3: http://download.sourceforge.net/junit/junit%{V_junit}.zip
  48. Source4: ant.conf
  49. Source5: rc.ant
  50. Source6: ant.1
  51. Source7: build.xml.5
  52. Patch0: ant.patch
  53. # build information
  54. BuildPreReq: OpenPKG, openpkg >= 20160101, infozip
  55. PreReq: OpenPKG, openpkg >= 20160101, java, JAVA-JDK
  56. %description
  57. Apache Ant is a Java based build tool. In theory it is kind of like
  58. make(1) without make(1)'s wrinkles. In practice it has its own
  59. wrinkles.
  60. %track
  61. prog ant = {
  62. version = %{V_ant}
  63. url = http://www.apache.org/dist/ant/binaries/
  64. regex = apache-ant-(__VER__)-bin\.tar\.bz2
  65. }
  66. prog ant:maven-ant-tasks = {
  67. version = %{V_maven}
  68. url = http://www.apache.org/dist/maven/binaries/
  69. regex = maven-ant-tasks-(__VER__)\.jar
  70. }
  71. prog ant:ivy = {
  72. version = %{V_ivy}
  73. url = http://www.apache.org/dist/ant/ivy/
  74. regex = (\d+\.\d+(?:\.\d+))/
  75. }
  76. prog ant:junit = {
  77. version = %{V_junit}
  78. url = http://sourceforge.net/projects/junit/files/
  79. regex = junit(\d+\.\d+(?:\.\d+)?)\.zip
  80. }
  81. %prep
  82. %setup -q -n apache-ant-%{V_ant}
  83. %setup -q -n apache-ant-%{V_ant} -T -D -a 1
  84. %{l_prefix}/bin/unzip -q %{SOURCE junit%{V_junit}.zip}
  85. %patch -p0
  86. %build
  87. # Note that there is nothing to build since the Ant binary distribution
  88. # is used. The reason for that is that a Ant build would require other
  89. # tools which build procedures depend on Ant which leads to a chicken
  90. # and egg problem. But in the end this doesn't hurt very much since we
  91. # are talking about Java byte code and shell scripts which are portable
  92. # anyway.
  93. %install
  94. %{l_shtool} mkdir -f -p -m 755 \
  95. $RPM_BUILD_ROOT%{l_prefix}/bin \
  96. $RPM_BUILD_ROOT%{l_prefix}/etc/ant \
  97. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
  98. $RPM_BUILD_ROOT%{l_prefix}/libexec/ant/lib \
  99. $RPM_BUILD_ROOT%{l_prefix}/libexec/ant/etc \
  100. $RPM_BUILD_ROOT%{l_prefix}/libexec/ant/bin \
  101. $RPM_BUILD_ROOT%{l_prefix}/man/man1 \
  102. $RPM_BUILD_ROOT%{l_prefix}/man/man5
  103. %{l_shtool} install -c -m 755 \
  104. -e 's;/etc/ant.conf;%{l_prefix}/etc/ant/ant.conf;' \
  105. bin/ant $RPM_BUILD_ROOT%{l_prefix}/libexec/ant/bin/
  106. ( echo "#!/bin/sh"
  107. echo "exec %{l_prefix}/libexec/ant/bin/ant \${1+\"\$@\"}"
  108. ) >ant.sh
  109. %{l_shtool} install -c -m 755 \
  110. ant.sh $RPM_BUILD_ROOT%{l_prefix}/bin/ant
  111. %{l_shtool} install -c -m 644 \
  112. lib/*.jar $RPM_BUILD_ROOT%{l_prefix}/libexec/ant/lib/
  113. %{l_shtool} install -c -m 644 \
  114. etc/*.jar $RPM_BUILD_ROOT%{l_prefix}/libexec/ant/etc/
  115. %{l_shtool} install -c -m 644 \
  116. apache-ivy-*/ivy-%{V_ivy}.jar $RPM_BUILD_ROOT%{l_prefix}/libexec/ant/lib/ivy.jar
  117. ( cd apache-ivy-*/lib
  118. for jar in commons-codec-*.jar commons-httpclient-*.jar \
  119. commons-logging-*.jar commons-vfs-*.jar jsch-*.jar oro-*.jar; do
  120. newjar="ivy-`echo $jar | sed -e 's;-[0-9].*$;;'`.jar"
  121. %{l_shtool} install -c -m 644 \
  122. $jar $RPM_BUILD_ROOT%{l_prefix}/libexec/ant/lib/$newjar
  123. done
  124. ) || exit $?
  125. ( echo "#!/bin/sh"
  126. echo "CP=\"%{l_prefix}/libexec/ant/lib/ivy.jar\""
  127. echo "for jar in %{l_prefix}/libexec/ant/lib/ivy-*.jar; do"
  128. echo " CP=\"\${CP}:\${jar}\""
  129. echo "done"
  130. echo "%{l_prefix}/bin/java -Djava.awt.headless=true -cp \$CP org.apache.ivy.Main \${1+\"\$@\"}"
  131. ) >ivy.sh
  132. %{l_shtool} install -c -m 755 \
  133. ivy.sh $RPM_BUILD_ROOT%{l_prefix}/bin/ivy
  134. %{l_shtool} install -c -m 644 \
  135. junit*/junit-%{V_junit}.jar $RPM_BUILD_ROOT%{l_prefix}/libexec/ant/junit.jar
  136. %{l_shtool} install -c -m 644 \
  137. etc/*.xsl etc/checkstyle/*.xsl $RPM_BUILD_ROOT%{l_prefix}/etc/ant/
  138. %{l_shtool} install -c -m 644 \
  139. %{SOURCE maven-ant-tasks-%{V_maven}.jar} \
  140. $RPM_BUILD_ROOT%{l_prefix}/libexec/ant/maven-ant-task.jar
  141. %{l_shtool} install -c -m 644 \
  142. %{SOURCE ant.1} \
  143. $RPM_BUILD_ROOT%{l_prefix}/man/man1/
  144. %{l_shtool} install -c -m 644 \
  145. %{SOURCE build.xml.5} \
  146. $RPM_BUILD_ROOT%{l_prefix}/man/man5/
  147. %if "%{with_docs}" == "yes"
  148. %{l_shtool} mkdir -f -p -m 755 \
  149. $RPM_BUILD_ROOT%{l_prefix}/share/ant
  150. rm docs/LICENSE*
  151. cp -rp docs/* $RPM_BUILD_ROOT%{l_prefix}/share/ant/
  152. %endif
  153. %{l_shtool} install -c -m 644 %{l_value -s -a} \
  154. %{SOURCE ant.conf} $RPM_BUILD_ROOT%{l_prefix}/etc/ant/
  155. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  156. %{SOURCE rc.ant} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  157. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} \
  158. '%config %{l_prefix}/etc/ant/*.conf'
  159. %files -f files
  160. %clean