# Copyright 1999-2009 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ EAPI="2" inherit alternatives autotools gnome2 versionator MY_MAJORV=$(get_version_component_range 1-2) DESCRIPTION="Fully featured yet light and fast cross platform word processor" HOMEPAGE="http://www.abisource.com/" SRC_URI="http://www.abisource.com/downloads/${PN}/${PV}/source/${P}.tar.gz" LICENSE="GPL-2" SLOT="2" KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86" IUSE="debug +clipart emacs gnome +print +spell +templates tidy vim" RDEPEND="sys-libs/zlib >=dev-libs/glib-2.16 >=x11-libs/gtk+-2.14 >=x11-libs/pango-1.2[X] >=x11-libs/cairo-1.8[X] media-libs/jpeg >=media-libs/libpng-1.2 >=media-libs/fontconfig-2.1 >=app-text/wv-1.2 >=dev-libs/fribidi-0.10.4 dev-libs/expat >=gnome-base/librsvg-2.16 >=gnome-extra/libgsf-1.14.9 spell? ( >=app-text/enchant-1.2 ) tidy? ( app-text/htmltidy ) gnome? ( >=gnome-extra/gucharmap-2 >=x11-libs/goffice-0.6:0.6[gnome] gnome-extra/libgsf[gnome] )" DEPEND="${RDEPEND} >=dev-util/pkgconfig-0.9" pkg_setup() { G2CONF="${G2CONF} $(use_enable debug) $(use_enable clipart) $(use_enable emacs emacs-keybinding) $(use_enable print) $(use_enable spell) --enable-default-plugins # include OpenDocument import/export $(use_enable templates) $(use_enable vim vi-keybindings) --with-gio $(use_with gnome gnomevfs) $(use_with gnome goffice) $(use_with gnome gucharmap) --with-pic $(use_with tidy libtidy)" } src_prepare() { gnome2_src_prepare # install icon to pixmaps (bug #220097) sed 's:icondir= $(datadir)/icons:icondir = $(datadir)/pixmaps:' \ -i Makefile.am || die "sed 1 failed" # readme.txt will be installed using dodoc sed '/readme\.txt\|abw/d' \ -i user/wp/Makefile.am || die "sed 2 failed" # remove macros for compatibility with libtool-1 rm -v libtool.m4 lt* || die "removing libtool macros failed" eautoreconf } src_install() { gnome2_src_install sed "s:Exec=abiword:Exec=abiword-${MY_MAJORV}:" \ -i "${D}"/usr/share/applications/abiword.desktop || die "sed 3 failed" mv "${D}/usr/bin/abiword" "${D}/usr/bin/AbiWord-${MY_MAJORV}" dosym AbiWord-${MY_MAJORV} /usr/bin/abiword-${MY_MAJORV} dodoc AUTHORS user/wp/readme.txt if use clipart || use templates; then if !( -x /usr/share/AbiSuite ); then dodir /usr/share/AbiSuite fi fi if use clipart; then dodir /usr/share/AbiSuite/clipart insinto /usr/share/Abisuit/clipart doins user/wp/clipart/* fi if use templates; then dodir /usr/share/AbiSuite/templates insinto /usr/share/Abisuite/templates doins user/wp/templates/*.awt* fi } pkg_postinst() { gnome2_pkg_postinst alternatives_auto_makesym "/usr/bin/abiword" "/usr/bin/abiword-[0-9].[0-9]" } pkg_postrm() { gnome2_pkg_postrm alternatives_auto_makesym "/usr/bin/abiword" "/usr/bin/abiword-[0-9].[0-9]" }