Guest
Public paste!

Ernestas

By: a guest | Oct 27th, 2008 | Syntax: None | Size: 6.79 KB | Hits: 83 | Expires: Never
Copy text to clipboard
  1. # Copyright 1999-2008 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. # $Header: /var/cvsroot/gentoo-x86/app-office/openoffice-bin/openoffice-bin-3.0.0.ebuild,v 1.6 2008/10/21 06:31:16 suka Exp $
  4.  
  5. inherit eutils fdo-mime rpm multilib
  6.  
  7. IUSE="gnome java kde"
  8.  
  9. BUILDID="9358"
  10. BUILDID2="9354"
  11. MY_PV="${PV}rc4"
  12. MY_PV2="${MY_PV}_20080930"
  13. MY_PV3="${PV}-${BUILDID}"
  14. BASIS="ooobasis3.0"
  15. MST="OOO300_m9"
  16.  
  17. if [ "${ARCH}" = "amd64" ] ; then
  18.         OOARCH="x86_64"
  19.         PACKED="${MST}_native_packed-1"
  20.         PACKED2="${MST}_native_packed-1"
  21. else
  22.         OOARCH="i586"
  23.         PACKED="${MST}_native_packed-1"
  24.         PACKED2="${MST}_native_packed-1"
  25. fi
  26.  
  27. S="${WORKDIR}/${PACKED}_en-US.${BUILDID}/RPMS"
  28. DESCRIPTION="OpenOffice productivity suite"
  29.  
  30. SRC_URI="x86? ( mirror://openoffice/stable/${PV}/OOo_${PV}_LinuxIntel_install_en-US.tar.gz )
  31.         amd64? ( mirror://openoffice/stable/${PV}/OOo_${PV}_LinuxX86-64_install_en-US.tar.gz )"
  32.  
  33. LANGS="af ar as_IN be_BY bg br bs ca cs da de dz el en en_GB en_ZA es et fi fr ga gu he hi_IN hr hu it ja ka km ko lt mk ml_IN mr_IN nb ne nl nn nr ns or_IN pa_IN pl pt pt_BR rw sh sk sl sr ss st sv sw_TZ ta te_IN tg th ti_ER tr ts uk ur_IN ve vi xh zh_CN zh_TW zu"
  34.  
  35. for X in ${LANGS} ; do
  36.         [[ ${X} != "en" ]] && SRC_URI="${SRC_URI} linguas_${X}? (
  37.                 x86? ( mirror://openoffice-extended/${MY_PV}/OOo_${MY_PV2}_LinuxIntel_langpack_${X/_/-}.tar.gz )
  38.                 amd64? ( mirror://openoffice-extended/${MY_PV}/OOo_${MY_PV2}_LinuxX86-64_langpack_${X/_/-}.tar.gz ) )"
  39.         IUSE="${IUSE} linguas_${X}"
  40. done
  41.  
  42. HOMEPAGE="http://www.openoffice.org/"
  43.  
  44. LICENSE="LGPL-2"
  45. SLOT="0"
  46. KEYWORDS="amd64 x86"
  47.  
  48. RDEPEND="!app-office/openoffice
  49.         x11-libs/libXaw
  50.         sys-libs/glibc
  51.         >=dev-lang/perl-5.0
  52.         app-arch/zip
  53.         app-arch/unzip
  54.         >=media-libs/freetype-2.1.10-r2
  55.         java? ( >=virtual/jre-1.5 )
  56.         linguas_ja? ( >=media-fonts/kochi-substitute-20030809-r3 )
  57.         linguas_zh_CN? ( >=media-fonts/arphicfonts-0.1-r2 )
  58.         linguas_zh_TW? ( >=media-fonts/arphicfonts-0.1-r2 )"
  59.  
  60. DEPEND="${RDEPEND}
  61.         sys-apps/findutils"
  62.  
  63. PROVIDE="virtual/ooo"
  64. RESTRICT="strip"
  65.  
  66. QA_EXECSTACK="usr/$(get_libdir)/openoffice/basis3.0/program/*"
  67. QA_TEXTRELS="usr/$(get_libdir)/openoffice/basis3.0/program/libvclplug_genli.so \
  68.         usr/$(get_libdir)/openoffice/basis3.0/program/python-core-2.3.4/lib/lib-dynload/_curses_panel.so \
  69.         usr/$(get_libdir)/openoffice/basis3.0/program/python-core-2.3.4/lib/lib-dynload/_curses.so \
  70.         usr/$(get_libdir)/openoffice/ure/lib/*"
  71.  
  72. src_unpack() {
  73.  
  74.         unpack ${A}
  75.  
  76.         for i in base binfilter calc core01 core02 core03 core04 core05 core06 core07 draw graphicfilter images impress math ooofonts ooolinguistic pyuno testtool writer xsltfilter ; do
  77.                 rpm_unpack "${S}/${BASIS}-${i}-${MY_PV3}.${OOARCH}.rpm"
  78.         done
  79.  
  80.         for j in base calc draw impress math writer; do
  81.                 rpm_unpack "${S}/openoffice.org3-${j}-${MY_PV3}.${OOARCH}.rpm"
  82.         done
  83.  
  84.         rpm_unpack "${S}/openoffice.org3-${MY_PV3}.${OOARCH}.rpm"
  85.         rpm_unpack "${S}/openoffice.org-ure-1.4.0-${BUILDID}.${OOARCH}.rpm"
  86.  
  87.         rpm_unpack "${S}/desktop-integration/openoffice.org3.0-freedesktop-menus-3.0-${BUILDID2}.noarch.rpm"
  88.  
  89.         use gnome && rpm_unpack "${S}/${BASIS}-gnome-integration-${MY_PV3}.${OOARCH}.rpm"
  90.         use kde && rpm_unpack "${S}/${BASIS}-kde-integration-${MY_PV3}.${OOARCH}.rpm"
  91.         use java && rpm_unpack "${S}/${BASIS}-javafilter-${MY_PV3}.${OOARCH}.rpm"
  92.  
  93.         strip-linguas ${LANGS}
  94.  
  95.         if [[ -z "${LINGUAS}" ]]; then
  96.                 export LINGUAS="en"
  97.         fi
  98.  
  99.         for k in ${LINGUAS}; do
  100.                 i="${k/_/-}"
  101.                 if [[ ${i} = "en" ]] ; then
  102.                         i="en-US"
  103.                         LANGDIR="${WORKDIR}/${PACKED}_${i}.${BUILDID}/RPMS/"
  104.                 else
  105.                         LANGDIR="${WORKDIR}/${PACKED2}_${i}.${BUILDID}/RPMS/"
  106.                 fi
  107.                 rpm_unpack ${LANGDIR}/${BASIS}-${i}-${MY_PV3}.${OOARCH}.rpm
  108.                 rpm_unpack ${LANGDIR}/openoffice.org3-${i}-${MY_PV3}.${OOARCH}.rpm
  109.                 for j in base binfilter calc draw help impress math res writer; do
  110.                         rpm_unpack ${LANGDIR}/${BASIS}-${i}-${j}-${MY_PV3}.${OOARCH}.rpm
  111.                 done
  112.         done
  113.  
  114.         # Unpack provided dictionaries, unless there is a better solution...
  115.         rpm_unpack "${S}/openoffice.org3-dict-en-${MY_PV3}.${OOARCH}.rpm"
  116.         rpm_unpack "${S}/openoffice.org3-dict-es-${MY_PV3}.${OOARCH}.rpm"
  117.         rpm_unpack "${S}/openoffice.org3-dict-fr-${MY_PV3}.${OOARCH}.rpm"
  118.  
  119. }
  120.  
  121. src_install () {
  122.  
  123.         INSTDIR="/usr/$(get_libdir)/openoffice"
  124.  
  125.         einfo "Installing OpenOffice.org into build root..."
  126.         dodir ${INSTDIR}
  127.         mv "${WORKDIR}"/opt/openoffice.org/* "${D}${INSTDIR}" || die
  128.         mv "${WORKDIR}"/opt/openoffice.org3/* "${D}${INSTDIR}" || die
  129.  
  130.         #Menu entries, icons and mime-types
  131.         cd "${D}${INSTDIR}/share/xdg/"
  132.  
  133.         for desk in base calc draw impress math printeradmin qstart writer; do
  134.                 mv ${desk}.desktop openoffice.org-${desk}.desktop
  135.                 sed -i -e s/openoffice.org3/ooffice/g openoffice.org-${desk}.desktop || die
  136.                 sed -i -e s/openofficeorg3-${desk}/ooo-${desk}/g openoffice.org-${desk}.desktop || die
  137.                 domenu openoffice.org-${desk}.desktop
  138.                 insinto /usr/share/pixmaps
  139.                 if [ "${desk}" != "qstart" ] ; then
  140.                         newins "${WORKDIR}/usr/share/icons/gnome/48x48/apps/openofficeorg3-${desk}.png" ooo-${desk}.png
  141.                 fi
  142.         done
  143.  
  144.         # Install wrapper script
  145.         newbin "${FILESDIR}/wrapper.in" ooffice
  146.         sed -i -e s/LIBDIR/$(get_libdir)/g "${D}/usr/bin/ooffice" || die
  147.  
  148.         # Component symlinks
  149.         for app in base calc draw impress math writer; do
  150.                 dosym ${INSTDIR}/program/s${app} /usr/bin/oo${app}
  151.         done
  152.  
  153.         dosym ${INSTDIR}/program/spadmin /usr/bin/ooffice-printeradmin
  154.         dosym ${INSTDIR}/program/soffice /usr/bin/soffice
  155.  
  156.         rm -f ${INSTDIR}/basis-link || die
  157.         dosym ${INSTDIR}/basis3.0 ${INSTDIR}/basis-link
  158.  
  159.         # Change user install dir
  160.         sed -i -e "s/.openoffice.org\/3/.ooo3/g" "${D}${INSTDIR}/program/bootstraprc" || die
  161.  
  162.         # Non-java weirdness see bug #99366
  163.         use !java && rm -f "${D}${INSTDIR}/ure/bin/javaldx"
  164.  
  165.         # prevent revdep-rebuild from attempting to rebuild all the time
  166.         insinto /etc/revdep-rebuild && doins "${FILESDIR}/50-openoffice-bin"
  167.  
  168. }
  169.  
  170. pkg_postinst() {
  171.  
  172.         fdo-mime_desktop_database_update
  173.         fdo-mime_mime_database_update
  174.  
  175.         [[ -x /sbin/chpax ]] && [[ -e /usr/$(get_libdir)/openoffice/program/soffice.bin ]] && chpax -zm /usr/$(get_libdir)/openoffice/program/soffice.bin
  176.  
  177.         elog " openoffice-bin does not provide integration with system spell "
  178.         elog " dictionaries. Please install them manually through the Extensions "
  179.         elog " Manager (Tools > Extensions Manager) or use the source based "
  180.         elog " package instead. "
  181.         elog
  182.         elog " Dictionaries for english, french and spanish are provided in "
  183.         elog " /usr/$(get_libdir)/openoffice/share/extension/install "
  184.         elog " Other dictionaries can be found at Suns extension site. "
  185.         elog
  186.  
  187.         ewarn " Please note that this release of OpenOffice.org uses a "
  188.         ewarn " new user install dir. As a result you will have to redo "
  189.         ewarn " your settings. Alternatively you might copy the old one "
  190.         ewarn " over from ~/.ooo-2.0 to ~/.ooo3, but be warned that this "
  191.         ewarn " might break stuff. "
  192.         ewarn
  193.  
  194. }