app-office/libreoffice-voikko: new package
authorJoonas Niilola <juippis@gentoo.org>
Sun, 8 Sep 2019 06:54:58 +0000 (09:54 +0300)
committerJoonas Niilola <juippis@gentoo.org>
Sun, 8 Sep 2019 06:54:58 +0000 (09:54 +0300)
- Free Finnish spell checking and hyphenation for LibreOffice

Package-Manager: Portage-2.3.75, Repoman-2.3.17
Signed-off-by: Joonas Niilola <juippis@gentoo.org>
app-office/libreoffice-voikko/Manifest [new file with mode: 0644]
app-office/libreoffice-voikko/libreoffice-voikko-5.0.ebuild [new file with mode: 0644]
app-office/libreoffice-voikko/metadata.xml [new file with mode: 0644]

diff --git a/app-office/libreoffice-voikko/Manifest b/app-office/libreoffice-voikko/Manifest
new file mode 100644 (file)
index 0000000..aeec9c2
--- /dev/null
@@ -0,0 +1 @@
+DIST libreoffice-voikko-5.0.tar.gz 51882 BLAKE2B c4d33f469821b3d3ee15f71c21a2e3fd5474939dda204873e85d9e52aee0d1cd9c01f660d63fdbef87786dbb0b8a88ba4fd45b8aff07b0b35588c9933d4c9cef SHA512 58f139c190acf5c56a8506365c296d06efd95b4422bb66c50e8058231bd10410b202d2a01ad0a2bf82dc0f41565c1e3a07ed86a4ae070d32af8cfd0e56d7eec0
diff --git a/app-office/libreoffice-voikko/libreoffice-voikko-5.0.ebuild b/app-office/libreoffice-voikko/libreoffice-voikko-5.0.ebuild
new file mode 100644 (file)
index 0000000..407d340
--- /dev/null
@@ -0,0 +1,56 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+DESCRIPTION="Free Finnish spell checking and hyphenation for LibreOffice"
+HOMEPAGE="https://voikko.puimula.org/"
+SRC_URI="https://www.puimula.org/voikko-sources/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+DEPEND="app-office/libreoffice[odk]
+       dev-libs/voikko-fi"
+RDEPEND="${DEPEND}
+       dev-libs/libvoikko"
+
+src_compile() {
+       emake oxt
+}
+
+src_install() {
+       einstalldocs
+
+       emake DESTDIR="${D}/usr/$(get_libdir)/${P}" install-unpacked
+
+       insinto /usr/$(get_libdir)/libreoffice/share/extension/install/
+       doins build/voikko.oxt
+}
+
+pkg_postinst() {
+       # Register voikko with libreoffice
+       COMPONENT="${ROOT}/usr/$(get_libdir)/libreoffice/share/extension/install/voikko.oxt"
+
+       einfo "Trying to register ${COMPONENT} ..."
+       unopkg add --shared "${COMPONENT}"
+       if [[ $? == 0 ]] ; then
+               einfo "${PN} registered succesfully with LibreOffice."
+       else
+               eerror "Couldn’t register ${PN} with LibreOffice."
+       fi
+}
+
+pkg_prerm() {
+       # Remove voikko registration from libreoffice
+       unopkg remove --shared org.puimula.ooovoikko
+       if [[ $? == 0 ]] ; then
+               einfo "${PN} removed succesfully from LibreOffice."
+       else
+               eerror "Couldn't remove ${PN} from LibreOffice, "
+               eerror "manual removal might be needed with "
+               eerror "  unopkg list --shared"
+               eerror "  unopkg remove --shared VOIKKO-IDENTIFIER"
+       fi
+}
diff --git a/app-office/libreoffice-voikko/metadata.xml b/app-office/libreoffice-voikko/metadata.xml
new file mode 100644 (file)
index 0000000..6b0a0fb
--- /dev/null
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+  <maintainer type="person">
+    <email>juippis@gentoo.org</email>
+    <name>Joonas Niilola</name>
+  </maintainer>
+</pkgmetadata>