All pastes #263200 Raw Edit

Stuff

public text v1 · immutable
·published 2006-12-01 08:00 UTC
rendered paste body
# Maintainer: Hussam Al-Tayeb <ht990332@gmail.com>

pkgname=openoffice
pkgver=2.1rc1
OO_milestone=OOE680_m5
pkgrel=3
pkgdesc="OpenOffice.org - a free office suite"
url="http://www.openoffice.org"
install=install.openoffice
arch=(i686 x86_64)
depends=('ttf-bitstream-vera' 'cups' 'curl' 'dbus-glib' 'desktop-file-utils' \
	'fontconfig' 'gtk2' 'hunspell' 'icu' 'neon' 'perl' 'python' 'sane' \
	'libwpd' 'xmlsec' 'xulrunner')

makedepends=('boost' 'bison' 'ccache' 'cvs' 'cairo' 'curl' 'fastjar' \
	'findutils' 'flex' 'gawk' 'gcc' 'gcc-gcj' 'kdelibs' 'libart-lgpl' \
	'pam' 'perl-archive-zip' 'pkgconfig' 'tcsh' 'unzip' 'zip')

conflicts=('openoffice-cvs')
provides=('openoffice-cvs')

mirror="ftp.linux.cz/pub/localization/OpenOffice.org/devel/build/Sources"
source=(http://$mirror/OOo_${OO_milestone}_source.tar.gz intro.bmp \
	http://www.apache.org/dist/ant/binaries/apache-ant-1.6.5-bin.tar.bz2 \
	OOD680_m5-hinting.diff buildfix-gcc-4.1.2-NULL.diff \
	buildfix-new-xslt.diff config_office-dbus-check-m1.diff \
	default-no-registration-menu.diff \
	default-no-startup-wizard.diff gui-insensitive.diff \
	default-no-registration.diff framework-layered-accelerators.diff \
	default-system-fpicker.diff  intros-config_office.diff \
	leak-sal-file.diff no-mozilla-plug-in-option.diff \
	session-management.diff sc-default-color-modify.diff \
	soffice-detect-mozilla-certificates.diff system-icu.diff \
	system-xmlsec.diff vcl-gnome-screensaver-poke.diff )

md5sums=('6a9ce4587ab4f188ff33de74b23f2482' '18e281491eadda03ed661b0261be0c22'\
         '26031ee1a2fd248ad0cc2e7f17c44c39' '01ffdb2c3061c27bc3132435ed9a02ef'\
         '76e905921552d799822473f98560af80' '2871ab2688ee93c187ff98445e5ea0ca'\
         'a99e2ef5cdcfe8a4abc551a9f6e0af2a' '9a3c032b7dc4490684da8710d6c49886'\
         '65a1b5017c3f8c66b1bf560e19caa6e6' 'd1b5885af55ceab6425fa021c3e027ec'\
         '2c54a8812c9679db9edc80961898df52' '5764750868a88eb3e044b09faf52751b'\
         'd3c4b2a690c2d379177c1517b70757ad' '4f261a2fb059d53892488aa94bbfc859'\
         '4f96c7b71b692aacf2acf9105f075feb' 'bd138afc57721883166c64940c326705'\
         '6a759417169ca7b86bb6748fc1ca3f93' '99a3c930a36d29747ff0e6b2fed916cb'\
         '43c47481599b0b9fa8b3b806d7417d94' '643ef5a893507d0fcd9ea9f9f1260ef5'\
         'ff1a71b4d6b6510deb0b0a0e5e79c5fe' '1f7152bc9c05376c12462aa61c84448c')
