jedit-5.2.0-r1.ebuild 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. JAVA_PKG_IUSE="doc test"
  5. inherit java-pkg-2 java-ant-2 eutils fdo-mime
  6. DESCRIPTION="Programmer's editor written in Java"
  7. HOMEPAGE="http://www.jedit.org"
  8. SRC_URI="mirror://sourceforge/${PN}/${PN}${PV}source.tar.bz2"
  9. LICENSE="BSD GPL-2"
  10. KEYWORDS="amd64 ppc64 x86"
  11. SLOT="0"
  12. IUSE=""
  13. CDEPEND="
  14. dev-java/bsh:0
  15. dev-java/jsr305:0
  16. dev-java/ant-contrib:0
  17. dev-java/ant-apache-bsf:0"
  18. RDEPEND="
  19. ${CDEPEND}
  20. >=virtual/jre-1.7"
  21. DEPEND="
  22. ${CDEPEND}
  23. >=virtual/jdk-1.7"
  24. S="${WORKDIR}/jEdit"
  25. JEDIT_HOME="/usr/share/${PN}"
  26. java_prepare() {
  27. mkdir -p lib/{ant-contrib,compile,default-plugins,scripting} || die
  28. epatch "${FILESDIR}"/${P}-build-xml.patch
  29. java-ant_xml-rewrite -f "${S}/build.xml" -c \
  30. -e javadoc \
  31. -a failonerror \
  32. -v no || die
  33. }
  34. JAVA_ANT_REWRITE_CLASSPATH="true"
  35. EANT_ANT_TASKS="ant-apache-bsf ant-contrib bsh"
  36. EANT_GENTOO_CLASSPATH="jsr305"
  37. EANT_EXTRA_ARGS="-Divy.jar.present=true -Divy.done=true"
  38. EANT_BUILD_TARGET="build"
  39. # TODO could build more docs, ie generate-doc-faq generate-doc-news
  40. # generate-doc-users-guide ua.
  41. EANT_DOC_TARGET="generate-javadoc"
  42. # in fact needed only for docs, but shouldn't hurt
  43. EANT_NEEDS_TOOLS="true"
  44. src_test() {
  45. java-pkg-2_src_test
  46. }
  47. src_install () {
  48. dodir ${JEDIT_HOME}
  49. cp -R build/${PN}.jar jars doc keymaps macros modes properties startup \
  50. "${D}${JEDIT_HOME}" || die
  51. java-pkg_regjar "${JEDIT_HOME}/${PN}.jar"
  52. java-pkg_dolauncher "${PN}" --main org.gjt.sp.jedit.jEdit
  53. use doc && java-pkg_dojavadoc build/classes/javadoc/api
  54. make_desktop_entry ${PN} \
  55. jEdit \
  56. ${JEDIT_HOME}/doc/${PN}.png \
  57. "Development;Utility;TextEditor"
  58. # keep the plugin directory
  59. keepdir ${JEDIT_HOME}/jars
  60. }
  61. pkg_postinst() {
  62. fdo-mime_desktop_database_update
  63. elog "The system directory for jEdit plugins is"
  64. elog "${JEDIT_HOME}/jars"
  65. elog "If you get plugin related errors on startup, first try updating them."
  66. }
  67. pkg_postrm() {
  68. if [[ -z ${REPLACED_BY_VERSION} ]]; then
  69. fdo-mime_desktop_database_update
  70. elog "jEdit plugins installed into /usr/share/jedit/jars"
  71. elog "(after installation of jEdit itself) haven't been"
  72. elog "removed. To get rid of jEdit completely, you may"
  73. elog "want to run"
  74. elog ""
  75. elog " rm -r ${JEDIT_HOME}"
  76. fi
  77. }