sqldeveloper-4.1.5.21.78.ebuild 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit eutils java-pkg-2
  5. DESCRIPTION="Oracle SQL Developer is a graphical tool for database development"
  6. HOMEPAGE="http://www.oracle.com/technetwork/developer-tools/sql-developer/overview/index.html"
  7. SRC_URI="${P}-no-jre.zip"
  8. RESTRICT="fetch"
  9. LICENSE="OTN"
  10. SLOT="0"
  11. KEYWORDS="~amd64 ~x86"
  12. IUSE="mssql mysql sybase"
  13. DEPEND="mssql? ( dev-java/jtds:1.3 )
  14. mysql? ( dev-java/jdbc-mysql:0 )
  15. sybase? ( dev-java/jtds:1.3 )"
  16. RDEPEND=">=virtual/jdk-1.8
  17. ${DEPEND}"
  18. S="${WORKDIR}/${PN}"
  19. QA_PREBUILT="
  20. opt/${PN}/netbeans/platform/modules/lib/amd64/linux/*.so
  21. opt/${PN}/netbeans/platform/modules/lib/i386/linux/*.so
  22. "
  23. pkg_nofetch() {
  24. eerror "Please go to"
  25. eerror " ${HOMEPAGE}"
  26. eerror "and download"
  27. eerror " Oracle SQL Developer for other platforms"
  28. eerror " ${SRC_URI}"
  29. eerror "and move it to ${DISTDIR}"
  30. }
  31. src_prepare() {
  32. # we don't need these, do we?
  33. find ./ \( -iname "*.exe" -or -iname "*.dll" -or -iname "*.bat" \) -exec rm {} +
  34. # they both use jtds, enabling one of them also enables the other one
  35. if use mssql && ! use sybase; then
  36. einfo "You requested MSSQL support, this also enables Sybase support."
  37. fi
  38. if use sybase && ! use mssql; then
  39. einfo "You requested Sybase support, this also enables MSSQL support."
  40. fi
  41. if use mssql || use sybase; then
  42. echo "AddJavaLibFile $(java-pkg_getjars jtds-1.3)" >> sqldeveloper/bin/sqldeveloper.conf || die
  43. fi
  44. if use mysql; then
  45. echo "AddJavaLibFile $(java-pkg_getjars jdbc-mysql)" >> sqldeveloper/bin/sqldeveloper.conf || die
  46. fi
  47. }
  48. src_install() {
  49. dodir /opt/${PN}
  50. # NOTE For future version to get that line (what to copy) go to the unpacked sources dir
  51. # using `bash` and press Meta+_ (i.e. Meta+Shift+-) -- that is a builtin bash feature ;-)
  52. cp -r {configuration,d{ataminer,ropins,vt},e{quinox,xternal},ide,j{avavm,d{bc,ev},lib,views},modules,netbeans,ords,rdbms,s{leepycat,ql{developer,j},vnkit}} \
  53. "${D}"/opt/${PN}/ || die "Install failed"
  54. newbin "${FILESDIR}"/${PN}-r1 ${PN}
  55. newicon icon.png ${PN}-32x32.png
  56. make_desktop_entry ${PN} "Oracle SQL Developer" ${PN}-32x32
  57. # This is normally called automatically by java-pkg_dojar, which
  58. # hasn't been used above. We need to create package.env to help the
  59. # launcher select the correct VM.
  60. java-pkg_do_write_
  61. }
  62. pkg_postinst() {
  63. # this temporary fixes FileNotFoundException with datamodeler
  64. # this is more like a workaround than permanent fix
  65. mkdir -p /opt/sqldeveloper/sqldeveloper/extensions/oracle.datamodeler/log || die
  66. touch /opt/sqldeveloper/sqldeveloper/extensions/oracle.datamodeler/log/datamodeler.log || die
  67. chmod -R 1777 /opt/sqldeveloper/sqldeveloper/extensions/oracle.datamodeler/log/datamodeler.log || die
  68. # this fixes another datamodeler FileNotFoundException
  69. # also more like a workaround than permanent fix
  70. chmod 1777 /opt/sqldeveloper/sqldeveloper/extensions/oracle.datamodeler/types/dr_custom_scripts.xml || die
  71. echo
  72. einfo "If you want to use the TNS connection type you need to set up the"
  73. einfo "TNS_ADMIN environment variable to point to the directory your"
  74. einfo "tnsnames.ora resides in."
  75. echo
  76. }