build() {

## parallel build is broken in most cases
export MAKEFLAGS="-j1"

## Workaround for people with Qt3 and Qt4 installed. 
## We need to use Qt3 by default if we are going to build with --enable -kde
[ -r /etc/profile.d/qt.sh ] && . /etc/profile.d/qt.sh 

# Set environment vars for (free) java
if [ "$CARCH" = "i686" ]; then
	export JAVADOC=/usr/bin/gjdoc
	export JAR=/usr/bin/fastjar
	export JAVACMD=/usr/bin/gij
	export JAVA=/usr/bin/gij
fi

cd $startdir/src
mv ooo_${OO_milestone}_src OOo2
cd OOo2
chmod +wX -R ./svx

# Apply patches
msg "Applying patches..."
for OOPATCHES in ../*.diff
do echo "${OOPATCHES}" && patch -p0 < ../${OOPATCHES} || return 1
done

# Enter config dir
cd config_office/

# Need to recreate the configure script because of patches
msg "Running autoconf..."
autoconf

# Configuring
msg "Running Configure..."

[ "$CARCH" = "x86_64" ] && EXTRAOPTS="--with-arch=x86_64  --without-java"
[ "$CARCH" = "i686" ] && EXTRAOPTS="--with-arch=x86 --with-java=gij --with-java-home=/usr --enable-gcjaot --enable-xsltproc"

./configure --disable-gnome-vfs --with-system-fonts --with-system-neon \
	--with-system-python --with-system-xrender-headers --with-system-curl \
	--without-docdir --with-system-sane-header --disable-mono \
	--with-package-format=native --without-nas --with-system-freetype \
	--with-system-jpeg --with-system-zlib --with-system-libxml \
	--with-xulrunner --with-system-mozilla --with-system-expat \
	--with-system-sndfile --with-system-stdlibs \
	--with-vendor="ArchLinux" --disable-qadevooo \
	--disable-odk --with-system-libwpd --with-system-xmlsec \
       	--without-myspell-dicts --with-system-hunspell \
	--with-build-version="2.1rc1 Build-${pkgrel}" --enable-cairo \
	--with-system-cairo --enable-evolution2 --with-system-libxslt \
	--disable-binfilter --disable-fontooo --without-fonts \
	--with-system-icu --with-system-boost --enable-dbus --enable-kde \
	--with-ant-home=$startdir/src/apache-ant-1.6.5 \
	--with-gcc-speedup=ccache \
	$EXTRAOPTS\

## NOTES
# 1. We need java bindings for db if we are to use --with-system-db so we don't.

## Compiling
cd ..

# Compile dmake utility
./bootstrap || return 1

# Setup environment for build
if [ "$CARCH" = "x86_64" ]; then
    source $startdir/src/OOo2/LinuxX86-64Env.Set.sh      # for x86_64
  else source $startdir/src/OOo2/LinuxIntelEnv.Set.sh   # for i686
fi

export EXTERNAL_WARNINGS_NOT_ERRORS=TRUE

# Running dmake.
msg "Compiling..."
dmake || return 1

# Install binaries
msg "Packaging binary files..."
if [ "$CARCH" = "x86_64" ]; then
    cp -R instsetoo_native/unxlngx6.pro/OpenOffice/native/install/en-US/linux-2.6-x86_64/buildroot/* $startdir/pkg/
   else cp -R instsetoo_native/unxlngx6.pro/OpenOffice/native/install/en-US/linux-2.6-intel/buildroot/* $startdir/pkg/
fi

mv openoffice.org2.1 openoffice

# Replace original splash intro screen with one provided by shastry
msg "Adding ArchLinux intro screen..."
rm -f $startdir/pkg/opt/openoffice/program/intro.bmp
install -D -m644 $startdir/src/intro.bmp $startdir/pkg/opt/openoffice/program/

# Prepare filesystem entries
mkdir -p $startdir/pkg/usr/{bin,share/applications}
mkdir -p $startdir/pkg/usr/share/icons/{HighContrast,hicolor,locolor}

# Make symlinks
cd $startdir/pkg/usr/bin
ln -s ../../opt/openoffice/program/soffice soffice
ln -s ../../opt/openoffice/program/spadmin spadmin

# Install shortcuts
msg "Adding Desktop related shortcuts.."
cp $startdir/pkg/opt/openoffice/share/xdg/*.desktop  $startdir/pkg/usr/share/applications
cd $startdir/pkg/usr/share/applications
sed -i -e 's|Exec=openoffice.org-2.1|Exec=/opt/openoffice/program/soffice|g' *.desktop
sed -i -e 's|Exec=/opt/openoffice/program/soffice-printeradmin|Exec=/opt/openoffice/program/spadmin|g' printeradmin.desktop

# Fix icons in shortcuts
sed -i -e 's|Icon=openofficeorg-21-base|Icon=base|g' *.desktop
sed -i -e 's|Icon=openofficeorg-21-calc|Icon=ooocalc|g' *.desktop
sed -i -e 's|Icon=openofficeorg-21-draw|Icon=draw|g' *.desktop
sed -i -e 's|Icon=openofficeorg-21-impress|Icon=impress|g' *.desktop
sed -i -e 's|Icon=openofficeorg-21-math|Icon=math|g' *.desktop
sed -i -e 's|Icon=openofficeorg-21-writer|Icon=writer|g' *.desktop
sed -i -e 's|Icon=openofficeorg-21-printeradmin.png|Icon=printeradmin|g' *.desktop

# Install icons
cd $startdir/src/OOo2/sysui/desktop/icons
cp -a -v HighContrast/*x* $startdir/pkg/usr/share/icons/HighContrast
cp -a -v hicolor/*x* $startdir/pkg/usr/share/icons/hicolor
cp -a -v locolor/*x* $startdir/pkg/usr/share/icons/locolor

## Just in case icon calc is used by calculator :)
find $startdir/pkg/usr/share/icons -type d -name apps  -exec mv \{}/calc.png  \{}/ooocalc.png \;

# Fix ownership and permissions
chown root.root -R $startdir/pkg/
chmod +rX -R $startdir/pkg/usr

msg "Doing some cleanup. This may take a while. Please Wait..."
find $startdir/pkg/usr/share/icons -name "CVS" -type d -exec rm -r {} \; > /dev/null 2>&1
rm -f $startdir/pkg/opt/openoffice/program/oo_product.bmp
rmdir $startdir/pkg/opt/openoffice/program/{addin,plugin}
rmdir $startdir/pkg/opt/openoffice/presets/{uno_packages/cache,uno_packages}
rmdir $startdir/pkg/opt/openoffice/presets/{autocorr,store,Scripts,wordbook,template,backup,temp}
rmdir $startdir/pkg/opt/openoffice/share/{uno_packages/cache,uno_packages}
rmdir $startdir/pkg/opt/openoffice/share/{samples/en-US,samples}
rmdir $startdir/pkg/opt/openoffice/share/{dict/ooo,dict}
}