ant-vl.spec 6.9 KB

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