# $Header: /magellan-cvs/smage/openoffice/openoffice-2.3.1-r1.smage2,v 1.2 2008/02/19 18:48:49 niro Exp $ PNAME="openoffice" PVER="2.3.1" PBUILD="r1" PCATEGORIE="app-office" STATE="unstable" DESCRIPTION="OpenOffice ${PVER}." HOMEPAGE="http://www.openoffice.org/" DEPEND=">= virtual/glibc >= dev-lang/perl-5 >= x11-libs/libXaw-1 >= app-arch/zip-2 >= app-arch/unzip-5 >= virtual/java" SDEPEND=">= sys-apps/findutils-4.1 >= sys-apps/sed-4 >= app-arch/rpm2targz-9.0" # must be /opt/openoffice-${PVER} OO_HOME="/opt/openoffice-${PVER}" # svn revision (used in SRC_DIR name) OO_SVNBUILD="9238" # build id of the core rpms OO_BUILD="${OO_SVNBUILD}.i586" # build id of the freedesktop-menus rpm (may differ with the other rpms) OO_MENU_BUILD="${OO_SVNBUILD}.noarch" # revision codename of OOo OO_REVISION="OOG680_m9" # version of our OOo wrapper OO_WRAPPER_VER="2.2-1" # provide OO_HOME in the mage-file for use in postinstall() SPECIAL_VARS="OO_HOME" SRCFILE="OOo_${PVER}_LinuxIntel_install_en-US.tar.gz" SRCDIR="${BUILDDIR}/${OO_REVISION}_native_packed-1_en-US.${OO_SVNBUILD}/RPMS" sminclude mtools xdg SRC_URI=( ftp://ftp.tu-chemnitz.de/pub/openoffice/stable/${PVER}/${SRCFILE} mirror://${PNAME}/${SRCFILE} mirror://${PNAME}/ooffice-wrapper-${OO_WRAPPER_VER} ) src_prepare() { munpack ${SRCFILE} || die cd ${SRCDIR} # unpack the real bin-files for i in base \ calc \ core{0{1,2,3{,u},4{,u},5{,u},6,7,8,9},10} \ draw \ emailmerge \ graphicfilter \ impress \ math \ pyuno \ testtool \ writer \ xsltfilter do rpm2targz openoffice.org-${i}-${PVER}-${OO_BUILD}.rpm || die "rpm ${i}" tar xvzf openoffice.org-${i}-${PVER}-${OO_BUILD}.tar.gz || die "tar ${i}" done # generic desktop menus rpm2targz desktop-integration/openoffice.org-freedesktop-menus-${PVER:0:3}-${OO_MENU_BUILD}.rpm || die tar xvzf openoffice.org-freedesktop-menus-${PVER:0:3}-${OO_MENU_BUILD}.tar.gz || die # kde integration rpm2targz openoffice.org-kde-integration-${PVER}-${OO_BUILD}.rpm || die tar xvzf openoffice.org-kde-integration-${PVER}-${OO_BUILD}.tar.gz || die # gnome intration rpm2targz openoffice.org-gnome-integration-${PVER}-${OO_BUILD}.rpm || die tar xvzf openoffice.org-gnome-integration-${PVER}-${OO_BUILD}.tar.gz || die # java support rpm2targz openoffice.org-javafilter-${PVER}-${OO_BUILD}.rpm || die tar xvzf openoffice.org-javafilter-${PVER}-${OO_BUILD}.tar.gz || die # get rid of all rpms and tar.gzs rm ${SRCDIR}/*.rpm || die rm ${SRCDIR}/*.tar.gz || die } src_install () { cd ${SRCDIR} # needed directories minstalldir ${OO_HOME} || die minstalldir /usr/bin || die minstalldir /usr/share/applications || die minstalldir /usr/share/icons || die minstalldir /usr/share/mime || die minstalldir /usr/share/mimelnk/application || die # install binaries mv ${SRCDIR}/opt/openoffice.org${PVER:0:3}/* ${BINDIR}${OO_HOME} || die mv ${SRCDIR}/usr/share/icons/* ${BINDIR}/usr/share/icons || die # menu entries cd ${BINDIR}${OO_HOME}/share/xdg/ # fix and install all desktop icons local i for i in base calc draw impress math writer printeradmin do sed -i "s:openoffice.org${PVER:0:3}:ooffice:g" ${i}.desktop || die # but the printeradmin is a special case [[ ${i} = printeradmin ]] && { sed -i "s:^\(Exec=\).*:\1oopadmin:" ${i}.desktop || die; } mv ${i}.desktop openoffice.org-${PVER:0:3}-${i}.desktop || die minstallxdg openoffice.org-${PVER:0:3}-${i}.desktop || die done # install wrapper script minstallexec -s ooffice-wrapper-${OO_WRAPPER_VER} /usr/bin/ooffice || die sed -i "s::${PVER}:g" ${BINDIR}/usr/bin/ooffice || die # create component symlinks for app in calc draw impress math writer web padmin do mlink ooffice /usr/bin/oo${app} || die done } # >= kernel-2.6.11-r1 segfaults # http://linux.derkeiler.com/Mailing-Lists/Kernel/2005-01/8751.html postinstall() { echo echo -en ${COLRED} echo "OpenOffice.org may segfault on systems running kernel-2.6.11-r1 and higher." echo -en ${COLDEFAULT} echo echo "OOo needs write access to the dri interface or it will segfault." echo "See 'http://linux.derkeiler.com/Mailing-Lists/Kernel/2005-01/8751.html'" echo "for more information about this issue" echo echo "Adding your user to the 'video' group will solve this issue." echo echo "To add more fonts to OOo like the Microsoft Corefonts," echo "run '${OO_HOME}/spadmin' and click on fonts to install them." echo "Normally the fonts got installed in the /usr/share/fonts directory on your system." echo # echo "[ Press any key to continue ]" # read }