1 # Copyright 1999-2009 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
9 inherit autotools check-reqs db-use eutils gnome2-utils fdo-mime flag-o-matic java-pkg-opt-2 kde-functions mono multilib
12 IUSE="binfilter cups dbus debug eds firefox gnome gstreamer gtk java kde ldap mono odk oodict opengl pam seamonkey xulrunner"
16 OOOTAG=${PATCHLEVEL}_m${MILESTONE}
17 OOOBUILDTAG=ooh680-m${MILESTONE}
21 S="${WORKDIR}/infra-ooo-files_${PV}"
22 WORKSRC="${WORKDIR}/${OOOTAG}"
24 DESCRIPTION="OpenOffice-Infra, office suite with enhanced Russian support from Infra-Resource"
26 SRC_URI="mirror://openoffice/stable/${PV}/${SRC}_core.tar.bz2
27 mirror://openoffice/stable/${PV}/${SRC}_system.tar.bz2
28 mirror://openoffice/stable/${PV}/${SRC}_binfilter.tar.bz2
29 odk? ( mirror://openoffice/stable/${PV}/${SRC}_sdk.tar.bz2
30 java? ( http://tools.openoffice.org/unowinreg_prebuild/680/unowinreg.dll ) )
31 http://download.go-oo.org/SRC680/extras-2.tar.bz2
32 http://download.go-oo.org/SRC680/biblio.tar.bz2
33 http://download.go-oo.org/SRC680/lp_solve_5.5.0.10_source.tar.gz
34 http://download.go-oo.org/SRC680/oox.2008-02-29.tar.bz2
35 http://download.go-oo.org/SRC680/writerfilter.2008-02-29.tar.bz2
36 http://download.i-rs.ru/pub/openoffice/${PV}/ru/infra-ooo-files_2.4.2.tar.gz
37 http://tools.openoffice.org/unowinreg_prebuild/680/unowinreg.dll"
40 LANGS="${LANGS1} en en_US"
42 # proprt linguas handling
43 for X in ${LANGS} ; do
44 IUSE="${IUSE} linguas_${X}"
47 for Y in ${LANGS1} ; do
48 SRC_URI="${SRC_URI} linguas_${Y}? ( mirror://openoffice/stable/${PV}/${SRC}_l10n.tar.bz2 )"
51 # detect ARCH variable
52 if [[ "${ARCH}" == "amd64" ]] ; then
58 HOMEPAGE="http://www.i-rs.ru/ http://www.go-oo.org/"
62 KEYWORDS="~x86 ~amd64"
64 COMMON_DEPEND="!app-office/openoffice-bin
68 dbus? ( >=dev-libs/dbus-glib-0.71 )
69 gnome? ( >=x11-libs/gtk+-2.10
70 >=gnome-base/gnome-vfs-2.6
71 >=gnome-base/gconf-2.0
72 >=x11-libs/cairo-1.0.2 )
73 gtk? ( >=x11-libs/gtk+-2.10
74 >=x11-libs/cairo-1.0.2 )
75 eds? ( >=gnome-extra/evolution-data-server-1.2 )
76 gstreamer? ( >=media-libs/gstreamer-0.10
77 >=media-libs/gst-plugins-base-0.10 )
78 kde? ( =kde-base/kdelibs-3* )
79 java? ( >=dev-java/bsh-2.0_beta4
81 >=dev-java/xalan-serializer-2.7
83 =dev-java/xml-commons-external-1.3*
84 >=dev-db/hsqldb-1.8.0.9
85 =dev-java/rhino-1.5* )
86 mono? ( >=dev-lang/mono-1.2.3.1 )
87 opengl? ( virtual/opengl
89 xulrunner? ( >=net-libs/xulrunner-1.8
91 >=dev-libs/nss-3.11-r1 )
92 !xulrunner? ( firefox? ( >=dev-libs/nspr-4.6.6
93 >=dev-libs/nss-3.11-r1 ) )
94 !xulrunner? ( !firefox? ( seamonkey? ( =www-client/seamonkey-1*
96 >=dev-libs/nss-3.11-r1 ) ) )
97 >=net-misc/neon-0.24.7
98 >=dev-libs/openssl-0.9.8g
99 >=x11-libs/startup-notification-0.5
100 >=media-libs/freetype-2.1.10-r2
101 >=media-libs/fontconfig-2.3.0
102 cups? ( net-print/cups )
107 >=app-text/hunspell-1.1.4-r1
108 >=app-admin/eselect-oodict-20060706
112 >=app-text/libwpd-0.8.8
113 >=media-libs/libsvg-0.1.4
114 >=media-libs/vigra-1.4
115 linguas_ja? ( >=media-fonts/kochi-substitute-20030809-r3 )
116 linguas_zh_CN? ( >=media-fonts/arphicfonts-0.1-r2 )
117 linguas_zh_TW? ( >=media-fonts/arphicfonts-0.1-r2 )"
119 RDEPEND="java? ( >=virtual/jre-1.4 )
120 !xulrunner? ( firefox? ( || ( =www-client/mozilla-firefox-2*
121 =www-client/mozilla-firefox-bin-2* ) ) )
124 DEPEND="${COMMON_DEPEND}
129 x11-proto/xineramaproto
130 >=sys-apps/findutils-4.1.20-r1
132 virtual/perl-Compress-Zlib
133 >=virtual/perl-Compress-Raw-Zlib-2.002
134 virtual/perl-IO-Compress-Base
137 >=dev-libs/boost-1.33.1
141 >=dev-libs/libxml2-2.0
142 !xulrunner? ( firefox? ( =www-client/mozilla-firefox-2* ) )
147 media-gfx/imagemagick
148 pam? ( sys-libs/pam )
150 >=dev-lang/python-2.3.4
151 java? ( || ( =virtual/jdk-1.6* =virtual/jdk-1.5* =virtual/jdk-1.4* )
153 ldap? ( net-nds/openldap )
154 virtual/postgresql-base"
156 PROVIDE="virtual/ooo"
157 RESTRICT="strip" # the openoffice.org from infra-resource is already stripped
162 ewarn " It is important to note that OpenOffice-Infra is a very fragile "
163 ewarn " build when it comes to CFLAGS. A number of flags have already "
164 ewarn " been filtered out. If you experience difficulty merging this "
165 ewarn " package and use agressive CFLAGS, lower the CFLAGS and try to "
166 ewarn " merge again. Also note that building OOo takes a lot of time and "
167 ewarn " hardware ressources: 4-6 GB free diskspace and 256 MB RAM are "
168 ewarn " the minimum requirements. If you have less, use openoffice-infra-bin "
172 # Check if we have enough RAM and free diskspace to build this beast
173 CHECKREQS_MEMORY="512"
174 use debug && CHECKREQS_DISK_BUILD="8192" || CHECKREQS_DISK_BUILD="5120"
177 strip-linguas ${LANGS}
179 if [[ -z "${LINGUAS}" ]]; then
180 export LINGUAS_OOO="en-US"
182 ewarn " To get a localized build, set the according "
183 ewarn " LINGUAS variable(s). LINGUAS=ru for example. "
186 export LINGUAS_OOO=`echo ${LINGUAS} | \
187 sed -e 's/\ben\b/en_US/g' -e 's/_/-/g'`
190 if [[ "${#LINGUAS_OOO}" == "2" ]]; then
191 export BASELNG="${LINGUAS_OOO}"
193 export BASELNG="en-US"
197 ewarn " You are building with java-support disabled, this results in some "
198 ewarn " of the OpenOffice.org functionality (i.e. help) being disabled. "
199 ewarn " If something you need does not work for you, rebuild with "
200 ewarn " java in your USE-flags. "
204 if is-flagq -ffast-math ; then
205 eerror " You are using -ffast-math, which is known to cause problems. "
206 eerror " Please remove it from your CFLAGS, using this globally causes "
207 eerror " all sorts of problems. "
208 eerror " After that you will also have to - at least - rebuild python otherwise "
209 eerror " the openoffice build will break. "
214 if ! built_with_use sys-apps/shadow pam; then
215 eerror " shadow needs to be built with pam-support. "
216 eerror " rebuild it accordingly or remove the pam use-flag "
221 if use xulrunner; then
222 if pkg-config --exists xulrunner-xpcom; then
224 elif pkg-config --exists libxul; then
227 die "USE flag [xulrunner] set but not found!"
232 if ! built_with_use dev-lang/python threads
234 eerror "Python needs to be built with threads."
238 java-pkg-opt-2_pkg_setup
240 # sys-libs/db version used
241 local db_ver="$(db_findver '>=sys-libs/db-4.3')"
247 unpack infra-ooo-files_${PV}.tar.gz
248 unpack ${SRC}_system.tar.bz2
249 unpack ${SRC}_core.tar.bz2
250 unpack ${SRC}_binfilter.tar.bz2
251 unpack ${SRC}_l10n.tar.bz2
253 # Some fixes for our patchset
255 epatch "${FILESDIR}/${PV}/gentoo-scripts.diff"
256 # Missing includes for amd64 gcc43
257 cp -f "${FILESDIR}/${PV}/build-gcc43-missingincludes.diff" "${WORKDIR}"/infra-ooo-files_${PV}/patches/src680/
258 # Patch for using Gentoo specific goo team patches and GentooInfra distro target
259 epatch "${FILESDIR}/${PV}/gentoo-gentooinfra.diff"
261 mkdir -p "${WORKSRC}"/solver/680/unxlng${ARCH_VAR}6.pro/pck/
262 cp -f "${WORKDIR}"/infra-ooo-files_${PV}/files/extra_templates_*.zip "${WORKSRC}"/solver/680/unxlng${ARCH_VAR}6.pro/pck/
264 cd "${WORKSRC}"; rm -rf "extras/source/autotext/lang/ru/*" ; tar xjf "${WORKDIR}/infra-ooo-files_${PV}/files/extras_ru.tar.bz2"
265 cd "${WORKSRC}"; tar xjf "${WORKDIR}/infra-ooo-files_${PV}/files/oox.2008-02-29.tar.bz2"
267 "${WORKDIR}"/infra-ooo-files_${PV}/bin/enable-dict ru_RU "${WORKDIR}"/infra-ooo-files_${PV}/files/dict_ru_RU.tar.bz2 ${WORKSRC}
268 "${WORKDIR}"/infra-ooo-files_${PV}/bin/enable-dict de_DE "${WORKDIR}"/infra-ooo-files_${PV}/files/dict_de_DE.tar.bz2 ${WORKSRC}
269 "${WORKDIR}"/infra-ooo-files_${PV}/bin/enable-dict uk_UA "${WORKDIR}"/infra-ooo-files_${PV}/files/dict_uk_UA.tar.bz2 ${WORKSRC}
270 "${WORKDIR}"/infra-ooo-files_${PV}/bin/enable-dict fr_FR "${WORKDIR}"/infra-ooo-files_${PV}/files/dict_fr_FR.tar.bz2 ${WORKSRC}
271 mkdir -p "${WORKSRC}"/mdbtools/download/
272 mkdir -p "${WORKSRC}"/libwps/download/
273 mkdir -p "${WORKSRC}"/libwpg/download/
274 mkdir -p "${WORKSRC}"/libwpd/download/
275 mkdir -p "${WORKSRC}"/libsvg/download/
276 mkdir -p "${WORKSRC}"/default_images/sw/res/
277 mkdir -p "${WORKSRC}"/ooo_custom_images/nologo/introabout/
278 mkdir -p "${WORKSRC}"/default_images/introabout/
279 cp -f "${WORKDIR}"/infra-ooo-files_${PV}/files/mdbtools*.tar.gz "${WORKSRC}"/mdbtools/download/
280 cp -f "${WORKDIR}"/infra-ooo-files_${PV}/files/libwps*.tar.gz "${WORKSRC}"/libwps/download/
281 cp -f "${WORKDIR}"/infra-ooo-files_${PV}/files/libwpg*.tar.gz "${WORKSRC}"/libwpg/download/
282 cp -f "${WORKDIR}"/infra-ooo-files_${PV}/files/libwpd*.tar.gz "${WORKSRC}"/libwpd/download/
283 cp -f "${WORKDIR}"/infra-ooo-files_${PV}/files/libsvg*.tar.gz "${WORKSRC}"/libsvg/download/
284 cp -f "${WORKDIR}"/infra-ooo-files_${PV}/files/infra-logo.png "${WORKSRC}"/default_images/sw/res/
285 cp -f "${WORKDIR}"/infra-ooo-files_${PV}/files/go-oo-team.png "${WORKSRC}"/default_images/sw/res/
286 cp -f "${WORKDIR}"/infra-ooo-files_${PV}/res/infra/intro.bmp "${WORKSRC}"/ooo_custom_images/nologo/introabout/
287 cp -f "${WORKDIR}"/infra-ooo-files_${PV}/res/infra/about.bmp "${WORKSRC}"/default_images/introabout/
290 patchconf="--tag=${OOOBUILDTAG} --distro=GentooInfra --distro=Localize"
291 if use binfilter; then
292 patchconf="${patchconf} --distro=Binfilter"
294 "${WORKDIR}"/infra-ooo-files_${PV}/bin/apply.pl "${WORKDIR}"/infra-ooo-files_${PV}/patches/src680 ${WORKSRC} ${patchconf}
295 "${WORKDIR}"/infra-ooo-files_${PV}/bin/transform --apply "${WORKDIR}"/infra-ooo-files_${PV} ${WORKSRC}
297 cp -f "${DISTDIR}"/unowinreg.dll "${WORKSRC}"/external/unowinreg/
299 # workaround for x86/~x86 hunspell
300 export HUNSPELL_LIBS=$(echo "$(pkg-config hunspell --libs)" | sed 's|/|\\/|g')
302 # missing macolor1/macolor2 properties patch
303 epatch "${FILESDIR}/${PV}/gentoo-macolor.diff"
304 # completion_matches -> rl_completion_matches
305 epatch "${FILESDIR}/${PV}/gentoo-completion_matches.diff"
306 # enable/disable-gstreamer, disable scanning for rpm/dpkg and etc
307 epatch "${FILESDIR}/${PV}/gentoo-configure.diff"
308 # disable mkdepend warning
309 epatch "${FILESDIR}/${PV}/gentoo-mkdepend.diff"
310 # fix buildroot issue for rpm >=4.4.7
311 epatch "${FILESDIR}/gentoo-epm-3.7.patch.diff"
312 # fix handling of system libs for postgresql-base
313 epatch "${FILESDIR}/gentoo-system_pgsql.diff"
315 epatch "${FILESDIR}/gentoo-fixsandbox.diff"
319 CONFIGURE_ARGS="${CONFIGURE_ARGS} --with-ant-home=${ANT_HOME}"
320 CONFIGURE_ARGS="${CONFIGURE_ARGS} --with-jdk-home=$(java-config --jdk-home 2>/dev/null)"
321 CONFIGURE_ARGS="${CONFIGURE_ARGS} --with-java-target-version=$(java-pkg_get-target)"
322 CONFIGURE_ARGS="${CONFIGURE_ARGS} --with-system-beanshell"
323 CONFIGURE_ARGS="${CONFIGURE_ARGS} --with-system-xalan"
324 CONFIGURE_ARGS="${CONFIGURE_ARGS} --with-system-xerces"
325 CONFIGURE_ARGS="${CONFIGURE_ARGS} --with-system-xml-apis"
326 CONFIGURE_ARGS="${CONFIGURE_ARGS} --with-system-hsqldb"
327 CONFIGURE_ARGS="${CONFIGURE_ARGS} --with-beanshell-jar=$(java-pkg_getjar bsh bsh.jar)"
328 CONFIGURE_ARGS="${CONFIGURE_ARGS} --with-serializer-jar=$(java-pkg_getjar xalan-serializer serializer.jar)"
329 CONFIGURE_ARGS="${CONFIGURE_ARGS} --with-xalan-jar=$(java-pkg_getjar xalan xalan.jar)"
330 CONFIGURE_ARGS="${CONFIGURE_ARGS} --with-xerces-jar=$(java-pkg_getjar xerces-2 xercesImpl.jar)"
331 CONFIGURE_ARGS="${CONFIGURE_ARGS} --with-xml-apis-jar=$(java-pkg_getjar xml-commons-external-1.3 xml-apis.jar)"
332 CONFIGURE_ARGS="${CONFIGURE_ARGS} --with-hsqldb-jar=$(java-pkg_getjar hsqldb hsqldb.jar)"
335 if use firefox || use seamonkey || use xulrunner; then
336 CONFIGURE_ARGS="${CONFIGURE_ARGS} --enable-mozilla"
338 use seamonkey && browser="seamonkey"
339 use firefox && browser="firefox"
340 use xulrunner && browser="${XULR}"
341 CONFIGURE_ARGS="${CONFIGURE_ARGS} --with-system-mozilla=${browser}"
343 CONFIGURE_ARGS="${CONFIGURE_ARGS} --disable-mozilla"
344 CONFIGURE_ARGS="${CONFIGURE_ARGS} --without-system-mozilla"
347 CONFIGURE_ARGS="${CONFIGURE_ARGS} `use_enable binfilter`"
348 CONFIGURE_ARGS="${CONFIGURE_ARGS} `use_enable cups`"
349 CONFIGURE_ARGS="${CONFIGURE_ARGS} `use_enable dbus`"
350 CONFIGURE_ARGS="${CONFIGURE_ARGS} `use_enable eds evolution2`"
351 CONFIGURE_ARGS="${CONFIGURE_ARGS} `use_enable gnome gnome-vfs`"
352 CONFIGURE_ARGS="${CONFIGURE_ARGS} `use_enable gnome lockdown`"
353 CONFIGURE_ARGS="${CONFIGURE_ARGS} `use_enable gnome systray`"
354 CONFIGURE_ARGS="${CONFIGURE_ARGS} `use_enable gstreamer`"
355 CONFIGURE_ARGS="${CONFIGURE_ARGS} `use_enable ldap`"
356 CONFIGURE_ARGS="${CONFIGURE_ARGS} `use_enable opengl`"
357 CONFIGURE_ARGS="${CONFIGURE_ARGS} `use_with ldap openldap`"
358 CONFIGURE_ARGS="${CONFIGURE_ARGS} --enable-neon"
359 CONFIGURE_ARGS="${CONFIGURE_ARGS} --with-system-neon"
360 CONFIGURE_ARGS="${CONFIGURE_ARGS} --with-system-openssl"
362 CONFIGURE_ARGS="${CONFIGURE_ARGS} `use_enable debug crashdump`"
364 # Original branding results in black splash screens for some, so forcing ours
365 CONFIGURE_ARGS="${CONFIGURE_ARGS} --with-intro-bitmaps=\\\"${WORKSRC}/ooo_custom_images/nologo/introabout/intro.bmp\\\""
367 export CONFIGURE_ARGS
369 cd ${WORKSRC}/config_office
376 # Should the build use multiprocessing? Not enabled by default, as it tends to break
378 if [[ "${WANT_MP}" == "true" ]]; then
379 export JOBS=`echo "${MAKEOPTS}" | sed -e "s/.*-j\([0-9]\+\).*/\1/"`
382 # Compile problems with these ...
383 filter-flags "-funroll-loops"
384 filter-flags "-fprefetch-loop-arrays"
385 filter-flags "-fno-default-inline"
386 filter-flags "-fstack-protector"
387 filter-flags "-fstack-protector-all"
388 filter-flags "-ftracer"
389 filter-flags "-fforce-addr"
390 replace-flags "-O?" "-O2"
391 # not very clever to disable warning, but ... users afraid it
392 append-flags "-Wno-implicit"
393 append-flags "-fno-strict-aliasing"
395 # Build with NVidia cards breaks otherwise
396 use opengl && append-flags "-DGL_GLEXT_PROTOTYPES"
398 # Now for our optimization flags ...
399 export ARCH_FLAGS="${CXXFLAGS}"
400 use debug || export LINKFLAGSOPTIMIZE="${LDFLAGS}"
402 # Make sure gnome-users get gtk-support
403 local GTKFLAG="--disable-gtk --disable-cairo"
404 ( use gtk || use gnome ) && GTKFLAG="--enable-gtk --enable-cairo"
406 use kde && set-kdedir 3
408 # workaround for --with-system-*
409 export PKG_CONFIG=pkg-config
411 cd "${WORKSRC}/config_office"
414 --srcdir="${DISTDIR}" \
415 --with-lang="${LINGUAS_OOO}" \
416 --with-build-version=${OOOTAG} \
421 `use_enable debug symbols` \
424 --with-system-freetype \
425 --with-system-libxml \
426 --with-system-libwpd \
427 --with-system-hunspell \
431 --with-system-boost \
434 --with-system-expat \
436 --with-system-libxslt \
437 --with-system-vigra \
439 --mandir=/usr/share/man \
440 --libdir=/usr/$(get_libdir) \
441 --with-use-shell=bash \
442 --with-epm=internal \
443 --with-package-format=native \
444 --with-vendor="Infra-Resource" \
446 || die "Configuration failed!"
448 einfo "Building OpenOffice-Infra..."
452 if [[ "${ARCH}" == "amd64" ]]; then
453 GENTOO_ENV_SET="${WORKSRC}/LinuxX86-64Env.Set.sh"
455 GENTOO_ENV_SET="${WORKSRC}/LinuxX86Env.Set.sh"
458 source "${GENTOO_ENV_SET}"
462 cd transex3; build.pl -P${JOBS} --all && deliver.pl
466 if [[ "${BASELNG}" == "ru" || "${BASELNG}" == "uk" ]]; then
467 [ -f "${WORKDIR}"/infra-ooo-files_${PV}/sdf/${BASELNG}/${BASELNG}.sdf ] && "${WORKSRC}"/transex3/scripts/localize -m -l ${BASELNG} -f "${WORKDIR}"/infra-ooo-files_${PV}/sdf/${BASELNG}/${BASELNG}.sdf
468 [ -f "${WORKDIR}"/infra-ooo-files_${PV}/sdf/${BASELNG}/${BASELNG}-vendor.sdf ] && "${WORKSRC}"/transex3/scripts/localize -m -l ${BASELNG} -f "${WORKDIR}"/infra-ooo-files_${PV}/sdf/${BASELNG}/${BASELNG}-vendor.sdf
470 if [[ "${BASELNG}" == "ru" ]]; then
471 [ -f "${WORKDIR}"/infra-ooo-files_${PV}/sdf/${BASELNG}/${BASELNG}-patched.sdf ] && "${WORKSRC}"/transex3/scripts/localize -m -l ${BASELNG} -f "${WORKDIR}"/infra-ooo-files_${PV}/sdf/${BASELNG}/${BASELNG}-patched.sdf
474 if [[ "${JOBS}" != "1" ]]; then
475 cd instsetoo_native ; build.pl -P${JOBS} --all || die "Build failed"
477 dmake || die "Build failed"
487 einfo "Preparing Installation"
489 local gentoo_env_set_dst
491 if [[ "${ARCH}" == "amd64" ]]; then
492 gentoo_env_set_dst="linux-2.6-x86_64"
494 gentoo_env_set_dst="linux-2.6-intel"
497 local instdir="/usr/$(get_libdir)/openoffice"
498 local basecomponents="base calc draw impress math writer"
502 allcomponents="${basecomponents} extension printeradmin"
504 allcomponents="${basecomponents} extension"
509 cp -af "${WORKSRC}"/instsetoo_native/unxlng"${ARCH_VAR}"6.pro/OpenOffice/native/install/"${BASELNG}"/"${gentoo_env_set_dst}"/buildroot/opt/openoffice.org2.4/* \
512 for i in ${LINGUAS_OOO}; do
513 cp -af "${WORKSRC}"/instsetoo_native/unxlng"${ARCH_VAR}"6.pro/OpenOffice_languagepack/native/install/"${i}"/"${gentoo_env_set_dst}"/buildroot/opt/openoffice.org2.4/* \
519 rm -rf "${D}"${instdir}/share/dict/ooo/*.dic
520 rm -rf "${D}"${instdir}/share/dict/ooo/*.aff
524 cd "${D}"${instdir}/share/xdg/
526 for i in ${allcomponents}; do
527 mv "${i}".desktop openoffice.org2.4-"${i}".desktop
528 if [[ "${i}" == "printeradmin" ]]; then
529 sed -i -e s/openoffice.org2.4-/oo/g openoffice.org2.4-"${i}".desktop || die "Sed failed"
531 sed -i -e s/openoffice.org2.4/ooffice/g openoffice.org2.4-"${i}".desktop || die "Sed failed"
533 if [[ "${i}" == "draw" ]]; then
534 sed -i -e "s/Name\=OpenOffice\.org 2\.4 Draw/Name\=OpenOffice\.org 2\.4 Draw\nGenericName\=Draw\nGenericName[ru]\=Рисунки, блок-схемы и логотипы/g" \
535 openoffice.org2.4-"${i}".desktop || die "Sed failed"
537 if [[ "${i}" == "math" ]]; then
538 sed -i -e "s/Name\=OpenOffice\.org 2\.4 Math/Name\=OpenOffice\.org 2\.4 Math\nGenericName\=Math\nGenericName[ru]\=Формулы и уравнения/g" \
539 openoffice.org2.4-"${i}".desktop || die "Sed failed"
541 domenu openoffice.org2.4-"${i}".desktop
545 insinto /usr/share/icons
546 doins -r "${WORKSRC}"/sysui/desktop/icons/{hicolor,locolor}
547 find "${D}"/usr/share/icons -name 'CVS' | xargs rm -rf
548 for color in {hicolor,locolor}; do
549 for sizes in "${D}"usr/share/icons/${color}/* ; do
550 for i in ${allcomponents}; do
551 [[ -f "${sizes}"/apps/"${i}".png ]] && mv "${sizes}"/apps/"${i}".png "${sizes}"/apps/openofficeorg24-"${i}".png
558 mkdir -p "${D}"/usr/share/icons/gnome
559 for size in {16x16,32x32,48x48}; do
560 if ! [[ -d "${D}"/usr/share/icons/gnome/"${size}" ]]; then
561 mkdir -p "${D}"/usr/share/icons/gnome/"${size}"
562 mkdir -p "${D}"/usr/share/icons/gnome/"${size}/apps"
564 for i in ${allcomponents}; do
565 dosym /usr/share/icons/hicolor/"${size}"/apps/openofficeorg24-"${i}".png /usr/share/icons/gnome/"${size}"/apps/openofficeorg24-"${i}".png
570 for i in ${allcomponents}; do
571 dosym /usr/share/icons/hicolor/48x48/apps/openofficeorg24-"${i}".png /usr/share/pixmaps/openofficeorg24-"${i}".png
575 insinto /usr/share/mime/packages
576 doins "${WORKSRC}"/sysui/unxlng"${ARCH_VAR}"6.pro/misc/openoffice.org/openoffice.org.xml
578 # Install wrapper script
579 newbin "${FILESDIR}"/wrapper.in ooffice
580 sed -i -e s/LIBDIR/$(get_libdir)/g "${D}"/usr/bin/ooffice || die "Wrapper script failed"
583 for i in ${basecomponents}; do
584 dosym "${instdir}"/program/s"${i}" /usr/bin/oo"${i}"
588 dosym "${instdir}"/program/spadmin.bin /usr/bin/ooprinteradmin
590 dosym "${instdir}"/program/soffice /usr/bin/soffice
591 dosym "${instdir}"/program/unopkg /usr/bin/unopkg
593 # Install extensions: Sun Report Builder and Sun Presentation Minimizer
594 insinto "${instdir}"/share/extension/install
595 doins "${WORKSRC}"/solver/680/unxlng"${ARCH_VAR}"6.pro/bin/sun-report-builder.oxt
596 doins "${WORKSRC}"/solver/680/unxlng"${ARCH_VAR}"6.pro/bin/minimizer/sun-presentation-minimizer.oxt
598 # Fix the permissions for security reasons
599 # chown -R root:0 "${D}"
601 # Fix lib handling for internal old python 2.3
602 if [[ ! -e /usr/$(get_libdir)/libpython2.3.so.1.0 ]]; then
603 dolib.so "${D}"${instdir}/program/libpython2.3.so.1.0
606 # Non-java weirdness see bug #99366
607 use !java && rm -f "${D}"${instdir}/program/javaldx
609 # record java libraries
610 use java && java-pkg_regjar "${D}"/usr/$(get_libdir)/openoffice/program/classes/*.jar
612 # install java-set-classpath
614 insinto /usr/$(get_libdir)/openoffice/program
615 newins "${FILESDIR}/java-set-classpath.in" java-set-classpath
616 fperms 755 /usr/$(get_libdir)/openoffice/program/java-set-classpath
623 fdo-mime_desktop_database_update
624 fdo-mime_mime_database_update
625 if use gtk || use gnome; then
626 gnome2_icon_cache_update
629 use !oodict && eselect oodict update --libdir $(get_libdir)
631 [[ -x /sbin/chpax ]] && [[ -e /usr/$(get_libdir)/openoffice/program/soffice.bin ]] && chpax -zm /usr/$(get_libdir)/openoffice/program/soffice.bin
633 # Add available & useful jars to openoffice classpath
634 use java && /usr/$(get_libdir)/openoffice/program/java-set-classpath $(java-config --classpath=jdbc-mysql 2>/dev/null) >/dev/null
636 elog " To start OpenOffice-Infra, run:"
640 elog " Also, for individual components, you can use any of:"
642 elog " oobase, oocalc, oodraw, ooimpress, oomath or oowriter"
644 elog " You can find extension in: /usr/$(get_libdir)/openoffice/share/extension/install "
646 use !oodict && elog " Spell checking is now provided through our own myspell-ebuilds, "
647 use !oodict && elog " if you want to use it, please install the correct myspell package "
648 use !oodict && elog " according to your language needs. "
649 use !oodict && elog " For example, for myspell and the russian language You should do "
651 use !oodict && elog " emerge -av myspell-ru "
652 use !oodict && elog " eselect oodict set myspell-ru"
654 use !oodict && elog " If You do not like it re-emerge the package with "
655 use !oodict && elog " USE=\"oodict\" "
661 fdo-mime_desktop_database_update
662 fdo-mime_mime_database_update
663 if use gtk || use gnome; then
664 gnome2_icon_cache_update
667 use !oodict && [[ ! -e /usr/$(get_libdir)/openoffice/program/soffice.bin ]] && rm -rf /usr/$(get_libdir)/openoffice