summaryrefslogtreecommitdiff
path: root/editors
diff options
context:
space:
mode:
authorMaho Nakata <maho@FreeBSD.org>2013-08-26 04:19:17 +0000
committerMaho Nakata <maho@FreeBSD.org>2013-08-26 04:19:17 +0000
commit8f7988e67cb52454ef94d4a4882dbfcd352d5926 (patch)
treed25627b68f83d840df02b50cc4a578afa440c2b0 /editors
parent- Update to 2013.08.23. (diff)
Update (branching) Apache OpenOffice port to 4.0.0.
Notes
Notes: svn path=/head/; revision=325370
Diffstat (limited to 'editors')
-rw-r--r--editors/openoffice-4/Makefile352
-rw-r--r--editors/openoffice-4/distinfo6
-rw-r--r--editors/openoffice-4/files/Makefile.knobs28
-rw-r--r--editors/openoffice-4/files/Makefile.localized401
-rw-r--r--editors/openoffice-4/files/Makefile.others69
-rw-r--r--editors/openoffice-4/files/extra-patch-libexttextcat-lingucomponent13
-rw-r--r--editors/openoffice-4/files/generate.pl40
-rw-r--r--editors/openoffice-4/files/ooo.sh43
-rw-r--r--editors/openoffice-4/files/openoffice-wrapper18
-rw-r--r--editors/openoffice-4/files/patch-configmgr19
-rw-r--r--editors/openoffice-4/files/patch-freebsd.mk10
-rw-r--r--editors/openoffice-4/files/patch-i114430112
-rw-r--r--editors/openoffice-4/files/patch-i118574323
-rw-r--r--editors/openoffice-4/files/patch-i12301811
-rw-r--r--editors/openoffice-4/files/patch-sal-inline16
-rw-r--r--editors/openoffice-4/files/patch-unxfbsd.mk28
-rw-r--r--editors/openoffice-4/files/pkg-message.in39
-rw-r--r--editors/openoffice-4/pkg-descr18
-rw-r--r--editors/openoffice-4/pkg-plist1
19 files changed, 1547 insertions, 0 deletions
diff --git a/editors/openoffice-4/Makefile b/editors/openoffice-4/Makefile
new file mode 100644
index 000000000000..1979a302f3ef
--- /dev/null
+++ b/editors/openoffice-4/Makefile
@@ -0,0 +1,352 @@
+# Created by: Martin Blapp
+# $FreeBSD$
+
+PORTNAME= apache-openoffice
+PORTVERSION= 4.0.0
+CATEGORIES= editors java
+MASTER_SITES= ftp://ftp.riken.jp/net/apache/openoffice/${PORTVERSION}/source/ \
+ ${MASTER_SITE_LOCAL:S@%SUBDIR%@maho/openoffice@}:extsrc
+DISTFILES+= ${OOOSRC} unowinreg.dll ${EXTSRC}:extsrc
+EXTRACT_ONLY= ${OOOSRC} ${EXTSRC}
+
+#de facto maintainer is maho@FreeBSD.org
+#Frequent Patch submitters should optionally sign Apache iCLA
+MAINTAINER= office@FreeBSD.org
+COMMENT= Integrated wordprocessor/dbase/spreadsheet/drawing/chart/browser
+
+LICENSE= AL2
+
+NO_LATEST_LINK= yes
+
+USE_GNOME= desktopfileutils gtk20 libxslt libidl glib20
+USE_XORG= x11 ice xaw xau xext xrender xrandr \
+ xi xt xcursor xdamage xcomposite xfixes
+USE_GL= gl glu
+USE_GSTREAMER= yes
+#USE_GCC= 4.6+
+USE_GMAKE= yes
+USE_PYTHON= yes
+USE_PERL5_BUILD= yes
+USE_BZIP2= yes
+USES+= bison perl5
+USE_PERL5= build
+WITHOUT_CPU_CFLAGS= true
+MAKE_JOBS_SAFE= yes
+
+OPTIONS_DEFINE= GCONF GNOMEVFS
+OPTIONS_DEFAULT=GCONF GNOMEVFS
+GNOMEVFS_DESC= Enable GNOME Virtual File System
+
+.include <bsd.port.pre.mk>
+
+USE_JAVA= yes
+JAVA_BUILD= jdk
+JAVA_VENDOR= openjdk
+JAVA_VERSION= 1.6+
+
+.if !defined(WITHOUT_GCONF)
+USE_GNOME+= gconf2
+.else
+CONFIGURE_ARGS+=--disable-gconf
+.endif
+
+.if !defined(WITHOUT_GNOMEVFS)
+USE_GNOME+= gnomevfs2
+.else
+CONFIGURE_ARGS+=--disable-gnome-vfs
+.endif
+
+.include <${FILESDIR}/Makefile.localized>
+
+ONLY_FOR_ARCHS= i386 amd64
+
+.if ${ARCH} == amd64
+FREEBSD_ENV_SET= FreeBSDAMDEnv.Set.sh
+.else
+FREEBSD_ENV_SET= FreeBSDX86Env.Set.sh
+.endif
+
+OOOSRC= apache-openoffice-${PORTVERSION}-r${SVNREVISION}-src${EXTRACT_SUFX}
+EXTSRC= ApacheOpenOffice.ext_sources.${PORTVERSION}.r${SVNREVISION}${EXTRACT_SUFX}
+OOODIR= openoffice4
+SVNREVISION= 1503704
+INSTALLATION_BASEDIR?= openoffice-${PORTVERSION}
+EXECBASE?= openoffice-${PORTVERSION}
+DIST_SUBDIR= openoffice
+SIMPLEOSVER= ${OSREL:C/\.//g}
+
+PACKAGE_PREFIX= Apache_OpenOffice
+.if ${ARCH} == amd64
+PACKAGE_MIDDLE= ${PORTVERSION}_${OPSYS}_x86-64
+.else
+PACKAGE_MIDDLE= ${PORTVERSION}_${OPSYS}_x86
+.endif
+
+LOCALIZED_LANG?= en-US
+.if defined(LANG_PKGNAME)
+PKGNAMEPREFIX= ${LANG_PKGNAME}-
+.endif
+.if defined(LANG_SUFFIX)
+PKGNAMESUFFIX= -${LANG_SUFFIX}
+.endif
+
+RUN_DEPENDS+= ${LOCALBASE}/share/icons/hicolor/index.theme:${PORTSDIR}/misc/hicolor-icon-theme \
+ ${JAVALIBDIR}/commons-httpclient.jar:${PORTSDIR}/java/jakarta-commons-httpclient \
+ ${JAVALIBDIR}/bsh.jar:${PORTSDIR}/lang/bsh \
+ ${JAVALIBDIR}/saxon9.jar:${PORTSDIR}/textproc/saxon-devel \
+ ${LOCALBASE}/lib/X11/fonts/ChromeOS/Arimo-Bold.ttf:${PORTSDIR}/x11-fonts/croscorefonts-fonts-ttf
+
+.if defined(WITH_CCACHE)
+BUILD_DEPENDS+= ccache:${PORTSDIR}/devel/ccache
+CCACHE_PREFIX= ccache
+OOOCC= ${CCACHE_PREFIX} ${CC}
+OOOCXX= ${CCACHE_PREFIX} ${CXX}
+.else
+OOOCC= ${CC}
+OOOCXX= ${CXX}
+.endif
+CONFIGURE_ENV+= CC="${OOOCC}" CXX="${OOOCXX}" \
+ PATH=${WRKSRC}/solenv/bin:$$PATH \
+ CPPFLAGS="-I${LOCALBASE}/include" LDFLAGS="-L${LOCALBASE}/lib"
+
+LIB_DEPENDS= cairo:${PORTSDIR}/graphics/cairo \
+ expat:${PORTSDIR}/textproc/expat2 \
+ jpeg:${PORTSDIR}/graphics/jpeg \
+ curl:${PORTSDIR}/ftp/curl \
+ hunspell-1.3:${PORTSDIR}/textproc/hunspell \
+ poppler-glib:${PORTSDIR}/graphics/poppler-glib \
+ rdf:${PORTSDIR}/textproc/redland \
+ textcat:${PORTSDIR}/textproc/libtextcat \
+ freetype:${PORTSDIR}/print/freetype2 \
+ apr-1:${PORTSDIR}/devel/apr1 \
+ CoinMP:${PORTSDIR}/math/coinmp \
+ serf-1:${PORTSDIR}/www/serf \
+ freetype:${PORTSDIR}/print/freetype2 \
+ textcat:${PORTSDIR}/textproc/libtextcat
+
+BUILD_DEPENDS+= zip:${PORTSDIR}/archivers/zip \
+ ${LOCALBASE}/bin/unzip:${PORTSDIR}/archivers/unzip \
+ gpatch:${PORTSDIR}/devel/patch \
+ p5-Archive-Zip>=0:${PORTSDIR}/archivers/p5-Archive-Zip \
+ bash:${PORTSDIR}/shells/bash \
+ imake:${PORTSDIR}/devel/imake \
+ ${LOCALBASE}/bin/gperf:${PORTSDIR}/devel/gperf \
+ ant:${PORTSDIR}/devel/apache-ant \
+ ${LOCALBASE}/lib/libboost_regex.a:${PORTSDIR}/devel/boost-libs \
+ ${LOCALBASE}/bin/vigra-config:${PORTSDIR}/graphics/vigra \
+ ${JAVALIBDIR}/junit.jar:${PORTSDIR}/java/junit \
+ ${JAVALIBDIR}/commons-httpclient.jar:${PORTSDIR}/java/jakarta-commons-httpclient \
+ ${JAVALIBDIR}/commons-lang.jar:${PORTSDIR}/java/jakarta-commons-lang \
+ ${JAVALIBDIR}/lucene-core-3.6.2.jar:${PORTSDIR}/textproc/lucene \
+ ${JAVALIBDIR}/bsh.jar:${PORTSDIR}/lang/bsh \
+ ${JAVALIBDIR}/saxon9.jar:${PORTSDIR}/textproc/saxon-devel \
+ epm:${PORTSDIR}/devel/epm \
+ dmake:${PORTSDIR}/devel/dmake \
+ p5-libwww>=0:${PORTSDIR}/www/p5-libwww
+
+USE_AUTOTOOLS= autoconf
+GNU_CONFIGURE= yes
+WRKSRC?= ${WRKDIR}/aoo-${PORTVERSION}/main
+BASH?= ${PREFIX}/bin/bash
+SUB_FILES= pkg-message
+SUB_LIST= EXECBASE=${EXECBASE} OOOTAG=${OOOTAG} OOODIR=${OOODIR}
+
+.if defined(DISABLE_MAKE_JOBS)
+MAKE_JOBS_NUMBER= 4
+.endif
+
+CONFIGURE_ARGS+= --enable-verbose \
+ --enable-symbols=small \
+ --enable-crashdump \
+ --with-vendor="FreeBSD ports system" \
+ --with-epm=${LOCALBASE}/bin/epm \
+ --with-gnu-patch=${LOCALBASE}/bin/gpatch \
+ --with-gperf=${LOCALBASE}/bin/gperf \
+ --x-includes=${LOCALBASE}/include \
+ --x-libraries=${LOCALBASE}lib \
+ --with-system-libxml \
+ --with-system-libxslt \
+ --with-system-cairo --enable-cairo \
+ --with-system-boost \
+ --with-system-zlib \
+ --with-system-python \
+ --with-system-expat \
+ --with-system-openssl \
+ --with-system-curl \
+ --with-system-poppler \
+ --with-system-redland \
+ --with-system-libtextcat \
+ --with-system-vigra \
+ --with-system-stdlibs \
+ --with-system-apr \
+ --with-system-apr-util \
+ --with-system-coinmp \
+ --with-system-apache-commons=yes \
+ --with-commons-codec-jar=${JAVALIBDIR}/commons-codec.jar \
+ --with-commons-lang-jar=${JAVALIBDIR}/commons-lang.jar \
+ --with-commons-httpclient-jar=${JAVALIBDIR}/commons-httpclient.jar \
+ --with-commons-logging-jar=${JAVALIBDIR}/commons-logging.jar \
+ --with-system-lucene \
+ --with-lucene-core-jar=${JAVALIBDIR}/lucene-core-3.6.2.jar \
+ --with-lucene-analyzers-jar=${JAVALIBDIR}/lucene-analyzers-3.6.2.jar \
+ --with-junit=${LOCALBASE}/share/java/classes/junit.jar \
+ --with-package-format="archive" \
+ --enable-gstreamer \
+ --enable-wiki-publisher \
+ --enable-dbus \
+ --enable-opengl \
+ --enable-category-b \
+ --enable-lockdown \
+ --with-system-hunspell \
+ --with-system-saxon \
+ --with-saxon-jar=${JAVALIBDIR}/saxon9.jar \
+ --with-system-beanshell \
+ --with-beanshell-jar=${JAVALIBDIR}/bsh.jar \
+ --without-fonts \
+ --with-system-serf
+# --with-system-jpeg
+# --enable-pdfimport
+# --without-stlport --disable-mozilla \
+# --with-system-graphite \
+
+#OOOEXTENSIONS+= minimizer/presentation-minimizer.oxt
+#OOOEXTENSIONS+= presenter/presenter-screen.oxt
+#OOOEXTENSIONS+= pdfimport/pdfimport.oxt
+OOOEXTENSIONS+= swext/wiki-publisher.oxt
+
+ICONS= ${WRKSRC}/sysui/desktop/icons
+
+.include <${FILESDIR}/Makefile.knobs>
+
+pre-everything::
+# really tweak, extremely useful when you build all localized language versions
+# needed after when you build with ALL_LOCALIZED_LANGS.
+.if defined(TWEAK_L10N)
+ @${RM} -f ${WRKDIR}/.PLIST*
+ @${RM} -f ${WRKDIR}/.install_done.*
+ @${RM} -f ${WRKDIR}/.package_done.*
+ @${RM} -f ${WRKDIR}/.extract_done.*
+ @${RM} -f ${WRKDIR}/.patch_done.*
+ @${RM} -f ${WRKDIR}/.configure_done.*
+ @${RM} -f ${WRKDIR}/.build_done.*
+ @${MKDIR} ${WRKDIR}
+ @${TOUCH} ${EXTRACT_COOKIE}
+ @${TOUCH} ${PATCH_COOKIE}
+ @${TOUCH} ${CONFIGURE_COOKIE}
+ @${TOUCH} ${BUILD_COOKIE}
+.endif
+
+post-extract:
+ @${CP} ${DISTDIR}/${DIST_SUBDIR}/unowinreg.dll ${WRKSRC}/external/unowinreg/
+# @${MKDIR} ${WRKSRC}/../ext_sources
+# @${MV} ${WRKDIR}/ooo/ext_sources/* ${WRKSRC}/../ext_sources/
+# @${RM} -rf ${WRKSRC}/l10n
+ @${MKDIR} ${WRKSRC}/../ext_sources
+ @${RM} -rf ${WRKSRC}/l10n
+
+post-patch:
+.if defined (USE_GCC)
+ @${REINPLACE_CMD} -e "s+%%RPATH%%+-Wl,-rpath=${_GCC_RUNTIME}+" ${WRKSRC}/solenv/inc/unxfbsd.mk
+ @${REINPLACE_CMD} -e "s+%%RPATH%%+-Wl,-rpath=${_GCC_RUNTIME}+" ${WRKSRC}/solenv/gbuild/platform/freebsd.mk
+.else
+ @${REINPLACE_CMD} -e "s+%%RPATH%%++" ${WRKSRC}/solenv/inc/unxfbsd.mk
+ @${REINPLACE_CMD} -e "s+%%RPATH%%++" ${WRKSRC}/solenv/gbuild/platform/freebsd.mk
+.endif
+
+pre-configure:
+ @${LN} -sf ${UNZIP_CMD} ${WRKSRC}/solenv/bin/unzip
+
+do-build:
+ @cd ${WRKDIR}/aoo-${PORTVERSION} ; ${PRINTF} "[repositories]\n" > source_config
+ @cd ${WRKDIR}/aoo-${PORTVERSION} ; ${PRINTF} "main=active\n" >> source_config
+ @cd ${WRKDIR}/aoo-${PORTVERSION} ; ${PRINTF} "extras=active\n" >> source_config
+ @cd ${WRKSRC} ; ./bootstrap
+ @cd ${WRKSRC} ; ${SETENV} "LANG=C" "LC_ALL=C" ${BASH} -c "source ${FREEBSD_ENV_SET} ; cd instsetoo_native/util ; build.pl --all -P${MAKE_JOBS_NUMBER} -- -P${MAKE_JOBS_NUMBER}"
+
+do-install:
+ @cd ${WRKSRC}/instsetoo_native/unxfbsd?.pro/Apache_OpenOffice/archive/install/${LOCALIZED_LANG}/ ; ${LS} *.tar.?z > ${WRKDIR}/INSTALLFILES
+ @${RM} -Rf ${WRKDIR}/tmp
+ @${MKDIR} ${WRKDIR}/tmp
+ @for i in `${CAT} ${WRKDIR}/INSTALLFILES`; do \
+ ${ECHO_CMD} "extracting $$i" ; \
+ cd ${WRKDIR}/tmp ; ${TAR} xfz ${WRKSRC}/instsetoo_native/unxfbsd?.pro/Apache_OpenOffice/archive/install/${LOCALIZED_LANG}/$$i ; \
+ done
+ @${MKDIR} ${PREFIX}/${INSTALLATION_BASEDIR}
+ @cd ${WRKDIR}/tmp/*/ ; ${TAR} cf - -C . . | ${TAR} xf - -C ${PREFIX}/${INSTALLATION_BASEDIR}
+ @${REINPLACE_CMD} -e 's/^UserInstallation.*$$/USERINSTALLATION/' ${PREFIX}/${INSTALLATION_BASEDIR}/${OOODIR}/program/bootstraprc
+ @${REINPLACE_CMD} -e 's/USERINSTALLATION/UserInstallation=$$SYSUSERCONFIG\/\.openoffice\.org-devel\/4/' ${PREFIX}/${INSTALLATION_BASEDIR}/openoffice4/program/bootstraprc
+ @${MKDIR} ${PREFIX}/${INSTALLATION_BASEDIR}/extensions/
+ @cd ${WRKSRC}/solver/4?0/unxfbsd?.pro/bin/ ; ${INSTALL_DATA} ${OOOEXTENSIONS} ${PREFIX}/${INSTALLATION_BASEDIR}/extensions/
+
+post-install:
+ @${FIND} ${PREFIX}/${INSTALLATION_BASEDIR} -type d -exec ${CHMOD} 755 {} \;
+ @${ECHO_MSG} "===> Add wrapper scripts";
+ @${CP} ${FILESDIR}/openoffice-wrapper ${WRKDIR}/
+ @${REINPLACE_CMD} -e 's#%%PREFIX%%#${PREFIX}#g' \
+ -e 's#%%SVNREVISION%%#${SVNREVISION}#g' \
+ -e 's#%%OOODIR%%#${OOODIR}#g' \
+ -e 's#%%INSTALLATION_BASEDIR%%#${INSTALLATION_BASEDIR}#g' \
+ ${WRKDIR}/openoffice-wrapper
+ @${INSTALL_SCRIPT} ${WRKDIR}/openoffice-wrapper \
+ ${PREFIX}/bin/${EXECBASE}
+ @${LN} -fs ${PREFIX}/bin/${EXECBASE} ${PREFIX}/bin/${EXECBASE}-sbase
+ @${LN} -fs ${PREFIX}/bin/${EXECBASE} ${PREFIX}/bin/${EXECBASE}-scalc
+ @${LN} -fs ${PREFIX}/bin/${EXECBASE} ${PREFIX}/bin/${EXECBASE}-sdraw
+ @${LN} -fs ${PREFIX}/bin/${EXECBASE} ${PREFIX}/bin/${EXECBASE}-setofficelang
+ @${LN} -fs ${PREFIX}/bin/${EXECBASE} ${PREFIX}/bin/${EXECBASE}-simpress
+ @${LN} -fs ${PREFIX}/bin/${EXECBASE} ${PREFIX}/bin/${EXECBASE}-smath
+ @${LN} -fs ${PREFIX}/bin/${EXECBASE} ${PREFIX}/bin/${EXECBASE}-spadmin
+ @${LN} -fs ${PREFIX}/bin/${EXECBASE} ${PREFIX}/bin/${EXECBASE}-swriter
+ @${ECHO_CMD} "" > ${TMPPLIST}
+ @${ECHO_CMD} "share/licenses/${PKGNAME}/catalog.mk" >> ${TMPPLIST}
+ @${ECHO_CMD} "share/licenses/${PKGNAME}/LICENSE" >> ${TMPPLIST}
+ @${ECHO_CMD} "share/licenses/${PKGNAME}/AL2" >> ${TMPPLIST}
+ @${ECHO_CMD} "@dirrm share/licenses/${PKGNAME}" >> ${TMPPLIST}
+ @${ECHO_CMD} "@dirrm share/licenses" >> ${TMPPLIST}
+ @cd ${PREFIX} ; ${FIND} -s bin \( -type f -or -type l \) -name "${EXECBASE}*" >> ${TMPPLIST}
+ @cd ${PREFIX} ; ${FIND} -s ${INSTALLATION_BASEDIR} \( -type f -or -type l \) >> ${TMPPLIST}
+ @cd ${PREFIX} ; ${FIND} ${INSTALLATION_BASEDIR} -type d | ${SORT} -r | \
+ ${XARGS} -n 1 ${ECHO_CMD} @dirrm >> ${TMPPLIST}
+ @for app in base calc draw impress math writer; do \
+ ${REINPLACE_CMD} -e "s/^Exec.*/Exec=${EXECBASE} -$${app} %U/" \
+ -e "s/^Icon.*/Icon=${EXECBASE}-$${app}.png/" \
+ ${PREFIX}/${INSTALLATION_BASEDIR}/${OOODIR}/share/xdg/$${app}.desktop ; \
+ done
+ @${REINPLACE_CMD} -e "s/^Exec.*/Exec=${EXECBASE}-spadmin %U/" \
+ -e "s/^Icon.*/Icon=${EXECBASE}-printeradmin.png/" \
+ ${PREFIX}/${INSTALLATION_BASEDIR}/${OOODIR}/share/xdg/printeradmin.desktop
+ @${REINPLACE_CMD} -e "s/^Exec.*/Exec=${EXECBASE} -quickstart -nologo -nodefault/" \
+ ${PREFIX}/${INSTALLATION_BASEDIR}/${OOODIR}/share/xdg/startcenter.desktop
+ @${RM} ${PREFIX}/${INSTALLATION_BASEDIR}/${OOODIR}/share/xdg/*.desktop.bak
+ @${RM} -f ${DESKTOPDIR}/${EXECBASE}
+ @${MKDIR} ${DESKTOPDIR}
+ @${LN} -sf ${PREFIX}/${INSTALLATION_BASEDIR}/${OOODIR}/share/xdg \
+ ${DESKTOPDIR}/${EXECBASE}
+ @${ECHO_CMD} "share/applications/${EXECBASE}" >> ${TMPPLIST}
+ @${ECHO_CMD} "@unexec ${RMDIR} %D/share/applications 2>/dev/null || ${TRUE}" >> ${TMPPLIST}
+ @${PREFIX}/bin/update-desktop-database 2>/dev/null || ${TRUE}
+ @${ECHO_CMD} "@exec ${PREFIX}/bin/update-desktop-database 2>/dev/null || ${TRUE}" >> ${TMPPLIST}
+ @for dir in `ls ${ICONS}/hicolor | ${GREP} -v CVS`; do \
+ for app in base calc draw impress math printeradmin writer; do \
+ if [ -r ${ICONS}/hicolor/$${dir}/apps/$${app}.png ]; then \
+ ${INSTALL_DATA} ${ICONS}/hicolor/$${dir}/apps/$${app}.png \
+ ${PREFIX}/share/icons/hicolor/$${dir}/apps/${EXECBASE}-$${app}.png ; \
+ ${ECHO_CMD} "share/icons/hicolor/$${dir}/apps/${EXECBASE}-$${app}.png" >> ${TMPPLIST} ; \
+ fi \
+ done ; \
+ for iconfile in `cd ${ICONS}/hicolor/$${dir}/mimetypes; ls *.png`; do \
+ ${INSTALL_DATA} ${ICONS}/hicolor/$${dir}/mimetypes/$${iconfile} \
+ ${PREFIX}/share/icons/hicolor/$${dir}/mimetypes/ ; \
+ ${ECHO_CMD} "share/icons/hicolor/$${dir}/mimetypes/$${iconfile}" >> ${TMPPLIST} ; \
+ done ; \
+ done
+ @${PREFIX}/bin/gtk-update-icon-cache -q -f ${PREFIX}/share/icons/hicolor 2>/dev/null || ${TRUE}
+ @${ECHO_CMD} "@unexec ${RM} %D/share/icons/hicolor/icon-theme.cache 2>/dev/null || ${TRUE}" >> ${TMPPLIST}
+ @${ECHO_CMD} "@exec ${PREFIX}/bin/gtk-update-icon-cache -q -f %D/share/icons/hicolor 2>/dev/null || ${TRUE}" >> ${TMPPLIST}
+ @${ECHO_CMD} "@unexec ${PREFIX}/bin/gtk-update-icon-cache -q -f %D/share/icons/hicolor 2>/dev/null || ${TRUE}" >> ${TMPPLIST}
+ @${ECHO_CMD}
+ @${CAT} ${PKGMESSAGE}
+ @${ECHO_CMD}
+
+.include <${FILESDIR}/Makefile.others>
+.include <bsd.port.post.mk>
diff --git a/editors/openoffice-4/distinfo b/editors/openoffice-4/distinfo
new file mode 100644
index 000000000000..98b9f22c4299
--- /dev/null
+++ b/editors/openoffice-4/distinfo
@@ -0,0 +1,6 @@
+SHA256 (openoffice/apache-openoffice-4.0.0-r1503704-src.tar.bz2) = 019a7c213f7020afa23bfee555c9d70a1df92fa6e759d20f7e6fa31e01b0aec8
+SIZE (openoffice/apache-openoffice-4.0.0-r1503704-src.tar.bz2) = 211869164
+SHA256 (openoffice/unowinreg.dll) = f563e522922133db9340b0306711c2d8767cc3481dd9e7d9b0d059906d12653c
+SIZE (openoffice/unowinreg.dll) = 6144
+SHA256 (openoffice/ApacheOpenOffice.ext_sources.4.0.0.r1503704.tar.bz2) = 4d21329da736fbdaaf530d705f7872eb2c6c96180ac917db7f66d7cfc1551e06
+SIZE (openoffice/ApacheOpenOffice.ext_sources.4.0.0.r1503704.tar.bz2) = 138567395
diff --git a/editors/openoffice-4/files/Makefile.knobs b/editors/openoffice-4/files/Makefile.knobs
new file mode 100644
index 000000000000..d5c399470ad3
--- /dev/null
+++ b/editors/openoffice-4/files/Makefile.knobs
@@ -0,0 +1,28 @@
+# Makefile for knobs
+# Whom: Maho Nakata <maho@FreeBSD.org>
+# $FreeBSD$
+# Makefile for knobs
+
+CONFIGURE_ARGS+= --with-jdk-home="${JAVA_HOME}" --with-ant-home="${LOCALBASE}/share/java/apache-ant"
+CONFIGURE_ARGS+= --with-lang=${LOCALIZED_LANG}
+
+pre-fetch:
+ @${ECHO} "OPTIONS:"
+ @${ECHO}
+ @${ECHO} "You can select the language for OOo by making it with:"
+ @${ECHO} "make LOCALIZED_LANG=xx"
+ @${ECHO} "while xx can be one of the following"
+ @${ECHO} "af ar as-IN be-BY bg br bn bn-BD bn-IN bs ca cs cy da"
+ @${ECHO} "de dz el en-GB en-US en-ZA eo es et eu fa fi fr ga gl"
+ @${ECHO} "gu-IN he hi-IN hr hu it ja ka km kn ko ku lo lt lv mk"
+ @${ECHO} "ms ml-IN mr-IN ne nb nl nn nr ns oc or-IN pa-IN pl pt"
+ @${ECHO} "pt-BR ru rw sk sl sh sr ss st sv sw sw-TZ te-IN ti-ER"
+ @${ECHO} "ta-IN th tn tr ts tg ur-IN uk uz ve vi xh zh-CN zh-TW"
+ @${ECHO} "zu"
+ @${ECHO} "Current setting: ${LOCALIZED_LANG}"
+ @${ECHO}
+ @${ECHO} "NOTICE:"
+ @${ECHO}
+ @${ECHO} "To build OOo, you should have a lot"
+ @${ECHO} "of free diskspace (~ 11GB) and memory (~ 2GB)."
+ @${ECHO} "If you want SDK and/or solver, please type make sdk and/or make solver"
diff --git a/editors/openoffice-4/files/Makefile.localized b/editors/openoffice-4/files/Makefile.localized
new file mode 100644
index 000000000000..1b6364941f2f
--- /dev/null
+++ b/editors/openoffice-4/files/Makefile.localized
@@ -0,0 +1,401 @@
+# localized makefile
+# Whom: Maho Nakata <maho@FreeBSD.org>
+# $FreeBSD$
+
+################################################################
+#See solenv/inc/postset.mk for details
+################################################################
+.if defined(LOCALIZED_LANG)
+.if ${LOCALIZED_LANG} == "af"
+LANG_PKGNAME= ${LOCALIZED_LANG}
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "ar"
+CATEGORIES+= arabic
+LANG_PKGNAME= ${LOCALIZED_LANG}
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "as-IN"
+LANG_PKGNAME= as
+LANG_SUFFIX= IN
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "be-BY"
+LANG_PKGNAME= be
+LANG_SUFFIX= BY
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "bg"
+LANG_PKGNAME= ${LOCALIZED_LANG}
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "bn-BD"
+LANG_PKGNAME= be
+LANG_SUFFIX= BD
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "bn-IN"
+LANG_PKGNAME= bn
+LANG_SUFFIX= IN
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "bn"
+LANG_PKGNAME= ${LOCALIZED_LANG}
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "br"
+LANG_PKGNAME= ${LOCALIZED_LANG}
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "bs"
+LANG_PKGNAME= ${LOCALIZED_LANG}
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "ca"
+LANG_PKGNAME= ${LOCALIZED_LANG}
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "cs"
+LANG_PKGNAME= ${LOCALIZED_LANG}
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "cy"
+LANG_PKGNAME= ${LOCALIZED_LANG}
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "da"
+LANG_PKGNAME= ${LOCALIZED_LANG}
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "de"
+CATEGORIES+= german
+LANG_PKGNAME= ${LOCALIZED_LANG}
+COMMENT= Office-Suite mit Textverarbeitung, Tabellenkalkulation, Datenbank und Praesentationsprogramm
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "dz"
+LANG_PKGNAME= ${LOCALIZED_LANG}
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "el"
+LANG_PKGNAME= ${LOCALIZED_LANG}
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "en-GB"
+LANG_PKGNAME= en
+LANG_SUFFIX= GB
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "en-US"
+LANG_PKGNAME= en
+LANG_SUFFIX= US
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "en-ZA"
+LANG_PKGNAME= en
+LANG_SUFFIX= ZA
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "eo"
+LANG_PKGNAME= ${LOCALIZED_LANG}
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "es"
+LANG_PKGNAME= ${LOCALIZED_LANG}
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "et"
+LANG_PKGNAME= ${LOCALIZED_LANG}
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "eu"
+LANG_PKGNAME= ${LOCALIZED_LANG}
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "fa"
+LANG_PKGNAME= ${LOCALIZED_LANG}
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "fi"
+LANG_PKGNAME= ${LOCALIZED_LANG}
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "fr"
+CATEGORIES+= french
+LANG_PKGNAME= ${LOCALIZED_LANG}
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "ga"
+LANG_PKGNAME= ${LOCALIZED_LANG}
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "gl"
+LANG_PKGNAME= ${LOCALIZED_LANG}
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "gu-IN"
+LANG_PKGNAME= gu
+LANG_SUFFIX= IN
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "he"
+LANG_PKGNAME= ${LOCALIZED_LANG}
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "hi-IN"
+LANG_PKGNAME= hi
+LANG_SUFFIX= IN
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "hr"
+LANG_PKGNAME= ${LOCALIZED_LANG}
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "hu"
+CATEGORIES+= hungarian
+LANG_PKGNAME= ${LOCALIZED_LANG}
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "it"
+LANG_PKGNAME= ${LOCALIZED_LANG}
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "ja"
+CATEGORIES+= japanese
+LANG_PKGNAME= ${LOCALIZED_LANG}
+RUN_DEPENDS+= ${LOCALBASE}/share/fonts/std.ja_JP/Ryumin-Light:${PORTSDIR}/japanese/font-std
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "ka"
+LANG_PKGNAME= ${LOCALIZED_LANG}
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "km"
+LANG_PKGNAME= ${LOCALIZED_LANG}
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "kn"
+LANG_PKGNAME= kn
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "ko"
+CATEGORIES+= korean
+LANG_PKGNAME= ${LOCALIZED_LANG}
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "ku"
+LANG_PKGNAME= ${LOCALIZED_LANG}
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "lo"
+LANG_PKGNAME= ${LOCALIZED_LANG}
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "lt"
+LANG_PKGNAME= ${LOCALIZED_LANG}
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "lv"
+LANG_PKGNAME= ${LOCALIZED_LANG}
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "mk"
+LANG_PKGNAME= ${LOCALIZED_LANG}
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "ml-IN"
+LANG_PKGNAME= ml
+LANG_SUFFIX= IN
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "mr-IN"
+LANG_PKGNAME= mr
+LANG_SUFFIX= IN
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "ms"
+LANG_PKGNAME= ${LOCALIZED_LANG}
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "nb"
+LANG_PKGNAME= ${LOCALIZED_LANG}
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "ne"
+LANG_PKGNAME= ${LOCALIZED_LANG}
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "nl"
+LANG_PKGNAME= ${LOCALIZED_LANG}
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "nn"
+LANG_PKGNAME= ${LOCALIZED_LANG}
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "nr"
+LANG_PKGNAME= ${LOCALIZED_LANG}
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "ns"
+LANG_PKGNAME= ${LOCALIZED_LANG}
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "oc"
+LANG_PKGNAME= ${LOCALIZED_LANG}
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "or-IN"
+LANG_PKGNAME= or
+LANG_SUFFIX= IN
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "pa-IN"
+LANG_PKGNAME= pa
+LANG_SUFFIX= IN
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "pl"
+CATEGORIES+= polish
+LANG_PKGNAME= ${LOCALIZED_LANG}
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "pt"
+COMMENT= Editor texto/grBaGico, banco de dados/planilha/navegador integrado
+CATEGORIES+= portuguese
+LANG_PKGNAME= ${LOCALIZED_LANG}
+LANG_CONFIGURE_ARG= PORT
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "pt-BR"
+COMMENT= Editor texto/grBaGico, banco de dados/planilha/navegador integrado
+CATEGORIES+= portuguese
+LANG_PKGNAME= pt
+LANG_SUFFIX= BR
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "ru"
+CATEGORIES+= russian
+LANG_PKGNAME= ${LOCALIZED_LANG}
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "rw"
+LANG_PKGNAME= ${LOCALIZED_LANG}
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "sh"
+LANG_PKGNAME= sh
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "sk"
+LANG_PKGNAME= ${LOCALIZED_LANG}
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "sl"
+LANG_PKGNAME= ${LOCALIZED_LANG}
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "sr"
+LANG_PKGNAME= sr
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "ss"
+LANG_PKGNAME= ${LOCALIZED_LANG}
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "st"
+LANG_PKGNAME= ${LOCALIZED_LANG}
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "sv"
+LANG_PKGNAME= ${LOCALIZED_LANG}
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "sw-TZ"
+LANG_PKGNAME= sw
+LANG_SUFFIX= TZ
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "sw"
+LANG_PKGNAME= ${LOCALIZED_LANG}
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "ta-IN"
+LANG_PKGNAME= ta
+LANG_SUFFIX= IN
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "te-IN"
+LANG_PKGNAME= te
+LANG_SUFFIX= IN
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "tg"
+LANG_PKGNAME= ${LOCALIZED_LANG}
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "th"
+LANG_PKGNAME= ${LOCALIZED_LANG}
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "ti-ER"
+LANG_PKGNAME= ti
+LANG_SUFFIX= ER
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "tn"
+LANG_PKGNAME= ${LOCALIZED_LANG}
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "tr"
+LANG_PKGNAME= ${LOCALIZED_LANG}
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "ts"
+LANG_PKGNAME= ${LOCALIZED_LANG}
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "uk"
+LANG_PKGNAME= ${LOCALIZED_LANG}
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "ur-IN"
+LANG_PKGNAME= ur
+LANG_SUFFIX= IN
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "uz"
+LANG_PKGNAME= ${LOCALIZED_LANG}
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "ve"
+LANG_PKGNAME= ${LOCALIZED_LANG}
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "vi"
+LANG_PKGNAME= ${LOCALIZED_LANG}
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "xh"
+LANG_PKGNAME= ${LOCALIZED_LANG}
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "zh-CN"
+CATEGORIES+= chinese
+LANG_PKGNAME= zh
+LANG_SUFFIX= CN
+BUILD_DEPENDS+= ${PREFIX}/share/fonts/TrueType/gbsn00lp.ttf:${PORTSDIR}/chinese/arphicttf
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "zh-TW"
+CATEGORIES+= chinese
+LANG_PKGNAME= zh
+LANG_SUFFIX= TW
+BUILD_DEPENDS+= ${PREFIX}/share/fonts/TrueType/bsmi00lp.ttf:${PORTSDIR}/chinese/arphicttf
+.endif
+################################################################
+.if ${LOCALIZED_LANG} == "zu"
+LANG_PKGNAME= ${LOCALIZED_LANG}
+.endif
+################################################################
+.endif
diff --git a/editors/openoffice-4/files/Makefile.others b/editors/openoffice-4/files/Makefile.others
new file mode 100644
index 000000000000..14d039ca28b4
--- /dev/null
+++ b/editors/openoffice-4/files/Makefile.others
@@ -0,0 +1,69 @@
+# Makefile for other stuffs
+# Whom: Maho Nakata <maho@FreeBSD.org>
+# $FreeBSD$
+
+#other stuffs which are not directly related to making ports
+#package-rename: rename package for uploading
+#package-canonical: making official packages (WIP)
+#ure: URE (Uno Runtime Environment) packages (WIP)
+#solver: solver
+#languagepack: language pack
+
+package-rename:
+ @${ECHO_MSG} "===> Rename package for Apache OpenOffice mirror upload";
+ @${LN} ${PKGFILE} \
+ ${WRKDIR}/../${PACKAGE_PREFIX}_${PACKAGE_MIDDLE}_install_${LOCALIZED_LANG}${PKG_SUFX}
+
+package-canonical:
+ @${ECHO_MSG} "===> Canonical packaging for Apache OpenOffice";
+ @${CP} ${WRKSRC}/instsetoo_native/unxfbsd?.pro/OpenOffice/archive/install/${LOCALIZED_LANG}/${PACKAGE_PREFI}* .
+
+sdk:
+ @${ECHO_MSG} "===> Make SDK of Apache OpenOffice"
+ @${RM} -fr ${WRKDIR}/sdk_tmp
+ @${MKDIR} ${WRKDIR}/sdk_tmp
+ @cd ${WRKDIR}/sdk_tmp ; \
+ ${TAR} xfz ${WRKSRC}/instsetoo_native/unxfbsd?.pro/OpenOffice_SDK/archive/install/${LOCALIZED_LANG}/Apache_OpenOffice_*SDK*.tar.gz
+ @cd ${WRKDIR}/sdk_tmp/Apache_*/openoffice* ; \
+ ${MKDIR} ../${INSTALLATION_BASEDIR}_sdk ; \
+ ${MV} * ../${INSTALLATION_BASEDIR}_sdk ; cd .. ; \
+ ${TAR} cfj ${WRKDIR}/../${PACKAGE_PREFIX}-SDK_${PACKAGE_MIDDLE}_install_en-US.tbz ${INSTALLATION_BASEDIR}_sdk
+
+ure:
+ @${ECHO_MSG} "===> Make Uno Runtime Environment of Apache OpenOffice"
+ @${RM} -fr ${WRKDIR}/ure_tmp
+ @${MKDIR} ${WRKDIR}/ure_tmp
+ @cd ${WRKDIR}/ure_tmp ; \
+ ${TAR} xfz ${WRKSRC}/instsetoo_native/unxfbsd?.pro/URE/archive/install/${LOCALIZED_LANG}/Apache_OpenOffice_*URE*.tar.gz
+ @cd ${WRKDIR}/ure_tmp/Apache_OpenOffice*URE* ; \
+ ${MKDIR} ../${INSTALLATION_BASEDIR} ; \
+ ${MV} * ../${INSTALLATION_BASEDIR} ; cd .. ; \
+ ${TAR} cfj ${WRKDIR}/../${PACKAGE_PREFIX}-URE_${PACKAGE_MIDDLE}_install_en-US.tbz ${INSTALLATION_BASEDIR}
+solver:
+ @${ECHO_MSG} "===> Make Solver of Apache OpenOffice"
+ @cd ${WRKSRC} ; ${TAR} cfj ${WRKDIR}/../${PACKAGE_PREFIX}-solver_${PACKAGE_MIDDLE}.tar.bz2 solver
+
+languagepack:
+ @${ECHO_MSG} "===> Make languagepack of Apache OpenOffice"
+.if defined (ALL_LOCALIZED_LANGS)
+ @cd ${WRKSRC} ; ${BASH} -c 'source ${FREEBSD_ENV_SET} ; cd instsetoo_native/util ; dmake ooolanguagepack'
+.else
+ @cd ${WRKSRC} ; ${BASH} -c 'source ${FREEBSD_ENV_SET} ; cd instsetoo_native/util ; dmake ooolanguagepack_${LOCALIZED_LANG}'
+.endif
+
+.if !defined (ALL_LOCALIZED_LANGS)
+ @${RM} -fr ${WRKDIR}/langpack_tmp
+ @${MKDIR} ${WRKDIR}/langpack_tmp
+.if defined (LOCALIZED_LANG)
+ @cd ${WRKSRC}/instsetoo_native/unxfbsd?.pro/OpenOffice_languagepack/archive/install/${LOCALIZED_LANG} ; ls Apache_OpenOffice*tar.* > ${WRKDIR}/${LOCALIZED_LANG}_LANGPACK
+ @cd ${WRKDIR}/langpack_tmp ; \
+ for i in `${CAT} ${WRKDIR}/${LOCALIZED_LANG}_LANGPACK`; do \
+ ${ECHO_CMD} "extracting $$i" ; \
+ cd ${WRKDIR}/langpack_tmp ; ${TAR} xfz ${WRKSRC}/instsetoo_native/unxfbsd?.pro/OpenOffice_languagepack/archive/install/${LOCALIZED_LANG}/$$i ; \
+ done
+ @cd ${WRKDIR}/langpack_tmp/Apache_OpenOffice*/ ; \
+ ${MKDIR} ../${INSTALLATION_BASEDIR} ; \
+ ${MV} * ../${INSTALLATION_BASEDIR} ; cd .. ; \
+ ${TAR} cfj ${WRKDIR}/../${PACKAGE_PREFIX}_${PACKAGE_MIDDLE}_langpack_${LOCALIZED_LANG}.tbz ${INSTALLATION_BASEDIR}
+.endif
+.endif
diff --git a/editors/openoffice-4/files/extra-patch-libexttextcat-lingucomponent b/editors/openoffice-4/files/extra-patch-libexttextcat-lingucomponent
new file mode 100644
index 000000000000..0aec5c2f9b6b
--- /dev/null
+++ b/editors/openoffice-4/files/extra-patch-libexttextcat-lingucomponent
@@ -0,0 +1,13 @@
+$FreeBSD$
+
+--- lingucomponent/source/languageguessing/simpleguesser.cxx.orig 2012-01-10 19:42:30.000000000 +0900
++++ lingucomponent/source/languageguessing/simpleguesser.cxx 2012-08-07 11:14:45.000000000 +0900
+@@ -114,7 +114,7 @@
+ if(!h){return guesses;}
+
+ //calculate le number of unicode charcters (symbols)
+- int len = utfstrlen(text);
++ int len = strlen(text);
+
+ if( len > MAX_STRING_LENGTH_TO_ANALYSE ){len = MAX_STRING_LENGTH_TO_ANALYSE ;}
+
diff --git a/editors/openoffice-4/files/generate.pl b/editors/openoffice-4/files/generate.pl
new file mode 100644
index 000000000000..d5871e7b2550
--- /dev/null
+++ b/editors/openoffice-4/files/generate.pl
@@ -0,0 +1,40 @@
+#!/usr/bin/perl
+# generate full build shell script for Apache OpenOffice
+# Whom: Maho Nakata <maho@FreeBSD.org>
+# $FreeBSD: /tmp/pcvs/ports/editors/openoffice-3/files/generate.pl,v 1.15 2012-05-09 03:48:16 maho Exp $
+
+print "#!/bin/csh\n";
+print "make deinstall clean\n";
+print "/usr/bin/time -h make WITH_CCACHE=yes install package package-rename solver sdk ure languagepack deinstall >& log.en\n";
+print "bzip2 log.en\n";
+#print "rm work/.configure* work/.build* \n";
+#workaround for breakage at odk sdk_oo
+print "make deinstall clean\n";
+
+print "/usr/bin/time -h make ALL_LOCALIZED_LANGS=yes >& log.all\n";
+print "bzip2 log.all\n";
+
+open ( FILE, "< Makefile.localized") ;
+while(<FILE>){
+@tmp=split (' ',$_);
+@tmp2=split ('"',$tmp[3]);
+if ( $tmp[0] eq ".if" && $tmp[1] eq "\${LOCALIZED_LANG}" ) { $LANG=$tmp2[1];
+ print "make TWEAK_L10N=yes LOCALIZED_LANG=$LANG pre-everything\n";
+ print "/usr/bin/time -h make LOCALIZED_LANG=$LANG WITH_CCACHE=yes languagepack package package-rename deinstall >& log.$LANG\n";
+ print "bzip2 log.$LANG\n";
+ }
+}
+close FILE;
+$oootag= `cd ..; make -V OOOTAG2`;
+chomp($oootag);
+$md5sumname = "$oootag" . "_md5sums.txt";
+print "md5 OOo* > $md5sumname\n";
+
+$arc= `uname -m`;
+if ($arc == "amd64" ) {
+print "sudo -u `who am i | awk '{print \$1}'` ssh build.good-day.net mkdir -p /home/ftp/pub/OpenOffice.org/contrib/freebsdx86-64/\n";
+print "sudo -u `who am i | awk '{print \$1}'` scp OOo* $md5sumname build.good-day.net:/home/ftp/pub/OpenOffice.org/contrib/freebsdx86-64/\n";
+} else {
+print "sudo -u `who am i | awk '{print \$1}'` ssh build.good-day.net mkdir -p /home/ftp/pub/OpenOffice.org/contrib/freebsdx86/\n";
+print "sudo -u `who am i | awk '{print \$1}'` scp OOo* $md5sumname build.good-day.net:/home/ftp/pub/OpenOffice.org/contrib/freebsdx86/\n";
+}
diff --git a/editors/openoffice-4/files/ooo.sh b/editors/openoffice-4/files/ooo.sh
new file mode 100644
index 000000000000..8f0ffbde843f
--- /dev/null
+++ b/editors/openoffice-4/files/ooo.sh
@@ -0,0 +1,43 @@
+#!/bin/sh
+# Openoffice.org build and uploader for FreeBSD.
+# Nakata Maho (maho@FreeBSD.org) 2010/2/13.
+# this file is public domain.
+# $Id$
+
+MILESTONE=`make -V OOOTAG`
+fbsdmajor=`uname -r | sed 's/\..*$//g'`
+fbsdarch=`uname -m`
+OOODIR=/home/ftp/pub/OpenOffice.org/FreeBSD/packages-$fbsdmajor-$fbsdarch
+SITE=build.good-day.net
+USER=maho
+
+#build
+/usr/bin/time -h sudo -u $USER make WITH_CCACHE=yes >log.en.$MILESTONE 2>&1
+/usr/bin/time -h make deinstall package package-rename >> log.en.$MILESTONE 2>&1
+/usr/bin/time -h make sdk ure >> log.en.$MILESTONE 2>&1
+/usr/bin/time -h make deinstall >> log.en.$MILESTONE 2>&1
+
+/usr/bin/time -h make clean >log.ja.$MILESTONE 2>&1
+/usr/bin/time -h sudo -u $USER make LOCALIZED_LANG=ja WITH_CCACHE=yes >log.ja.$MILESTONE 2>&1
+/usr/bin/time -h make LOCALIZED_LANG=ja deinstall package package-rename languagepack >> log.ja.$MILESTONE 2>&1
+/usr/bin/time -h make LOCALIZED_LANG=ja deinstall >> log.ja.$MILESTONE 2>&1
+
+OOOENUSPACKAGE1=`ls openoffice.org*tbz`
+OOOENUSPACKAGE2=`ls OOo*install_en-US.tbz`
+OOOJAPACKAGE1=`ls ja-openoffice.org*tbz`
+OOOJAPACKAGE2=`ls OOo*install_ja.tbz`
+
+#upload
+bzip2 log.en.$MILESTONE log.ja.$MILESTONE
+sudo -u $USER ssh $SITE mkdir $OOODIR
+sudo -u $USER scp *openoffice*.tbz *SDK* *URE* log.* $SITE:$OOODIR
+
+if [ x$OOOENUSPACKAGE1 != x"" ]; then
+sudo -u $USER ssh $SITE "ln -sf $OOODIR/$OOOENUSPACKAGE1 $OOODIR/$OOOENUSPACKAGE2"
+fi
+if [ x$OOOJAPACKAGE1 != x"" ]; then
+sudo -u $USER ssh $SITE "ln -sf $OOODIR/$OOOJAPACKAGE1 $OOODIR/$OOOJAPACKAGE2"
+fi
+
+
+
diff --git a/editors/openoffice-4/files/openoffice-wrapper b/editors/openoffice-4/files/openoffice-wrapper
new file mode 100644
index 000000000000..70bf6241f18b
--- /dev/null
+++ b/editors/openoffice-4/files/openoffice-wrapper
@@ -0,0 +1,18 @@
+#!/bin/sh
+#
+# $FreeBSD: /tmp/pcvs/ports/editors/openoffice-3/files/openoffice-wrapper,v 1.17 2012-05-09 03:48:16 maho Exp $
+
+oopath=%%PREFIX%%/%%INSTALLATION_BASEDIR%%/%%OOODIR%%
+program=`echo $0 | sed -e 's|.*-%%OOOVERSION%%-||'`
+
+case $program in
+$0)
+ $oopath/program/soffice "$@"
+ ;;
+setofficelang)
+ $oopath/basis-link/program/$program "$@"
+ ;;
+*)
+ $oopath/program/$program "$@"
+ ;;
+esac
diff --git a/editors/openoffice-4/files/patch-configmgr b/editors/openoffice-4/files/patch-configmgr
new file mode 100644
index 000000000000..5e078d6a34a1
--- /dev/null
+++ b/editors/openoffice-4/files/patch-configmgr
@@ -0,0 +1,19 @@
+--- configmgr/source/partial.hxx
++++ configmgr/source/partial.hxx
+@@ -26,6 +26,7 @@
+
+ #include "sal/config.h"
+
++#include <boost/functional/hash.hpp>
+ #include <boost/unordered_map.hpp> // using the boost container because it explicitly allows recursive types
+ #include <set>
+
+@@ -50,7 +51,7 @@ public:
+
+ private:
+ struct Node {
+- typedef boost::unordered_map< rtl::OUString, Node > Children;
++ typedef boost::unordered_map< rtl::OUString, Node, rtl::OUStringHash > Children;
+
+ Node(): startInclude(false) {}
+ void clear() { startInclude=false; children.clear(); }
diff --git a/editors/openoffice-4/files/patch-freebsd.mk b/editors/openoffice-4/files/patch-freebsd.mk
new file mode 100644
index 000000000000..427de633d0a4
--- /dev/null
+++ b/editors/openoffice-4/files/patch-freebsd.mk
@@ -0,0 +1,10 @@
+--- solenv/gbuild/platform/freebsd.mk 2012-10-31 10:39:44.000000000 +0900
++++ solenv/gbuild/platform/freebsd.mk 2012-10-31 17:40:48.000000000 +0900
+@@ -121,6 +121,7 @@
+ -Wl,-z,combreloc \
+ -Wl,-z,defs \
+ $(subst -L../lib , ,$(SOLARLIB)) \
++ %%RPATH%% \
+ \
+
+ ifeq ($(HAVE_LD_HASH_STYLE),TRUE)
diff --git a/editors/openoffice-4/files/patch-i114430 b/editors/openoffice-4/files/patch-i114430
new file mode 100644
index 000000000000..b5c73f6c17ce
--- /dev/null
+++ b/editors/openoffice-4/files/patch-i114430
@@ -0,0 +1,112 @@
+Index: sal/inc/rtl/math.h
+===================================================================
+--- sal/inc/rtl/math.h (revision 1447988)
++++ sal/inc/rtl/math.h (working copy)
+@@ -396,6 +396,21 @@
+ */
+ double SAL_CALL rtl_math_pow10Exp(double fValue, int nExp) SAL_THROW_EXTERN_C();
+
++/** Similar to pow() with stricter exception handling for indeterminate values.
++
++ powr is specified in the IEEE 754 - 2008 Floating Point Standard.
++
++ @param fValue
++ The value to be raised.
++
++ @param fExp
++ The exponent.
++
++ @return
++ powr(fValue, fExp)
++ */
++double SAL_CALL rtl_math_powr(double fValue, double fExp) SAL_THROW_EXTERN_C();
++
+ /** Rounds value to 15 significant decimal digits.
+
+ @param fValue
+Index: sal/inc/rtl/math.hxx
+===================================================================
+--- sal/inc/rtl/math.hxx (revision 1447988)
++++ sal/inc/rtl/math.hxx (working copy)
+@@ -186,6 +186,13 @@
+ return rtl_math_pow10Exp(fValue, nExp);
+ }
+
++/** A wrapper around rtl_math_powr.
++ */
++inline double powr(double fValue, double fExp)
++{
++ return rtl_math_powr(fValue, fExp);
++}
++
+ /** A wrapper around rtl_math_approxValue.
+ */
+ inline double approxValue(double fValue)
+Index: sal/rtl/source/math.cxx
+===================================================================
+--- sal/rtl/source/math.cxx (revision 1447988)
++++ sal/rtl/source/math.cxx (working copy)
+@@ -1113,7 +1113,20 @@
+ return (fe-1.0) * fValue / log(fe);
+ }
+
++double SAL_CALL rtl_math_powr( double fValue, double fExp ) SAL_THROW_EXTERN_C()
++{
++ if ((fValue == 0.0 && fExp == 0.0) ||
++ (rtl::math::isInf( fExp ) && !rtl::math::isSignBitSet( fExp )) ||
++ (rtl::math::isInf( fValue ) && !rtl::math::isSignBitSet( fValue )))
++ {
++ double fResult;
++ ::rtl::math::setNan( &fResult );
++ return fResult;
++ }
++ return pow(fValue, fExp);
++}
+
++
+ double SAL_CALL rtl_math_log1p( double fValue ) SAL_THROW_EXTERN_C()
+ {
+ // Use volatile because a compiler may be too smart "optimizing" the
+Index: sal/util/sal.map
+===================================================================
+--- sal/util/sal.map (revision 1447988)
++++ sal/util/sal.map (working copy)
+@@ -629,6 +629,8 @@
+ global:
+ osl_loadAsciiModule;
+ osl_loadAsciiModuleRelative;
++
++ rtl_math_powr;
+ } UDK_3.11;
+
+ PRIVATE_1.0 {
+Index: sc/source/core/tool/interpr5.cxx
+===================================================================
+--- sc/source/core/tool/interpr5.cxx (revision 1447988)
++++ sc/source/core/tool/interpr5.cxx (working copy)
+@@ -1611,14 +1611,14 @@
+ if (bFlag)
+ { for ( SCSIZE i = 0; i < nCount; i++ )
+ if (pMat->IsValue(i))
+- pResMat->PutDouble(pow(fVal,pMat->GetDouble(i)), i);
++ pResMat->PutDouble(::rtl::math::powr(fVal,pMat->GetDouble(i)), i);
+ else
+ pResMat->PutString(ScGlobal::GetRscString(STR_NO_VALUE), i);
+ }
+ else
+ { for ( SCSIZE i = 0; i < nCount; i++ )
+ if (pMat->IsValue(i))
+- pResMat->PutDouble(pow(pMat->GetDouble(i),fVal), i);
++ pResMat->PutDouble(::rtl::math::powr(pMat->GetDouble(i),fVal), i);
+ else
+ pResMat->PutString(ScGlobal::GetRscString(STR_NO_VALUE), i);
+ }
+@@ -1628,7 +1628,7 @@
+ PushIllegalArgument();
+ }
+ else
+- PushDouble(pow(fVal1,fVal2));
++ PushDouble(::rtl::math::powr(fVal1,fVal2));
+ }
+
+ void ScInterpreter::ScSumProduct()
diff --git a/editors/openoffice-4/files/patch-i118574 b/editors/openoffice-4/files/patch-i118574
new file mode 100644
index 000000000000..4f3c6467c22d
--- /dev/null
+++ b/editors/openoffice-4/files/patch-i118574
@@ -0,0 +1,323 @@
+--- unoxml/source/dom/attr.hxx.orig 2011-11-03 21:05:47.000000000 -0500
++++ unoxml/source/dom/attr.hxx 2011-11-03 21:06:26.000000000 -0500
+@@ -30,6 +30,7 @@
+
+ #include <memory>
+
++#include <cwchar> // for std::mbstate_t
+ #include <libxml/tree.h>
+
+ #include <cppuhelper/implbase1.hxx>
+--- unoxml/source/dom/characterdata.hxx.orig 2011-11-03 21:12:41.000000000 -0500
++++ unoxml/source/dom/characterdata.hxx 2011-11-03 21:13:08.000000000 -0500
+@@ -28,6 +28,7 @@
+ #ifndef DOM_CHARACTERDATA_HXX
+ #define DOM_CHARACTERDATA_HXX
+
++#include <cwchar> // for std::mbstate_t
+ #include <libxml/tree.h>
+
+ #include <sal/types.h>
+--- unoxml/source/dom/childlist.cxx.orig 2011-11-03 21:36:22.000000000 -0500
++++ unoxml/source/dom/childlist.cxx 2011-11-03 21:37:22.000000000 -0500
+@@ -27,6 +27,7 @@
+
+ #include <childlist.hxx>
+
++#include <cwchar> // for std::mbstate_t
+ #include <libxml/tree.h>
+
+ #include <node.hxx>
+--- unoxml/source/dom/document.hxx.orig 2011-11-03 20:59:53.000000000 -0500
++++ unoxml/source/dom/document.hxx 2011-11-03 21:00:40.000000000 -0500
+@@ -31,6 +31,7 @@
+ #include <set>
+ #include <memory>
+
++#include <cwchar> // for std::mbstate_t
+ #include <libxml/tree.h>
+
+ #include <sal/types.h>
+--- unoxml/source/dom/documentbuilder.cxx.orig 2011-11-03 21:15:44.000000000 -0500
++++ unoxml/source/dom/documentbuilder.cxx 2011-11-03 21:16:26.000000000 -0500
+@@ -31,6 +31,7 @@
+ #include <stdio.h>
+ #include <stdarg.h>
+
++#include <cwchar> // for std::mbstate_t
+ #include <libxml/xmlerror.h>
+ #include <libxml/tree.h>
+
+--- unoxml/source/dom/documenttype.hxx.orig 2011-11-03 21:19:12.000000000 -0500
++++ unoxml/source/dom/documenttype.hxx 2011-11-03 21:19:39.000000000 -0500
+@@ -28,6 +28,7 @@
+ #ifndef DOM_DOCUMENTTYPE_HXX
+ #define DOM_DOCUMENTTYPE_HXX
+
++#include <cwchar> // for std::mbstate_t
+ #include <libxml/tree.h>
+
+ #include <sal/types.h>
+--- unoxml/source/dom/element.hxx.orig 2011-11-03 21:02:39.000000000 -0500
++++ unoxml/source/dom/element.hxx 2011-11-03 21:03:48.000000000 -0500
+@@ -28,6 +28,7 @@
+ #ifndef DOM_ELEMENT_HXX
+ #define DOM_ELEMENT_HXX
+
++#include <cwchar> // for std::mbstate_t
+ #include <libxml/tree.h>
+
+ #include <com/sun/star/uno/Reference.h>
+--- unoxml/source/dom/elementlist.hxx.orig 2011-11-03 21:33:35.000000000 -0500
++++ unoxml/source/dom/elementlist.hxx 2011-11-03 21:34:07.000000000 -0500
+@@ -32,6 +32,7 @@
+
+ #include <boost/scoped_array.hpp>
+
++#include <cwchar> // for std::mbstate_t
+ #include <libxml/tree.h>
+
+ #include <sal/types.h>
+--- unoxml/source/dom/entity.hxx.orig 2011-11-03 21:21:42.000000000 -0500
++++ unoxml/source/dom/entity.hxx 2011-11-03 21:22:28.000000000 -0500
+@@ -28,6 +28,7 @@
+ #ifndef DOM_ENTITY_HXX
+ #define DOM_ENTITY_HXX
+
++#include <cwchar> // for std::mbstate_t
+ #include <libxml/tree.h>
+ #include <libxml/entities.h>
+
+--- unoxml/source/dom/entityreference.hxx.orig 2011-11-03 21:24:36.000000000 -0500
++++ unoxml/source/dom/entityreference.hxx 2011-11-03 21:25:13.000000000 -0500
+@@ -28,6 +28,7 @@
+ #ifndef DOM_ENTITYREFERENCE_HXX
+ #define DOM_ENTITYREFERENCE_HXX
+
++#include <cwchar> // for std::mbstate_t
+ #include <libxml/tree.h>
+
+ #include <com/sun/star/uno/Reference.h>
+--- unoxml/source/dom/node.hxx.orig 2011-11-03 20:54:49.000000000 -0500
++++ unoxml/source/dom/node.hxx 2011-11-03 20:56:47.000000000 -0500
+@@ -30,6 +30,7 @@
+
+ #include <hash_map>
+
++#include <cwchar> // for std::mbstate_t
+ #include <libxml/tree.h>
+
+ #include <sal/types.h>
+--- unoxml/source/dom/notation.hxx.orig 2011-11-03 21:27:17.000000000 -0500
++++ unoxml/source/dom/notation.hxx 2011-11-03 21:28:12.000000000 -0500
+@@ -28,6 +28,7 @@
+ #ifndef DOM_NOTATION_HXX
+ #define DOM_NOTATION_HXX
+
++#include <cwchar> // for std::mbstate_t
+ #include <libxml/tree.h>
+
+ #include <com/sun/star/uno/Reference.h>
+--- unoxml/source/dom/processinginstruction.hxx.orig 2011-11-03 21:30:54.000000000 -0500
++++ unoxml/source/dom/processinginstruction.hxx 2011-11-03 21:31:30.000000000 -0500
+@@ -28,6 +28,7 @@
+ #ifndef DOM_PROCESSINGINSTRUCTION_HXX
+ #define DOM_PROCESSINGINSTRUCTION_HXX
+
++#include <cwchar> // for std::mbstate_t
+ #include <libxml/tree.h>
+
+ #include <com/sun/star/uno/Reference.h>
+--- unoxml/source/dom/text.hxx.orig 2011-11-03 21:10:46.000000000 -0500
++++ unoxml/source/dom/text.hxx 2011-11-03 21:11:14.000000000 -0500
+@@ -28,6 +28,7 @@
+ #ifndef DOM_TEXT_HXX
+ #define DOM_TEXT_HXX
+
++#include <cwchar> // for std::mbstate_t
+ #include <libxml/tree.h>
+
+ #include <sal/types.h>
+--- unoxml/source/events/eventdispatcher.hxx.orig 2011-11-03 21:51:05.000000000 -0500
++++ unoxml/source/events/eventdispatcher.hxx 2011-11-03 21:55:59.000000000 -0500
+@@ -31,6 +31,7 @@
+ #include <map>
+ #include <vector>
+
++#include <cwchar> // for std::mbstate_t
+ #include <libxml/tree.h>
+
+ #include <rtl/ustring.hxx>
+--- jvmfwk/source/elements.hxx.orig 2011-11-03 14:14:18.000000000 -0500
++++ jvmfwk/source/elements.hxx 2011-11-03 14:24:14.000000000 -0500
+@@ -32,6 +32,7 @@
+ #include "fwkutil.hxx"
+ #include "rtl/ustring.hxx"
+ #include "rtl/byteseq.hxx"
++#include <cwchar> // for std::mbstate_t
+ #include "libxml/parser.h"
+ #include "boost/optional.hpp"
+
+--- jvmfwk/source/fwkbase.cxx.orig 2011-11-03 14:31:12.000000000 -0500
++++ jvmfwk/source/fwkbase.cxx 2011-11-03 14:32:34.000000000 -0500
+@@ -32,6 +32,7 @@
+ #include "rtl/uri.hxx"
+ #include "osl/thread.hxx"
+ #include "osl/process.h"
++#include <cwchar> // for std::mbstate_t
+ #include "libxml/xpathInternals.h"
+ #include "osl/file.hxx"
+ #include "osl/module.hxx"
+--- jvmfwk/source/libxmlutil.hxx.orig 2011-11-03 14:28:02.000000000 -0500
++++ jvmfwk/source/libxmlutil.hxx 2011-11-03 14:28:52.000000000 -0500
+@@ -27,7 +27,7 @@
+ #if !defined INCLUDED_JVMFWK_LIBXMLUTIL_HXX
+ #define INCLUDED_JVMFWK_LIBXMLUTIL_HXX
+
+-
++#include <cwchar> // for std::mbstate_t
+ #include "libxml/parser.h"
+ #include "libxml/xpath.h"
+ //#include "libxml/xpathinternals.h"
+--- xmlhelp/source/cxxhelp/provider/urlparameter.cxx.orig 2011-11-03 23:28:51.000000000 -0500
++++ xmlhelp/source/cxxhelp/provider/urlparameter.cxx 2011-11-03 23:33:15.000000000 -0500
+@@ -46,6 +46,7 @@
+ #include <comphelper/processfactory.hxx>
+ #include <rtl/uri.hxx>
+ #include <rtl/ustrbuf.hxx>
++#include <cwchar> // for std::mbstate_t
+ #include <libxslt/xslt.h>
+ #include <libxslt/transform.h>
+ #include <libxslt/xsltutils.h>
+--- unoxml/source/xpath/nodelist.hxx.orig 2011-11-03 21:42:28.000000000 -0500
++++ unoxml/source/xpath/nodelist.hxx 2011-11-03 21:43:53.000000000 -0500
+@@ -38,6 +38,7 @@
+ #include <com/sun/star/xml/dom/XNodeList.hpp>
+ #include <com/sun/star/xml/xpath/XXPathObject.hpp>
+
++#include <cwchar> // for std::mbstate_t
+ #include "libxml/tree.h"
+ #include "libxml/xpath.h"
+
+--- unoxml/source/xpath/xpathapi.cxx.orig 2011-11-03 21:46:02.000000000 -0500
++++ unoxml/source/xpath/xpathapi.cxx 2011-11-03 21:46:34.000000000 -0500
+@@ -30,6 +30,7 @@
+ #include <stdarg.h>
+ #include <string.h>
+
++#include <cwchar> // for std::mbstate_t
+ #include <libxml/tree.h>
+ #include <libxml/xmlerror.h>
+ #include <libxml/xpath.h>
+Index: main/forms/source/xforms/xpathlib/xpathlib.hxx
+===================================================================
+--- forms/source/xforms/xpathlib/xpathlib.hxx (revision 1235458)
++++ forms/source/xforms/xpathlib/xpathlib.hxx (working copy)
+@@ -20,7 +20,7 @@
+ *************************************************************/
+
+
+-
++#include <cwchar> // for std::mbstate_t
+ #include <libxml/tree.h>
+ #include <libxml/xpath.h>
+ #include <libxml/xpathInternals.h>
+
+--- avmedia/source/gstreamer/gstplayer.hxx 2012-02-02 07:33:58.000000000 +0900
++++ avmedia/source/gstreamer/gstplayer.hxx 2012-02-02 07:35:03.000000000 +0900
+@@ -24,6 +24,8 @@
+ #ifndef _GSTPLAYER_HXX
+ #define _GSTPLAYER_HXX
+
++#include <cwchar> // for std::mbstate_t
++
+ #include "gstcommon.hxx"
+ #include <glib.h>
+ #include <glib/gatomic.h>
+
+
+--- xmlsecurity/source/xmlsec/biginteger.cxx 2012-02-04 10:36:05.000000000 +0900
++++ xmlsecurity/source/xmlsec/biginteger.cxx 2012-02-01 16:51:40.000000000 +0900
+@@ -19,7 +19,7 @@
+ *
+ *************************************************************/
+
+-
++#include <cwchar> // for std::mbstate_t
+
+ // MARKER(update_precomp.py): autogen include statement, do not remove
+ #include "precompiled_xmlsecurity.hxx"
+
+--- xmlsecurity/source/xmlsec/errorcallback.cxx 2012-02-04 10:37:52.000000000 +0900
++++ xmlsecurity/source/xmlsec/errorcallback.cxx 2012-02-01 16:51:40.000000000 +0900
+@@ -19,7 +19,7 @@
+ *
+ *************************************************************/
+
+-
++#include <cwchar> // for std::mbstate_t
+
+
+ // MARKER(update_precomp.py): autogen include statement, do not remove
+ #include "precompiled_xmlsecurity.hxx"
+
+--- xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.hxx 2012-02-03 13:03:47.000000000 +0900
++++ xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.hxx 2012-02-01 16:51:40.000000000 +0900
+@@ -24,6 +24,8 @@
+ #ifndef _XSECURITYENVIRONMENT_NSSIMPL_HXX_
+ #define _XSECURITYENVIRONMENT_NSSIMPL_HXX_
+
++#include <cwchar> // for std::mbstate_t
++
+ #include <sal/config.h>
+ #include <rtl/ustring.hxx>
+ #include <cppuhelper/factory.hxx>
+
+
+--- xmlsecurity/source/xmlsec/nss/seinitializer_nssimpl.hxx 2012-02-04 10:33:01.000000000 +0900
++++ xmlsecurity/source/xmlsec/nss/seinitializer_nssimpl.hxx 2012-02-01 16:51:40.000000000 +0900
+@@ -24,6 +24,8 @@
+ #ifndef _SEINITIALIZERIMPL_HXX
+ #define _SEINITIALIZERIMPL_HXX
+
++#include <cwchar> // for std::mbstate_t
++
+ #include <com/sun/star/xml/crypto/XXMLSecurityContext.hpp>
+ #include <com/sun/star/xml/crypto/XSEInitializer.hpp>
+
+
+--- xmlsecurity/source/xmlsec/saxhelper.hxx 2012-02-04 10:34:58.000000000 +0900
++++ xmlsecurity/source/xmlsec/saxhelper.hxx 2012-02-01 16:51:40.000000000 +0900
+@@ -24,6 +24,8 @@
+ #ifndef _SAXHELPER_HXX
+ #define _SAXHELPER_HXX
+
++#include <cwchar> // for std::mbstate_t
++
+ #include "libxml/tree.h"
+
+ #include <com/sun/star/xml/sax/SAXException.hpp>
+
+--- xmlsecurity/source/xmlsec/xmlelementwrapper_xmlsecimpl.hxx 2012-02-04 10:36:45.000000000 +0900
++++ xmlsecurity/source/xmlsec/xmlelementwrapper_xmlsecimpl.hxx 2012-02-01 16:51:40.000000000 +0900
+@@ -20,6 +20,7 @@
+ *************************************************************/
+
+
++#include <cwchar> // for std::mbstate_t
+
+ #ifndef _XMLELEMENTWRAPPER_XMLSECIMPL_HXX
+ #define _XMLELEMENTWRAPPER_XMLSECIMPL_HXX
+
+--- xmlsecurity/source/xmlsec/xmlstreamio.hxx 2012-02-04 10:37:09.000000000 +0900
++++ xmlsecurity/source/xmlsec/xmlstreamio.hxx 2012-02-01 16:51:40.000000000 +0900
+@@ -19,7 +19,7 @@
+ *
+ *************************************************************/
+
+-
++#include <cwchar> // for std::mbstate_t
+
+
+ #ifndef _XMLSTREAMIO_XMLSECIMPL_HXX_
+ #define _XMLSTREAMIO_XMLSECIMPL_HXX_
diff --git a/editors/openoffice-4/files/patch-i123018 b/editors/openoffice-4/files/patch-i123018
new file mode 100644
index 000000000000..a40ea1079d1d
--- /dev/null
+++ b/editors/openoffice-4/files/patch-i123018
@@ -0,0 +1,11 @@
+--- offapi/com/sun/star/awt/grid/XMutableGridDataModel.idl 2013/08/12 08:53:46 1513085
++++ offapi/com/sun/star/awt/grid/XMutableGridDataModel.idl 2013/08/12 09:41:11 1513086
+@@ -122,7 +122,7 @@
+ <p>The change in the data model will be notified to registered listeners via
+ <member">XGridDataListener::dataChanged</member>. The <member>GridDataEvent::FirstColumn</member> and
+ <member>GridDataEvent::LastColumn</member> will denote the smallest respectively largest column
+- index from <argColumnIndexes</arg>.</p>
++ index from <arg>ColumnIndexes</arg>.</p>
+
+ @param ColumnIndexes
+ contains the column indexes of the cells, which should be updated
diff --git a/editors/openoffice-4/files/patch-sal-inline b/editors/openoffice-4/files/patch-sal-inline
new file mode 100644
index 000000000000..8da6e53482aa
--- /dev/null
+++ b/editors/openoffice-4/files/patch-sal-inline
@@ -0,0 +1,16 @@
+Index: sal/util/makefile.mk
+===================================================================
+--- sal/util/makefile.mk (revision 1509387)
++++ sal/util/makefile.mk (working copy)
+@@ -45,6 +45,11 @@
+ CFLAGS+= $(LFS_CFLAGS)
+ CXXFLAGS+= $(LFS_CFLAGS)
+
++# gcc can have some broken inlining optimizations
++.IF "$(OS)"=="FREEBSD" && "$(COM)" == "GCC"
++CFLAGS += -fkeep-inline-functions
++.ENDIF
++
+ .IF "$(depend)" == ""
+
+ # --- Files --------------------------------------------------------
diff --git a/editors/openoffice-4/files/patch-unxfbsd.mk b/editors/openoffice-4/files/patch-unxfbsd.mk
new file mode 100644
index 000000000000..55a159337693
--- /dev/null
+++ b/editors/openoffice-4/files/patch-unxfbsd.mk
@@ -0,0 +1,28 @@
+--- solenv/inc/unxfbsd.mk~ 2012-10-31 10:39:44.000000000 +0900
++++ solenv/inc/unxfbsd.mk 2012-10-31 17:42:59.000000000 +0900
+@@ -80,14 +80,14 @@
+ .ENDIF
+
+ # flags for the C++ Compiler
+-CFLAGSCC= -pipe $(ARCH_FLAGS)
++CFLAGSCC= -pipe $(ARCH_FLAGS) %%RPATH%%
+ # Flags for enabling exception handling
+ CFLAGSEXCEPTIONS=-fexceptions -fno-enforce-eh-specs
+ # Flags for disabling exception handling
+ CFLAGS_NO_EXCEPTIONS=-fno-exceptions
+
+ # -fpermissive should be removed as soon as possible
+-CFLAGSCXX= -pipe $(ARCH_FLAGS)
++CFLAGSCXX= -pipe $(ARCH_FLAGS) %%RPATH%%
+ .IF "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE"
+ CFLAGSCXX += -fvisibility-inlines-hidden
+ .ENDIF # "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE"
+@@ -145,7 +145,7 @@
+ LINKFLAGSRUNPATH_OXT=
+ LINKFLAGSRUNPATH_BOXT=-Wl,-z,origin -Wl,-rpath,\''$$ORIGIN/../../../basis-link/program'\'
+ LINKFLAGSRUNPATH_NONE=
+-LINKFLAGS=-Wl,-z,combreloc $(LINKFLAGSDEFS) $(LINKFLAGS_SYSBASE)
++LINKFLAGS=-Wl,-z,combreloc %%RPATH%% $(LINKFLAGSDEFS) $(LINKFLAGS_SYSBASE)
+
+ # linker flags for linking applications
+ LINKFLAGSAPPGUI= -Wl,-export-dynamic -Wl,--noinhibit-exec \
diff --git a/editors/openoffice-4/files/pkg-message.in b/editors/openoffice-4/files/pkg-message.in
new file mode 100644
index 000000000000..5d4f68bb1a37
--- /dev/null
+++ b/editors/openoffice-4/files/pkg-message.in
@@ -0,0 +1,39 @@
+Apache OpenOffice Build %%OOOTAG%% Personal Install How-To
+
+Written by: Martin Blapp <mbr@freebsd.org>
+ and Maho Nakata <maho@FreeBSD.org>
+
+Apache OpenOffice %%OOOTAG%% will soon been installed in
+%%PREFIX%%/%%EXECBASE%%
+
+1. User installation
+--------------------
+
+Just type "%%EXECBASE%%" after you have successfully
+installed the package. If there is no installed OO.org dir
+in your homedir, the setup installs ".%%OOODIR%%" folder.
+
+2. Starting OO.org
+------------------
+
+There are some wrappers installed for faster startup.
+Add "%%PREFIX%%/bin/" to your PATH and you will be able
+to use them.
+
+%%PREFIX%%/bin/%%EXECBASE%%
+%%PREFIX%%/bin/%%EXECBASE%%-sbase
+%%PREFIX%%/bin/%%EXECBASE%%-scalc
+%%PREFIX%%/bin/%%EXECBASE%%-sdraw
+%%PREFIX%%/bin/%%EXECBASE%%-setofficelang
+%%PREFIX%%/bin/%%EXECBASE%%-smath
+%%PREFIX%%/bin/%%EXECBASE%%-simpress
+%%PREFIX%%/bin/%%EXECBASE%%-spadmin
+%%PREFIX%%/bin/%%EXECBASE%%-swriter
+
+OO.org does need $LANG to be set to a suitable value.
+
+3. If you run into problems
+--------------------------------------------------
+If you somehow run into problems, please remove the already
+installed ".%%OOODIR%%" dir in your homedir. Redo the user
+installation and the problems should go away.
diff --git a/editors/openoffice-4/pkg-descr b/editors/openoffice-4/pkg-descr
new file mode 100644
index 000000000000..1e923488924d
--- /dev/null
+++ b/editors/openoffice-4/pkg-descr
@@ -0,0 +1,18 @@
+Apache OpenOffice is an Open Source, community-developed, multi-platform
+office productivity suite. It includes the key desktop applications,
+such as a word processor, spreadsheet, presentation manager, and drawing
+program, with a user interface and feature set similar to other
+office suites.
+
+Components include:
+ * A universal word processing application for creating business
+ letters, extensive text documents, professional layouts, and HTML
+ documents.
+ * A sophisticated application for performing advanced spreadsheet
+ functions, such as analyzing figures, creating lists, and viewing data.
+ * A tool for creating effective eye-catching presentations.
+ * A vector-oriented draw module that enables the creation of 3D
+ illustrations
+
+WWW: http://openoffice.apache.org/
+
diff --git a/editors/openoffice-4/pkg-plist b/editors/openoffice-4/pkg-plist
new file mode 100644
index 000000000000..28bd78453b52
--- /dev/null
+++ b/editors/openoffice-4/pkg-plist
@@ -0,0 +1 @@
+# Dummy file, do not delete. Package list is generated automatically.