sqldeveloper-4.0.2.15.21.ebuild 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. # Copyright 1999-2014 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="2"
  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.2 )
  14. mysql? ( dev-java/jdbc-mysql:0 )
  15. sybase? ( dev-java/jtds:1.2 )"
  16. RDEPEND=">=virtual/jdk-1.7.0
  17. dev-java/java-config:2
  18. ${DEPEND}"
  19. S="${WORKDIR}/${PN}"
  20. pkg_nofetch() {
  21. eerror "Please go to"
  22. eerror " ${HOMEPAGE}"
  23. eerror "and download"
  24. eerror " Oracle SQL Developer for other platforms"
  25. eerror " ${SRC_URI}"
  26. eerror "and move it to ${DISTDIR}"
  27. }
  28. src_prepare() {
  29. # we don't need these, do we?
  30. find ./ \( -iname "*.exe" -or -iname "*.dll" -or -iname "*.bat" \) -exec rm {} +
  31. # they both use jtds, enabling one of them also enables the other one
  32. if use mssql && ! use sybase; then
  33. einfo "You requested MSSQL support, this also enables Sybase support."
  34. fi
  35. if use sybase && ! use mssql; then
  36. einfo "You requested Sybase support, this also enables MSSQL support."
  37. fi
  38. if use mssql || use sybase; then
  39. echo "AddJavaLibFile $(java-pkg_getjars jtds-1.2)" >> sqldeveloper/bin/sqldeveloper.conf
  40. fi
  41. if use mysql; then
  42. echo "AddJavaLibFile $(java-pkg_getjars jdbc-mysql)" >> sqldeveloper/bin/sqldeveloper.conf
  43. fi
  44. }
  45. src_install() {
  46. dodir /opt/${PN}
  47. # NOTE For future version to get that line (what to copy) go to the unpacked sources dir
  48. # using `bash` and press Meta+_ (i.e. Meta+Shift+-) -- that is a builtin bash feature ;-)
  49. cp -r {configuration,d{ataminer,ropins,vt},e{quinox,xternal},ide,j{avavm,d{bc,ev},lib,views},modules,netbeans,r{dbms,eadme.html},s{leepycat,ql{cli,developer,j},vnkit}} \
  50. "${D}"/opt/${PN}/ || die "Install failed"
  51. dobin "${FILESDIR}"/${PN} || die "Install failed"
  52. mv icon.png ${PN}-32x32.png || die
  53. doicon ${PN}-32x32.png || die
  54. make_desktop_entry ${PN} "Oracle SQL Developer" ${PN}-32x32 || die
  55. }
  56. pkg_postinst() {
  57. # this temporary fixes FileNotFoundException with datamodeler
  58. # this is more like a workaround than permanent fix
  59. test -d /opt/sqldeveloper/sqldeveloper/extensions/oracle.datamodeler/log \
  60. || mkdir /opt/sqldeveloper/sqldeveloper/extensions/oracle.datamodeler/log
  61. touch /opt/sqldeveloper/sqldeveloper/extensions/oracle.datamodeler/log/datamodeler.log
  62. chmod -R 1777 /opt/sqldeveloper/sqldeveloper/extensions/oracle.datamodeler/log/datamodeler.log
  63. # this fixes another datamodeler FileNotFoundException
  64. # also more like a workaround than permanent fix
  65. chmod 1777 /opt/sqldeveloper/sqldeveloper/extensions/oracle.datamodeler/types/dr_custom_scripts.xml
  66. echo
  67. einfo "If you want to use the TNS connection type you need to set up the"
  68. einfo "TNS_ADMIN environment variable to point to the directory your"
  69. einfo "tnsnames.ora resides in."
  70. echo
  71. }