alpha-quadrant/app-office/staroffice/staroffice-8.0.0.ebuild

133 lines
3.6 KiB
Bash
Raw Normal View History

2006-04-05 12:25:29 +02:00
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
inherit eutils fdo-mime rpm multilib
IUSE="gnome kde"
MY_P="so-8-ga-bin-linux-en-US"
MY_PV="${PV}-124"
S="${WORKDIR}/RPMS"
DESCRIPTION="StarOffice productivity suite"
#LANGS="de es fr it pt_BR sv ja ko zh_CN zh_TW"
#LANGS="de"
# Make sure LINGUAS only has allowed languages
strip-linguas "${LANGS}"
# If LINGUAS then we loop round till we get it. If more than one
# language the last one looped is installed. Else just install US/English
# version
if [ -n "${LINGUAS}" ]; then
for X in ${LANGS}; do
SRC_URI="${SRC_URI} linguas_${X}? ( ${MY_P}_${X/_/-}.sh )"
done
else
SRC_URI="${MY_P}.sh"
fi
HOMEPAGE="http://www.sun.com/software/star/staroffice/index.jsp"
LICENSE="sdlc"
SLOT="0"
KEYWORDS="~x86 ~amd64"
RDEPEND="virtual/x11
virtual/libc
>=dev-lang/perl-5.0
app-arch/zip
app-arch/unzip
java? ( >=virtual/jre-1.4.1 )
amd64? ( >=app-emulation/emul-linux-x86-xlibs-1.0 )
linguas_ja? ( >=media-fonts/kochi-substitute-20030809-r3 )
linguas_zh_CN? ( >=media-fonts/arphicfonts-0.1-r2 )
linguas_zh_TW? ( >=media-fonts/arphicfonts-0.1-r2 )"
DEPEND="${RDEPEND}
sys-apps/findutils"
pkg_nofetch() {
einfo "Please download the appropriate StarOffice archive ( ${SRC_URI} )"
einfo "from ${HOMEPAGE} (requires a Sun registration)"
einfo
einfo "Then put the file in ${DISTDIR}"
einfo
einfo "If a language other than English is needed please set LINGUAS"
einfo " and choose a language."
einfo "Available languages are: ${LANGS}"
}
src_unpack() {
cd ${WORKDIR}
for X in ${A}; do
( tail -n+79 "${DISTDIR}/${X}" | tar xf - ) || die
done
for i in agfafonts base calc core01 core02 core03 core03u core04 core04u core05 core05u core06 core07 core08 core09 core10 draw fonts gallery graphicfilter impress javafilter lngutils math ooofonts writer xsltfilter ; do
rpm_unpack ${S}/staroffice-${i}-${MY_PV}.i586.rpm || die
done
rpm_unpack ${S}/adabas-13.01.00-1.i586.rpm || die
rpm_unpack ${S}/staroffice-desktop-integration-${MY_PV}.noarch.rpm || die
strip-linguas ${LANGS}
for i in ${LINGUAS}; do
i="${i/_/-}"
rpm_unpack ${S}/staroffice-${i}-${MY_PV}.i586.rpm || die
rpm_unpack ${S}/staroffice-${i}-help-${MY_PV}.i586.rpm || die
rpm_unpack ${S}/staroffice-${i}-res-${MY_PV}.i586.rpm || die
done
}
src_install () {
einfo "Installing StarOffice into build root..."
# Remove invalid symlink to /etc/staroffice
rm ${WORKDIR}/usr/bin/*
# Setup directories
dodir "/opt/staroffice8"
dodir "/usr/bin"
dodir "/usr/share/icons"
dodir "/usr/share/mime"
dodir "/usr/share/mime-info"
# Create new one to /opt/staroffice8/program
dosym /opt/staroffice8/program/soffice /usr/bin/soffice
# Copy standard stuff
mv ${WORKDIR}/opt/staroffice8/* ${D}/opt/staroffice8
mv ${WORKDIR}/usr/share/icons/* ${D}/usr/share/icons
mv ${WORKDIR}/usr/share/mime/* ${D}/usr/share/mime
mv ${WORKDIR}/usr/share/mime-info/* ${D}/usr/share/mime-info
# Now copy kde/gnome stuff
use kde && dodir /usr/lib/menu && dodir /usr/share/mimelnk && dodir /usr/share/applnk \
&& mv ${WORKDIR}/usr/lib/menu/* ${D}/usr/lib/menu \
&& mv ${WORKDIR}/usr/share/mimelnk/* ${D}/usr/share/mimelnk \
&& mv ${WORKDIR}/usr/share/applnk/* ${D}/usr/share/applnk
use gnome && dodir /usr/share/application-registry && dodir /usr/share/applications \
&& mv ${WORKDIR}/usr/share/application-registry/* ${D}/usr/share/application-registry \
&& mv ${WORKDIR}/usr/share/applications/* ${D}/usr/share/applications
}
pkg_postinst() {
fdo-mime_desktop_database_update
fdo-mime_mime_database_update
einfo " To start StarOffice, run:"
einfo
einfo " $ soffice"
einfo
}