Advertisement
Guest User

app-office/libreoffice-voikko-3.2

a guest
Apr 6th, 2011
588
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.71 KB | None | 0 0
  1. # Copyright 1999-2011 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. # $Header: $
  4.  
  5. EAPI=2
  6.  
  7. inherit eutils versionator multilib
  8.  
  9. MY_P="libreoffice-voikko/${P}"
  10. MY_PN="libreoffice-voikko/${PN}"
  11.  
  12. DESCRIPTION="Free Finnish spell checking and hyphenation for LibreOffice"
  13. IUSE=""
  14. HOMEPAGE="http://voikko.sf.net/"
  15. SRC_URI="mirror://sourceforge/voikko/${MY_P}.tar.gz"
  16. LICENSE="GPL-2"
  17. SLOT="0"
  18. KEYWORDS="~amd64 ~x86"
  19.  
  20. DEPEND=">=app-office/libreoffice-3.3.2[odk]
  21. >=app-text/voikko-3.0
  22. sys-apps/grep
  23. sys-apps/sed
  24. sys-apps/sysvinit
  25. !app-office/oo2-voikko"
  26. RDEPEND=">=app-office/libreoffice-3.3.2
  27. app-text/voikko"
  28.  
  29. S="${WORKDIR}/${P}"
  30.  
  31. pkg_setup() {
  32. if pidof soffice.bin >/dev/null; then
  33. ewarn "${PN} may not be installed while LibreOffice is running."
  34. fi
  35. einfo "Setting SDK environment from "
  36. einfo " ${ROOT}/usr/lib/libreoffice/basis-link/sdk/setsdkenv_unix.sh"
  37. source "${ROOT}"/usr/lib/libreoffice/basis-link/sdk/setsdkenv_unix.sh
  38. export UNOPKG="${ROOT}"/usr/bin/unopkg
  39. }
  40.  
  41. src_compile() {
  42. cd ${S}
  43. emake oxt || die "make failed"
  44. }
  45.  
  46. src_install() {
  47. dodoc README ChangeLog || die "docs missing"
  48. emake DESTDIR="${D}/usr/$(get_libdir)/${P}" install-unpacked
  49. insinto /usr/$(get_libdir)/libreoffice/share/extension/install/
  50. doins build/voikko.oxt
  51. }
  52.  
  53. # FIXME: installation of an unopkg is troublesome, move to src_install when
  54. # OO.o supports it somehow sanely
  55. pkg_postinst() {
  56. # N.B.: uno packages meddle with $HOME, let’s fool it
  57. HOME="${S}"
  58. cd "${S}"
  59.  
  60. # select component
  61. COMPONENT="${ROOT}/usr/$(get_libdir)/libreoffice/share/extension/install/voikko.oxt"
  62.  
  63. einfo "Trying to register ${COMPONENT}..."
  64. HOME=${HOME} "${UNOPKG}" add --shared "${COMPONENT}"
  65. if [[ $? == 0 ]] ;
  66. then
  67. einfo "${PN} package registered succesfully"
  68. else
  69. eerror "Couldn’t register ${PN} package "
  70. fi
  71. elog "Please note that ${PN} is very dependent on ABI compatible "
  72. elog "version of LibreOffice to exist on system when removing ${PN}!"
  73. elog "Before any incompatible update or removal of LibreOffice you must"
  74. elog "unmerge ${PN}!"
  75. }
  76.  
  77. pkg_prerm() {
  78. #unregister()
  79. UNOPKG_LIST="$(${UNOPKG} list --shared 2> /dev/null)"
  80. if [[ $? != 0 ]] ; then
  81. ewarn "Couldn’t list existing packages..."
  82. fi
  83. PKG="org.puimula.ooovoikko"
  84. echo ${UNOPKG_LIST} | grep ${PKG} &>/dev/null
  85. if [ $? = 0 ]; then
  86. einfo "Removing uno package ${PKG}..."
  87. if "${UNOPKG}" remove --shared ${PKG} &>/dev/null
  88. then
  89. einfo "${PN} package (${PKG}) unregistered succesfully"
  90. else
  91. die "Couldn’t uninstall existing ${PN} packages"
  92. fi
  93. else
  94. ewarn "Couldn’t find existing ${PN} packages."
  95. ewarn "You may need to \`unopkg remove\` them manually."
  96. fi
  97. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement