# copied from oo2-voikko.ebuild in # http://bugs.gentoo.org/attachment.cgi?id=73027 # Original ebuild script wasn’t marked GPL? DESCRIPTION="Voikko—Free Finnish spell checking and hyphenation for OpenOffice" HOMEPAGE="http://www.hunspell-fi.org/" SRC_URI=" x86? ( http://www.hunspell-fi.org/files/${PN}-Linux_x86-${PV}.tar.gz ) amd64? ( http://www.hunspell-fi.org/files/${PN}-Linux_x86_64-${PV}.tar.gz ) " #http://www.hunspell-fi.org/files/${P}.tgz LICENSE="LGPL-2.1" SLOT="0" KEYWORDS="~x86" DEPEND="|| ( >=app-office/openoffice-bin-2.0 >=app-office/openoffice-2.0 ) app-text/voikko" # ! app-office/oo2-soikko # FIXME: if use amd64; then S="${WORKDIR}/${PN}-Linux_x86_64-${PV}" else S="${WORKDIR}/${PN}-Linux_x86-${PV}" fi pkg_setup() { if pidof soffice.bin >/dev/null; then die "Soikko can't be installed while OpenOffice.org is running." # Or use the force #killall soffice.bin || killall -9 soffice.bin fi if use amd64; then S="${WORKDIR}/${PN}-Linux_x86_64-${PV}" else S="${WORKDIR}/${PN}-Linux_x86-${PV}" fi } src_install() { dodoc ASENNUS.txt insinto /usr/lib/openoffice/share/ doins install-oo2-voikko } find_unopkg() { if has_version '>=app-office/openoffice-bin'; then if use amd64 ; then UNOPKG="/usr/lib32/openoffice/program/unopkg" else UNOPKG="/usr/lib/openoffice/program/unopkg" fi else UNOPKG="/usr/lib/openoffice/program/unopkg" #verify! fi } pkg_postinst() { find_unopkg # select component if use amd64; then COMPONENT="${S}/oo2-voikko-Linux_x86_64-${PV}.uno.pkg" else COMPONENT="${S}/oo2-voikko-Linux_x86-${PV}.uno.pkg" fi PKG=$(basename "${COMPONENT}") # verify binary interface if grep -U -q CXXABI_1.3 "$UNOPKG".bin && echo "$COMPONENT" | grep -q gcc3.3 then die "blah mismatch" fi # use normal binary # register() if $UNOPKG add --shared "${COMPONENT}" &>/dev/null; then einfo "Voikko package (${PKG}) registered succesfully" else die "Couldn't register Voikko package (${PKG})" fi } pkg_prerm() { find_unopkg #unregister() UNOPKG_LIST="$(${UNOPKG} list --shared 2> /dev/null)" if [[ $? != 0 ]] ; then die "Couldn't list existing packages" fi PKG=$(echo "${UNOPKG_LIST}" | egrep -m1 "^Name: oo2-voikko-Linux_x86(_64)?_-${PV}" | sed -e "s/Name: //") if [ "${PKG}" != "" ]; then if $UNOPKG remove --shared ${PKG} &>/dev/null then einfo "Voikko package (${PKG}) unregistered succesfully" else die "Couldn't uninstall existing Voikko packages" fi fi }