ant-vl.spec 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  1. %define ant_home %{_datadir}/ant
  2. %define gcj_support 0
  3. Name: ant
  4. Summary: Ant build tool for java
  5. Summary(ja): Java 用ビルドツール
  6. Version: 1.9.14
  7. Release: 1%{?_dist_release}
  8. Group: Development/Tools
  9. Vendor: Project Vine
  10. Distribution: Vine Linux
  11. License: ASL 2.0
  12. URL: https://ant.apache.org/
  13. # using binary for bootstrap
  14. #Source0: http://www.apache.org/dist/ant/binaries/apache-ant-%{version}-bin.tar.bz2
  15. Source0: http://ftp.jaist.ac.jp/pub/apache/ant/binaries/apache-ant-%{version}-bin.tar.bz2
  16. Source1: apache-ant-1.7.ant.conf
  17. BuildRequires: jpackage-utils >= 1.7.5
  18. #BuildRequires: java-devel >= 1.5.0
  19. #BuildRequires: jaxp_transform_impl
  20. #if %without bootstrap
  21. #BuildRequires: ant
  22. #BuildRequires: junit
  23. #BuildRequires: xml-commons-jaxp-1.3-apis
  24. #BuildRequires: xerces-j2
  25. #endif
  26. Requires: jpackage-utils >= 1.7.5
  27. Requires: java-devel >= 1.5.0
  28. #if %without bootstrap
  29. Requires: xerces-j2
  30. Requires: xml-commons-jaxp-1.3-apis
  31. #endif
  32. %if !%{gcj_support}
  33. BuildArch: noarch
  34. %endif
  35. BuildRoot: %{_tmppath}/%{name}-%{version}-root
  36. # RHUG
  37. Obsoletes: ant-devel < %{version}-%{release}
  38. Provides: ant-devel = %{version}-%{release}
  39. # Mandriva
  40. Conflicts: j2sdk-ant
  41. %if %{gcj_support}
  42. BuildRequires: java-gcj-compat-devel
  43. Requires(post): java-gcj-compat
  44. Requires(postun): java-gcj-compat
  45. %endif
  46. Requires(post): jpackage-utils >= 1.7.5
  47. Requires(postun): jpackage-utils >= 1.7.5
  48. %description
  49. Ant is a platform-independent build tool for java. It's used by apache
  50. jakarta and xml projects.
  51. #'
  52. # -----------------------------------------------------------------------------
  53. %prep
  54. %setup -q -n apache-ant-%{version}
  55. # Fix file-not-utf8 rpmlint warning
  56. iconv KEYS -f iso-8859-1 -t utf-8 -o KEYS.utf8
  57. mv KEYS.utf8 KEYS
  58. iconv LICENSE -f iso-8859-1 -t utf-8 -o LICENSE.utf8
  59. mv LICENSE.utf8 LICENSE
  60. # Provides: exclude perl(oata), perl(examples)
  61. cat <<__EOF__ > %{name}-perl.prov
  62. #!/bin/sh
  63. /usr/lib/rpm/perl.prov \$* | grep -v '^perl(oata)$' | grep -v '^perl(examples)$'
  64. __EOF__
  65. %define __perl_provides %{_builddir}/apache-ant-%{version}/%{name}-perl.prov
  66. chmod +x %{__perl_provides}
  67. # Requires: exclude bogus perl(the)
  68. cat <<__EOF__ > %{name}-perl.req
  69. #!/bin/sh
  70. /usr/lib/rpm/perl.req \$* | grep -v '^perl(the)$'
  71. __EOF__
  72. %define __perl_requires %{_builddir}/apache-ant-%{version}/%{name}-perl.req
  73. chmod +x %{__perl_requires}
  74. # -----------------------------------------------------------------------------
  75. %build
  76. # -----------------------------------------------------------------------------
  77. %install
  78. rm -rf $RPM_BUILD_ROOT
  79. # ANT_HOME and subdirs
  80. mkdir -p $RPM_BUILD_ROOT%{ant_home}/{lib,etc}
  81. # jars
  82. install -d -m 755 $RPM_BUILD_ROOT%{_javadir}
  83. install -d -m 755 $RPM_BUILD_ROOT%{_javadir}/%{name}
  84. install -d -m 755 $RPM_BUILD_ROOT%{_datadir}/maven2/poms
  85. pushd lib
  86. for jars in *.jar; do
  87. suffix=`echo $jars | cut -f1 -d.`
  88. case "$suffix" in
  89. ant | ant-launcher)
  90. install -m 644 $jars $RPM_BUILD_ROOT%{_javadir}/$suffix-%{version}.jar
  91. ;;
  92. *)
  93. install -m 644 $jars $RPM_BUILD_ROOT%{_javadir}/%{name}/$suffix-%{version}.jar
  94. ;;
  95. esac
  96. done
  97. for poms in *.pom; do
  98. case "$poms" in
  99. ant.pom | ant-launcher.pom)
  100. install -m 644 $poms $RPM_BUILD_ROOT%{_datadir}/maven2/poms/JPP-$poms
  101. ;;
  102. *)
  103. install -m 644 $poms $RPM_BUILD_ROOT%{_datadir}/maven2/poms/JPP.%{name}-$poms
  104. ;;
  105. esac
  106. done
  107. ln -sf %{name}-apache-bcel.jar $RPM_BUILD_ROOT%{_javadir}/%{name}/%{name}-jakarta-bcel.jar
  108. ln -sf %{name}-apache-log4j.jar $RPM_BUILD_ROOT%{_javadir}/%{name}/%{name}-jakarta-log4j.jar
  109. ln -sf %{name}-apache-oro.jar $RPM_BUILD_ROOT%{_javadir}/%{name}/%{name}-jakarta-oro.jar
  110. ln -sf %{name}-apache-regexp.jar $RPM_BUILD_ROOT%{_javadir}/%{name}/%{name}-jakarta-regexp.jar
  111. popd
  112. # jar aliases
  113. (cd $RPM_BUILD_ROOT%{_javadir} && for jar in *-%{version}.jar; do ln -sf ${jar} `echo $jar| sed "s|-%{version}||g"`; done)
  114. (cd $RPM_BUILD_ROOT%{_javadir}/%{name} && for jar in *-%{version}.jar; do ln -sf ${jar} `echo $jar| sed "s|-%{version}||g"`; done)
  115. # XSLs
  116. cp -p etc/*.xsl $RPM_BUILD_ROOT%{ant_home}/etc
  117. # install everything else
  118. mkdir -p $RPM_BUILD_ROOT%{_bindir}
  119. cp -p bin/ant{,Run} $RPM_BUILD_ROOT%{_bindir}
  120. # default ant.conf
  121. mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}
  122. cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}.conf
  123. # OPT_JAR_LIST fragments
  124. mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/%{name}.d
  125. echo "ant/ant-jmf" > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}.d/jmf
  126. echo "ant/ant-nodeps" > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}.d/nodeps
  127. echo "ant/ant-swing" > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}.d/swing
  128. echo "jaxp_transform_impl ant/ant-trax xalan-j2-serializer" > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}.d/trax
  129. echo "antlr ant/ant-antlr" > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}.d/antlr
  130. echo "bsf ant/ant-apache-bsf" > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}.d/apache-bsf
  131. echo "xml-commons-resolver12 ant/ant-apache-resolver" > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}.d/apache-resolver
  132. echo "jakarta-commons-logging ant/ant-commons-logging" > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}.d/commons-logging
  133. echo "jakarta-commons-net ant/ant-commons-net" > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}.d/commons-net
  134. #echo "jai ant/ant-jai" > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}.d/jai
  135. echo "bcel ant/ant-apache-bcel" > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}.d/apache-bcel
  136. echo "log4j ant/ant-apache-log4j" > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}.d/apache-log4j
  137. echo "oro ant/ant-apache-oro" > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}.d/apache-oro
  138. echo "regexp ant/ant-apache-regexp" > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}.d/apache-regexp
  139. echo "javamail jaf ant/ant-javamail" > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}.d/javamail
  140. echo "jdepend ant/ant-jdepend" > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}.d/jdepend
  141. echo "jsch ant/ant-jsch" > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}.d/jsch
  142. echo "junit ant/ant-junit" > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}.d/junit
  143. # -----------------------------------------------------------------------------
  144. %if %{gcj_support}
  145. rm -rf aot-compile-rpm
  146. %{_bindir}/aot-compile-rpm
  147. %endif
  148. %if %{gcj_support}
  149. %post
  150. if [ -x %{_bindir}/rebuild-gcj-db ]
  151. then
  152. %{_bindir}/rebuild-gcj-db
  153. fi
  154. %postun
  155. if [ -x %{_bindir}/rebuild-gcj-db ]
  156. then
  157. %{_bindir}/rebuild-gcj-db
  158. fi
  159. %endif
  160. %clean
  161. rm -rf $RPM_BUILD_ROOT
  162. # -----------------------------------------------------------------------------
  163. %files
  164. %defattr(0644,root,root,0755)
  165. %license LICENSE
  166. %doc KEYS NOTICE README WHATSNEW
  167. %config(noreplace) %{_sysconfdir}/%{name}.conf
  168. %dir %{_sysconfdir}/%{name}.d
  169. %{_sysconfdir}/%{name}.d/*
  170. %attr(0755,root,root) %{_bindir}/ant
  171. %attr(0755,root,root) %{_bindir}/antRun
  172. %{_javadir}/*.jar
  173. %dir %{_javadir}/%{name}
  174. %{_javadir}/%{name}/*.jar
  175. %dir %{ant_home}
  176. %dir %{ant_home}/etc
  177. %{ant_home}/etc/*.xsl
  178. %{_datadir}/maven2/poms/*
  179. %if %{gcj_support}
  180. %attr(-,root,root) %{_libdir}/gcj/%{name}/*
  181. %endif
  182. # -----------------------------------------------------------------------------
  183. %changelog
  184. * Sat Oct 26 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.9.14-1
  185. - new upstream release.
  186. * Sat Jun 16 2012 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 1.8.4-1
  187. - updated to 1.8.4
  188. * Sat Aug 28 2010 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 1.8.1-1
  189. - Initial build for Vine Linux
  190. - this release is based on binary distribution