# Distributed under the terms of the GNU General Public License v2
# $Header: $
-WANT_AUTOCONF="2.5"
WANT_AUTOMAKE="1.9"
-EAPI="1"
+EAPI="2"
inherit autotools check-reqs db-use eutils fdo-mime flag-o-matic java-pkg-opt-2 kde-functions mono multilib toolchain-funcs
OOOTAG=${PATCHLEVEL}_m${MILESTONE}
OOOBUILDTAG=ooo300-m${MILESTONE}
-SRC="OOo_${PV}_src"
-S="${WORKDIR}/infra-ooo-files_${PV}"
-WORKSRC="${WORKDIR}/${OOOTAG}"
+SRC=OOo_${PV}_src
+S=${WORKDIR}/infra-ooo-files_${PV}
+WORKSRC=${WORKDIR}/${OOOTAG}
DESCRIPTION="OpenOffice-Infra, office suite with enhanced Russian support from Infra-Resource"
>=net-misc/curl-7.12
sys-libs/zlib
sys-apps/coreutils
- pam? ( sys-libs/pam )
+ pam? ( sys-libs/pam
+ sys-apps/shadow[pam] )
!dev-util/dmake
- >=dev-lang/python-2.3.4
+ >=dev-lang/python-2.3.4[threads]
java? ( || ( =virtual/jdk-1.6* =virtual/jdk-1.5* )
>=dev-java/ant-core-1.7 )
ldap? ( net-nds/openldap )
ewarn " LINGUAS variable(s). LINGUAS=ru for example. "
ewarn
else
- export LINGUAS_OOO=`echo ${LINGUAS} | \
- sed -e 's/\ben\b/en_US/g' -e 's/_/-/g'`
+ export LINGUAS_OOO=$(echo ${LINGUAS} | sed -e 's/\ben\b/en_US/g;s/_/-/g')
fi
if use !java; then
die
fi
- if use pam; then
- if ! built_with_use sys-apps/shadow pam; then
- eerror
- eerror " shadow needs to be built with pam-support. "
- eerror " rebuild it accordingly or remove the pam use-flag "
- die
- fi
- fi
-
if use nsplugin; then
if pkg-config --exists libxul; then
BRWS="libxul"
fi
fi
- # Check python
- if ! built_with_use dev-lang/python threads
- then
- eerror "Python needs to be built with threads."
- die
- fi
-
java-pkg-opt-2_pkg_setup
# sys-libs/db version used
- local db_ver="$(db_findver '>=sys-libs/db-4.3')"
+ local db_ver=$(db_findver '>=sys-libs/db-4.3')
}
unpack ${SRC}_extensions.tar.bz2
unpack ${SRC}_system.tar.bz2
+}
+
+src_prepare() {
+
if use odk && use java; then
cp -f "${DISTDIR}"/unowinreg.dll "${WORKSRC}"/external/unowinreg/
fi
cd "${WORKSRC}"; tar xjf "${WORKDIR}/infra-ooo-files_${PV}/files/extras-templates.tar.bz2"
cd "${WORKSRC}"; rm -rf "extras/source/autotext/lang/ru/*" ; tar xjf "${WORKDIR}/infra-ooo-files_${PV}/files/extras_ru.tar.bz2"
- "${WORKDIR}"/infra-ooo-files_${PV}/bin/enable-dict ru_RU "${WORKDIR}"/infra-ooo-files_${PV}/files/dict_ru_RU.tar.bz2 ${WORKSRC}
- "${WORKDIR}"/infra-ooo-files_${PV}/bin/enable-dict uk_UA "${WORKDIR}"/infra-ooo-files_${PV}/files/dict_uk_UA.tar.bz2 ${WORKSRC}
-
- mkdir -p "${WORKSRC}"/libwps/download/
- mkdir -p "${WORKSRC}"/libwpg/download/
- mkdir -p "${WORKSRC}"/libwpd/download/
- mkdir -p "${WORKSRC}"/libsvg/download/
+ "${WORKDIR}"/infra-ooo-files_${PV}/bin/enable-dict ru_RU "${WORKDIR}"/infra-ooo-files_${PV}/files/dict_ru_RU.tar.bz2 "${WORKSRC}"
+ "${WORKDIR}"/infra-ooo-files_${PV}/bin/enable-dict uk_UA "${WORKDIR}"/infra-ooo-files_${PV}/files/dict_uk_UA.tar.bz2 "${WORKSRC}"
+ # Infra branding
+ mkdir -p "${WORKSRC}"/{libwps,libwpg,libwpd,libsvg}/download/
cp -f "${WORKDIR}"/infra-ooo-files_${PV}/files/libwps*.tar.gz "${WORKSRC}"/libwps/download/
cp -f "${WORKDIR}"/infra-ooo-files_${PV}/files/libwpg*.tar.gz "${WORKSRC}"/libwpg/download/
cp -f "${WORKDIR}"/infra-ooo-files_${PV}/files/libwpd*.tar.gz "${WORKSRC}"/libwpd/download/
patchconf="${patchconf} --distro=Binfilter"
fi
- "${WORKDIR}"/infra-ooo-files_${PV}/bin/apply.pl "${WORKDIR}"/infra-ooo-files_${PV}/patches/dev300 ${WORKSRC} ${patchconf}
- "${WORKDIR}"/infra-ooo-files_${PV}/bin/transform --apply "${WORKDIR}"/infra-ooo-files_${PV} ${WORKSRC}
+ "${WORKDIR}"/infra-ooo-files_${PV}/bin/apply.pl "${WORKDIR}"/infra-ooo-files_${PV}/patches/dev300 "${WORKSRC}" ${patchconf}
+ "${WORKDIR}"/infra-ooo-files_${PV}/bin/transform --apply "${WORKDIR}"/infra-ooo-files_${PV} "${WORKSRC}"
if use postgres; then
# fix using of pg lib
# fix ru dict
epatch "${FILESDIR}/${PV}/gentoo-ru_dict.diff"
+ cd "${WORKSRC}/config_office"
+
+ eautoreconf
+
+}
+
+src_configure() {
+
# Use flag checks
if use java; then
CONFIGURE_ARGS="${CONFIGURE_ARGS} --with-ant-home=${ANT_HOME}"
local tempdict
for i in ${LINGUAS_OOO}; do
if [[ "${i}" != "en-US" ]]; then
- tempdict=`ls ${WORKSRC}/dictionaries/ | grep ${i} | sed -e 's/_//g' -e 's/\///g' | tr '[a-z]' '[A-Z]'`
+ tempdict=$(ls ${WORKSRC}/dictionaries/ | grep ${i} | sed -e 's/_//g;s/\///g' | tr '[a-z]' '[A-Z]')
tempdicts="${tempdicts},${tempdict}"
fi
done
CONFIGURE_ARGS="${CONFIGURE_ARGS} --with-external-thes-dir=/usr/share/myspell"
fi
- CONFIGURE_ARGS="${CONFIGURE_ARGS} `use_enable binfilter`"
- CONFIGURE_ARGS="${CONFIGURE_ARGS} `use_enable cups`"
- CONFIGURE_ARGS="${CONFIGURE_ARGS} `use_enable dbus`"
- CONFIGURE_ARGS="${CONFIGURE_ARGS} `use_enable eds evolution2`"
- CONFIGURE_ARGS="${CONFIGURE_ARGS} `use_enable gnome gnome-vfs`"
- CONFIGURE_ARGS="${CONFIGURE_ARGS} `use_enable gnome lockdown`"
- CONFIGURE_ARGS="${CONFIGURE_ARGS} `use_enable gstreamer`"
- CONFIGURE_ARGS="${CONFIGURE_ARGS} `use_enable gtk systray`"
- CONFIGURE_ARGS="${CONFIGURE_ARGS} `use_enable ldap`"
- CONFIGURE_ARGS="${CONFIGURE_ARGS} `use_enable opengl`"
- CONFIGURE_ARGS="${CONFIGURE_ARGS} `use_with ldap openldap`"
- CONFIGURE_ARGS="${CONFIGURE_ARGS} `use_enable debug crashdump`"
- CONFIGURE_ARGS="${CONFIGURE_ARGS} `use_enable debug strip-solver`"
+ CONFIGURE_ARGS="${CONFIGURE_ARGS} $(use_enable binfilter)"
+ CONFIGURE_ARGS="${CONFIGURE_ARGS} $(use_enable cups)"
+ CONFIGURE_ARGS="${CONFIGURE_ARGS} $(use_enable dbus)"
+ CONFIGURE_ARGS="${CONFIGURE_ARGS} $(use_enable eds evolution2)"
+ CONFIGURE_ARGS="${CONFIGURE_ARGS} $(use_enable gnome gnome-vfs)"
+ CONFIGURE_ARGS="${CONFIGURE_ARGS} $(use_enable gnome lockdown)"
+ CONFIGURE_ARGS="${CONFIGURE_ARGS} $(use_enable gstreamer)"
+ CONFIGURE_ARGS="${CONFIGURE_ARGS} $(use_enable gtk systray)"
+ CONFIGURE_ARGS="${CONFIGURE_ARGS} $(use_enable ldap)"
+ CONFIGURE_ARGS="${CONFIGURE_ARGS} $(use_enable opengl)"
+ CONFIGURE_ARGS="${CONFIGURE_ARGS} $(use_with ldap openldap)"
+ CONFIGURE_ARGS="${CONFIGURE_ARGS} $(use_enable debug crashdump)"
+ CONFIGURE_ARGS="${CONFIGURE_ARGS} $(use_enable debug strip-solver)"
# Extension stuff
CONFIGURE_ARGS="${CONFIGURE_ARGS} --with-extension-integration"
# Original branding results in black splash screens for some, so forcing ours
CONFIGURE_ARGS="${CONFIGURE_ARGS} --with-intro-bitmaps=\\\"${WORKSRC}/ooo_custom_images/nologo/introabout/intro.bmp\\\""
- export CONFIGURE_ARGS
-
- cd "${WORKSRC}/config_office"
- eautoreconf
-
-}
-
-src_compile() {
-
- # Should the build use multiprocessing? Not enabled by default, as it tends to break
- export JOBS="1"
- if [[ "${WANT_MP}" == "true" ]]; then
- export JOBS=`echo "${MAKEOPTS}" | sed -e "s/.*-j\([0-9]\+\).*/\1/"`
- fi
+ # Use multiprocessing by default now, it gets tested by upstream
+ export JOBS=$(echo "${MAKEOPTS}" | sed -e "s/.*-j\([0-9]\+\).*/\1/")
# Compile problems with these ...
filter-flags "-funroll-loops"
# Make sure gnome-users get gtk-support
local GTKFLAG="--disable-gtk --disable-cairo --without-system-cairo"
- ( use gtk || use gnome ) && GTKFLAG="--enable-gtk --enable-cairo --with-system-cairo"
+ { use gtk || use gnome; } && GTKFLAG="--enable-gtk --enable-cairo --with-system-cairo"
use kde && set-kdedir 3
cd "${WORKSRC}/config_office"
+ # distro-configs are not hooked in infra build, passing configure options as commandline arguments
./configure \
--srcdir="${DISTDIR}" \
--with-lang="${LINGUAS_OOO}" \
--with-build-version="${OOOTAG}" \
${GTKFLAG} \
- `use_enable mono` \
- `use_enable kde` \
- `use_enable debug symbols` \
- `use_enable odk` \
- `use_enable pam` \
- `use_with java` \
+ $(use_enable mono) \
+ $(use_enable kde) \
+ $(use_enable debug symbols) \
+ $(use_enable odk) \
+ $(use_enable pam) \
+ $(use_with java) \
--with-system-jpeg \
--with-system-libxml \
--with-system-libwpd \
${CONFIGURE_ARGS} \
|| die "Configuration failed!"
- einfo "Building OpenOffice-Infra..."
+}
+
+src_compile() {
cd "${WORKSRC}"
dmake || die "Build failed"
fi
- unset PYTHONPATH
- unset PYTHONHOME
-
}
src_install() {
fi
allcomponents="${basecomponents}"
- if use cups; then
- allcomponents="${allcomponents} printeradmin"
- fi
-
- if use gtk || use gnome; then
- allcomponents="${allcomponents} qstart"
- fi
+ use cups && allcomponents="${allcomponents} printeradmin"
+ { use gtk || use gnome; } && allcomponents="${allcomponents} qstart"
dodir "${instdir}"
# Icons
insinto /usr/share/icons
doins -r "${WORKSRC}"/sysui/desktop/icons/{hicolor,locolor}
- find "${D}"/usr/share/icons -name 'CVS' | xargs rm -rf
+ ecvs_clean "${D}/usr/share/icons"
for color in {hicolor,locolor}; do
for sizes in "${D}"usr/share/icons/${color}/* ; do
for i in ${allcomponents}; do
doins "${WORKSRC}"/sysui/unxlng"${arch_var}"6.pro/misc/openoffice.org/openoffice.org.xml
# Install wrapper script
- newbin "${FILESDIR}"/wrapper.in ooffice
+ newbin "${FILESDIR}"/wrapper.in ooffice || die
sed -i -e s/LIBDIR/$(get_libdir)/g "${D}"/usr/bin/ooffice || die "Wrapper script failed"
# Install PostgreSQL SDBC extension
}
-pkg_preinst() {
-
- use java && java-pkg-2_pkg_preinst
-
-}
-
pkg_postinst() {
fdo-mime_desktop_database_update