icm-3.7.3b.ebuild 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. # Copyright 1999-2015 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="5"
  4. inherit eutils unpacker versionator
  5. MY_PV=$(replace_version_separator 2 '-' )
  6. MY_P="$PN-${MY_PV}"
  7. DESCRIPTION="MolSoft LCC ICM Pro"
  8. HOMEPAGE="http://www.molsoft.com/icm_pro.html"
  9. SRC_URI="${MY_P}-linux.sh"
  10. LICENSE="MolSoft"
  11. SLOT="0"
  12. KEYWORDS="~amd64 ~x86"
  13. IUSE="32bit 64bit vim-syntax"
  14. REQUIRED_USE="^^ (
  15. ( !32bit 64bit )
  16. ( 32bit !64bit )
  17. ( 32bit 64bit )
  18. )"
  19. RESTRICT="fetch"
  20. DEPEND="app-arch/unzip
  21. vim-syntax? ( || ( app-editors/vim app-editors/gvim ) )
  22. amd64? (
  23. 64bit? (
  24. =media-libs/tiff-3*
  25. media-libs/libmng
  26. app-crypt/mit-krb5
  27. app-arch/bzip2
  28. media-libs/libpng:1.2
  29. || ( virtual/jpeg:62 media-libs/jpeg:62 )
  30. x11-libs/libdrm
  31. x11-libs/libX11
  32. sys-apps/keyutils
  33. )
  34. 32bit? (
  35. virtual/libstdc++:3.3
  36. >=x11-libs/libX11-1.6.2[abi_x86_32(-)]
  37. )
  38. )
  39. x86? (
  40. =media-libs/tiff-3*
  41. media-libs/libpng:1.2
  42. media-libs/libmng
  43. app-crypt/mit-krb5
  44. app-arch/bzip2
  45. x11-libs/libdrm
  46. x11-libs/libX11
  47. sys-apps/keyutils
  48. )"
  49. RDEPEND="$DEPEND"
  50. S="${WORKDIR}"
  51. pkg_nofetch() {
  52. einfo "Please download ${SRC_URI} from "
  53. einfo "${HOMEPAGE}"
  54. einfo "and move it to ${DISTDIR}"
  55. }
  56. src_unpack() {
  57. unpack_makeself
  58. unpack ./data.tgz
  59. rm ./data.tgz
  60. }
  61. src_install () {
  62. instdir=/opt/icm
  63. dodir "${instdir}"
  64. dodir "${instdir}/licenses"
  65. cp -pPR * "${D}/${instdir}"
  66. rm "${D}/${instdir}/unzip"
  67. doenvd "${FILESDIR}/90icm" || die
  68. if use x86; then
  69. dosym "${instdir}/icm" /opt/bin/icm || die
  70. dosym "${instdir}/icmng" /opt/bin/icmng || die
  71. rm "${D}/${instdir}/icm64" || die
  72. rm "${D}/${instdir}/icmng64" || die
  73. rm "${D}/${instdir}/icmora64" || die
  74. rm "${D}/${instdir}/icmora64.bin" || die
  75. rm -rf "${D}/${instdir}/lib64" || die
  76. elif use amd64; then
  77. if use 32bit; then
  78. dosym "${instdir}/icm" /opt/bin/icm || die
  79. dosym "${instdir}/icmng" /opt/bin/icmng || die
  80. fi
  81. if use 64bit; then
  82. dosym "${instdir}/icm64" /opt/bin/icm64 || die
  83. dosym "${instdir}/icmng64" /opt/bin/icmng64 || die
  84. fi
  85. if ! use 64bit; then
  86. rm "${D}/${instdir}/icm64" || die
  87. rm "${D}/${instdir}/icmng64" || die
  88. rm "${D}/${instdir}/icmora64{,.bin}" || die
  89. rm -rf "${D}/${instdir}/lib64" || die
  90. fi
  91. if ! use 32bit; then
  92. rm "${D}/${instdir}/icm" || die
  93. rm "${D}/${instdir}/icmng" || die
  94. rm "${D}/${instdir}/icmora" || die
  95. rm "${D}/${instdir}/icmora.bin" || die
  96. rm -rf "${D}/${instdir}/lib32" || die
  97. fi
  98. fi
  99. dosym "${instdir}/txdoc" /opt/bin/txdoc || die
  100. dosym "${instdir}/lmhostid" /opt/bin/lmhostid || die
  101. # install vim files
  102. if use vim-syntax ; then
  103. insinto /usr/share/vim/vimfiles/ftdetect
  104. doins "${WORKDIR}/icm.vim"
  105. insinto /usr/share/vim/vimfiles/syntax
  106. doins "${WORKDIR}/icm.vim"
  107. rm "${D}/${instdir}/icm.vim" || die
  108. fi
  109. # make desktop entry
  110. doicon "${FILESDIR}/${PN}.xpm"
  111. if use x86; then
  112. make_desktop_entry "icm -g" "ICM Pro" ${PN} Chemistry
  113. elif use amd64; then
  114. use 32bit && make_desktop_entry "icm -g" "ICM Pro (32bit)" ${PN} Chemistry
  115. use 64bit && make_desktop_entry "icm64 -g" "ICM Pro (64bit)" ${PN} Chemistry
  116. fi
  117. }
  118. pkg_postinst () {
  119. einfo
  120. einfo "Documentation can be found in ${instdir}/man/"
  121. einfo
  122. einfo "You will need to place your license in ${instdir}/licenses/"
  123. einfo
  124. }