spacepaste

  1.  
  2. # Copyright 1999-2012 Gentoo Foundation
  3. # Distributed under the terms of the GNU General Public License v2
  4. EAPI="4"
  5. GCONF_DEBUG="yes"
  6. GNOME2_LA_PUNT="yes"
  7. inherit alternatives eutils gnome2 versionator autotools
  8. MY_MAJORV=$(get_version_component_range 1-2)
  9. DESCRIPTION="Fully featured yet light and fast cross platform word processor"
  10. HOMEPAGE="http://www.abisource.com/"
  11. SRC_URI="http://www.abisource.com/downloads/${PN}/${PV}/source/${P}.tar.gz"
  12. LICENSE="GPL-2"
  13. SLOT="2"
  14. KEYWORDS="amd64 ~arm x86 ~amd64-linux ~x86-linux"
  15. IUSE="collab cups grammar latex math ots +plugins readline spell wordperfect wmf thesaurus" # svg
  16. # You need 'plugins' enabled if want to enable the extra plugins
  17. REQUIRED_USE="!plugins? ( !collab !grammar !latex !math !ots !readline !thesaurus !wordperfect !wmf )"
  18. # libgsf raised to make sure it provides gio backend
  19. # not enabling telepathy backend for collab, it depends on libempathy-gtk which
  20. # has be removed from empathy-2.30 already
  21. RDEPEND="
  22. >=app-text/wv-1.2
  23. >=dev-libs/fribidi-0.10.4
  24. >=dev-libs/glib-2.16:2
  25. >=gnome-base/librsvg-2.16:2
  26. >=gnome-extra/libgsf-1.14.15
  27. >=media-libs/libpng-1.2
  28. virtual/jpeg
  29. >=x11-libs/cairo-1.8[X]
  30. >=x11-libs/gtk+-2.14:2[cups?]
  31. plugins? (
  32. collab? (
  33. >=dev-libs/boost-1.33.1
  34. >=dev-libs/libxml2-2.4
  35. >=net-libs/loudmouth-1
  36. net-libs/libsoup:2.4
  37. net-libs/gnutls )
  38. grammar? ( dev-libs/link-grammar )
  39. latex? ( dev-libs/libxslt )
  40. math? ( >=x11-libs/gtkmathview-0.7.5 )
  41. ots? ( >=app-text/ots-0.5 )
  42. readline? ( sys-libs/readline )
  43. thesaurus? ( >=app-text/aiksaurus-1.2[gtk] )
  44. wordperfect? (
  45. app-text/libwpd:0.9
  46. app-text/libwpg:0.2 )
  47. wmf? ( >=media-libs/libwmf-0.2.8 )
  48. )
  49. spell? ( >=app-text/enchant-1.2 )
  50. !<app-office/abiword-plugins-2.8"
  51. # svg? ( >=gnome-base/librsvg-2 )
  52. DEPEND="${RDEPEND}
  53. virtual/pkgconfig
  54. collab? ( dev-cpp/asio )"
  55. pkg_setup() {
  56. echo "CFLAGS = "${CFLAGS}
  57. echo "CPPFLAGS = "${CPPFLAGS}
  58. # do not enable gnome-vfs
  59. G2CONF="${G2CONF}
  60. --enable-shave
  61. --disable-static
  62. --disable-default-plugins
  63. --disable-builtin-plugins
  64. --disable-collab-backend-telepathy
  65. --enable-clipart
  66. --enable-statusbar
  67. --enable-templates
  68. --with-gio
  69. --without-gnomevfs
  70. $(use_enable cups print)
  71. $(use_enable collab collab-backend-xmpp)
  72. $(use_enable collab collab-backend-tcp)
  73. $(use_enable collab collab-backend-service)
  74. $(use_enable spell)"
  75. }
  76. src_prepare() {
  77. epatch "${FILESDIR}"/${P}-libpng15.patch
  78. epatch "${FILESDIR}"/${P}-gcc46.patch
  79. epatch "${FILESDIR}"/${P}-libwpd.patch
  80. epatch "${FILESDIR}"/${P}-glib-2.31.patch
  81. # install icon to pixmaps (bug #220097)
  82. sed 's:$(datadir)/icons:$(datadir)/pixmaps:' \
  83. -i Makefile.am Makefile.in || die "sed 1 failed"
  84. # readme.txt will be installed using dodoc
  85. sed '/readme\.txt\|abw/d' \
  86. -i user/wp/Makefile.am user/wp/Makefile.in || die "sed 2 failed"
  87. eautoreconf
  88. gnome2_src_prepare
  89. }
  90. src_configure() {
  91. local plugins=""
  92. if use plugins; then
  93. # Plugins depending on libgsf
  94. plugins="t602 docbook clarisworks wml kword hancom openwriter pdf
  95. loadbindings mswrite garble pdb applix opendocument sdw xslfo"
  96. # Plugins not depending on anything
  97. plugins="${plugins} gimp bmp freetranslation iscii s5 babelfish opml eml
  98. wikipedia gdict passepartout google presentation urldict hrtext mif"
  99. # inter7eps: eps.h
  100. # libtidy: gsf + tidy.h
  101. # paint: windows only ?
  102. use collab && plugins="${plugins} collab"
  103. use latex && plugins="${plugins} latex"
  104. use math && plugins="${plugins} mathview"
  105. use ots && plugins="${plugins} ots"
  106. # psion: >=psiconv-0.9.4
  107. use readline && plugins="${plugins} command"
  108. # plugin doesn't build
  109. #use svg && plugins="${plugins} rsvg"
  110. use thesaurus && plugins="${plugins} aiksaurus"
  111. use wmf && plugins="${plugins} wmf"
  112. # wordperfect: >=wpd-0.9 >=wpg-0.2
  113. use wordperfect && plugins="${plugins} wpg"
  114. fi
  115. gnome2_src_configure --enable-plugins="$(echo ${plugins})"
  116. }
  117. src_install() {
  118. gnome2_src_install
  119. sed "s:Exec=abiword:Exec=abiword-${MY_MAJORV}:" \
  120. -i "${ED}"/usr/share/applications/abiword.desktop || die "sed 3 failed"
  121. mv "${ED}/usr/bin/abiword" "${ED}/usr/bin/AbiWord-${MY_MAJORV}"
  122. dosym AbiWord-${MY_MAJORV} /usr/bin/abiword-${MY_MAJORV}
  123. dodoc AUTHORS user/wp/readme.txt
  124. }
  125. pkg_postinst() {
  126. gnome2_pkg_postinst
  127. alternatives_auto_makesym "/usr/bin/abiword" "/usr/bin/abiword-[0-9].[0-9]"
  128. }
  129. pkg_postrm() {
  130. gnome2_pkg_postrm
  131. alternatives_auto_makesym "/usr/bin/abiword" "/usr/bin/abiword-[0-9].[0-9]"
  132. }
  133.