summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--community-staging/calibre/PKGBUILD67
-rw-r--r--community-staging/calibre/calibre.install12
-rw-r--r--community-staging/calibre/desktop_integration.patch68
-rw-r--r--community-staging/couchdb/PKGBUILD40
-rw-r--r--community-staging/couchdb/couchdb.install22
-rw-r--r--community-staging/couchdb/rc-script.patch90
-rw-r--r--community-staging/dwdiff/PKGBUILD24
-rw-r--r--community-staging/gnustep-base/ChangeLog6
-rw-r--r--community-staging/gnustep-base/PKGBUILD34
-rw-r--r--community-staging/goldendict/PKGBUILD37
-rw-r--r--community-staging/goldendict/goldendict-paths.diff10
-rw-r--r--community-staging/goldendict/goldendict.changelog8
-rw-r--r--community-staging/ibus-qt/PKGBUILD31
-rw-r--r--community-staging/mapnik/PKGBUILD52
-rw-r--r--community-staging/mapnik/mapnik.install11
-rw-r--r--community-staging/open-vm-tools/PKGBUILD68
-rw-r--r--community-staging/open-vm-tools/open-vm-tools-X11Bool.patch15
-rw-r--r--community-staging/open-vm-tools/open-vm-tools.conf.d6
-rw-r--r--community-staging/open-vm-tools/open-vm-tools.install10
-rw-r--r--community-staging/open-vm-tools/open-vm-tools.rc.d101
-rw-r--r--community-staging/open-vm-tools/scripts-network-FS19541.patch40
-rw-r--r--community-staging/open-vm-tools/scripts-network.patch63
-rw-r--r--community-staging/open-vm-tools/tools.conf1
-rw-r--r--community-staging/open-vm-tools/vmware-guestd6
-rw-r--r--community-staging/open-vm-tools/xautostart.conf6
-rw-r--r--community-staging/openttd/PKGBUILD38
-rw-r--r--community-staging/openttd/openttd.install17
-rw-r--r--community-staging/parrot/ChangeLog5
-rw-r--r--community-staging/parrot/PKGBUILD44
-rw-r--r--community-staging/sword/PKGBUILD26
-rw-r--r--community-staging/tea/PKGBUILD35
-rw-r--r--community-staging/tea/tea.desktop10
-rw-r--r--community-staging/tea/tea.install4
-rw-r--r--community-staging/tracker/PKGBUILD50
-rw-r--r--community-staging/tracker/tracker.install11
-rw-r--r--community-staging/xulrunner-oss/PKGBUILD70
-rw-r--r--community-staging/xulrunner-oss/mozconfig56
-rw-r--r--community-staging/xulrunner-oss/mozilla-pkgconfig.patch60
-rw-r--r--community-staging/xulrunner-oss/oss.patch31
-rw-r--r--community-staging/xulrunner-oss/port_gnomevfs_to_gio.patch1316
-rw-r--r--community-staging/xulrunner-oss/xulrunner-omnijar.patch1737
-rw-r--r--community-staging/xulrunner-oss/xulrunner-version.patch12
-rw-r--r--community-staging/yaz/PKGBUILD38
-rw-r--r--community/etherape/PKGBUILD6
-rw-r--r--community/john/PKGBUILD11
-rw-r--r--community/roxterm/PKGBUILD9
-rw-r--r--community/vnstat/PKGBUILD15
-rw-r--r--core/bison/PKGBUILD10
-rw-r--r--core/bison/bison.install2
-rw-r--r--core/module-init-tools/PKGBUILD8
-rw-r--r--extra/cppunit/PKGBUILD32
-rw-r--r--extra/cppunit/gcc4.5.patch15
-rw-r--r--extra/telepathy-gabble/PKGBUILD8
-rw-r--r--extra/telepathy-qt4/PKGBUILD6
-rw-r--r--libre/abuse-libre/PKGBUILD50
-rw-r--r--libre/abuse-libre/abuse.install14
-rw-r--r--libre/abuse-libre/rePKGBUILD33
-rw-r--r--libre/initscripts/PKGBUILD4
-rw-r--r--libre/kernel26-libre/PKGBUILD7
-rw-r--r--staging/libreoffice/PKGBUILD701
-rw-r--r--staging/libreoffice/buildfix_64bit_system_libjpeg.diff11
-rw-r--r--staging/libreoffice/buildfix_bison25.diff23
-rw-r--r--staging/libreoffice/buildfix_boost.diff40
-rw-r--r--staging/libreoffice/buildfix_ct2n.diff17
-rw-r--r--staging/libreoffice/buildfix_i116795.diff22
-rw-r--r--staging/libreoffice/libreoffice.install25
-rw-r--r--staging/libreoffice/vbahelper.visibility.patch33
67 files changed, 5450 insertions, 40 deletions
diff --git a/community-staging/calibre/PKGBUILD b/community-staging/calibre/PKGBUILD
new file mode 100644
index 000000000..5ad10d94b
--- /dev/null
+++ b/community-staging/calibre/PKGBUILD
@@ -0,0 +1,67 @@
+# $Id: PKGBUILD 48634 2011-06-03 16:47:30Z stephane $
+# Maintainer: Giovanni Scafora <giovanni@archlinux.org>
+# Contributor: Petrov Roman <nwhisper@gmail.com>
+# Contributor: Andrea Fagiani <andfagiani _at_ gmail dot com>
+
+pkgname=calibre
+pkgver=0.8.3
+pkgrel=2
+pkgdesc="Ebook management application"
+arch=('i686' 'x86_64')
+url="http://calibre-ebook.com/"
+license=('GPL3')
+depends=('python-dateutil' 'python2-cssutils' 'python2-cherrypy'
+ 'python-mechanize' 'podofo' 'libwmf' 'python-beautifulsoup'
+ 'imagemagick' 'poppler-qt' 'chmlib' 'python-lxml' 'libusb'
+ 'python-imaging' 'desktop-file-utils' 'shared-mime-info'
+ 'python-dnspython' 'unrar' 'python2-pyqt' 'icu')
+makedepends=('python2-pycountry')
+optdepends=('ipython: to use calibre-debug')
+install=calibre.install
+source=(http://downloads.sourceforge.net/${pkgname}/${pkgname}-${pkgver}.tar.gz
+ desktop_integration.patch)
+md5sums=('aee05cac444f68491f2a3d68b22da53e'
+ 'f4b80e3b34e34bce68b3f052ff52dee8')
+
+build() {
+ cd "${srcdir}/${pkgname}"
+
+ #rm -rf src/{cherrypy,pyPdf}
+ rm -rf src/cherrypy
+ sed -i -e "s/ldflags = shlex.split(ldflags)/ldflags = shlex.split(ldflags) + ['-fPIC']/" setup/extensions.py
+ sed -i -e 's:\(#!/usr/bin/env[ ]\+python$\|#!/usr/bin/python$\):\12:g' \
+ $(find . -regex ".*.py\|.*.recipe")
+
+ python2 setup.py build
+ python2 setup.py resources
+ python2 setup.py translations
+}
+
+package() {
+ cd "${srcdir}/${pkgname}"
+
+ patch -Np1 -i "${srcdir}/desktop_integration.patch"
+
+ # More on desktop integration (e.g. enforce arch defaults)
+ sed -i -e "/self.create_uninstaller()/,/os.rmdir(config_dir)/d" \
+ -e "s|self.opts.staging_sharedir, 'man/man1'|self.opts.staging_root, 'usr/share/man/man1'|" \
+ -e "s|manpath, prog+'.1'+__appname__+'.bz2'|manpath, prog+'.1'+'.bz2'|" \
+ -e "s|old_udev = '/etc|old_udev = '${pkgdir}/etc|" \
+ -e "s/^Name=calibre/Name=Calibre/g" src/calibre/linux.py
+
+ # Fix the environment module location
+ sed -i -e "s|(prefix=.*)|(prefix='$pkgdir/usr')|g" setup/install.py
+
+ install -d "${pkgdir}/usr/lib/python2.7/site-packages"
+ python2 setup.py install --root="${pkgdir}" --prefix=/usr \
+ --staging-bindir="${pkgdir}/usr/bin" \
+ --staging-libdir="${pkgdir}/usr/lib" \
+ --staging-sharedir="${pkgdir}/usr/share"
+
+ find "${pkgdir}" -type d -empty -delete
+
+ # Decompress the man pages so makepkg will do it for us.
+ for decom in "${pkgdir}"/usr/share/man/man1/*.bz2; do
+ bzip2 -d "${decom}"
+ done
+}
diff --git a/community-staging/calibre/calibre.install b/community-staging/calibre/calibre.install
new file mode 100644
index 000000000..6210bd0ab
--- /dev/null
+++ b/community-staging/calibre/calibre.install
@@ -0,0 +1,12 @@
+post_install() {
+ update-desktop-database -q
+ update-mime-database usr/share/mime &> /dev/null
+}
+
+post_upgrade() {
+ post_install
+}
+
+post_remove() {
+ post_install
+}
diff --git a/community-staging/calibre/desktop_integration.patch b/community-staging/calibre/desktop_integration.patch
new file mode 100644
index 000000000..40d48c03e
--- /dev/null
+++ b/community-staging/calibre/desktop_integration.patch
@@ -0,0 +1,68 @@
+--- a/src/calibre/linux.py 2011-05-27 18:42:14.000000000 +0200
++++ b/src/calibre/linux.py 2011-05-29 14:57:49.000000000 +0200
+@@ -340,51 +340,39 @@
+
+ with TemporaryDirectory() as tdir:
+ with CurrentDir(tdir):
+- render_img('mimetypes/lrf.png', 'calibre-lrf.png')
+- check_call('xdg-icon-resource install --noupdate --context mimetypes --size 128 calibre-lrf.png application-lrf', shell=True)
+- self.icon_resources.append(('mimetypes', 'application-lrf', '128'))
+- check_call('xdg-icon-resource install --noupdate --context mimetypes --size 128 calibre-lrf.png text-lrs', shell=True)
+- self.icon_resources.append(('mimetypes', 'application-lrs',
+- '128'))
+- render_img('lt.png', 'calibre-gui.png')
+- check_call('xdg-icon-resource install --noupdate --size 128 calibre-gui.png calibre-gui', shell=True)
+- self.icon_resources.append(('apps', 'calibre-gui', '128'))
+- render_img('viewer.png', 'calibre-viewer.png')
+- check_call('xdg-icon-resource install --size 128 calibre-viewer.png calibre-viewer', shell=True)
+- self.icon_resources.append(('apps', 'calibre-viewer', '128'))
++ dir = os.path.join(self.opts.staging_sharedir,'../pixmaps')
++ os.mkdir(dir)
++ render_img('mimetypes/lrf.png', os.path.join(dir,'calibre-lrf.png'))
++ render_img('lt.png', os.path.join(dir, 'calibre-gui.png'))
++ render_img('viewer.png', os.path.join(dir, 'calibre-viewer.png'))
+
+ mimetypes = set([])
+ for x in all_input_formats():
+ mt = guess_type('dummy.'+x)[0]
+- if mt and 'chemical' not in mt and 'ctc-posml' not in mt:
++ if mt and 'chemical' not in mt and 'text' not in mt and 'pdf' not in mt and 'xhtml' not in mt:
+ mimetypes.add(mt)
+
+ def write_mimetypes(f):
+ f.write('MimeType=%s;\n'%';'.join(mimetypes))
+
+- f = open('calibre-lrfviewer.desktop', 'wb')
++ dir = os.path.join(self.opts.staging_sharedir,'../applications')
++ os.mkdir(dir)
++ f = open(os.path.join(dir, 'calibre-lrfviewer.desktop'), 'wb')
+ f.write(VIEWER)
+ f.close()
+- f = open('calibre-ebook-viewer.desktop', 'wb')
++ f = open(os.path.join(dir, 'calibre-ebook-viewer.desktop'), 'wb')
+ f.write(EVIEWER)
+ write_mimetypes(f)
+ f.close()
+- f = open('calibre-gui.desktop', 'wb')
++ f = open(os.path.join(dir, 'calibre-gui.desktop'), 'wb')
+ f.write(GUI)
+ write_mimetypes(f)
+ f.close()
+- des = ('calibre-gui.desktop', 'calibre-lrfviewer.desktop',
+- 'calibre-ebook-viewer.desktop')
+- for x in des:
+- cmd = ['xdg-desktop-menu', 'install', '--noupdate', './'+x]
+- check_call(' '.join(cmd), shell=True)
+- self.menu_resources.append(x)
+- check_call(['xdg-desktop-menu', 'forceupdate'])
+- f = open('calibre-mimetypes', 'wb')
++ dir = os.path.join(self.opts.staging_sharedir,'../mime/packages/')
++ os.makedirs(dir)
++ f = open(os.path.join(dir, 'calibre.xml'), 'wb')
+ f.write(MIME)
+ f.close()
+- self.mime_resources.append('calibre-mimetypes')
+- check_call('xdg-mime install ./calibre-mimetypes', shell=True)
+ except Exception:
+ if self.opts.fatal_errors:
+ raise
diff --git a/community-staging/couchdb/PKGBUILD b/community-staging/couchdb/PKGBUILD
new file mode 100644
index 000000000..4327a8094
--- /dev/null
+++ b/community-staging/couchdb/PKGBUILD
@@ -0,0 +1,40 @@
+# $Id: PKGBUILD 48637 2011-06-03 16:51:06Z stephane $
+# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
+# Contributor: Vitaliy Berdinskikh ur6lad[at]i.ua
+# Previous Contributor: Michael Fellinger <m.fellinger@gmail.com>
+
+pkgname=couchdb
+pkgver=1.0.2
+pkgrel=3
+pkgdesc="A document-oriented database that can be queried and indexed in a MapReduce fashion using JSON"
+arch=('i686' 'x86_64')
+url="http://couchdb.apache.org"
+license=('APACHE')
+depends=('icu' 'erlang' 'spidermonkey' 'openssl' 'curl')
+makedepends=('gcc')
+install=couchdb.install
+options=('!libtool')
+backup=('etc/couchdb/local.ini'
+ 'etc/conf.d/couchdb'
+ 'etc/logrotate.d/couchdb')
+source=("http://www.apache.org/dist/$pkgname/$pkgver/apache-$pkgname-$pkgver.tar.gz"
+ "rc-script.patch")
+md5sums=('7ffbbe0f23f672181c89923c9f7a1de1'
+ 'e9b5595338efbdc1a5db13284a296612')
+
+build() {
+ cd "$srcdir/apache-$pkgname-$pkgver"
+
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var
+ make
+ patch etc/init/couchdb <$srcdir/rc-script.patch
+ make DESTDIR="$pkgdir" install
+
+ install -Dm755 etc/default/couchdb $pkgdir/etc/conf.d/couchdb
+ sed -i 's|\(CONFIGURATION_FILE=/etc/\)default\(/couchdb\)|\1conf.d\2|' $pkgdir/etc/rc.d/couchdb
+ sed -i 's|\(COUCHDB_OPTIONS=\)|\1"-p /var/run/couchdb/couchdb.pid"|' $pkgdir/etc/conf.d/couchdb
+ sed -i 's|$COUCHDB -s|$COUCHDB $COUCHDB_OPTIONS -s|' $pkgdir/etc/rc.d/couchdb
+ sed -i 's|su $COUCHDB_USER -c|su $COUCHDB_USER -s /bin/bash -c|' $pkgdir/etc/rc.d/couchdb
+
+ rm -rf $pkgdir/etc/default/ $pkgdir/var/run
+}
diff --git a/community-staging/couchdb/couchdb.install b/community-staging/couchdb/couchdb.install
new file mode 100644
index 000000000..5eff459c7
--- /dev/null
+++ b/community-staging/couchdb/couchdb.install
@@ -0,0 +1,22 @@
+post_install() {
+ id couchdb &>/dev/null || \
+ useradd -r -c "CouchDB daemon" -g daemon -d /var/lib/couchdb -s /bin/false couchdb
+ mkdir -p /var/run/couchdb
+ chown -R couchdb.daemon /etc/couchdb
+ chown -R couchdb.daemon /var/{lib,log,run}/couchdb
+}
+
+pre_upgrade() {
+ id couchdb &>/dev/null || \
+ useradd -r -c "CouchDB daemon" -g daemon -d /var/lib/couchdb -s /bin/false couchdb
+}
+
+post_upgrade() {
+ mkdir -p $pkgdir/var/run/couchdb
+ chown -R couchdb.daemon /etc/couchdb
+ chown -R couchdb.daemon /var/{lib,log,run}/couchdb
+}
+
+post_remove() {
+ userdel couchdb &>/dev/null
+}
diff --git a/community-staging/couchdb/rc-script.patch b/community-staging/couchdb/rc-script.patch
new file mode 100644
index 000000000..d38f4dc6c
--- /dev/null
+++ b/community-staging/couchdb/rc-script.patch
@@ -0,0 +1,90 @@
+--- couchdb.org 2011-04-01 19:56:32.000000000 +0000
++++ couchdb 2011-04-01 19:59:17.000000000 +0000
+@@ -1,4 +1,7 @@
+-#!/bin/sh -e
++#!/bin/bash
++#general config
++. /etc/rc.conf
++. /etc/rc.d/functions
+
+ # Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ # use this file except in compliance with the License. You may obtain a copy of
+@@ -29,7 +32,7 @@
+ NAME=couchdb
+ SCRIPT_NAME=`basename $0`
+ COUCHDB=/usr/bin/couchdb
+-CONFIGURATION_FILE=/etc/default/couchdb
++CONFIGURATION_FILE=/etc/conf.d/couchdb
+ RUN_DIR=/var/run/couchdb
+ LSB_LIBRARY=/lib/lsb/init-functions
+
+@@ -61,8 +63,9 @@
+ fi
+
+ start_couchdb () {
+- # Start Apache CouchDB as a background process.
++ stat_busy "Starting the CouchDB daemon"
+
++ [ -d /var/run/couchdb ] || mkdir -p /var/run/couchdb
+ command="$COUCHDB -b"
+ if test -n "$COUCHDB_STDOUT_FILE"; then
+ command="$command -o $COUCHDB_STDOUT_FILE"
+@@ -79,38 +82,38 @@
+ mkdir -p "$RUN_DIR"
+ if test -n "$COUCHDB_USER"; then
+ chown $COUCHDB_USER "$RUN_DIR"
+- if su $COUCHDB_USER -c "$command" > /dev/null; then
+- return $SCRIPT_OK
++ if su $COUCHDB_USER -s /bin/bash -c "$command" > /dev/null; then
++ stat_done
+ else
+- return $SCRIPT_ERROR
++ stat_fail
+ fi
+ else
+ if $command > /dev/null; then
+- return $SCRIPT_OK
++ stat_done
+ else
+- return $SCRIPT_ERROR
++ stat_fail
+ fi
+ fi
+ }
+
+ stop_couchdb () {
+- # Stop the running Apache CouchDB process.
++ stat_busy "Stopping the CouchDB daemon"
+
+ command="$COUCHDB -d"
+ if test -n "$COUCHDB_OPTIONS"; then
+ command="$command $COUCHDB_OPTIONS"
+ fi
+ if test -n "$COUCHDB_USER"; then
+- if su $COUCHDB_USER -c "$command" > /dev/null; then
+- return $SCRIPT_OK
++ if su $COUCHDB_USER -s /bin/bash -c "$command" > /dev/null; then
++ stat_done
+ else
+- return $SCRIPT_ERROR
++ stat_fail
+ fi
+ else
+ if $command > /dev/null; then
+- return $SCRIPT_OK
++ stat_done
+ else
+- return $SCRIPT_ERROR
++ stat_fail
+ fi
+ fi
+ }
+@@ -118,7 +121,7 @@
+ display_status () {
+ # Display the status of the running Apache CouchDB process.
+
+- $COUCHDB -s
++ $COUCHDB $COUCHDB_OPTIONS -s
+ }
+
+ parse_script_option_list () {
diff --git a/community-staging/dwdiff/PKGBUILD b/community-staging/dwdiff/PKGBUILD
new file mode 100644
index 000000000..4585b2ae9
--- /dev/null
+++ b/community-staging/dwdiff/PKGBUILD
@@ -0,0 +1,24 @@
+# $Id: PKGBUILD 48640 2011-06-03 16:55:04Z stephane $
+# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
+
+pkgname=dwdiff
+pkgver=1.9
+pkgrel=2
+pkgdesc="a front-end for the diff program that operates at the word level instead of the line level"
+arch=('i686' 'x86_64')
+url="http://os.ghalkes.nl/dwdiff.html"
+depends=('diffutils' 'icu')
+license=('GPL')
+source=(http://os.ghalkes.nl/dist/$pkgname-$pkgver.tgz)
+md5sums=('f483d8d8dab7a972ef21d5096e07fd47')
+
+build() {
+ cd "$srcdir/$pkgname-$pkgver"
+ ./configure --prefix=/usr
+ make
+}
+
+package() {
+ cd "$srcdir/$pkgname-$pkgver"
+ make prefix="$pkgdir"/usr install
+}
diff --git a/community-staging/gnustep-base/ChangeLog b/community-staging/gnustep-base/ChangeLog
new file mode 100644
index 000000000..590f23f5e
--- /dev/null
+++ b/community-staging/gnustep-base/ChangeLog
@@ -0,0 +1,6 @@
+2007-07-24 Snowman <eric@archlinux>
+ * rebuilt against toolchain in current
+ * fixed SMP build
+ * fixed file ownership
+2007-06-26 tardo <tardo@nagi-fanboi.net>
+* Built for x86_64
diff --git a/community-staging/gnustep-base/PKGBUILD b/community-staging/gnustep-base/PKGBUILD
new file mode 100644
index 000000000..a2a05176b
--- /dev/null
+++ b/community-staging/gnustep-base/PKGBUILD
@@ -0,0 +1,34 @@
+# $Id: PKGBUILD 48665 2011-06-03 22:32:57Z stephane $
+# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
+# Maintainer: Vesa Kaihlavirta <vegai@iki.fi>
+# Contributor: Sebastian Sareyko <public@nooms.de>
+
+pkgname=gnustep-base
+pkgver=1.22.0
+pkgrel=2
+pkgdesc="The GNUstep base package"
+arch=('i686' 'x86_64')
+url="http://www.gnustep.org/"
+license=("GPL" "LGPL")
+depends=(libxslt avahi gmp gcc-libs openssl libffi gnustep-make gnutls)
+makedepends=(gcc-objc)
+conflicts=('gnustep-base-svn')
+groups=('gnustep-core')
+options=('!emptydirs' '!makeflags')
+source=(ftp://ftp.gnustep.org/pub/gnustep/core/$pkgname-$pkgver.tar.gz)
+md5sums=('7faab4891ae6c1e7a6c806d6da368410')
+
+build() {
+ cd "$srcdir/$pkgname-$pkgver"
+ source /etc/profile.d/GNUstep.sh
+ ./configure --prefix=/usr --sysconfdir=/etc/GNUstep --with-ffi-include=/usr/lib/libffi-3.0.9/include/
+ # fix file ownership
+ sed -i 's/tar -xf $(TIMEZONE_ARCHIVE);/tar -xf $(TIMEZONE_ARCHIVE);chown -R root:root * ;/' NSTimeZones/Makefile.postamble
+ make VERBOSE=1
+}
+
+package() {
+ cd "$srcdir/$pkgname-$pkgver"
+ make DESTDIR="$pkgdir" install
+ chown -R root.root "$pkgdir/"
+}
diff --git a/community-staging/goldendict/PKGBUILD b/community-staging/goldendict/PKGBUILD
new file mode 100644
index 000000000..237e20083
--- /dev/null
+++ b/community-staging/goldendict/PKGBUILD
@@ -0,0 +1,37 @@
+# $Id: PKGBUILD 48628 2011-06-03 15:58:27Z stephane $
+# Maintainer: Jaroslav Lichtblau <dragonlord@aur.archlinux.org>
+# Contributor: m0rph <m0rph.mailbox@gmail.com>
+
+pkgname=goldendict
+pkgver=1.0.1
+pkgrel=3
+pkgdesc="Feature-rich dictionary lookup program"
+arch=('i686' 'x86_64')
+url="http://goldendict.berlios.de/"
+license=('GPL3')
+depends=('hunspell' 'libvorbis' 'libxtst' 'libzip' 'openssl' 'phonon')
+makedepends=('patch')
+changelog=$pkgname.changelog
+source=(http://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver-src.tar.bz2 \
+ $pkgname-paths.diff)
+md5sums=('d56bb854936015104029d1f0b98b61bb'
+ '4488d4353e5522796c00785f0ce265e1')
+
+build(){
+ cd ${srcdir}
+
+ patch -Np0 -i ${srcdir}/$pkgname-paths.diff
+
+ qmake
+ make
+ qmake
+}
+
+package() {
+ cd ${srcdir}
+
+ make INSTALL_ROOT=${pkgdir} install
+
+#removing unneeded
+ rm -rf ${pkgdir}/usr/share/app-install
+}
diff --git a/community-staging/goldendict/goldendict-paths.diff b/community-staging/goldendict/goldendict-paths.diff
new file mode 100644
index 000000000..812dfdb97
--- /dev/null
+++ b/community-staging/goldendict/goldendict-paths.diff
@@ -0,0 +1,10 @@
+--- goldendict.pro~ 2010-12-27 22:52:21.000000000 +0100
++++ goldendict.pro 2010-12-27 22:52:21.000000000 +0100
+@@ -63,2 +63,2 @@
+- isEmpty( PREFIX ):PREFIX = /usr/local
+- DEFINES += PROGRAM_DATA_DIR=\\\"$$PREFIX/share/apps/goldendict/\\\"
++ isEmpty( PREFIX ):PREFIX = /usr
++ DEFINES += PROGRAM_DATA_DIR=\\\"$$PREFIX/share/goldendict/\\\"
+@@ -66 +66 @@
+- locale.path = $$PREFIX/share/apps/goldendict/locale/
++ locale.path = $$PREFIX/share/goldendict/locale/
diff --git a/community-staging/goldendict/goldendict.changelog b/community-staging/goldendict/goldendict.changelog
new file mode 100644
index 000000000..8ec311fe1
--- /dev/null
+++ b/community-staging/goldendict/goldendict.changelog
@@ -0,0 +1,8 @@
+2010-12-27 Jaroslav Lichtblau <dragonlord@aur.archlinux.org>
+ * Update to major release 1.0.1
+
+2010-02-16 Jaroslav Lichtblau <dragonlord@aur.archlinux.org>
+ * FS#18350 fixed in 0.9.0-5
+
+2009-06-21 Jaroslav Lichtblau <dragonlord@aur.archlinux.org>
+ * Package moved to [community] in v0.9.0
diff --git a/community-staging/ibus-qt/PKGBUILD b/community-staging/ibus-qt/PKGBUILD
new file mode 100644
index 000000000..51d3beb3d
--- /dev/null
+++ b/community-staging/ibus-qt/PKGBUILD
@@ -0,0 +1,31 @@
+# $Id: PKGBUILD 48593 2011-06-03 07:34:58Z andrea $
+# Maintainer: Thomas Dziedzic < gostrc at gmail >
+# Contributor: garion < garion @ mailoo.org >
+# Contributor: leemars
+
+pkgname=ibus-qt
+pkgver=1.3.1
+pkgrel=3
+pkgdesc='IBus qt library and IBus qt input method plugin'
+arch=('i686' 'x86_64')
+license=('LGPL')
+url='http://ibus.googlecode.com'
+depends=('qt' 'ibus' 'icu')
+makedepends=('cmake' 'automoc4' 'doxygen')
+source=("http://ibus.googlecode.com/files/${pkgname}-${pkgver}-Source.tar.gz")
+md5sums=('769e8872ca8a59327b2073ce2f142589')
+
+build() {
+ cd "${srcdir}"
+ mkdir build
+ cd build
+
+ cmake ../${pkgname}-${pkgver}-Source \
+ -DCMAKE_INSTALL_PREFIX=/usr
+ make
+}
+
+package() {
+ cd "${srcdir}"/build
+ make DESTDIR="${pkgdir}" install
+}
diff --git a/community-staging/mapnik/PKGBUILD b/community-staging/mapnik/PKGBUILD
new file mode 100644
index 000000000..a008e5c60
--- /dev/null
+++ b/community-staging/mapnik/PKGBUILD
@@ -0,0 +1,52 @@
+# $Id: PKGBUILD 48662 2011-06-03 19:43:21Z stephane $
+# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
+# Contributor: David Dent <thewinch@gmail.com>
+# Contributor: orbisvicis <orbisvicis@gmail.com>
+
+pkgname=mapnik
+pkgver=0.7.1
+pkgrel=10
+pkgdesc="Free Toolkit for developing mapping applications. Above all Mapnik is about rendering beautiful maps."
+arch=('i686' 'x86_64')
+url="http://mapnik.org/"
+license=('LGPL')
+depends=('boost-libs' 'icu' 'libpng' 'libjpeg' 'libtiff' 'freetype2'
+ 'libxml2' 'python2' 'proj' 'cairo' 'cairomm' 'pycairo'
+ 'postgresql-libs' 'postgis' 'gdal' 'curl' 'libtool')
+ # already in core ('zlib' 'sqlite3')
+optdepends=('libxslt: Web Map Service'
+ 'python-lxml: Web Map Service'
+ 'python-imaging: Web Map Service'
+ 'python-nose: Web Map Service'
+ 'apache: Web Map Service'
+ 'mod_fastcgi: Web Map Service - or:'
+ 'mod_fcgid: Web Map Service - or:'
+ 'mod_wsgi: Web Map Service'
+ )
+makedepends=('scons' 'boost') # already in core ('pkg-config')
+conflicts=('mapnik-svn')
+install="mapnik.install"
+source=("http://download.berlios.de/${pkgname}/${pkgname}-${pkgver}.tar.bz2")
+md5sums=('8f65fda2a792518d6f6be8a85f62fc73')
+
+build() {
+ cd "$srcdir/$pkgname-$pkgver"
+
+ #patch SConstruct so libs end up in /usr/lib not /usr/lib64 on X86_64
+ sed -i -e "/LIBDIR_SCHEMA=/s/lib64/lib/" SConstruct
+
+ sed -i 's/-ansi -Wall/-ansi -DBOOST_FILESYSTEM_VERSION=2 -Wall/' SConstruct
+
+ scons configure \
+ PREFIX="/usr" \
+ INPUT_PLUGINS=all \
+ DESTDIR="$pkgdir"
+ scons
+}
+package(){
+ cd "$srcdir/$pkgname-$pkgver"
+ scons install
+
+ # fix permissions on SCons-autogenerated files
+ chmod 644 "${pkgdir}/usr/lib/python2.7/site-packages/mapnik/paths.py"
+}
diff --git a/community-staging/mapnik/mapnik.install b/community-staging/mapnik/mapnik.install
new file mode 100644
index 000000000..46f265d5b
--- /dev/null
+++ b/community-staging/mapnik/mapnik.install
@@ -0,0 +1,11 @@
+post_install() {
+ /sbin/ldconfig
+}
+
+post_upgrade() {
+ post_install
+}
+
+post_remove() {
+ post_install
+}
diff --git a/community-staging/open-vm-tools/PKGBUILD b/community-staging/open-vm-tools/PKGBUILD
new file mode 100644
index 000000000..9a97df2e4
--- /dev/null
+++ b/community-staging/open-vm-tools/PKGBUILD
@@ -0,0 +1,68 @@
+# $Id: PKGBUILD 48659 2011-06-03 19:34:11Z stephane $
+# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
+# Contributor: Krzysztof Raczkowski <raczkow@gmail.com>
+
+pkgname=open-vm-tools
+pkgver=2011.03.28
+_pkgsubver=387002
+pkgrel=4
+pkgdesc="The Open Virtual Machine Tools (open-vm-tools) are the open source implementation of VMware Tools."
+arch=('i686' 'x86_64')
+url="http://open-vm-tools.sourceforge.net/"
+license=('LGPL')
+depends=('open-vm-tools-modules' 'libdnet' 'icu' 'procps' 'glib2' 'uriparser' 'libsigc++' 'libxss')
+makedepends=('chrpath' 'doxygen' 'gtkmm' 'fuse' 'libxtst')
+optdepends=('gtkmm' 'libnotify' 'libxtst' 'fuse' 'libsm')
+options=('docs' '!libtool')
+install=$pkgname.install
+source=(http://switch.dl.sourceforge.net/$pkgname/$pkgname-$pkgver-${_pkgsubver}.tar.gz
+ scripts-network.patch
+ scripts-network-FS19541.patch
+ open-vm-tools-X11Bool.patch
+ open-vm-tools.conf.d
+ open-vm-tools.rc.d
+ tools.conf
+ vmware-guestd
+ xautostart.conf)
+md5sums=('a9c72ab0b8f7778d444e69e9d3b95527'
+ '06f7448e274db2a911f582e276088fc9'
+ 'b183ec265200d68431a5e4eb1b0c8cf5'
+ '8c333a979578bdc0c3134c1dd6bb7353'
+ '79b0a14d86191fee70a4639da8bd7785'
+ '67cb83a9e5a4dd016c1a1da2863ca36d'
+ 'b55d15e2c4be396aad709aeca91033d3'
+ '73cc1a2665b0dd62427733d62ead8b9a'
+ '75a25d83417e683957321f97a00f8465')
+
+build() {
+ cd "$srcdir/$pkgname-${pkgver}-${_pkgsubver}"
+ [ $NOEXTRACT -eq 1 ] || {
+ sed -i 's#3.2.7#3.2.8#' configure configure.ac
+ sed -i 's#CFLAGS="$CFLAGS -Werror"##' configure configure.ac
+ }
+ [ -f Makefile ] || ./configure --prefix=/usr --without-kernel-modules
+ make
+}
+
+package() {
+ cd "$srcdir/$pkgname-${pkgver}-${_pkgsubver}"
+
+ make install DESTDIR=$pkgdir
+ install -D -m 755 scripts/common/vmware-xdg-detect-de $pkgdir/usr/bin/vmware-xdg-detect-de
+ chmod 07755 $pkgdir/usr/bin/vmware-user-suid-wrapper
+
+ cd $pkgdir
+ patch -Np1 -i $srcdir/scripts-network.patch etc/vmware-tools/scripts/vmware/network
+ patch -Np1 -i $srcdir/scripts-network-FS19541.patch etc/vmware-tools/scripts/vmware/network
+
+ install -D -m 755 $srcdir/open-vm-tools.rc.d $pkgdir/etc/rc.d/open-vm-tools
+ install -D -m 644 $srcdir/open-vm-tools.conf.d $pkgdir/etc/conf.d/open-vm-tools
+ install -D -m 644 $srcdir/tools.conf $pkgdir/etc/vmware-tools/tools.conf
+ install -D -m 644 $srcdir/xautostart.conf $pkgdir/etc/vmware-tools/xautostart.conf
+ install -D -m 644 $srcdir/vmware-guestd $pkgdir/etc/pam.d/vmware-guestd
+ rm -rf $pkgdir/usr/etc
+
+ ln -fs /usr/sbin/mount.vmhgfs $pkgdir/sbin/mount.vmhgfs
+
+ cd $pkgdir && find -type f -exec sh -c "file {} | grep ELF >/dev/null && echo {} && chrpath -d {}" \;
+}
diff --git a/community-staging/open-vm-tools/open-vm-tools-X11Bool.patch b/community-staging/open-vm-tools/open-vm-tools-X11Bool.patch
new file mode 100644
index 000000000..f12581807
--- /dev/null
+++ b/community-staging/open-vm-tools/open-vm-tools-X11Bool.patch
@@ -0,0 +1,15 @@
+diff -wbBur open-vm-tools-2010.08.24-292196.org/lib/include/vm_basic_types.h open-vm-tools-2010.08.24-292196/lib/include/vm_basic_types.h
+--- open-vm-tools-2010.08.24-292196.org/lib/include/vm_basic_types.h 2010-08-24 19:59:22.000000000 +0000
++++ open-vm-tools-2010.08.24-292196/lib/include/vm_basic_types.h 2010-08-30 09:38:48.000000000 +0000
+@@ -83,8 +83,11 @@
+
+ /* STRICT ANSI means the Xserver build and X defines Bool differently. */
+ #if !defined(__STRICT_ANSI__) || defined(__FreeBSD__) || defined(__MINGW32__)
++# ifndef _XTYPEDEF_BOOL
++# define _XTYPEDEF_BOOL
+ typedef char Bool;
+ #endif
++#endif
+
+ #ifndef FALSE
+ #define FALSE 0
diff --git a/community-staging/open-vm-tools/open-vm-tools.conf.d b/community-staging/open-vm-tools/open-vm-tools.conf.d
new file mode 100644
index 000000000..83f7864e8
--- /dev/null
+++ b/community-staging/open-vm-tools/open-vm-tools.conf.d
@@ -0,0 +1,6 @@
+# Enable support for Drag'n'Drop
+VM_DRAG_AND_DROP="yes"
+
+# vmware-guestd settings
+GUESTD_BIN="/usr/sbin/vmware-guestd"
+PIDFILE="/var/run/vmware-guestd.pid"
diff --git a/community-staging/open-vm-tools/open-vm-tools.install b/community-staging/open-vm-tools/open-vm-tools.install
new file mode 100644
index 000000000..88d9b88e6
--- /dev/null
+++ b/community-staging/open-vm-tools/open-vm-tools.install
@@ -0,0 +1,10 @@
+post_install() {
+ [ ! -d "/mnt/hgfs" ] && mkdir /mnt/hgfs
+ echo ">>>"
+ echo ">>> You can mount VMware Shared Folders via:"
+ echo ">>> mount -t vmhgfs .host:/ /mnt/hgfs"
+ echo ">>>"
+ echo ">>> or by adding this line to /etc/fstab:"
+ echo ">>> .host:/ /mnt/hgfs vmhgfs defaults 0 0"
+ echo ">>>"
+}
diff --git a/community-staging/open-vm-tools/open-vm-tools.rc.d b/community-staging/open-vm-tools/open-vm-tools.rc.d
new file mode 100644
index 000000000..0c9221489
--- /dev/null
+++ b/community-staging/open-vm-tools/open-vm-tools.rc.d
@@ -0,0 +1,101 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+# source application-specific settings
+[ -f /etc/conf.d/open-vm-tools ] && . /etc/conf.d/open-vm-tools
+
+PID=`pidof -o %PPID /usr/bin/vmtoolsd`
+case "$1" in
+ start)
+ stat_busy "Starting Open Virtual Machine Tools"
+
+ if [ "$VM_DRAG_AND_DROP" == "yes" ]; then
+ VMBLOCK=`grep -w vmblock /proc/modules`
+ [ -z "$VMBLOCK" ] && modprobe vmblock
+ if [ $? -gt 0 ]; then
+ stat_fail
+ exit 1
+ fi
+
+ DND_TMPDIR="/tmp/VMwareDnD"
+ if [ ! -d "$DND_TMPDIR" ]; then
+ mkdir $DND_TMPDIR
+ chmod 1777 $DND_TMPDIR
+ fi
+
+ mount -t vmblock none /proc/fs/vmblock/mountPoint
+ if [ $? -gt 0 ]; then
+ stat_fail
+ exit 1
+ fi
+ fi
+
+
+ for m in vmhgfs vmsync; do
+ VMMOD=`grep -w $m /proc/modules`
+ [ -z "$VMMOD" ] && \
+ { modprobe $m
+ if [ $? -gt 0 ]; then
+ stat_fail
+ exit 1
+ fi; }
+ done
+
+
+ [ -z "$PID" ] && /usr/bin/vmtoolsd --background $PIDFILE
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ add_daemon open-vm-tools
+ stat_done
+ fi
+ ;;
+ stop)
+ stat_busy "Stopping Open Virtual Machine Tools"
+ [ ! -z "$PID" ] && kill $PID &>/dev/null
+# if [ $? -gt 0 ]; then
+# stat_fail
+# exit 1
+# fi
+
+ for m in vmhgfs vmsync vmci; do
+ VMMOD=`grep -w $m /proc/modules`
+ [ ! -z "$VMMOD" ] && rmmod $m
+ if [ $? -gt 0 ]; then
+ stat_fail
+ exit 4
+ fi
+ done
+
+ if [ "$VM_DRAG_AND_DROP" == "yes" ]; then
+ MOUNTPOINT=`grep -w "none /proc/fs/vmblock/mountPoint vmblock" /proc/modules`
+ [ -z "$MOUNTPOINT" ] && umount /proc/fs/vmblock/mountPoint
+ if [ $? -gt 0 ]; then
+ stat_fail
+ exit 5
+ fi
+
+ DND_TMPDIR="/tmp/VMwareDnD"
+ rm -r $DND_TMPDIR
+
+ VMBLOCK=`grep -w vmblock /proc/modules`
+ [ ! -z "$VMBLOCK" ] && rmmod vmblock
+ if [ $? -gt 0 ]; then
+ stat_fail
+ exit 6
+ fi
+ fi
+
+ rm_daemon open-vm-tools
+ stat_done
+ ;;
+ restart)
+ $0 stop
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+esac
+exit 0
diff --git a/community-staging/open-vm-tools/scripts-network-FS19541.patch b/community-staging/open-vm-tools/scripts-network-FS19541.patch
new file mode 100644
index 000000000..1f65b9824
--- /dev/null
+++ b/community-staging/open-vm-tools/scripts-network-FS19541.patch
@@ -0,0 +1,40 @@
+--- network 2010-04-28 12:30:51.000000000 +0200
++++ network.bak 2010-05-20 12:12:50.000000000 +0200
+@@ -76,7 +76,7 @@
+ else
+ echo `date` "[rescue_nic] activating $nic ..."
+
+- ifup $nic
++ ifconfig $nic up
+ exitCode=`expr $exitCode \| $?`
+ fi
+ done < $activeList
+@@ -103,7 +103,7 @@
+ TranquilizeNetworkManager() {
+ # `which' may be a bit noisy, so we'll shush it.
+ dbusSend=`which dbus-send 2>/dev/null`
+- if [ $? -eq 0 ]; then
++ if [ $? -eq 0 ] && [ `pidof dbus-daemon` ]; then
+ # NetworkManager 0.6
+ $dbusSend --system --dest=org.freedesktop.NetworkManager \
+ /org/freedesktop/NetworkManager \
+@@ -133,7 +133,7 @@
+ WakeNetworkManager() {
+ # `which' may be a bit noisy, so we'll shush it.
+ dbusSend=`which dbus-send 2>/dev/null`
+- if [ $? -eq 0 ]; then
++ if [ $? -eq 0 ] && [ `pidof dbus-daemon` ]; then
+ # NetworkManager 0.6
+ $dbusSend --system --dest=org.freedesktop.NetworkManager \
+ /org/freedesktop/NetworkManager \
+@@ -165,8 +165,8 @@
+
+ # XXX Are these really necessary? If so, we should have seen customer
+ # complaints by now.
+- which ifup >/dev/null 2>&1 || Panic "ifup not in search path."
+- which ifconfig >/dev/null 2>&1 || Panic "ifconfig not in search path."
++# which ifup >/dev/null 2>&1 || Panic "ifup not in search path."
++ which ifconfig >/dev/null 2>&1 || Panic "ifconfig not in search path."
+
+ case "$1" in
+ poweron-vm)
diff --git a/community-staging/open-vm-tools/scripts-network.patch b/community-staging/open-vm-tools/scripts-network.patch
new file mode 100644
index 000000000..13ea7f565
--- /dev/null
+++ b/community-staging/open-vm-tools/scripts-network.patch
@@ -0,0 +1,63 @@
+--- network.org 2010-04-28 10:21:14.000000000 +0000
++++ network 2010-04-28 10:24:00.000000000 +0000
+@@ -34,51 +34,6 @@
+
+
+ #
+-# find_networking_script --
+-#
+-# Searches common Linux distro init/rc paths to find a singular network
+-# services script.
+-#
+-# Result:
+-# Returns a valid networking script path on success or "error" on failure.
+-#
+-# Side effects:
+-# None.
+-#
+-
+-find_networking_script() {
+- local script="error"
+- for dir in "/etc/init.d" "/sbin/init.d" "/etc" "/etc/rc.d" ; do
+- if [ -d "$dir/rc0.d" ] &&
+- [ -d "$dir/rc1.d" ] &&
+- [ -d "$dir/rc2.d" ] &&
+- [ -d "$dir/rc3.d" ] &&
+- [ -d "$dir/rc4.d" ] &&
+- [ -d "$dir/rc5.d" ] &&
+- [ -d "$dir/rc6.d" ]; then
+-
+- # Now find the appropriate networking script.
+- if [ -d "$dir/init.d" ]; then
+- if [ -x "$dir/init.d/network" ]; then
+- script="$dir/init.d/network"
+- elif [ -x "$dir/init.d/networking" ]; then
+- script="$dir/init.d/networking"
+- fi
+- else
+- if [ -x "$dir/network" ]; then
+- script="$dir/network"
+- elif [ -x "$dir/networking" ]; then
+- script="$dir/networking"
+- fi
+- fi
+- fi
+- done
+-
+- echo "$script"
+-}
+-
+-
+-#
+ # save_active_NIC_list --
+ #
+ # Records a list of every active NIC to /var/run/vmware-active-nics.
+@@ -205,7 +160,7 @@
+ exitCode=0
+ activeList=/var/run/vmware-active-nics
+
+- networkScript=`find_networking_script`
++ networkScript=/etc/rc.d/network
+ [ "$networkScript" != "error" ] || Panic "Cannot find system networking script."
+
+ # XXX Are these really necessary? If so, we should have seen customer
diff --git a/community-staging/open-vm-tools/tools.conf b/community-staging/open-vm-tools/tools.conf
new file mode 100644
index 000000000..0bb2681b1
--- /dev/null
+++ b/community-staging/open-vm-tools/tools.conf
@@ -0,0 +1 @@
+bindir = "/usr/bin"
diff --git a/community-staging/open-vm-tools/vmware-guestd b/community-staging/open-vm-tools/vmware-guestd
new file mode 100644
index 000000000..ac80c0385
--- /dev/null
+++ b/community-staging/open-vm-tools/vmware-guestd
@@ -0,0 +1,6 @@
+#%PAM-1.0
+
+auth sufficient /lib/security/pam_unix2.so shadow nullok
+auth required /lib/security/pam_unix_auth.so shadow nullok
+account sufficient /lib/security/pam_unix2.so
+account required /lib/security/pam_unix_acct.so
diff --git a/community-staging/open-vm-tools/xautostart.conf b/community-staging/open-vm-tools/xautostart.conf
new file mode 100644
index 000000000..829f379ce
--- /dev/null
+++ b/community-staging/open-vm-tools/xautostart.conf
@@ -0,0 +1,6 @@
+gnome-panel
+ksmserver
+startkde
+kwrapper
+panel
+xfce4-panel
diff --git a/community-staging/openttd/PKGBUILD b/community-staging/openttd/PKGBUILD
new file mode 100644
index 000000000..5a2aedccc
--- /dev/null
+++ b/community-staging/openttd/PKGBUILD
@@ -0,0 +1,38 @@
+# $Id: PKGBUILD 48655 2011-06-03 19:25:38Z stephane $
+# Maintainer: Vesa Kaihlavirta <vegai@iki.fi>
+
+pkgname=openttd
+pkgver=1.1.0
+pkgrel=2
+pkgdesc='An engine for running Transport Tycoon Deluxe.'
+arch=('i686' 'x86_64')
+url='http://www.openttd.org'
+license=('GPL')
+depends=('libpng' 'sdl' 'icu' 'fontconfig' 'lzo2' 'hicolor-icon-theme' 'desktop-file-utils')
+install=openttd.install
+optdepends=('openttd-opengfx: free graphics'
+ 'openttd-opensfx: free soundset')
+source=("http://binaries.openttd.org/releases/${pkgver}/${pkgname}-${pkgver}-source.tar.xz")
+md5sums=('b5b1f2ecc7327505e360047236b09d06')
+
+build() {
+ cd ${pkgname}-${pkgver}
+
+ ./configure \
+ --prefix-dir=/usr \
+ --binary-name=${pkgname} \
+ --binary-dir=bin \
+ --data-dir=share/${pkgname} \
+ --install-dir=${pkgdir} \
+ --doc-dir=share/doc/${pkgname} \
+ --menu-name="OpenTTD" \
+ --personal-dir=.${pkgname}
+
+ make
+}
+
+package() {
+ cd ${pkgname}-${pkgver}
+
+ make install
+}
diff --git a/community-staging/openttd/openttd.install b/community-staging/openttd/openttd.install
new file mode 100644
index 000000000..85b22a1c5
--- /dev/null
+++ b/community-staging/openttd/openttd.install
@@ -0,0 +1,17 @@
+post_install() {
+ gtk-update-icon-cache -q -t -f /usr/share/icons/hicolor > /dev/null 2>&1
+ update-desktop-database > /dev/null 2>&1
+}
+
+post_upgrade() {
+ post_install $1
+}
+
+pre_remove() {
+ update-desktop-database > /dev/null 2>&1
+}
+
+post_remove() {
+ gtk-update-icon-cache -q -t -f /usr/share/icons/hicolor > /dev/null 2>&1
+ update-desktop-database > /dev/null 2>&1
+}
diff --git a/community-staging/parrot/ChangeLog b/community-staging/parrot/ChangeLog
new file mode 100644
index 000000000..725287638
--- /dev/null
+++ b/community-staging/parrot/ChangeLog
@@ -0,0 +1,5 @@
+
+2008-01-06 Douglas Soares de Andrade <dsa@aur.archlinux.org>
+
+ * Added for x86_64
+
diff --git a/community-staging/parrot/PKGBUILD b/community-staging/parrot/PKGBUILD
new file mode 100644
index 000000000..eb5f198b7
--- /dev/null
+++ b/community-staging/parrot/PKGBUILD
@@ -0,0 +1,44 @@
+# $Id: PKGBUILD 48652 2011-06-03 17:21:22Z stephane $
+# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
+# Contributer: mpie <michael.kyne-phillips1@ntlworld.com>
+
+pkgname=parrot
+pkgver=3.3.0
+#_rel=devel
+_rel=stable
+pkgrel=2
+pkgdesc="standalone virtual machine that can be used to execute bytecode compiled dynamic languages"
+arch=(i686 x86_64)
+url="http://www.parrotcode.org/"
+license=('GPL')
+depends=('gmp' 'gdbm' 'readline' 'icu' 'openssl' 'libffi')
+makedepends=('perl-json')
+optdepends=('freeglut')
+options=(!emptydirs !makeflags)
+source=(ftp://ftp.parrot.org/pub/parrot/releases/${_rel}/$pkgver/parrot-$pkgver.tar.gz)
+md5sums=('335d50fbef245bfe6d0bb277e224c728')
+
+build() {
+ cd $srcdir/$pkgname-$pkgver
+
+ sed -i 's#auto::sha1##' lib/Parrot/Configure/Step/List.pm
+ sed -i 's#auto::git_describe##' lib/Parrot/Configure/Step/List.pm
+
+ [ $NOEXTRACT -eq 1 ] || perl Configure.pl --prefix=/usr --parrot_is_shared
+
+ find -type f -name Makefile | while read F; do
+ grep "$srcdir" $F && sed -i "s#-Wl,-rpath=$srcdir/parrot-$pkgver/blib/lib##" $F || true
+ grep "$srcdir" $F && sed -i "s#-rpath=$srcdir/parrot-$pkgver/blib/lib##" $F || true
+ done
+
+ OLD_LIB_PATH=$LD_LIBRARY_PATH
+ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$srcdir/parrot-$pkgver/blib/lib
+ make -j1 all parrot_utils docs html RPATH_BLIB=
+
+ export LD_LIBRARY_PATH=`pwd`/blib/lib
+ make -j1 DESTDIR=$pkgdir install-dev
+
+ sed -i "s#$srcdir#/usr/src#" $pkgdir/usr/lib/parrot/$pkgver/tools/lib/Parrot/Config/Generated.pm
+
+ export LD_LIBRARY_PATH=$OLD_LIB_PATH
+}
diff --git a/community-staging/sword/PKGBUILD b/community-staging/sword/PKGBUILD
new file mode 100644
index 000000000..0ad02180e
--- /dev/null
+++ b/community-staging/sword/PKGBUILD
@@ -0,0 +1,26 @@
+# Maintainer: Stefan Husmann <stefan-husmann@t-online.de>
+# Contributor: TripleE <eric1548@yahoo.com>
+
+pkgname=sword
+pkgver=1.6.2
+pkgrel=3
+pkgdesc="SWORD libraries for Bible programs"
+arch=('i686' 'x86_64')
+url="http://www.crosswire.org/sword/index.jsp"
+license=('GPL')
+depends=('curl' 'icu' 'clucene')
+source=(http://www.crosswire.org/ftpmirror/pub/${pkgname}/source/v1.6/${pkgname}-${pkgver}.tar.gz)
+md5sums=('a7dc4456e20e915fec46d774b690e305')
+backup=('etc/sword.conf')
+
+build() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ ./configure --prefix=/usr --sysconfdir=/etc --with-icu
+ make
+}
+package() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ make DESTDIR="${pkgdir}" install
+ make DESTDIR="${pkgdir}" install_config
+}
+
diff --git a/community-staging/tea/PKGBUILD b/community-staging/tea/PKGBUILD
new file mode 100644
index 000000000..4ab5fde5d
--- /dev/null
+++ b/community-staging/tea/PKGBUILD
@@ -0,0 +1,35 @@
+# $Id: PKGBUILD 48620 2011-06-03 13:51:59Z ibiru $
+# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
+# Maintainer: Andrea Scarpino <andrea@archlinux.org>
+# Contributor: Roman Kyrylych <roman@archlinux.org>
+# Contributor: Michal Kaliszka <desmont@gmail.com>
+# Contributor: Zsolt Varadi <sysop_xxl@fibermail.hu>
+
+pkgname=tea
+pkgver=29.0.3
+pkgrel=2
+pkgdesc="A QT-based text editor for Linux and *BSD. With an ultimate small size TEA provides you hundreds of functions."
+arch=('i686' 'x86_64')
+url="http://tea-editor.sourceforge.net/"
+license=('GPL')
+depends=('qt' 'aspell' 'hunspell')
+install=tea.install
+source=(http://downloads.sourceforge.net/tea-editor/${pkgname}-${pkgver}.tar.bz2
+ tea.desktop)
+md5sums=('1c900e7f57a0fe72fb4cc481450a5b32'
+ '377ace3363124f4c086de0babb820761')
+
+build() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+
+ qmake PREFIX=/usr/bin
+ make
+}
+
+package(){
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ make INSTALL_ROOT="${pkgdir}" install
+
+ install -Dm644 "${srcdir}/tea.desktop" "${pkgdir}/usr/share/applications/tea.desktop"
+ install -Dm644 icons/tea_icon_v2.png "${pkgdir}/usr/share/pixmaps/tea.png"
+}
diff --git a/community-staging/tea/tea.desktop b/community-staging/tea/tea.desktop
new file mode 100644
index 000000000..818704a26
--- /dev/null
+++ b/community-staging/tea/tea.desktop
@@ -0,0 +1,10 @@
+[Desktop Entry]
+Encoding=UTF-8
+Name=Tea
+Comment=A small programmer's QT editor
+Exec=tea %U
+Terminal=false
+Type=Application
+StartupNotify=true
+Icon=tea.png
+Categories=Application;Utility;TextEditor;
diff --git a/community-staging/tea/tea.install b/community-staging/tea/tea.install
new file mode 100644
index 000000000..d7904254b
--- /dev/null
+++ b/community-staging/tea/tea.install
@@ -0,0 +1,4 @@
+post_upgrade() {
+ echo "############################################"
+ echo "for the old GTK branch of TEA install teagtk"
+}
diff --git a/community-staging/tracker/PKGBUILD b/community-staging/tracker/PKGBUILD
new file mode 100644
index 000000000..f6ec9331b
--- /dev/null
+++ b/community-staging/tracker/PKGBUILD
@@ -0,0 +1,50 @@
+# $Id: PKGBUILD 48646 2011-06-03 17:05:43Z stephane $
+# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
+# Maintainer: Alexander Fehr <pizzapunk gmail com>
+
+pkgname=tracker
+pkgver=0.10.15
+pkgrel=2
+pkgdesc="Powerful object database, tag/metadata database, search tool and indexer"
+arch=('i686' 'x86_64')
+url="http://www.gnome.org/projects/tracker/"
+license=('GPL')
+depends=('upower' 'poppler-glib' 'gstreamer0.10-base' 'libgee' 'gnome-desktop' 'libnotify' 'xdg-utils' 'gtkhtml'
+ 'libgsf' 'gnome-panel-bonobo' 'exempi' 'networkmanager')
+makedepends=('intltool' 'gnome-panel' 'nautilus' 'evolution' 'totem-plparser' 'icu')
+optdepends=('nautilus'
+ 'enca'
+ 'gtkhtml'
+ 'gnome-panel'
+ 'totem-plparser'
+ 'icu'
+ 'taglib'
+ 'giflib')
+options=('!libtool')
+conflicts=('libtracker')
+provides=("libtracker")
+install=tracker.install
+source=(http://ftp.gnome.org/pub/GNOME/sources/tracker/0.10/tracker-$pkgver.tar.bz2)
+md5sums=('c948ef3988b08e81cad3ff980b17a0fd')
+
+build() {
+ cd "$srcdir/$pkgname-$pkgver"
+
+ # python2 fix
+ export PYTHON=`which python2`
+ for file in tests/functional-tests/*.py; do
+ sed -i 's_#!/usr/bin/env python_#!/usr/bin/env python2_' $file
+ sed -i 's_#!/usr/bin/python_#!/usr/bin/python2_' $file
+ done
+
+ ./configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib/$pkgname \
+ --enable-video-extractor=gstreamer --disable-unac --disable-hal \
+ --disable-devkit-power --disable-miner-evolution
+ touch docs/manpages/tracker-search-bar.1
+ make
+}
+
+package() {
+ cd "$srcdir/$pkgname-$pkgver"
+ make DESTDIR="$pkgdir" install
+}
diff --git a/community-staging/tracker/tracker.install b/community-staging/tracker/tracker.install
new file mode 100644
index 000000000..b95cc069d
--- /dev/null
+++ b/community-staging/tracker/tracker.install
@@ -0,0 +1,11 @@
+post_install() {
+ which xdg-icon-resource 1>/dev/null 2>/dev/null && xdg-icon-resource forceupdate || true
+}
+
+post_upgrade() {
+ post_install $1
+}
+
+post_remove() {
+ which xdg-icon-resource 1>/dev/null 2>/dev/null && xdg-icon-resource forceupdate || true
+}
diff --git a/community-staging/xulrunner-oss/PKGBUILD b/community-staging/xulrunner-oss/PKGBUILD
new file mode 100644
index 000000000..613d9f41b
--- /dev/null
+++ b/community-staging/xulrunner-oss/PKGBUILD
@@ -0,0 +1,70 @@
+# $Id: PKGBUILD 114705 2011-03-15 15:11:28Z ibiru $
+# Maintainer: Jan de Groot <jgc@archlinux.org>
+# Contributor: Alexander Baldeck <alexander@archlinux.org>
+pkgname=xulrunner-oss
+pkgver=2.0.1
+_ffoxver=4.0.1
+pkgrel=2
+pkgdesc="Mozilla Runtime Environment compiled with OSS support"
+arch=('i686' 'x86_64')
+license=('MPL' 'GPL' 'LGPL')
+depends=('gtk2' 'gcc-libs' 'libidl2' 'mozilla-common' 'nss' 'libxt' 'libxrender' 'hunspell' 'startup-notification' 'mime-types' 'dbus-glib' 'libevent' 'sqlite3>=3.7.4' 'libnotify')
+makedepends=('zip' 'pkg-config' 'diffutils' 'python2' 'wireless_tools' 'yasm' 'mesa' 'autoconf2.13')
+url="http://wiki.mozilla.org/XUL:Xul_Runner"
+source=(http://releases.mozilla.org/pub/mozilla.org/firefox/releases/${_ffoxver}/source/firefox-${_ffoxver}.source.tar.bz2
+ mozconfig
+ mozilla-pkgconfig.patch
+ xulrunner-version.patch
+ xulrunner-omnijar.patch
+ port_gnomevfs_to_gio.patch
+ oss.patch)
+options=('!emptydirs')
+conflicts=('xulrunner')
+provides=("xulrunner=${pkgver}")
+md5sums=('9abda7d23151e97913c8555a64c13f34'
+ '2358a2ddd35bcdd62ff42442dfe548d9'
+ '639ea80e823543dd415b90c0ee804186'
+ 'a0236f6c3e55f60b7888d8cf137ff209'
+ '0bf82bc6677e3ce57fd20a147fe8d7b1'
+ '42f83468b296452fb754a81a4317ca64'
+ '81032ce49c2a5ac15d62155bcc42d3ed')
+
+build() {
+ cd "${srcdir}/mozilla-2.0"
+ cp "${srcdir}/mozconfig" .mozconfig
+
+ #fix libdir/sdkdir - fedora
+ patch -Np1 -i "${srcdir}/mozilla-pkgconfig.patch"
+
+ #Force installation to the same path for every version
+ patch -Np1 -i "${srcdir}/xulrunner-version.patch"
+
+ patch -Np1 -i "${srcdir}/xulrunner-omnijar.patch"
+
+ patch -Np1 -i "${srcdir}/port_gnomevfs_to_gio.patch"
+
+ patch -Np0 -i "${srcdir}/oss.patch"
+ sed -i 's/sydney_audio_alsa/sydney_audio_oss/' media/libsydneyaudio/src/Makefile.in
+ sed -i '/EXTRA_DSO_LDOPTS += $(MOZ_ALSA_LIBS)/d' layout/build/Makefile.in
+ sed -i '/EXTRA_DSO_LDOPTS += $(MOZ_ALSA_LIBS)/d' toolkit/library/libxul-config.mk
+
+ unset CFLAGS
+ unset CXXFLAGS
+ export CXXFLAGS="-fpermissive"
+
+ make -j1 -f client.mk build MOZ_MAKE_FLAGS="$MAKEFLAGS"
+}
+
+package() {
+ cd "${srcdir}/mozilla-2.0"
+ make -j1 -f client.mk DESTDIR="${pkgdir}" install
+
+ #Remove included dictionaries, add symlink to system myspell path.
+ #Note: this will cause file conflicts when users have installed dictionaries in the old location
+ rm -rf "${pkgdir}/usr/lib/xulrunner-2.0/dictionaries"
+ ln -sf /usr/share/myspell/dicts "${pkgdir}/usr/lib/xulrunner-2.0/dictionaries"
+
+ # add xulrunner library path to ld.so.conf
+ install -d ${pkgdir}/etc/ld.so.conf.d
+ echo "/usr/lib/xulrunner-2.0" > ${pkgdir}/etc/ld.so.conf.d/xulrunner.conf
+}
diff --git a/community-staging/xulrunner-oss/mozconfig b/community-staging/xulrunner-oss/mozconfig
new file mode 100644
index 000000000..03a352920
--- /dev/null
+++ b/community-staging/xulrunner-oss/mozconfig
@@ -0,0 +1,56 @@
+. $topsrcdir/xulrunner/config/mozconfig
+
+ac_add_options --prefix=/usr
+ac_add_options --libdir=/usr/lib
+ac_add_options --with-system-nspr
+ac_add_options --with-system-nss
+ac_add_options --with-system-jpeg
+ac_add_options --with-system-zlib
+ac_add_options --with-system-bz2
+ac_add_options --with-system-png
+ac_add_options --with-system-libevent
+ac_add_options --enable-system-hunspell
+ac_add_options --enable-system-sqlite
+ac_add_options --enable-system-cairo
+ac_add_options --with-pthreads
+
+ac_add_options --enable-default-toolkit=cairo-gtk2
+ac_add_options --enable-safe-browsing
+ac_add_options --enable-extensions=default
+ac_add_options --enable-startup-notification
+ac_add_options --enable-pango
+ac_add_options --enable-svg
+ac_add_options --enable-canvas
+ac_add_options --enable-smil
+ac_add_options --enable-canvas3d
+ac_add_options --enable-places
+ac_add_options --enable-shared-js
+ac_add_options --enable-url-classifier
+
+ac_add_options --enable-optimize
+ac_add_options --enable-strip
+ac_add_options --enable-install-strip
+ac_add_options --enable-jemalloc
+ac_add_options --enable-xterm-updates
+ac_add_options --enable-printing
+ac_add_options --enable-xinerama
+
+ac_add_options --disable-javaxpcom
+ac_add_options --disable-crashreporter
+ac_add_options --disable-updater
+ac_add_options --disable-tests
+ac_add_options --disable-xprint
+ac_add_options --disable-mochitest
+ac_add_options --disable-debug
+ac_add_options --disable-installer
+ac_add_options --disable-pedantic
+
+ac_add_options --enable-gio
+ac_add_options --disable-gnomevfs
+ac_add_options --enable-gconf
+ac_add_options --enable-libnotify
+
+export BUILD_OFFICIAL=1
+export MOZILLA_OFFICIAL=1
+mk_add_options BUILD_OFFICIAL=1
+mk_add_options MOZILLA_OFFICIAL=1
diff --git a/community-staging/xulrunner-oss/mozilla-pkgconfig.patch b/community-staging/xulrunner-oss/mozilla-pkgconfig.patch
new file mode 100644
index 000000000..2203efcde
--- /dev/null
+++ b/community-staging/xulrunner-oss/mozilla-pkgconfig.patch
@@ -0,0 +1,60 @@
+diff -Nur mozilla-2.0.orig/xulrunner/installer/libxul-embedding.pc.in mozilla-2.0/xulrunner/installer/libxul-embedding.pc.in
+--- mozilla-2.0.orig/xulrunner/installer/libxul-embedding.pc.in 2011-03-03 14:12:04.000000000 -0800
++++ mozilla-2.0/xulrunner/installer/libxul-embedding.pc.in 2011-03-13 03:25:12.350027359 -0700
+@@ -6,5 +6,6 @@
+ Name: libxul-embedding
+ Description: Static library for version-independent embedding of the Mozilla runtime
+ Version: %MOZILLA_VERSION%
++Requires: %NSPR_NAME% >= %NSPR_VERSION%
+ Libs: -L${sdkdir}/lib -lxpcomglue -ldl
+ Cflags: -DXPCOM_GLUE -I${includedir} %WCHAR_CFLAGS%
+diff -Nur mozilla-2.0.orig/xulrunner/installer/libxul.pc.in mozilla-2.0/xulrunner/installer/libxul.pc.in
+--- mozilla-2.0.orig/xulrunner/installer/libxul.pc.in 2011-03-03 14:12:04.000000000 -0800
++++ mozilla-2.0/xulrunner/installer/libxul.pc.in 2011-03-13 03:25:28.010027359 -0700
+@@ -1,5 +1,6 @@
+ prefix=%prefix%
+ sdkdir=%sdkdir%
++libdir=%libdir%
+ includedir=%includedir%
+ idldir=%idldir%
+
+diff -Nur mozilla-2.0.orig/xulrunner/installer/Makefile.in mozilla-2.0/xulrunner/installer/Makefile.in
+--- mozilla-2.0.orig/xulrunner/installer/Makefile.in 2011-03-03 14:12:04.000000000 -0800
++++ mozilla-2.0/xulrunner/installer/Makefile.in 2011-03-13 03:25:55.570027359 -0700
+@@ -121,6 +121,7 @@
+ -e "s|%includedir%|$(includedir)|" \
+ -e "s|%idldir%|$(idldir)|" \
+ -e "s|%sdkdir%|$(sdkdir)|" \
++ -e "s|%libdir%|$(installdir)|" \
+ -e "s|%MOZ_APP_NAME%|$(MOZ_APP_NAME)|" \
+ -e "s|%MOZILLA_VERSION%|$(MOZ_APP_VERSION)|" \
+ -e "s|%WCHAR_CFLAGS%|$(WCHAR_CFLAGS)|" \
+diff -Nur mozilla-2.0.orig/xulrunner/installer/mozilla-gtkmozembed-embedding.pc.in mozilla-2.0/xulrunner/installer/mozilla-gtkmozembed-embedding.pc.in
+--- mozilla-2.0.orig/xulrunner/installer/mozilla-gtkmozembed-embedding.pc.in 2011-03-03 14:12:04.000000000 -0800
++++ mozilla-2.0/xulrunner/installer/mozilla-gtkmozembed-embedding.pc.in 2011-03-13 03:26:18.676694023 -0700
+@@ -1,5 +1,6 @@
+ prefix=%prefix%
+ sdkdir=%sdkdir%
++libdir=%libdir%
+ includedir=%includedir%
+
+ Name: mozilla-gtkembedmoz
+diff -Nur mozilla-2.0.orig/xulrunner/installer/mozilla-gtkmozembed.pc.in mozilla-2.0/xulrunner/installer/mozilla-gtkmozembed.pc.in
+--- mozilla-2.0.orig/xulrunner/installer/mozilla-gtkmozembed.pc.in 2011-03-03 14:12:04.000000000 -0800
++++ mozilla-2.0/xulrunner/installer/mozilla-gtkmozembed.pc.in 2011-03-13 03:26:41.566694025 -0700
+@@ -1,5 +1,6 @@
+ prefix=%prefix%
+ sdkdir=%sdkdir%
++libdir=%libdir%
+ includedir=%includedir%
+
+ Name: mozilla-gtkembedmoz
+diff -Nur mozilla-2.0.orig/xulrunner/installer/mozilla-js.pc.in mozilla-2.0/xulrunner/installer/mozilla-js.pc.in
+--- mozilla-2.0.orig/xulrunner/installer/mozilla-js.pc.in 2011-03-03 14:12:04.000000000 -0800
++++ mozilla-2.0/xulrunner/installer/mozilla-js.pc.in 2011-03-13 03:27:19.680027357 -0700
+@@ -7,4 +7,4 @@
+ Version: %MOZILLA_VERSION%
+ Requires: %NSPR_NAME% >= %NSPR_VERSION%
+ Libs: -L${sdkdir}/lib %MOZ_JS_LINK%
+-Cflags: -I${includedir} -DXP_UNIX -DJS_THREADSAFE
++Cflags: -I${includedir} -I${includedir}/js -DXP_UNIX -DJS_THREADSAFE
diff --git a/community-staging/xulrunner-oss/oss.patch b/community-staging/xulrunner-oss/oss.patch
new file mode 100644
index 000000000..ca79879fd
--- /dev/null
+++ b/community-staging/xulrunner-oss/oss.patch
@@ -0,0 +1,31 @@
+--- configure.in 2011-03-16 04:58:10.640027357 -0700
++++ configure.in.orig 2011-03-16 04:58:39.313360691 -0700
+@@ -6266,20 +6266,6 @@
+ AC_DEFINE(MOZ_TREMOR)
+ fi
+
+-dnl ========================================================
+-dnl = Check alsa availability on Linux if using sydneyaudio
+-dnl ========================================================
+-
+-dnl If using sydneyaudio with Linux, ensure that the alsa library is available
+-if test -n "$MOZ_SYDNEYAUDIO"; then
+- case "$target_os" in
+-linux*)
+- PKG_CHECK_MODULES(MOZ_ALSA, alsa, ,
+- [echo "$MOZ_ALSA_PKG_ERRORS"
+- AC_MSG_ERROR([Need alsa for Ogg, Wave or WebM decoding on Linux. Disable with --disable-ogg --disable-wave --disable-webm. (On Ubuntu, you might try installing the package libasound2-dev.)])])
+- ;;
+- esac
+-fi
+
+ dnl ========================================================
+ dnl Splashscreen
+@@ -9294,7 +9280,6 @@
+ AC_SUBST(MOZ_TREMOR)
+ AC_SUBST(MOZ_WEBM)
+ AC_SUBST(MOZ_OGG)
+-AC_SUBST(MOZ_ALSA_LIBS)
+ AC_SUBST(VPX_AS)
+ AC_SUBST(VPX_ASFLAGS)
+ AC_SUBST(VPX_DASH_C_FLAG)
diff --git a/community-staging/xulrunner-oss/port_gnomevfs_to_gio.patch b/community-staging/xulrunner-oss/port_gnomevfs_to_gio.patch
new file mode 100644
index 000000000..797baff42
--- /dev/null
+++ b/community-staging/xulrunner-oss/port_gnomevfs_to_gio.patch
@@ -0,0 +1,1316 @@
+diff -r 49a1b2aa43c5 extensions/gio/Makefile.in
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ b/extensions/gio/Makefile.in Tue Jan 11 11:17:52 2011 +0100
+@@ -0,0 +1,69 @@
++# vim:set ts=8 sw=8 sts=8 noet:
++# ***** BEGIN LICENSE BLOCK *****
++# Version: MPL 1.1/GPL 2.0/LGPL 2.1
++#
++# The contents of this file are subject to the Mozilla Public License Version
++# 1.1 (the "License"); you may not use this file except in compliance with
++# the License. You may obtain a copy of the License at
++# http://www.mozilla.org/MPL/
++#
++# Software distributed under the License is distributed on an "AS IS" basis,
++# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
++# for the specific language governing rights and limitations under the
++# License.
++#
++# The Original Code is the Mozilla gnome-vfs extension.
++#
++# The Initial Developer of the Original Code is IBM Corporation.
++#
++# Portions created by IBM Corporation are Copyright (C) 2004
++# IBM Corporation. All Rights Reserved.
++#
++# Contributor(s):
++# Darin Fisher <darin@meer.net>
++# Jan Horak <jhorak@redhat.com>
++#
++# Alternatively, the contents of this file may be used under the terms of
++# either the GNU General Public License Version 2 or later (the "GPL"), or
++# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
++# in which case the provisions of the GPL or the LGPL are applicable instead
++# of those above. If you wish to allow use of your version of this file only
++# under the terms of either the GPL or the LGPL, and not to allow others to
++# use your version of this file under the terms of the MPL, indicate your
++# decision by deleting the provisions above and replace them with the notice
++# and other provisions required by the GPL or the LGPL. If you do not delete
++# the provisions above, a recipient may use your version of this file under
++# the terms of any one of the MPL, the GPL or the LGPL.
++#
++# ***** END LICENSE BLOCK *****
++
++DEPTH = ../..
++topsrcdir = @top_srcdir@
++srcdir = @srcdir@
++VPATH = @srcdir@
++
++include $(DEPTH)/config/autoconf.mk
++
++MODULE = nkgio
++LIBRARY_NAME = nkgio
++SHORT_LIBNAME = nkgio
++IS_COMPONENT = 1
++
++CPPSRCS = \
++ nsGIOProtocolHandler.cpp \
++ $(NULL)
++
++LOCAL_INCLUDES = $(MOZ_GIO_CFLAGS)
++
++EXTRA_DSO_LDOPTS = \
++ $(XPCOM_GLUE_LDOPTS) \
++ $(NSPR_LIBS) \
++ $(MOZ_GIO_LIBS) \
++ $(NULL)
++
++# make sure this component is never statically linked into the main
++# application. this is necessary since we don't want to force users
++# to install gio in order to use the rest of mozilla ;-)
++FORCE_SHARED_LIB= 1
++
++include $(topsrcdir)/config/rules.mk
+diff -r 49a1b2aa43c5 extensions/gio/makefiles.sh
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ b/extensions/gio/makefiles.sh Tue Jan 11 11:17:52 2011 +0100
+@@ -0,0 +1,41 @@
++#! /bin/sh
++# ***** BEGIN LICENSE BLOCK *****
++# Version: MPL 1.1/GPL 2.0/LGPL 2.1
++#
++# The contents of this file are subject to the Mozilla Public License Version
++# 1.1 (the "License"); you may not use this file except in compliance with
++# the License. You may obtain a copy of the License at
++# http://www.mozilla.org/MPL/
++#
++# Software distributed under the License is distributed on an "AS IS" basis,
++# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
++# for the specific language governing rights and limitations under the
++# License.
++#
++# The Original Code is Mozilla Build System
++#
++# The Initial Developer of the Original Code is
++# Ben Turner <mozilla@songbirdnest.com>
++#
++# Portions created by the Initial Developer are Copyright (C) 2007
++# the Initial Developer. All Rights Reserved.
++#
++# Contributor(s):
++#
++# Alternatively, the contents of this file may be used under the terms of
++# either the GNU General Public License Version 2 or later (the "GPL"), or
++# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
++# in which case the provisions of the GPL or the LGPL are applicable instead
++# of those above. If you wish to allow use of your version of this file only
++# under the terms of either the GPL or the LGPL, and not to allow others to
++# use your version of this file under the terms of the MPL, indicate your
++# decision by deleting the provisions above and replace them with the notice
++# and other provisions required by the GPL or the LGPL. If you do not delete
++# the provisions above, a recipient may use your version of this file under
++# the terms of any one of the MPL, the GPL or the LGPL.
++#
++# ***** END LICENSE BLOCK *****
++
++add_makefiles "
++ extensions/gio/Makefile
++"
+diff -r 49a1b2aa43c5 extensions/gio/nsGIOProtocolHandler.cpp
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ b/extensions/gio/nsGIOProtocolHandler.cpp Tue Jan 11 11:17:52 2011 +0100
+@@ -0,0 +1,1163 @@
++/* vim:set ts=2 sw=2 et cindent: */
++/* ***** BEGIN LICENSE BLOCK *****
++ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
++ *
++ * The contents of this file are subject to the Mozilla Public License Version
++ * 1.1 (the "License"); you may not use this file except in compliance with
++ * the License. You may obtain a copy of the License at
++ * http://www.mozilla.org/MPL/
++ *
++ * Software distributed under the License is distributed on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
++ * for the specific language governing rights and limitations under the
++ * License.
++ *
++ * The Original Code is the Mozilla gnome-vfs extension.
++ *
++ * The Initial Developer of the Original Code is IBM Corporation.
++ *
++ * Portions created by IBM Corporation are Copyright (C) 2004
++ * IBM Corporation. All Rights Reserved.
++ *
++ * Contributor(s):
++ * Darin Fisher <darin@meer.net>
++ * Jan Horak <jhorak@redhat.com>
++ *
++ * Alternatively, the contents of this file may be used under the terms of
++ * either the GNU General Public License Version 2 or later (the "GPL"), or
++ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
++ * in which case the provisions of the GPL or the LGPL are applicable instead
++ * of those above. If you wish to allow use of your version of this file only
++ * under the terms of either the GPL or the LGPL, and not to allow others to
++ * use your version of this file under the terms of the MPL, indicate your
++ * decision by deleting the provisions above and replace them with the notice
++ * and other provisions required by the GPL or the LGPL. If you do not delete
++ * the provisions above, a recipient may use your version of this file under
++ * the terms of any one of the MPL, the GPL or the LGPL.
++ *
++ * ***** END LICENSE BLOCK ***** */
++
++/*
++ * This code is based on original Mozilla gnome-vfs extension. It implements
++ * input stream provided by GVFS/GIO.
++*/
++#include "mozilla/ModuleUtils.h"
++#include "nsIPrefService.h"
++#include "nsIPrefBranch2.h"
++#include "nsIObserver.h"
++#include "nsThreadUtils.h"
++#include "nsProxyRelease.h"
++#include "nsIStringBundle.h"
++#include "nsIStandardURL.h"
++#include "nsMimeTypes.h"
++#include "nsNetUtil.h"
++#include "mozilla/Monitor.h"
++#include <gio/gio.h>
++
++#define MOZ_GIO_SCHEME "moz-gio"
++#define MOZ_GIO_SUPPORTED_PROTOCOLS "network.gio.supported-protocols"
++
++//-----------------------------------------------------------------------------
++
++// NSPR_LOG_MODULES=gio:5
++#ifdef PR_LOGGING
++static PRLogModuleInfo *sGIOLog;
++#define LOG(args) PR_LOG(sGIOLog, PR_LOG_DEBUG, args)
++#else
++#define LOG(args)
++#endif
++
++
++//-----------------------------------------------------------------------------
++static nsresult
++MapGIOResult(gint code)
++{
++ switch (code)
++ {
++ case G_IO_ERROR_NOT_FOUND: return NS_ERROR_FILE_NOT_FOUND; // shows error
++ case G_IO_ERROR_INVALID_ARGUMENT: return NS_ERROR_INVALID_ARG;
++ case G_IO_ERROR_NOT_SUPPORTED: return NS_ERROR_NOT_AVAILABLE;
++ case G_IO_ERROR_NO_SPACE: return NS_ERROR_FILE_NO_DEVICE_SPACE;
++ case G_IO_ERROR_READ_ONLY: return NS_ERROR_FILE_READ_ONLY;
++ case G_IO_ERROR_PERMISSION_DENIED: return NS_ERROR_FILE_ACCESS_DENIED; // wrong password/login
++ case G_IO_ERROR_CLOSED: return NS_BASE_STREAM_CLOSED; // was EOF
++ case G_IO_ERROR_NOT_DIRECTORY: return NS_ERROR_FILE_NOT_DIRECTORY;
++ case G_IO_ERROR_PENDING: return NS_ERROR_IN_PROGRESS;
++ case G_IO_ERROR_EXISTS: return NS_ERROR_FILE_ALREADY_EXISTS;
++ case G_IO_ERROR_IS_DIRECTORY: return NS_ERROR_FILE_IS_DIRECTORY;
++ case G_IO_ERROR_NOT_MOUNTED: return NS_ERROR_NOT_CONNECTED; // shows error
++ case G_IO_ERROR_HOST_NOT_FOUND: return NS_ERROR_UNKNOWN_HOST; // shows error
++ case G_IO_ERROR_CANCELLED: return NS_ERROR_ABORT;
++ case G_IO_ERROR_NOT_EMPTY: return NS_ERROR_FILE_DIR_NOT_EMPTY;
++ case G_IO_ERROR_FILENAME_TOO_LONG: return NS_ERROR_FILE_NAME_TOO_LONG;
++ case G_IO_ERROR_INVALID_FILENAME: return NS_ERROR_FILE_INVALID_PATH;
++ case G_IO_ERROR_TIMED_OUT: return NS_ERROR_NET_TIMEOUT; // shows error
++ case G_IO_ERROR_WOULD_BLOCK: return NS_BASE_STREAM_WOULD_BLOCK;
++ case G_IO_ERROR_FAILED_HANDLED: return NS_ERROR_ABORT; // Cancel on login dialog
++
++/* unhandled:
++ G_IO_ERROR_NOT_REGULAR_FILE,
++ G_IO_ERROR_NOT_SYMBOLIC_LINK,
++ G_IO_ERROR_NOT_MOUNTABLE_FILE,
++ G_IO_ERROR_TOO_MANY_LINKS,
++ G_IO_ERROR_ALREADY_MOUNTED,
++ G_IO_ERROR_CANT_CREATE_BACKUP,
++ G_IO_ERROR_WRONG_ETAG,
++ G_IO_ERROR_WOULD_RECURSE,
++ G_IO_ERROR_BUSY,
++ G_IO_ERROR_WOULD_MERGE,
++ G_IO_ERROR_TOO_MANY_OPEN_FILES
++*/
++ // Make GCC happy
++ default:
++ return NS_ERROR_FAILURE;
++ }
++
++ return NS_ERROR_FAILURE;
++}
++
++static nsresult
++MapGIOResult(GError *result)
++{
++ if (!result)
++ return NS_OK;
++ else
++ return MapGIOResult(result->code);
++}
++/** Return values for mount operation.
++ * These enums are used as mount operation return values.
++ */
++typedef enum {
++ MOUNT_OPERATION_IN_PROGRESS, /** \enum operation in progress */
++ MOUNT_OPERATION_SUCCESS, /** \enum operation successful */
++ MOUNT_OPERATION_FAILED /** \enum operation not successful */
++} MountOperationResult;
++//-----------------------------------------------------------------------------
++/**
++ * Sort function compares according to file type (directory/file)
++ * and alphabethical order
++ * @param a pointer to GFileInfo object to compare
++ * @param b pointer to GFileInfo object to compare
++ * @return -1 when first object should be before the second, 0 when equal,
++ * +1 when second object should be before the first
++ */
++static gint
++FileInfoComparator(gconstpointer a, gconstpointer b)
++{
++ GFileInfo *ia = ( GFileInfo *) a;
++ GFileInfo *ib = ( GFileInfo *) b;
++ if (g_file_info_get_file_type(ia) == G_FILE_TYPE_DIRECTORY
++ && g_file_info_get_file_type(ib) != G_FILE_TYPE_DIRECTORY)
++ return -1;
++ if (g_file_info_get_file_type(ib) == G_FILE_TYPE_DIRECTORY
++ && g_file_info_get_file_type(ia) != G_FILE_TYPE_DIRECTORY)
++ return 1;
++
++ return strcasecmp(g_file_info_get_name(ia), g_file_info_get_name(ib));
++}
++
++/* Declaration of mount callback functions */
++static void mount_enclosing_volume_finished (GObject *source_object,
++ GAsyncResult *res,
++ gpointer user_data);
++static void mount_operation_ask_password (GMountOperation *mount_op,
++ const char *message,
++ const char *default_user,
++ const char *default_domain,
++ GAskPasswordFlags flags,
++ gpointer user_data);
++//-----------------------------------------------------------------------------
++
++class nsGIOInputStream : public nsIInputStream
++{
++ public:
++ NS_DECL_ISUPPORTS
++ NS_DECL_NSIINPUTSTREAM
++
++ nsGIOInputStream(const nsCString &uriSpec)
++ : mSpec(uriSpec)
++ , mChannel(nsnull)
++ , mHandle(nsnull)
++ , mStream(nsnull)
++ , mBytesRemaining(PR_UINT32_MAX)
++ , mStatus(NS_OK)
++ , mDirList(nsnull)
++ , mDirListPtr(nsnull)
++ , mDirBufCursor(0)
++ , mDirOpen(PR_FALSE)
++ , mMonitorMountInProgress("GIOInputStream::MountFinished") { }
++
++ ~nsGIOInputStream() { Close(); }
++
++ void SetChannel(nsIChannel *channel)
++ {
++ // We need to hold an owning reference to our channel. This is done
++ // so we can access the channel's notification callbacks to acquire
++ // a reference to a nsIAuthPrompt if we need to handle an interactive
++ // mount operation.
++ //
++ // However, the channel can only be accessed on the main thread, so
++ // we have to be very careful with ownership. Moreover, it doesn't
++ // support threadsafe addref/release, so proxying is the answer.
++ //
++ // Also, it's important to note that this likely creates a reference
++ // cycle since the channel likely owns this stream. This reference
++ // cycle is broken in our Close method.
++
++ NS_ADDREF(mChannel = channel);
++ }
++ void SetMountResult(MountOperationResult result, gint error_code);
++ private:
++ nsresult DoOpen();
++ nsresult DoRead(char *aBuf, PRUint32 aCount, PRUint32 *aCountRead);
++ nsresult SetContentTypeOfChannel(const char *contentType);
++ nsresult MountVolume();
++ nsresult DoOpenDirectory();
++ nsresult DoOpenFile(GFileInfo *info);
++ nsCString mSpec;
++ nsIChannel *mChannel; // manually refcounted
++ GFile *mHandle;
++ GFileInputStream *mStream;
++ PRUint64 mBytesRemaining;
++ nsresult mStatus;
++ GList *mDirList;
++ GList *mDirListPtr;
++ nsCString mDirBuf;
++ PRUint32 mDirBufCursor;
++ PRPackedBool mDirOpen;
++ MountOperationResult mMountRes;
++ mozilla::Monitor mMonitorMountInProgress;
++ gint mMountErrorCode;
++};
++/**
++ * Set result of mount operation and notify monitor waiting for results.
++ * This method is called in main thread as long as it is used only
++ * in mount_enclosing_volume_finished function.
++ * @param result Result of mount operation
++ */
++void
++nsGIOInputStream::SetMountResult(MountOperationResult result, gint error_code)
++{
++ mozilla::MonitorAutoEnter mon(mMonitorMountInProgress);
++ mMountRes = result;
++ mMountErrorCode = error_code;
++ mon.Notify();
++}
++
++/**
++ * Start mount operation and wait in loop until it is finished. This method is
++ * called from thread which is trying to read from location.
++ */
++nsresult
++nsGIOInputStream::MountVolume() {
++ GMountOperation* mount_op = g_mount_operation_new();
++ g_signal_connect (mount_op, "ask-password",
++ G_CALLBACK (mount_operation_ask_password), mChannel);
++ mMountRes = MOUNT_OPERATION_IN_PROGRESS;
++ /* g_file_mount_enclosing_volume uses a dbus request to mount the volume.
++ Callback mount_enclosing_volume_finished is called in main thread
++ (not this thread on which this method is called). */
++ g_file_mount_enclosing_volume(mHandle,
++ G_MOUNT_MOUNT_NONE,
++ mount_op,
++ NULL,
++ mount_enclosing_volume_finished,
++ this);
++ mozilla::MonitorAutoEnter mon(mMonitorMountInProgress);
++ /* Waiting for finish of mount operation thread */
++ while (mMountRes == MOUNT_OPERATION_IN_PROGRESS)
++ mon.Wait();
++
++ g_object_unref(mount_op);
++
++ if (mMountRes == MOUNT_OPERATION_FAILED) {
++ return MapGIOResult(mMountErrorCode);
++ } else {
++ return NS_OK;
++ }
++}
++
++/**
++ * Create list of infos about objects in opened directory
++ * Return: NS_OK when list obtained, otherwise error code according
++ * to failed operation.
++ */
++nsresult
++nsGIOInputStream::DoOpenDirectory()
++{
++ GError *error = NULL;
++
++ GFileEnumerator *f_enum = g_file_enumerate_children(mHandle,
++ "standard::*,time::*",
++ G_FILE_QUERY_INFO_NONE,
++ NULL,
++ &error);
++ if (!f_enum) {
++ nsresult rv = MapGIOResult(error);
++ g_warning("Cannot read from directory: %s", error->message);
++ g_error_free(error);
++ return rv;
++ }
++ // fill list of file infos
++ GFileInfo *info = g_file_enumerator_next_file(f_enum, NULL, &error);
++ while (info) {
++ mDirList = g_list_append(mDirList, info);
++ info = g_file_enumerator_next_file(f_enum, NULL, &error);
++ }
++ g_object_unref(f_enum);
++ if (error) {
++ g_warning("Error reading directory content: %s", error->message);
++ nsresult rv = MapGIOResult(error);
++ g_error_free(error);
++ return rv;
++ }
++ mDirOpen = PR_TRUE;
++
++ // Sort list of file infos by using FileInfoComparator function
++ mDirList = g_list_sort(mDirList, FileInfoComparator);
++ mDirListPtr = mDirList;
++
++ // Write base URL (make sure it ends with a '/')
++ mDirBuf.Append("300: ");
++ mDirBuf.Append(mSpec);
++ if (mSpec.get()[mSpec.Length() - 1] != '/')
++ mDirBuf.Append('/');
++ mDirBuf.Append('\n');
++
++ // Write column names
++ mDirBuf.Append("200: filename content-length last-modified file-type\n");
++
++ // Write charset (assume UTF-8)
++ // XXX is this correct?
++ mDirBuf.Append("301: UTF-8\n");
++ SetContentTypeOfChannel(APPLICATION_HTTP_INDEX_FORMAT);
++ return NS_OK;
++}
++
++/**
++ * Create file stream and set mime type for channel
++ * @param info file info used to determine mime type
++ * @return NS_OK when file stream created successfuly, error code otherwise
++ */
++nsresult
++nsGIOInputStream::DoOpenFile(GFileInfo *info)
++{
++ GError *error = NULL;
++
++ mStream = g_file_read(mHandle, NULL, &error);
++ if (!mStream) {
++ nsresult rv = MapGIOResult(error);
++ g_warning("Cannot read from file: %s", error->message);
++ g_error_free(error);
++ return rv;
++ }
++
++ const char * content_type = g_file_info_get_content_type(info);
++ if (content_type) {
++ char *mime_type = g_content_type_get_mime_type(content_type);
++ if (mime_type) {
++ if (strcmp(mime_type, APPLICATION_OCTET_STREAM) != 0) {
++ SetContentTypeOfChannel(mime_type);
++ }
++ g_free(mime_type);
++ }
++ } else {
++ g_warning("Missing content type.");
++ }
++
++ mBytesRemaining = g_file_info_get_size(info);
++ // Update the content length attribute on the channel. We do this
++ // synchronously without proxying. This hack is not as bad as it looks!
++ mChannel->SetContentLength(mBytesRemaining);
++
++ return NS_OK;
++}
++
++/**
++ * Start file open operation, mount volume when needed and according to file type
++ * create file output stream or read directory content.
++ * @return NS_OK when file or directory opened successfully, error code otherwise
++ */
++nsresult
++nsGIOInputStream::DoOpen()
++{
++ nsresult rv;
++ GError *error = NULL;
++
++ NS_ASSERTION(mHandle == nsnull, "already open");
++
++ mHandle = g_file_new_for_uri( mSpec.get() );
++
++ GFileInfo *info = g_file_query_info(mHandle,
++ "standard::*",
++ G_FILE_QUERY_INFO_NONE,
++ NULL,
++ &error);
++
++ if (error) {
++ if (error->domain == G_IO_ERROR && error->code == G_IO_ERROR_NOT_MOUNTED) {
++ // location is not yet mounted, try to mount
++ g_error_free(error);
++ if (NS_IsMainThread())
++ return NS_ERROR_NOT_CONNECTED;
++ error = NULL;
++ rv = MountVolume();
++ if (rv != NS_OK) {
++ return rv;
++ }
++ // get info again
++ info = g_file_query_info(mHandle,
++ "standard::*",
++ G_FILE_QUERY_INFO_NONE,
++ NULL,
++ &error);
++ // second try to get file info from remote files after media mount
++ if (!info) {
++ g_warning("Unable to get file info: %s", error->message);
++ rv = MapGIOResult(error);
++ g_error_free(error);
++ return rv;
++ }
++ } else {
++ g_warning("Unable to get file info: %s", error->message);
++ rv = MapGIOResult(error);
++ g_error_free(error);
++ return rv;
++ }
++ }
++ // Get file type to handle directories and file differently
++ GFileType f_type = g_file_info_get_file_type(info);
++ if (f_type == G_FILE_TYPE_DIRECTORY) {
++ // directory
++ rv = DoOpenDirectory();
++ } else if (f_type != G_FILE_TYPE_UNKNOWN) {
++ // file
++ rv = DoOpenFile(info);
++ } else {
++ g_warning("Unable to get file type.");
++ rv = NS_ERROR_FILE_NOT_FOUND;
++ }
++ if (info)
++ g_object_unref(info);
++ return rv;
++}
++
++/**
++ * Read content of file or create file list from directory
++ * @param aBuf read destination buffer
++ * @param aCount length of destination buffer
++ * @param aCountRead number of read characters
++ * @return NS_OK when read successfully, NS_BASE_STREAM_CLOSED when end of file,
++ * error code otherwise
++ */
++nsresult
++nsGIOInputStream::DoRead(char *aBuf, PRUint32 aCount, PRUint32 *aCountRead)
++{
++ nsresult rv = NS_ERROR_NOT_AVAILABLE;
++ if (mStream) {
++ // file read
++ GError *error = NULL;
++ PRUint32 bytes_read = g_input_stream_read(G_INPUT_STREAM(mStream),
++ aBuf,
++ aCount,
++ NULL,
++ &error);
++ if (error) {
++ rv = MapGIOResult(error);
++ *aCountRead = 0;
++ g_warning("Cannot read from file: %s", error->message);
++ g_error_free(error);
++ return rv;
++ }
++ *aCountRead = bytes_read;
++ mBytesRemaining -= *aCountRead;
++ return NS_OK;
++ }
++ else if (mDirOpen) {
++ // directory read
++ while (aCount && rv != NS_BASE_STREAM_CLOSED)
++ {
++ // Copy data out of our buffer
++ PRUint32 bufLen = mDirBuf.Length() - mDirBufCursor;
++ if (bufLen)
++ {
++ PRUint32 n = PR_MIN(bufLen, aCount);
++ memcpy(aBuf, mDirBuf.get() + mDirBufCursor, n);
++ *aCountRead += n;
++ aBuf += n;
++ aCount -= n;
++ mDirBufCursor += n;
++ }
++
++ if (!mDirListPtr) // Are we at the end of the directory list?
++ {
++ rv = NS_BASE_STREAM_CLOSED;
++ }
++ else if (aCount) // Do we need more data?
++ {
++ GFileInfo *info = (GFileInfo *) mDirListPtr->data;
++
++ // Prune '.' and '..' from directory listing.
++ const char * fname = g_file_info_get_name(info);
++ if (fname && fname[0] == '.' &&
++ (fname[1] == '\0' || (fname[1] == '.' && fname[2] == '\0')))
++ {
++ mDirListPtr = mDirListPtr->next;
++ continue;
++ }
++
++ mDirBuf.Assign("201: ");
++
++ // The "filename" field
++ nsCString escName;
++ nsCOMPtr<nsINetUtil> nu = do_GetService(NS_NETUTIL_CONTRACTID);
++ if (nu && fname) {
++ nu->EscapeString(nsDependentCString(fname),
++ nsINetUtil::ESCAPE_URL_PATH, escName);
++
++ mDirBuf.Append(escName);
++ mDirBuf.Append(' ');
++ }
++
++ // The "content-length" field
++ // XXX truncates size from 64-bit to 32-bit
++ mDirBuf.AppendInt(PRInt32(g_file_info_get_size(info)));
++ mDirBuf.Append(' ');
++
++ // The "last-modified" field
++ //
++ // NSPR promises: PRTime is compatible with time_t
++ // we just need to convert from seconds to microseconds
++ GTimeVal gtime;
++ g_file_info_get_modification_time(info, &gtime);
++
++ PRExplodedTime tm;
++ PRTime pt = ((PRTime) gtime.tv_sec) * 1000000;
++ PR_ExplodeTime(pt, PR_GMTParameters, &tm);
++ {
++ char buf[64];
++ PR_FormatTimeUSEnglish(buf, sizeof(buf),
++ "%a,%%20%d%%20%b%%20%Y%%20%H:%M:%S%%20GMT ", &tm);
++ mDirBuf.Append(buf);
++ }
++
++ // The "file-type" field
++ switch (g_file_info_get_file_type(info))
++ {
++ case G_FILE_TYPE_REGULAR:
++ mDirBuf.Append("FILE ");
++ break;
++ case G_FILE_TYPE_DIRECTORY:
++ mDirBuf.Append("DIRECTORY ");
++ break;
++ case G_FILE_TYPE_SYMBOLIC_LINK:
++ mDirBuf.Append("SYMBOLIC-LINK ");
++ break;
++ default:
++ break;
++ }
++ mDirBuf.Append('\n');
++
++ mDirBufCursor = 0;
++ mDirListPtr = mDirListPtr->next;
++ }
++ }
++ }
++ return rv;
++}
++
++/**
++ * This class is used to implement SetContentTypeOfChannel.
++ */
++class nsGIOSetContentTypeEvent : public nsRunnable
++{
++ public:
++ nsGIOSetContentTypeEvent(nsIChannel *channel, const char *contentType)
++ : mChannel(channel), mContentType(contentType)
++ {
++ // stash channel reference in mChannel. no AddRef here! see note
++ // in SetContentTypeOfchannel.
++ }
++
++ NS_IMETHOD Run()
++ {
++ mChannel->SetContentType(mContentType);
++ return NS_OK;
++ }
++
++ private:
++ nsIChannel *mChannel;
++ nsCString mContentType;
++};
++
++nsresult
++nsGIOInputStream::SetContentTypeOfChannel(const char *contentType)
++{
++ // We need to proxy this call over to the main thread. We post an
++ // asynchronous event in this case so that we don't delay reading data, and
++ // we know that this is safe to do since the channel's reference will be
++ // released asynchronously as well. We trust the ordering of the main
++ // thread's event queue to protect us against memory corruption.
++
++ nsresult rv;
++ nsCOMPtr<nsIRunnable> ev =
++ new nsGIOSetContentTypeEvent(mChannel, contentType);
++ if (!ev)
++ {
++ rv = NS_ERROR_OUT_OF_MEMORY;
++ }
++ else
++ {
++ rv = NS_DispatchToMainThread(ev);
++ }
++ return rv;
++}
++
++NS_IMPL_THREADSAFE_ISUPPORTS1(nsGIOInputStream, nsIInputStream)
++
++/**
++ * Free all used memory and close stream.
++ */
++NS_IMETHODIMP
++nsGIOInputStream::Close()
++{
++ if (mStream)
++ {
++ g_object_unref(mStream);
++ mStream = nsnull;
++ }
++
++ if (mHandle)
++ {
++ g_object_unref(mHandle);
++ mHandle = nsnull;
++ }
++
++ if (mDirList)
++ {
++ // Destroy the list of GIOFileInfo objects...
++ g_list_foreach(mDirList, (GFunc) g_object_unref, nsnull);
++ g_list_free(mDirList);
++ mDirList = nsnull;
++ mDirListPtr = nsnull;
++ }
++
++ if (mChannel)
++ {
++ nsresult rv = NS_OK;
++
++ nsCOMPtr<nsIThread> thread = do_GetMainThread();
++ if (thread)
++ rv = NS_ProxyRelease(thread, mChannel);
++
++ NS_ASSERTION(thread && NS_SUCCEEDED(rv), "leaking channel reference");
++ mChannel = nsnull;
++ }
++
++ mSpec.Truncate(); // free memory
++
++ // Prevent future reads from re-opening the handle.
++ if (NS_SUCCEEDED(mStatus))
++ mStatus = NS_BASE_STREAM_CLOSED;
++
++ return NS_OK;
++}
++
++/**
++ * Return number of remaining bytes available on input
++ * @param aResult remaining bytes
++ */
++NS_IMETHODIMP
++nsGIOInputStream::Available(PRUint32 *aResult)
++{
++ if (NS_FAILED(mStatus))
++ return mStatus;
++
++ /* When remaining bytes are bigger than max PRUint32 value an aResult must
++ be set to PRUint32 maximum */
++ if (mBytesRemaining > PR_UINT32_MAX)
++ *aResult = PR_UINT32_MAX;
++ else
++ *aResult = mBytesRemaining;
++
++ return NS_OK;
++}
++
++/**
++ * Trying to read from stream. When location is not available it tries to mount it.
++ * @param aBuf buffer to put read data
++ * @param aCount length of aBuf
++ * @param aCountRead number of bytes actually read
++ */
++NS_IMETHODIMP
++nsGIOInputStream::Read(char *aBuf,
++ PRUint32 aCount,
++ PRUint32 *aCountRead)
++{
++ *aCountRead = 0;
++ // Check if file is already opened, otherwise open it
++ if (!mStream && !mDirOpen && mStatus == NS_OK) {
++ mStatus = DoOpen();
++ if (NS_FAILED(mStatus)) {
++ return mStatus;
++ }
++ }
++
++ mStatus = DoRead(aBuf, aCount, aCountRead);
++ // Check if all data has been read
++ if (mStatus == NS_BASE_STREAM_CLOSED)
++ return NS_OK;
++
++ // Check whenever any error appears while reading
++ return mStatus;
++}
++
++NS_IMETHODIMP
++nsGIOInputStream::ReadSegments(nsWriteSegmentFun aWriter,
++ void *aClosure,
++ PRUint32 aCount,
++ PRUint32 *aResult)
++{
++ // There is no way to implement this using GnomeVFS, but fortunately
++ // that doesn't matter. Because we are a blocking input stream, Necko
++ // isn't going to call our ReadSegments method.
++ NS_NOTREACHED("nsGIOInputStream::ReadSegments");
++ return NS_ERROR_NOT_IMPLEMENTED;
++}
++
++NS_IMETHODIMP
++nsGIOInputStream::IsNonBlocking(PRBool *aResult)
++{
++ *aResult = PR_FALSE;
++ return NS_OK;
++}
++
++//-----------------------------------------------------------------------------
++
++/**
++ * Called when finishing mount operation. Result of operation is set in
++ * nsGIOInputStream. This function is called in main thread as an async request
++ * typically from dbus.
++ * @param source_object GFile object which requested the mount
++ * @param res result object
++ * @param user_data pointer to nsGIOInputStream
++ */
++static void
++mount_enclosing_volume_finished (GObject *source_object,
++ GAsyncResult *res,
++ gpointer user_data)
++{
++ GError *error = NULL;
++
++ nsGIOInputStream* istream = static_cast<nsGIOInputStream*>(user_data);
++
++ g_file_mount_enclosing_volume_finish(G_FILE (source_object), res, &error);
++
++ if (error) {
++ g_warning("Mount failed: %s %d", error->message, error->code);
++ istream->SetMountResult(MOUNT_OPERATION_FAILED, error->code);
++ g_error_free(error);
++ } else {
++ istream->SetMountResult(MOUNT_OPERATION_SUCCESS, 0);
++ }
++}
++
++/**
++ * This function is called when username or password are requested from user.
++ * This function is called in main thread as async request from dbus.
++ * @param mount_op mount operation
++ * @param message message to show to user
++ * @param default_user preffered user
++ * @param default_domain domain name
++ * @param flags what type of information is required
++ * @param user_data nsIChannel
++ */
++static void
++mount_operation_ask_password (GMountOperation *mount_op,
++ const char *message,
++ const char *default_user,
++ const char *default_domain,
++ GAskPasswordFlags flags,
++ gpointer user_data)
++{
++ nsIChannel *channel = (nsIChannel *) user_data;
++ if (!channel) {
++ g_mount_operation_reply(mount_op, G_MOUNT_OPERATION_ABORTED);
++ return;
++ }
++ // We can't handle request for domain
++ if (flags & G_ASK_PASSWORD_NEED_DOMAIN) {
++ g_mount_operation_reply(mount_op, G_MOUNT_OPERATION_ABORTED);
++ return;
++ }
++
++ nsCOMPtr<nsIAuthPrompt> prompt;
++ NS_QueryNotificationCallbacks(channel, prompt);
++
++ // If no auth prompt, then give up. We could failover to using the
++ // WindowWatcher service, but that might defeat a consumer's purposeful
++ // attempt to disable authentication (for whatever reason).
++ if (!prompt) {
++ g_mount_operation_reply(mount_op, G_MOUNT_OPERATION_ABORTED);
++ return;
++ }
++ // Parse out the host and port...
++ nsCOMPtr<nsIURI> uri;
++ channel->GetURI(getter_AddRefs(uri));
++ if (!uri) {
++ g_mount_operation_reply(mount_op, G_MOUNT_OPERATION_ABORTED);
++ return;
++ }
++
++ nsCAutoString scheme, hostPort;
++ uri->GetScheme(scheme);
++ uri->GetHostPort(hostPort);
++
++ // It doesn't make sense for either of these strings to be empty. What kind
++ // of funky URI is this?
++ if (scheme.IsEmpty() || hostPort.IsEmpty()) {
++ g_mount_operation_reply(mount_op, G_MOUNT_OPERATION_ABORTED);
++ return;
++ }
++ // Construct the single signon key. Altering the value of this key will
++ // cause people's remembered passwords to be forgotten. Think carefully
++ // before changing the way this key is constructed.
++ nsAutoString key, realm;
++
++ NS_ConvertUTF8toUTF16 dispHost(scheme);
++ dispHost.Append(NS_LITERAL_STRING("://"));
++ dispHost.Append(NS_ConvertUTF8toUTF16(hostPort));
++
++ key = dispHost;
++ if (*default_domain != '\0')
++ {
++ // We assume the realm string is ASCII. That might be a bogus assumption,
++ // but we have no idea what encoding GnomeVFS is using, so for now we'll
++ // limit ourselves to ISO-Latin-1. XXX What is a better solution?
++ realm.Append('"');
++ realm.Append(NS_ConvertASCIItoUTF16(default_domain));
++ realm.Append('"');
++ key.Append(' ');
++ key.Append(realm);
++ }
++ // Construct the message string...
++ //
++ // We use Necko's string bundle here. This code really should be encapsulated
++ // behind some Necko API, after all this code is based closely on the code in
++ // nsHttpChannel.cpp.
++ nsCOMPtr<nsIStringBundleService> bundleSvc =
++ do_GetService(NS_STRINGBUNDLE_CONTRACTID);
++ if (!bundleSvc) {
++ g_mount_operation_reply(mount_op, G_MOUNT_OPERATION_ABORTED);
++ return;
++ }
++ nsCOMPtr<nsIStringBundle> bundle;
++ bundleSvc->CreateBundle("chrome://global/locale/commonDialogs.properties",
++ getter_AddRefs(bundle));
++ if (!bundle) {
++ g_mount_operation_reply(mount_op, G_MOUNT_OPERATION_ABORTED);
++ return;
++ }
++ nsAutoString nsmessage;
++
++ if (flags & G_ASK_PASSWORD_NEED_PASSWORD) {
++ if (flags & G_ASK_PASSWORD_NEED_USERNAME) {
++ if (!realm.IsEmpty()) {
++ const PRUnichar *strings[] = { realm.get(), dispHost.get() };
++ bundle->FormatStringFromName(NS_LITERAL_STRING("EnterLoginForRealm").get(),
++ strings, 2, getter_Copies(nsmessage));
++ } else {
++ const PRUnichar *strings[] = { dispHost.get() };
++ bundle->FormatStringFromName(NS_LITERAL_STRING("EnterUserPasswordFor").get(),
++ strings, 1, getter_Copies(nsmessage));
++ }
++ } else {
++ NS_ConvertUTF8toUTF16 userName(default_user);
++ const PRUnichar *strings[] = { userName.get(), dispHost.get() };
++ bundle->FormatStringFromName(NS_LITERAL_STRING("EnterPasswordFor").get(),
++ strings, 2, getter_Copies(nsmessage));
++ }
++ } else {
++ g_warning("Unknown mount operation request (flags: %x)", flags);
++ }
++
++ if (nsmessage.IsEmpty()) {
++ g_mount_operation_reply(mount_op, G_MOUNT_OPERATION_ABORTED);
++ return;
++ }
++ // Prompt the user...
++ nsresult rv;
++ PRBool retval = PR_FALSE;
++ PRUnichar *user = nsnull, *pass = nsnull;
++ if (default_user) {
++ // user will be freed by PromptUsernameAndPassword
++ user = ToNewUnicode(NS_ConvertUTF8toUTF16(default_user));
++ }
++ if (flags & G_ASK_PASSWORD_NEED_USERNAME) {
++ rv = prompt->PromptUsernameAndPassword(nsnull, nsmessage.get(),
++ key.get(),
++ nsIAuthPrompt::SAVE_PASSWORD_PERMANENTLY,
++ &user, &pass, &retval);
++ } else {
++ rv = prompt->PromptPassword(nsnull, nsmessage.get(),
++ key.get(),
++ nsIAuthPrompt::SAVE_PASSWORD_PERMANENTLY,
++ &pass, &retval);
++ }
++ if (NS_FAILED(rv) || !retval) { // was || user == '\0' || pass == '\0'
++ g_mount_operation_reply(mount_op, G_MOUNT_OPERATION_ABORTED);
++ return;
++ }
++ /* GIO should accept UTF8 */
++ g_mount_operation_set_username(mount_op, NS_ConvertUTF16toUTF8(user).get());
++ g_mount_operation_set_password(mount_op, NS_ConvertUTF16toUTF8(pass).get());
++ nsMemory::Free(user);
++ nsMemory::Free(pass);
++ g_mount_operation_reply(mount_op, G_MOUNT_OPERATION_HANDLED);
++}
++
++//-----------------------------------------------------------------------------
++
++class nsGIOProtocolHandler : public nsIProtocolHandler
++ , public nsIObserver
++{
++ public:
++ NS_DECL_ISUPPORTS
++ NS_DECL_NSIPROTOCOLHANDLER
++ NS_DECL_NSIOBSERVER
++
++ nsresult Init();
++
++ private:
++ void InitSupportedProtocolsPref(nsIPrefBranch *prefs);
++ PRBool IsSupportedProtocol(const nsCString &spec);
++
++ nsCString mSupportedProtocols;
++};
++
++NS_IMPL_ISUPPORTS2(nsGIOProtocolHandler, nsIProtocolHandler, nsIObserver)
++
++nsresult
++nsGIOProtocolHandler::Init()
++{
++#ifdef PR_LOGGING
++ sGIOLog = PR_NewLogModule("gio");
++#endif
++
++ nsCOMPtr<nsIPrefBranch2> prefs = do_GetService(NS_PREFSERVICE_CONTRACTID);
++ if (prefs)
++ {
++ InitSupportedProtocolsPref(prefs);
++ prefs->AddObserver(MOZ_GIO_SUPPORTED_PROTOCOLS, this, PR_FALSE);
++ }
++
++ return NS_OK;
++}
++
++void
++nsGIOProtocolHandler::InitSupportedProtocolsPref(nsIPrefBranch *prefs)
++{
++ // Get user preferences to determine which protocol is supported.
++ // Gvfs/GIO has a set of supported protocols like obex, network, archive,
++ // computer, dav, cdda, gphoto2, trash, etc. Some of these seems to be
++ // irrelevant to process by browser. By default accept only smb and sftp
++ // protocols so far.
++ nsresult rv = prefs->GetCharPref(MOZ_GIO_SUPPORTED_PROTOCOLS,
++ getter_Copies(mSupportedProtocols));
++ if (NS_SUCCEEDED(rv)) {
++ mSupportedProtocols.StripWhitespace();
++ ToLowerCase(mSupportedProtocols);
++ }
++ else
++ mSupportedProtocols.Assign("smb:,sftp:"); // use defaults
++
++ LOG(("gio: supported protocols \"%s\"\n", mSupportedProtocols.get()));
++}
++
++PRBool
++nsGIOProtocolHandler::IsSupportedProtocol(const nsCString &aSpec)
++{
++ const char *specString = aSpec.get();
++ const char *colon = strchr(specString, ':');
++ if (!colon)
++ return PR_FALSE;
++
++ PRUint32 length = colon - specString + 1;
++
++ // <scheme> + ':'
++ nsCString scheme(specString, length);
++
++ char *found = PL_strcasestr(mSupportedProtocols.get(), scheme.get());
++ if (!found)
++ return PR_FALSE;
++
++ if (found[length] != ',' && found[length] != '\0')
++ return PR_FALSE;
++
++ return PR_TRUE;
++}
++
++NS_IMETHODIMP
++nsGIOProtocolHandler::GetScheme(nsACString &aScheme)
++{
++ aScheme.Assign(MOZ_GIO_SCHEME);
++ return NS_OK;
++}
++
++NS_IMETHODIMP
++nsGIOProtocolHandler::GetDefaultPort(PRInt32 *aDefaultPort)
++{
++ *aDefaultPort = -1;
++ return NS_OK;
++}
++
++NS_IMETHODIMP
++nsGIOProtocolHandler::GetProtocolFlags(PRUint32 *aProtocolFlags)
++{
++ // Is URI_STD true of all GnomeVFS URI types?
++ *aProtocolFlags = URI_STD | URI_DANGEROUS_TO_LOAD;
++ return NS_OK;
++}
++
++NS_IMETHODIMP
++nsGIOProtocolHandler::NewURI(const nsACString &aSpec,
++ const char *aOriginCharset,
++ nsIURI *aBaseURI,
++ nsIURI **aResult)
++{
++ const nsCString flatSpec(aSpec);
++ LOG(("gio: NewURI [spec=%s]\n", flatSpec.get()));
++
++ if (!aBaseURI)
++ {
++ // XXX Is it good to support all GIO protocols?
++ if (!IsSupportedProtocol(flatSpec))
++ return NS_ERROR_UNKNOWN_PROTOCOL;
++
++ PRInt32 colon_location = flatSpec.FindChar(':');
++ if (colon_location <= 0)
++ return NS_ERROR_UNKNOWN_PROTOCOL;
++
++ // Verify that GIO supports this URI scheme.
++ PRBool uri_scheme_supported = PR_FALSE;
++
++ GVfs *gvfs = g_vfs_get_default();
++
++ if (!gvfs) {
++ g_warning("Cannot get GVfs object.");
++ return NS_ERROR_UNKNOWN_PROTOCOL;
++ }
++
++ const gchar* const * uri_schemes = g_vfs_get_supported_uri_schemes(gvfs);
++
++ while (*uri_schemes != NULL) {
++ // While flatSpec ends with ':' the uri_scheme does not. Therefore do not
++ // compare last character.
++ if (StringHead(flatSpec, colon_location).Equals(*uri_schemes)) {
++ uri_scheme_supported = PR_TRUE;
++ break;
++ }
++ uri_schemes++;
++ }
++
++ if (!uri_scheme_supported) {
++ return NS_ERROR_UNKNOWN_PROTOCOL;
++ }
++ }
++
++ nsresult rv;
++ nsCOMPtr<nsIStandardURL> url =
++ do_CreateInstance(NS_STANDARDURL_CONTRACTID, &rv);
++ if (NS_FAILED(rv))
++ return rv;
++
++ rv = url->Init(nsIStandardURL::URLTYPE_STANDARD, -1, flatSpec,
++ aOriginCharset, aBaseURI);
++ if (NS_SUCCEEDED(rv))
++ rv = CallQueryInterface(url, aResult);
++ return rv;
++
++}
++
++NS_IMETHODIMP
++nsGIOProtocolHandler::NewChannel(nsIURI *aURI, nsIChannel **aResult)
++{
++ NS_ENSURE_ARG_POINTER(aURI);
++ nsresult rv;
++
++ nsCAutoString spec;
++ rv = aURI->GetSpec(spec);
++ if (NS_FAILED(rv))
++ return rv;
++
++ nsRefPtr<nsGIOInputStream> stream = new nsGIOInputStream(spec);
++ if (!stream)
++ {
++ rv = NS_ERROR_OUT_OF_MEMORY;
++ }
++ else
++ {
++ // start out assuming an unknown content-type. we'll set the content-type
++ // to something better once we open the URI.
++ rv = NS_NewInputStreamChannel(aResult,
++ aURI,
++ stream,
++ NS_LITERAL_CSTRING(UNKNOWN_CONTENT_TYPE));
++ if (NS_SUCCEEDED(rv))
++ stream->SetChannel(*aResult);
++ }
++ return rv;
++}
++
++NS_IMETHODIMP
++nsGIOProtocolHandler::AllowPort(PRInt32 aPort,
++ const char *aScheme,
++ PRBool *aResult)
++{
++ // Don't override anything.
++ *aResult = PR_FALSE;
++ return NS_OK;
++}
++
++NS_IMETHODIMP
++nsGIOProtocolHandler::Observe(nsISupports *aSubject,
++ const char *aTopic,
++ const PRUnichar *aData)
++{
++ if (strcmp(aTopic, NS_PREFBRANCH_PREFCHANGE_TOPIC_ID) == 0) {
++ nsCOMPtr<nsIPrefBranch> prefs = do_QueryInterface(aSubject);
++ InitSupportedProtocolsPref(prefs);
++ }
++ return NS_OK;
++}
++
++//-----------------------------------------------------------------------------
++
++#define NS_GIOPROTOCOLHANDLER_CID \
++{ /* ee706783-3af8-4d19-9e84-e2ebfe213480 */ \
++ 0xee706783, \
++ 0x3af8, \
++ 0x4d19, \
++ {0x9e, 0x84, 0xe2, 0xeb, 0xfe, 0x21, 0x34, 0x80} \
++}
++
++NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsGIOProtocolHandler, Init)
++NS_DEFINE_NAMED_CID(NS_GIOPROTOCOLHANDLER_CID);
++
++static const mozilla::Module::CIDEntry kVFSCIDs[] = {
++ { &kNS_GIOPROTOCOLHANDLER_CID, false, NULL, nsGIOProtocolHandlerConstructor },
++ { NULL }
++};
++
++static const mozilla::Module::ContractIDEntry kVFSContracts[] = {
++ { NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX MOZ_GIO_SCHEME, &kNS_GIOPROTOCOLHANDLER_CID },
++ { NULL }
++};
++
++static const mozilla::Module kVFSModule = {
++ mozilla::Module::kVersion,
++ kVFSCIDs,
++ kVFSContracts
++};
++
++NSMODULE_DEFN(nsGIOModule) = &kVFSModule;
+diff -r 49a1b2aa43c5 netwerk/base/src/nsIOService.cpp
+--- a/netwerk/base/src/nsIOService.cpp Tue Dec 21 12:42:59 2010 +0100
++++ b/netwerk/base/src/nsIOService.cpp Tue Jan 11 11:17:52 2011 +0100
+@@ -454,6 +454,27 @@
+ }
+
+ #ifdef MOZ_X11
++ // check to see whether GVFS can handle this URI scheme. if it can
++ // create a nsIURI for the "scheme:", then we assume it has support for
++ // the requested protocol. otherwise, we failover to using the default
++ // protocol handler.
++
++ rv = CallGetService(NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX"moz-gio",
++ result);
++ if (NS_SUCCEEDED(rv)) {
++ nsCAutoString spec(scheme);
++ spec.Append(':');
++
++ nsIURI *uri;
++ rv = (*result)->NewURI(spec, nsnull, nsnull, &uri);
++ if (NS_SUCCEEDED(rv)) {
++ NS_RELEASE(uri);
++ return rv;
++ }
++
++ NS_RELEASE(*result);
++ }
++
+ // check to see whether GnomeVFS can handle this URI scheme. if it can
+ // create a nsIURI for the "scheme:", then we assume it has support for
+ // the requested protocol. otherwise, we failover to using the default
diff --git a/community-staging/xulrunner-oss/xulrunner-omnijar.patch b/community-staging/xulrunner-oss/xulrunner-omnijar.patch
new file mode 100644
index 000000000..66ec5206c
--- /dev/null
+++ b/community-staging/xulrunner-oss/xulrunner-omnijar.patch
@@ -0,0 +1,1737 @@
+# HG changeset patch
+# Parent a7dea879b4b445a23186f438900562155bb39e99
+Bug 620931 part 1 - Use chrome manifest to register resource://gre-resources/
+
+diff --git a/layout/style/jar.mn b/layout/style/jar.mn
+--- a/layout/style/jar.mn
++++ b/layout/style/jar.mn
+@@ -1,8 +1,10 @@
+ toolkit.jar:
+ * res/ua.css (ua.css)
+ res/html.css (html.css)
+ res/quirk.css (quirk.css)
+ res/viewsource.css (viewsource.css)
+ * res/forms.css (forms.css)
+ res/arrow.gif (arrow.gif)
+ res/arrowd.gif (arrowd.gif)
++
++% resource gre-resources %res/
+diff --git a/netwerk/protocol/res/nsResProtocolHandler.cpp b/netwerk/protocol/res/nsResProtocolHandler.cpp
+--- a/netwerk/protocol/res/nsResProtocolHandler.cpp
++++ b/netwerk/protocol/res/nsResProtocolHandler.cpp
+@@ -75,17 +75,16 @@ static nsResProtocolHandler *gResHandler
+ //
+ // this enables PR_LOG_ALWAYS level information and places all output in
+ // the file log.txt
+ //
+ static PRLogModuleInfo *gResLog;
+ #endif
+
+ #define kGRE NS_LITERAL_CSTRING("gre")
+-#define kGRE_RESOURCES NS_LITERAL_CSTRING("gre-resources")
+
+ //----------------------------------------------------------------------------
+ // nsResURL : overrides nsStandardURL::GetFile to provide nsIFile resolution
+ //----------------------------------------------------------------------------
+
+ nsresult
+ nsResURL::EnsureFile()
+ {
+@@ -197,28 +196,16 @@ nsResProtocolHandler::Init()
+ NS_ENSURE_SUCCESS(rv, rv);
+
+ //
+ // make resource://gre/ point to the GRE directory
+ //
+ rv = AddSpecialDir(NS_GRE_DIR, kGRE);
+ NS_ENSURE_SUCCESS(rv, rv);
+
+- // make resource://gre-resources/ point to gre toolkit[.jar]/res
+- nsCOMPtr<nsIURI> greURI;
+- nsCOMPtr<nsIURI> greResURI;
+- GetSubstitution(kGRE, getter_AddRefs(greURI));
+-#ifdef MOZ_CHROME_FILE_FORMAT_JAR
+- NS_NAMED_LITERAL_CSTRING(strGRE_RES_URL, "jar:chrome/toolkit.jar!/res/");
+-#else
+- NS_NAMED_LITERAL_CSTRING(strGRE_RES_URL, "chrome/toolkit/res/");
+-#endif
+- rv = mIOService->NewURI(strGRE_RES_URL, nsnull, greURI,
+- getter_AddRefs(greResURI));
+- SetSubstitution(kGRE_RESOURCES, greResURI);
+ //XXXbsmedberg Neil wants a resource://pchrome/ for the profile chrome dir...
+ // but once I finish multiple chrome registration I'm not sure that it is needed
+
+ // XXX dveditz: resource://pchrome/ defeats profile directory salting
+ // if web content can load it. Tread carefully.
+
+ return rv;
+ }
+@@ -242,22 +229,16 @@ nsResProtocolHandler::Init(nsIFile *aOmn
+ // these entries should be kept in sync with the normal Init function
+
+ // resource:/// points to jar:omni.jar!/
+ SetSubstitution(EmptyCString(), uri);
+
+ // resource://gre/ points to jar:omni.jar!/
+ SetSubstitution(kGRE, uri);
+
+- urlStr += "chrome/toolkit/res/";
+- rv = mIOService->NewURI(urlStr, nsnull, nsnull, getter_AddRefs(uri));
+- NS_ENSURE_SUCCESS(rv, rv);
+-
+- // resource://gre-resources/ points to jar:omni.jar!/chrome/toolkit/res/
+- SetSubstitution(kGRE_RESOURCES, uri);
+ return NS_OK;
+ }
+ #endif
+
+ #ifdef MOZ_IPC
+ static PLDHashOperator
+ EnumerateSubstitution(const nsACString& aKey,
+ nsIURI* aURI,
+# HG changeset patch
+# Parent 3038cccba1a071d6b418e15442d0f2d9f3dcb11d
+Bug 620931 part 2 - When building --with-libxul-sdk, use the right preferences directory
+
+diff --git a/browser/locales/Makefile.in b/browser/locales/Makefile.in
+--- a/browser/locales/Makefile.in
++++ b/browser/locales/Makefile.in
+@@ -183,17 +183,17 @@ install:: $(addsuffix .xml,$(SEARCH_PLUG
+ $(SYSINSTALL) $(IFLAGS1) $^ $(DESTDIR)$(mozappdir)/searchplugins
+
+
+ libs-%:
+ $(NSINSTALL) -D $(DIST)/install
+ @$(MAKE) -C ../../toolkit/locales libs-$* BOTH_MANIFESTS=1
+ @$(MAKE) -C ../../services/sync/locales AB_CD=$* XPI_NAME=locale-$* BOTH_MANIFESTS=1
+ @$(MAKE) -C ../../extensions/spellcheck/locales AB_CD=$* XPI_NAME=locale-$* BOTH_MANIFESTS=1
+- @$(MAKE) libs AB_CD=$* XPI_NAME=locale-$* PREF_DIR=defaults/pref BOTH_MANIFESTS=1
++ @$(MAKE) libs AB_CD=$* XPI_NAME=locale-$* PREF_DIR=$(PREF_DIR) BOTH_MANIFESTS=1
+ @$(MAKE) -C $(DEPTH)/$(MOZ_BRANDING_DIRECTORY)/locales AB_CD=$* XPI_NAME=locale-$* BOTH_MANIFESTS=1
+
+
+ repackage-win32-installer: WIN32_INSTALLER_OUT="$(_ABS_DIST)/$(PKG_INST_PATH)$(PKG_INST_BASENAME).exe"
+ repackage-win32-installer: $(WIN32_INSTALLER_IN) $(SUBMAKEFILES)
+ @echo "Repackaging $(WIN32_INSTALLER_IN) into $(WIN32_INSTALLER_OUT)."
+ $(MAKE) -C $(DEPTH)/$(MOZ_BRANDING_DIRECTORY) export
+ $(MAKE) -C ../installer/windows CONFIG_DIR=l10ngen l10ngen/setup.exe l10ngen/7zSD.sfx
+diff --git a/toolkit/mozapps/installer/packager.mk b/toolkit/mozapps/installer/packager.mk
+--- a/toolkit/mozapps/installer/packager.mk
++++ b/toolkit/mozapps/installer/packager.mk
+@@ -307,17 +307,17 @@ OMNIJAR_FILES = \
+ res \
+ defaults \
+ greprefs.js \
+ jsloader \
+ $(NULL)
+
+ NON_OMNIJAR_FILES += \
+ chrome/icons/\* \
+- defaults/pref/channel-prefs.js \
++ $(PREF_DIR)/channel-prefs.js \
+ res/cursors/\* \
+ res/MainMenu.nib/\* \
+ $(NULL)
+
+ PACK_OMNIJAR = \
+ rm -f omni.jar components/binary.manifest && \
+ grep -h '^binary-component' components/*.manifest > binary.manifest ; \
+ sed -e 's/^binary-component/\#binary-component/' components/components.manifest > components.manifest && \
+# HG changeset patch
+# Parent cd8df8030f7ad7530692bd7c4391a8009df56a02
+Bug 620931 part 3 - Allow GRE and XUL application to use omni.jar independently
+
+We now store two independent locations for an omni.jar, allowing GRE/XRE and
+XUL application to each have their own omni.jar. And since xulrunner setups
+are very independent from the XUL applications, we implement support for both
+omni.jar and non omni.jar cases in the same runtime, with the side effect of
+allowing to switch from one to the other manually without rebuilding the
+binaries.
+
+We let the mozilla::Omnijar API handle both cases, so that callers don't need
+too much work to support them.
+
+We also make the preferences service load the same set of preferences in all
+the various cases (unified vs. separate, omni.jar vs. no omni.jar).
+
+The child process launcher for IPC is modified to pass the base directories
+needed for the mozilla::Omnijar API initialization in the child process.
+
+Finally, the startupcache file name canonicalization is modified to separate
+APP and GRE resources.
+
+diff --git a/ipc/glue/GeckoChildProcessHost.cpp b/ipc/glue/GeckoChildProcessHost.cpp
+--- a/ipc/glue/GeckoChildProcessHost.cpp
++++ b/ipc/glue/GeckoChildProcessHost.cpp
+@@ -440,26 +440,29 @@ GeckoChildProcessHost::PerformAsyncLaunc
+ // other end of the socketpair() from us
+
+ std::vector<std::string> childArgv;
+
+ childArgv.push_back(exePath.value());
+
+ childArgv.insert(childArgv.end(), aExtraOpts.begin(), aExtraOpts.end());
+
+-#ifdef MOZ_OMNIJAR
+ // Make sure the child process can find the omnijar
+ // See XRE_InitCommandLine in nsAppRunner.cpp
+- nsCAutoString omnijarPath;
+- if (mozilla::OmnijarPath()) {
+- mozilla::OmnijarPath()->GetNativePath(omnijarPath);
+- childArgv.push_back("-omnijar");
+- childArgv.push_back(omnijarPath.get());
++ nsCAutoString path;
++ nsCOMPtr<nsIFile> file = mozilla::Omnijar::GetBase(mozilla::Omnijar::GRE);
++ if (file && NS_SUCCEEDED(file->GetNativePath(path))) {
++ childArgv.push_back("-grebase");
++ childArgv.push_back(path.get());
+ }
+-#endif
++ file = mozilla::Omnijar::GetBase(mozilla::Omnijar::APP);
++ if (file && NS_SUCCEEDED(file->GetNativePath(path))) {
++ childArgv.push_back("-appbase");
++ childArgv.push_back(path.get());
++ }
+
+ childArgv.push_back(pidstring);
+
+ #if defined(MOZ_CRASHREPORTER)
+ # if defined(OS_LINUX)
+ int childCrashFd, childCrashRemapFd;
+ if (!CrashReporter::CreateNotificationPipeForChild(
+ &childCrashFd, &childCrashRemapFd))
+@@ -552,26 +555,29 @@ GeckoChildProcessHost::PerformAsyncLaunc
+ for (std::vector<std::string>::iterator it = aExtraOpts.begin();
+ it != aExtraOpts.end();
+ ++it) {
+ cmdLine.AppendLooseValue(UTF8ToWide(*it));
+ }
+
+ cmdLine.AppendLooseValue(std::wstring(mGroupId.get()));
+
+-#ifdef MOZ_OMNIJAR
+ // Make sure the child process can find the omnijar
+ // See XRE_InitCommandLine in nsAppRunner.cpp
+- nsAutoString omnijarPath;
+- if (mozilla::OmnijarPath()) {
+- mozilla::OmnijarPath()->GetPath(omnijarPath);
+- cmdLine.AppendLooseValue(UTF8ToWide("-omnijar"));
+- cmdLine.AppendLooseValue(omnijarPath.get());
++ nsAutoString path;
++ nsCOMPtr<nsIFile> file = mozilla::Omnijar::GetBase(mozilla::Omnijar::GRE);
++ if (file && NS_SUCCEEDED(file->GetPath(path))) {
++ cmdLine.AppendLooseValue(UTF8ToWide("-grebase"));
++ cmdLine.AppendLooseValue(path.get());
+ }
+-#endif
++ file = mozilla::Omnijar::GetBase(mozilla::Omnijar::APP);
++ if (file && NS_SUCCEEDED(file->GetPath(path))) {
++ cmdLine.AppendLooseValue(UTF8ToWide("-appbase"));
++ cmdLine.AppendLooseValue(path.get());
++ }
+
+ cmdLine.AppendLooseValue(UTF8ToWide(pidstring));
+
+ #if defined(MOZ_CRASHREPORTER)
+ cmdLine.AppendLooseValue(
+ UTF8ToWide(CrashReporter::GetChildNotificationPipe()));
+ #endif
+
+diff --git a/js/src/xpconnect/loader/mozJSComponentLoader.cpp b/js/src/xpconnect/loader/mozJSComponentLoader.cpp
+--- a/js/src/xpconnect/loader/mozJSComponentLoader.cpp
++++ b/js/src/xpconnect/loader/mozJSComponentLoader.cpp
+@@ -81,16 +81,17 @@
+ #include "nsIConsoleService.h"
+ #include "nsIStorageStream.h"
+ #include "nsIStringStream.h"
+ #include "prmem.h"
+ #if defined(XP_WIN)
+ #include "nsILocalFileWin.h"
+ #endif
+ #include "xpcprivate.h"
++#include "nsIResProtocolHandler.h"
+
+ #ifdef MOZ_ENABLE_LIBXUL
+ #include "mozilla/scache/StartupCache.h"
+ #include "mozilla/scache/StartupCacheUtils.h"
+ #endif
+ #include "mozilla/Omnijar.h"
+
+ #include "jsdbgapi.h"
+@@ -621,34 +622,21 @@ mozJSComponentLoader::LoadModule(nsILoca
+
+ const mozilla::Module*
+ mozJSComponentLoader::LoadModuleFromJAR(nsILocalFile *aJarFile,
+ const nsACString &aComponentPath)
+ {
+ #if !defined(XPCONNECT_STANDALONE)
+ nsresult rv;
+
+- nsCAutoString fullSpec;
+-
+-#ifdef MOZ_OMNIJAR
+- PRBool equal;
+- rv = aJarFile->Equals(mozilla::OmnijarPath(), &equal);
+- if (NS_SUCCEEDED(rv) && equal) {
+- fullSpec = "resource://gre/";
+- } else {
+-#endif
+- nsCAutoString fileSpec;
+- NS_GetURLSpecFromActualFile(aJarFile, fileSpec);
+- fullSpec = "jar:";
+- fullSpec += fileSpec;
+- fullSpec += "!/";
+-#ifdef MOZ_OMNIJAR
+- }
+-#endif
+-
++ nsCAutoString fullSpec, fileSpec;
++ NS_GetURLSpecFromActualFile(aJarFile, fileSpec);
++ fullSpec = "jar:";
++ fullSpec += fileSpec;
++ fullSpec += "!/";
+ fullSpec += aComponentPath;
+
+ nsCOMPtr<nsIURI> uri;
+ rv = NS_NewURI(getter_AddRefs(uri), fullSpec);
+ if (NS_FAILED(rv))
+ return NULL;
+
+ nsAutoString hashstring;
+@@ -833,57 +821,138 @@ class JSScriptHolder
+ JSScriptHolder(JSContext *cx, JSScript *script)
+ : mCx(cx), mScript(script) {}
+ ~JSScriptHolder() { ::JS_DestroyScript(mCx, mScript); }
+ private:
+ JSContext *mCx;
+ JSScript *mScript;
+ };
+
++static const char baseName[2][5] = { "gre/", "app/" };
++
++static inline PRBool
++canonicalizeBase(nsCAutoString &spec, nsACString &out, mozilla::Omnijar::Type aType)
++{
++ nsCAutoString base;
++ nsresult rv = mozilla::Omnijar::GetURIString(aType, base);
++
++ if (NS_FAILED(rv) || !base.Length())
++ return PR_FALSE;
++
++ if (base.Compare(spec.get(), PR_FALSE, base.Length()))
++ return PR_FALSE;
++
++ out.Append("/resource/");
++ out.Append(baseName[aType]);
++ out.Append(Substring(spec, base.Length()));
++ return PR_TRUE;
++}
+ /**
+ * PathifyURI transforms mozilla .js uris into useful zip paths
+ * to make it makes it easier to manipulate startup cache entries
+ * using standard zip tools.
+ * Transformations applied:
+- * * jsloader/<scheme> prefix is used to group mozJSComponentLoader cache entries in
++ * * jsloader/ prefix is used to group mozJSComponentLoader cache entries in
+ * a top-level zip directory.
+- * * In MOZ_OMNIJAR case resource:/// and resource://gre/ URIs refer to the same path
+- * so treat both of them as resource://gre/
++ * * resource:// URIs are resolved to their corresponding file/jar URI to
++ * canonicalize resources URIs other than gre and app.
++ * * Paths under GRE or APP directory have their base path replaced with
++ * resource/gre or resource/app to avoid depending on install location.
++ * * jar:file:///path/to/file.jar!/sub/path urls are replaced with
++ * /path/to/file.jar/sub/path
+ * * .bin suffix is added to the end of the path to indicate that jsloader/ entries
+ * are binary representations of JS source.
+ * For example:
+- * resource://gre/modules/XPCOMUtils.jsm becomes
+- * jsloader/resource/gre/modules/XPCOMUtils.jsm.bin
++ * resource://gre/modules/XPCOMUtils.jsm or
++ * file://$GRE_DIR/modules/XPCOMUtils.jsm or
++ * jar:file://$GRE_DIR/omni.jar!/modules/XPCOMUtils.jsm become
++ * jsloader/resource/gre/modules/XPCOMUtils.jsm.bin
++ * file://$PROFILE_DIR/extensions/{uuid}/components/component.js becomes
++ * jsloader/$PROFILE_DIR/extensions/%7Buuid%7D/components/component.js.bin
++ * jar:file://$PROFILE_DIR/extensions/some.xpi!/components/component.js becomes
++ * jsloader/$PROFILE_DIR/extensions/some.xpi/components/component.js.bin
+ */
+ static nsresult
+ PathifyURI(nsIURI *in, nsACString &out)
+ {
+- out = "jsloader/";
+- nsCAutoString scheme;
+- nsresult rv = in->GetScheme(scheme);
+- NS_ENSURE_SUCCESS(rv, rv);
+- out.Append(scheme);
+- nsCAutoString host;
+- // OK for GetHost to fail since it's not implemented sometimes
+- in->GetHost(host);
+-#ifdef MOZ_OMNIJAR
+- if (scheme.Equals("resource") && host.Length() == 0){
+- host = "gre";
+- }
+-#endif
+- if (host.Length()) {
+- out.Append("/");
+- out.Append(host);
+- }
+- nsCAutoString path;
+- rv = in->GetPath(path);
+- NS_ENSURE_SUCCESS(rv, rv);
+- out.Append(path);
+- out.Append(".bin");
+- return NS_OK;
++ PRBool equals;
++ nsresult rv;
++ nsCOMPtr<nsIURI> uri = in;
++ nsCAutoString spec;
++
++ out = "jsloader";
++
++ // Resolve resource:// URIs. At the end of this if/else block, we
++ // have both spec and uri variables identifying the same URI.
++ if (NS_SUCCEEDED(in->SchemeIs("resource", &equals)) && equals) {
++ nsCOMPtr<nsIIOService> ioService = do_GetIOService(&rv);
++ NS_ENSURE_SUCCESS(rv, rv);
++
++ nsCOMPtr<nsIProtocolHandler> ph;
++ rv = ioService->GetProtocolHandler("resource", getter_AddRefs(ph));
++ NS_ENSURE_SUCCESS(rv, rv);
++
++ nsCOMPtr<nsIResProtocolHandler> irph(do_QueryInterface(ph, &rv));
++ NS_ENSURE_SUCCESS(rv, rv);
++
++ rv = irph->ResolveURI(in, spec);
++ NS_ENSURE_SUCCESS(rv, rv);
++
++ rv = ioService->NewURI(spec, nsnull, nsnull, getter_AddRefs(uri));
++ NS_ENSURE_SUCCESS(rv, rv);
++ } else {
++ rv = in->GetSpec(spec);
++ NS_ENSURE_SUCCESS(rv, rv);
++ }
++
++ if (!canonicalizeBase(spec, out, mozilla::Omnijar::GRE) &&
++ !canonicalizeBase(spec, out, mozilla::Omnijar::APP)) {
++ if (NS_SUCCEEDED(uri->SchemeIs("file", &equals)) && equals) {
++ nsCOMPtr<nsIFileURL> baseFileURL;
++ baseFileURL = do_QueryInterface(uri, &rv);
++ NS_ENSURE_SUCCESS(rv, rv);
++
++ nsCAutoString path;
++ rv = baseFileURL->GetPath(path);
++ NS_ENSURE_SUCCESS(rv, rv);
++
++ out.Append(path);
++ } else if (NS_SUCCEEDED(uri->SchemeIs("jar", &equals)) && equals) {
++ nsCOMPtr<nsIJARURI> jarURI = do_QueryInterface(uri, &rv);
++ NS_ENSURE_SUCCESS(rv, rv);
++
++ nsCOMPtr<nsIURI> jarFileURI;
++ rv = jarURI->GetJARFile(getter_AddRefs(jarFileURI));
++ NS_ENSURE_SUCCESS(rv, rv);
++
++ nsCOMPtr<nsIFileURL> jarFileURL;
++ jarFileURL = do_QueryInterface(jarFileURI, &rv);
++ NS_ENSURE_SUCCESS(rv, rv);
++
++ nsCAutoString path;
++ rv = jarFileURL->GetPath(path);
++ NS_ENSURE_SUCCESS(rv, rv);
++ out.Append(path);
++
++ rv = jarURI->GetJAREntry(path);
++ NS_ENSURE_SUCCESS(rv, rv);
++ out.Append("/");
++ out.Append(path);
++ } else { // Very unlikely
++ nsCAutoString spec;
++ rv = uri->GetSpec(spec);
++ NS_ENSURE_SUCCESS(rv, rv);
++
++ out.Append("/");
++ out.Append(spec);
++ }
++ }
++
++ out.Append(".bin");
++ return NS_OK;
+ }
+
+ /* static */
+ #ifdef MOZ_ENABLE_LIBXUL
+ nsresult
+ mozJSComponentLoader::ReadScript(StartupCache* cache, nsIURI *uri,
+ JSContext *cx, JSScript **script)
+ {
+diff --git a/modules/libjar/nsJAR.cpp b/modules/libjar/nsJAR.cpp
+--- a/modules/libjar/nsJAR.cpp
++++ b/modules/libjar/nsJAR.cpp
+@@ -171,26 +171,23 @@ nsJAR::Open(nsIFile* zipFile)
+ if (mLock) return NS_ERROR_FAILURE; // Already open!
+
+ mZipFile = zipFile;
+ mOuterZipEntry.Truncate();
+
+ mLock = PR_NewLock();
+ NS_ENSURE_TRUE(mLock, NS_ERROR_OUT_OF_MEMORY);
+
+-#ifdef MOZ_OMNIJAR
+ // The omnijar is special, it is opened early on and closed late
+ // this avoids reopening it
+- PRBool equals;
+- nsresult rv = zipFile->Equals(mozilla::OmnijarPath(), &equals);
+- if (NS_SUCCEEDED(rv) && equals) {
+- mZip = mozilla::OmnijarReader();
++ nsZipArchive *zip = mozilla::Omnijar::GetReader(zipFile);
++ if (zip) {
++ mZip = zip;
+ return NS_OK;
+ }
+-#endif
+ return mZip->OpenArchive(zipFile);
+ }
+
+ NS_IMETHODIMP
+ nsJAR::OpenInner(nsIZipReader *aZipReader, const char *aZipEntry)
+ {
+ NS_ENSURE_ARG_POINTER(aZipReader);
+ NS_ENSURE_ARG_POINTER(aZipEntry);
+@@ -234,23 +231,22 @@ nsJAR::Close()
+ mLock = nsnull;
+ }
+
+ mParsedManifest = PR_FALSE;
+ mManifestData.Reset();
+ mGlobalStatus = JAR_MANIFEST_NOT_PARSED;
+ mTotalItemsInManifest = 0;
+
+-#ifdef MOZ_OMNIJAR
+- if (mZip == mozilla::OmnijarReader()) {
++ if ((mZip == mozilla::Omnijar::GetReader(mozilla::Omnijar::GRE)) ||
++ (mZip == mozilla::Omnijar::GetReader(mozilla::Omnijar::APP))) {
+ mZip.forget();
+ mZip = new nsZipArchive();
+ return NS_OK;
+ }
+-#endif
+ return mZip->CloseArchive();
+ }
+
+ NS_IMETHODIMP
+ nsJAR::Test(const char *aEntryName)
+ {
+ return mZip->Test(aEntryName);
+ }
+@@ -391,22 +387,21 @@ nsJAR::GetInputStreamWithSpec(const nsAC
+ NS_IMETHODIMP
+ nsJAR::GetCertificatePrincipal(const char* aFilename, nsIPrincipal** aPrincipal)
+ {
+ //-- Parameter check
+ if (!aPrincipal)
+ return NS_ERROR_NULL_POINTER;
+ *aPrincipal = nsnull;
+
+-#ifdef MOZ_OMNIJAR
+ // Don't check signatures in the omnijar - this is only
+ // interesting for extensions/XPIs.
+- if (mZip == mozilla::OmnijarReader())
++ if ((mZip == mozilla::Omnijar::GetReader(mozilla::Omnijar::GRE)) ||
++ (mZip == mozilla::Omnijar::GetReader(mozilla::Omnijar::APP)))
+ return NS_OK;
+-#endif
+
+ //-- Parse the manifest
+ nsresult rv = ParseManifest();
+ if (NS_FAILED(rv)) return rv;
+ if (mGlobalStatus == JAR_NO_MANIFEST)
+ return NS_OK;
+
+ PRInt16 requestedStatus;
+diff --git a/modules/libpref/src/nsPrefService.cpp b/modules/libpref/src/nsPrefService.cpp
+--- a/modules/libpref/src/nsPrefService.cpp
++++ b/modules/libpref/src/nsPrefService.cpp
+@@ -67,20 +67,18 @@
+
+ #include "prefapi.h"
+ #include "prefread.h"
+ #include "prefapi_private_data.h"
+ #include "PrefTuple.h"
+
+ #include "nsITimelineService.h"
+
+-#ifdef MOZ_OMNIJAR
+ #include "mozilla/Omnijar.h"
+ #include "nsZipArchive.h"
+-#endif
+
+ // Definitions
+ #define INITIAL_PREF_FILES 10
+ static NS_DEFINE_CID(kZipReaderCID, NS_ZIPREADER_CID);
+
+ // Prototypes
+ static nsresult openPrefFile(nsIFile* aFile);
+ static nsresult pref_InitInitialObjects(void);
+@@ -793,124 +791,144 @@ static nsresult pref_LoadPrefsInDirList(
+ pref_LoadPrefsInDir(dir, nsnull, 0);
+ }
+ }
+ }
+ }
+ return NS_OK;
+ }
+
+-//----------------------------------------------------------------------------------------
+-// Initialize default preference JavaScript buffers from
+-// appropriate TEXT resources
+-//----------------------------------------------------------------------------------------
+-static nsresult pref_InitDefaults()
+-{
+- nsCOMPtr<nsIFile> greprefsFile;
+- nsresult rv;
+-
+- rv = NS_GetSpecialDirectory(NS_GRE_DIR, getter_AddRefs(greprefsFile));
+- NS_ENSURE_SUCCESS(rv, rv);
+-
+- rv = greprefsFile->AppendNative(NS_LITERAL_CSTRING("greprefs.js"));
+- NS_ENSURE_SUCCESS(rv, rv);
+-
+- rv = openPrefFile(greprefsFile);
+- if (NS_FAILED(rv)) {
+- NS_WARNING("Error parsing GRE default preferences. Is this an old-style embedding app?");
+- }
+-
+- return NS_OK;
+-}
+-
+-#ifdef MOZ_OMNIJAR
+ static nsresult pref_ReadPrefFromJar(nsZipArchive* jarReader, const char *name)
+ {
+ nsZipItemPtr<char> manifest(jarReader, name, true);
+ NS_ENSURE_TRUE(manifest.Buffer(), NS_ERROR_NOT_AVAILABLE);
+
+ PrefParseState ps;
+ PREF_InitParseState(&ps, PREF_ReaderCallback, NULL);
+ nsresult rv = PREF_ParseBuf(&ps, manifest, manifest.Length());
+ PREF_FinalizeParseState(&ps);
+
+ return rv;
+ }
+
+-static nsresult pref_InitAppDefaultsFromOmnijar()
+-{
+- nsresult rv;
+-
+- nsZipArchive* jarReader = mozilla::OmnijarReader();
+- if (!jarReader)
+- return pref_InitDefaults();
+-
+- rv = pref_ReadPrefFromJar(jarReader, "greprefs.js");
+- NS_ENSURE_SUCCESS(rv, rv);
+-
+- nsZipFind *findPtr;
+- rv = jarReader->FindInit("defaults/pref/*.js$", &findPtr);
+- NS_ENSURE_SUCCESS(rv, rv);
+-
+- nsAutoPtr<nsZipFind> find(findPtr);
+-
+- nsTArray<nsCString> prefEntries;
+- const char *entryName;
+- PRUint16 entryNameLen;
+- while (NS_SUCCEEDED(find->FindNext(&entryName, &entryNameLen))) {
+- prefEntries.AppendElement(Substring(entryName, entryName + entryNameLen));
+- }
+-
+- prefEntries.Sort();
+- for (PRUint32 i = prefEntries.Length(); i--; ) {
+- rv = pref_ReadPrefFromJar(jarReader, prefEntries[i].get());
+- if (NS_FAILED(rv))
+- NS_WARNING("Error parsing preferences.");
+- }
+-
+- return NS_OK;
+-}
+-#endif
+-
++//----------------------------------------------------------------------------------------
++// Initialize default preference JavaScript buffers from
++// appropriate TEXT resources
++//----------------------------------------------------------------------------------------
+ static nsresult pref_InitInitialObjects()
+ {
+ nsresult rv;
+
+- // first we parse the GRE default prefs. This also works if we're not using a GRE,
+-#ifdef MOZ_OMNIJAR
+- rv = pref_InitAppDefaultsFromOmnijar();
+-#else
+- rv = pref_InitDefaults();
+-#endif
+- NS_ENSURE_SUCCESS(rv, rv);
++ // In omni.jar case, we load the following prefs:
++ // - jar:$gre/omni.jar!/greprefs.js
++ // - jar:$gre/omni.jar!/defaults/pref/*.js
++ // In non omni.jar case, we load:
++ // - $gre/greprefs.js
++ //
++ // When $app == $gre, we additionally load, in all cases:
++ // - $gre/defaults/pref/*.js
++ // This is kept for bug 591866 (channel-prefs.js should not be in omni.jar).
++ // We load all files instead of channel-prefs.js only to have the same
++ // behaviour as $app != $gre.
++ //
++ // When $app != $gre, we additionally load, in omni.jar case:
++ // - jar:$app/omni.jar!/defaults/preferences/*.js
++ // - $app/defaults/preferences/*.js
++ // and in non omni.jar case:
++ // - $app/defaults/preferences/*.js
+
+- nsCOMPtr<nsIFile> defaultPrefDir;
+- // now parse the "application" default preferences
+- rv = NS_GetSpecialDirectory(NS_APP_PREF_DEFAULTS_50_DIR, getter_AddRefs(defaultPrefDir));
+- NS_ENSURE_SUCCESS(rv, rv);
++ nsZipFind *findPtr;
++ nsAutoPtr<nsZipFind> find;
++ nsTArray<nsCString> prefEntries;
++ const char *entryName;
++ PRUint16 entryNameLen;
+
+- /* these pref file names should not be used: we process them after all other application pref files for backwards compatibility */
+- static const char* specialFiles[] = {
++ nsZipArchive* jarReader = mozilla::Omnijar::GetReader(mozilla::Omnijar::GRE);
++ if (jarReader) {
++ // Load jar:$gre/omni.jar!/greprefs.js
++ rv = pref_ReadPrefFromJar(jarReader, "greprefs.js");
++ NS_ENSURE_SUCCESS(rv, rv);
++
++ // Load jar:$gre/omni.jar!/defaults/pref/*.js
++ rv = jarReader->FindInit("defaults/pref/*.js$", &findPtr);
++ NS_ENSURE_SUCCESS(rv, rv);
++
++ find = findPtr;
++ while (NS_SUCCEEDED(find->FindNext(&entryName, &entryNameLen))) {
++ prefEntries.AppendElement(Substring(entryName, entryName + entryNameLen));
++ }
++
++ prefEntries.Sort();
++ for (PRUint32 i = prefEntries.Length(); i--; ) {
++ rv = pref_ReadPrefFromJar(jarReader, prefEntries[i].get());
++ if (NS_FAILED(rv))
++ NS_WARNING("Error parsing preferences.");
++ }
++ } else {
++ // Load $gre/greprefs.js
++ nsCOMPtr<nsIFile> greprefsFile;
++ rv = NS_GetSpecialDirectory(NS_GRE_DIR, getter_AddRefs(greprefsFile));
++ NS_ENSURE_SUCCESS(rv, rv);
++
++ rv = greprefsFile->AppendNative(NS_LITERAL_CSTRING("greprefs.js"));
++ NS_ENSURE_SUCCESS(rv, rv);
++
++ rv = openPrefFile(greprefsFile);
++ if (NS_FAILED(rv))
++ NS_WARNING("Error parsing GRE default preferences. Is this an old-style embedding app?");
++ }
++
++ if (!mozilla::Omnijar::HasOmnijar(mozilla::Omnijar::APP)) {
++ // Load $gre/defaults/pref/*.js
++ nsCOMPtr<nsIFile> defaultPrefDir;
++
++ rv = NS_GetSpecialDirectory(NS_APP_PREF_DEFAULTS_50_DIR, getter_AddRefs(defaultPrefDir));
++ NS_ENSURE_SUCCESS(rv, rv);
++
++ /* these pref file names should not be used: we process them after all other application pref files for backwards compatibility */
++ static const char* specialFiles[] = {
+ #if defined(XP_MAC) || defined(XP_MACOSX)
+ "macprefs.js"
+ #elif defined(XP_WIN)
+ "winpref.js"
+ #elif defined(XP_UNIX)
+ "unix.js"
+-#if defined(_AIX)
++#if defined(VMS)
++ , "openvms.js"
++#elif defined(_AIX)
+ , "aix.js"
+ #endif
+ #elif defined(XP_OS2)
+ "os2pref.js"
++#elif defined(XP_BEOS)
++ "beos.js"
+ #endif
+- };
++ };
+
+- rv = pref_LoadPrefsInDir(defaultPrefDir, specialFiles, NS_ARRAY_LENGTH(specialFiles));
+- if (NS_FAILED(rv)) {
+- NS_WARNING("Error parsing application default preferences.");
++ rv = pref_LoadPrefsInDir(defaultPrefDir, specialFiles, NS_ARRAY_LENGTH(specialFiles));
++ if (NS_FAILED(rv))
++ NS_WARNING("Error parsing application default preferences.");
++ }
++
++ // Load jar:$app/omni.jar!/defaults/preferences/*.js
++ nsZipArchive *appJarReader = mozilla::Omnijar::GetReader(mozilla::Omnijar::APP);
++ if (appJarReader) {
++ rv = appJarReader->FindInit("defaults/preferences/*.js$", &findPtr);
++ NS_ENSURE_SUCCESS(rv, rv);
++ find = findPtr;
++ prefEntries.Clear();
++ while (NS_SUCCEEDED(find->FindNext(&entryName, &entryNameLen))) {
++ prefEntries.AppendElement(Substring(entryName, entryName + entryNameLen));
++ }
++ prefEntries.Sort();
++ for (PRUint32 i = prefEntries.Length(); i--; ) {
++ rv = pref_ReadPrefFromJar(appJarReader, prefEntries[i].get());
++ if (NS_FAILED(rv))
++ NS_WARNING("Error parsing preferences.");
++ }
+ }
+
+ rv = pref_LoadPrefsInDirList(NS_APP_PREFS_DEFAULTS_DIR_LIST);
+ NS_ENSURE_SUCCESS(rv, rv);
+
+ NS_CreateServicesFromCategory(NS_PREFSERVICE_APPDEFAULTS_TOPIC_ID,
+ nsnull, NS_PREFSERVICE_APPDEFAULTS_TOPIC_ID);
+
+diff --git a/netwerk/protocol/res/nsResProtocolHandler.cpp b/netwerk/protocol/res/nsResProtocolHandler.cpp
+--- a/netwerk/protocol/res/nsResProtocolHandler.cpp
++++ b/netwerk/protocol/res/nsResProtocolHandler.cpp
+@@ -152,97 +152,62 @@ nsResProtocolHandler::nsResProtocolHandl
+ }
+
+ nsResProtocolHandler::~nsResProtocolHandler()
+ {
+ gResHandler = nsnull;
+ }
+
+ nsresult
+-nsResProtocolHandler::AddSpecialDir(const char* aSpecialDir, const nsACString& aSubstitution)
+-{
+- nsCOMPtr<nsIFile> file;
+- nsresult rv = NS_GetSpecialDirectory(aSpecialDir, getter_AddRefs(file));
+- NS_ENSURE_SUCCESS(rv, rv);
+-
+- nsCOMPtr<nsIURI> uri;
+- rv = mIOService->NewFileURI(file, getter_AddRefs(uri));
+- NS_ENSURE_SUCCESS(rv, rv);
+-
+- return SetSubstitution(aSubstitution, uri);
+-}
+-
+-nsresult
+ nsResProtocolHandler::Init()
+ {
+ if (!mSubstitutions.Init(32))
+ return NS_ERROR_UNEXPECTED;
+
+ nsresult rv;
+
+ mIOService = do_GetIOService(&rv);
+ NS_ENSURE_SUCCESS(rv, rv);
+
+-#ifdef MOZ_OMNIJAR
+- nsCOMPtr<nsIFile> omniJar(mozilla::OmnijarPath());
+- if (omniJar)
+- return Init(omniJar);
+-#endif
+-
+- // these entries should be kept in sync with the omnijar Init function
++ nsCAutoString appURI, greURI;
++ rv = mozilla::Omnijar::GetURIString(mozilla::Omnijar::APP, appURI);
++ NS_ENSURE_SUCCESS(rv, rv);
++ rv = mozilla::Omnijar::GetURIString(mozilla::Omnijar::GRE, greURI);
++ NS_ENSURE_SUCCESS(rv, rv);
+
+ //
+- // make resource:/// point to the application directory
++ // make resource:/// point to the application directory or omnijar
+ //
+- rv = AddSpecialDir(NS_OS_CURRENT_PROCESS_DIR, EmptyCString());
++ nsCOMPtr<nsIURI> uri;
++ rv = NS_NewURI(getter_AddRefs(uri), appURI.Length() ? appURI : greURI);
++ NS_ENSURE_SUCCESS(rv, rv);
++
++ rv = SetSubstitution(EmptyCString(), uri);
+ NS_ENSURE_SUCCESS(rv, rv);
+
+ //
+ // make resource://gre/ point to the GRE directory
+ //
+- rv = AddSpecialDir(NS_GRE_DIR, kGRE);
++ if (appURI.Length()) { // We already have greURI in uri if appURI.Length() is 0.
++ rv = NS_NewURI(getter_AddRefs(uri), greURI);
++ NS_ENSURE_SUCCESS(rv, rv);
++ }
++
++ rv = SetSubstitution(kGRE, uri);
+ NS_ENSURE_SUCCESS(rv, rv);
+
+ //XXXbsmedberg Neil wants a resource://pchrome/ for the profile chrome dir...
+ // but once I finish multiple chrome registration I'm not sure that it is needed
+
+ // XXX dveditz: resource://pchrome/ defeats profile directory salting
+ // if web content can load it. Tread carefully.
+
+ return rv;
+ }
+
+-#ifdef MOZ_OMNIJAR
+-nsresult
+-nsResProtocolHandler::Init(nsIFile *aOmniJar)
+-{
+- nsresult rv;
+- nsCOMPtr<nsIURI> uri;
+- nsCAutoString omniJarSpec;
+- NS_GetURLSpecFromActualFile(aOmniJar, omniJarSpec, mIOService);
+-
+- nsCAutoString urlStr("jar:");
+- urlStr += omniJarSpec;
+- urlStr += "!/";
+-
+- rv = mIOService->NewURI(urlStr, nsnull, nsnull, getter_AddRefs(uri));
+- NS_ENSURE_SUCCESS(rv, rv);
+-
+- // these entries should be kept in sync with the normal Init function
+-
+- // resource:/// points to jar:omni.jar!/
+- SetSubstitution(EmptyCString(), uri);
+-
+- // resource://gre/ points to jar:omni.jar!/
+- SetSubstitution(kGRE, uri);
+-
+- return NS_OK;
+-}
+-#endif
+-
+ #ifdef MOZ_IPC
+ static PLDHashOperator
+ EnumerateSubstitution(const nsACString& aKey,
+ nsIURI* aURI,
+ void* aArg)
+ {
+ nsTArray<ResourceMapping>* resources =
+ static_cast<nsTArray<ResourceMapping>*>(aArg);
+diff --git a/startupcache/StartupCache.cpp b/startupcache/StartupCache.cpp
+--- a/startupcache/StartupCache.cpp
++++ b/startupcache/StartupCache.cpp
+@@ -237,27 +237,36 @@ StartupCache::GetBuffer(const char* id,
+ nsZipItemPtr<char> zipItem(mArchive, id, true);
+ if (zipItem) {
+ *outbuf = zipItem.Forget();
+ *length = zipItem.Length();
+ return NS_OK;
+ }
+ }
+
+-#ifdef MOZ_OMNIJAR
+- if (mozilla::OmnijarReader()) {
++ if (mozilla::Omnijar::GetReader(mozilla::Omnijar::APP)) {
+ // no need to checksum omnijarred entries
+- nsZipItemPtr<char> zipItem(mozilla::OmnijarReader(), id);
++ nsZipItemPtr<char> zipItem(mozilla::Omnijar::GetReader(mozilla::Omnijar::APP), id);
+ if (zipItem) {
+ *outbuf = zipItem.Forget();
+ *length = zipItem.Length();
+ return NS_OK;
+ }
+ }
+-#endif
++
++ if (mozilla::Omnijar::GetReader(mozilla::Omnijar::GRE)) {
++ // no need to checksum omnijarred entries
++ nsZipItemPtr<char> zipItem(mozilla::Omnijar::GetReader(mozilla::Omnijar::GRE), id);
++ if (zipItem) {
++ *outbuf = zipItem.Forget();
++ *length = zipItem.Length();
++ return NS_OK;
++ }
++ }
++
+ return NS_ERROR_NOT_AVAILABLE;
+ }
+
+ // Makes a copy of the buffer, client retains ownership of inbuf.
+ nsresult
+ StartupCache::PutBuffer(const char* id, const char* inbuf, PRUint32 len)
+ {
+ WaitOnWriteThread();
+diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp
+--- a/toolkit/xre/nsAppRunner.cpp
++++ b/toolkit/xre/nsAppRunner.cpp
+@@ -3897,35 +3897,45 @@ XRE_InitCommandLine(int aArgc, char* aAr
+ CommandLine::Init(aArgc, canonArgs);
+
+ for (int i = 0; i < aArgc; ++i)
+ free(canonArgs[i]);
+ delete[] canonArgs;
+ #endif
+ #endif
+
+-#ifdef MOZ_OMNIJAR
+- const char *omnijarPath = nsnull;
+- ArgResult ar = CheckArg("omnijar", PR_FALSE, &omnijarPath);
++ const char *path = nsnull;
++ ArgResult ar = CheckArg("grebase", PR_FALSE, &path);
+ if (ar == ARG_BAD) {
+- PR_fprintf(PR_STDERR, "Error: argument -omnijar requires an omnijar path\n");
++ PR_fprintf(PR_STDERR, "Error: argument -grebase requires a path argument\n");
+ return NS_ERROR_FAILURE;
+ }
+
+- if (!omnijarPath)
++ if (!path)
+ return rv;
+
+- nsCOMPtr<nsILocalFile> omnijar;
+- rv = NS_NewNativeLocalFile(nsDependentCString(omnijarPath), PR_TRUE,
+- getter_AddRefs(omnijar));
+- if (NS_SUCCEEDED(rv))
+- mozilla::SetOmnijar(omnijar);
+-#endif
+-
+- return rv;
++ nsCOMPtr<nsILocalFile> greBase;
++ rv = XRE_GetFileFromPath(path, getter_AddRefs(greBase));
++ if (NS_FAILED(rv))
++ return rv;
++
++ ar = CheckArg("appbase", PR_FALSE, &path);
++ if (ar == ARG_BAD) {
++ PR_fprintf(PR_STDERR, "Error: argument -appbase requires a path argument\n");
++ return NS_ERROR_FAILURE;
++ }
++
++ nsCOMPtr<nsILocalFile> appBase;
++ if (path) {
++ rv = XRE_GetFileFromPath(path, getter_AddRefs(appBase));
++ if (NS_FAILED(rv))
++ return rv;
++ }
++
++ return mozilla::Omnijar::SetBase(greBase, appBase);
+ }
+
+ nsresult
+ XRE_DeinitCommandLine()
+ {
+ nsresult rv = NS_OK;
+
+ #if defined(MOZ_IPC)
+diff --git a/toolkit/xre/nsEmbedFunctions.cpp b/toolkit/xre/nsEmbedFunctions.cpp
+--- a/toolkit/xre/nsEmbedFunctions.cpp
++++ b/toolkit/xre/nsEmbedFunctions.cpp
+@@ -512,19 +512,17 @@ XRE_InitChildProcess(int aArgc,
+ }
+
+ // Run the UI event loop on the main thread.
+ uiMessageLoop.MessageLoop::Run();
+
+ // Allow ProcessChild to clean up after itself before going out of
+ // scope and being deleted
+ process->CleanUp();
+-#ifdef MOZ_OMNIJAR
+- mozilla::SetOmnijar(nsnull);
+-#endif
++ mozilla::Omnijar::SetBase(nsnull, nsnull);
+ }
+ }
+
+ NS_LogTerm();
+ return XRE_DeinitCommandLine();
+ }
+
+ MessageLoop*
+diff --git a/xpcom/build/Makefile.in b/xpcom/build/Makefile.in
+--- a/xpcom/build/Makefile.in
++++ b/xpcom/build/Makefile.in
+@@ -64,28 +64,25 @@ CSRCS = \
+ $(NULL)
+
+ CPPSRCS = \
+ $(XPCOM_GLUE_SRC_LCPPSRCS) \
+ $(XPCOM_GLUENS_SRC_LCPPSRCS) \
+ nsXPComInit.cpp \
+ nsXPCOMStrings.cpp \
+ Services.cpp \
++ Omnijar.cpp \
+ $(NULL)
+
+ ifndef MOZ_ENABLE_LIBXUL
+ ifeq (,$(filter-out WINNT WINCE OS2,$(OS_ARCH)))
+ CPPSRCS += dlldeps.cpp
+ endif
+ endif
+
+-ifdef MOZ_OMNIJAR
+-CPPSRCS += Omnijar.cpp
+-endif
+-
+ SHARED_LIBRARY_LIBS = \
+ $(DEPTH)/chrome/src/$(LIB_PREFIX)chrome_s.$(LIB_SUFFIX) \
+ ../ds/$(LIB_PREFIX)xpcomds_s.$(LIB_SUFFIX) \
+ ../io/$(LIB_PREFIX)xpcomio_s.$(LIB_SUFFIX) \
+ ../components/$(LIB_PREFIX)xpcomcomponents_s.$(LIB_SUFFIX) \
+ ../threads/$(LIB_PREFIX)xpcomthreads_s.$(LIB_SUFFIX) \
+ ../proxy/src/$(LIB_PREFIX)xpcomproxy_s.$(LIB_SUFFIX) \
+ ../base/$(LIB_PREFIX)xpcombase_s.$(LIB_SUFFIX) \
+diff --git a/xpcom/build/Omnijar.cpp b/xpcom/build/Omnijar.cpp
+--- a/xpcom/build/Omnijar.cpp
++++ b/xpcom/build/Omnijar.cpp
+@@ -16,16 +16,17 @@
+ *
+ * The Initial Developer of the Original Code is
+ * Mozilla Foundation.
+ * Portions created by the Initial Developer are Copyright (C) 2010
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * Michael Wu <mwu@mozilla.com>
++ * Mike Hommey <mh@glandium.org>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+@@ -33,69 +34,175 @@
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+ #include "Omnijar.h"
+
+-#include "nsILocalFile.h"
+-#include "nsXULAppAPI.h"
++#include "nsIFile.h"
+ #include "nsZipArchive.h"
++#include "nsNetUtil.h"
+
+-static nsILocalFile* sOmnijarPath = nsnull;
+-static nsZipArchive* sOmnijarReader = nsnull;
++namespace mozilla {
+
+-static void
+-SetupReader()
++nsIFile *Omnijar::sPath[2] = { nsnull, nsnull };
++PRBool Omnijar::sIsOmnijar[2] = { PR_FALSE, PR_FALSE };
++
++#ifdef MOZ_ENABLE_LIBXUL
++nsZipArchive *Omnijar::sReader[2] = { nsnull, nsnull };
++#endif
++
++static already_AddRefed<nsIFile>
++ComputePath(nsIFile *aPath, PRBool &aIsOmnijar)
+ {
+- if (!sOmnijarPath) {
+- return;
++ PRBool isDir;
++ aIsOmnijar = PR_FALSE;
++ if (!aPath || NS_FAILED(aPath->IsDirectory(&isDir)) || !isDir)
++ return nsnull;
++
++ nsCOMPtr<nsIFile> path;
++#ifdef MOZ_ENABLE_LIBXUL
++ // Search for omni.jar in the given directory
++ if (!isDir || NS_FAILED(aPath->Clone(getter_AddRefs(path))))
++ return nsnull;
++
++ if (NS_FAILED(path->AppendNative(NS_LITERAL_CSTRING("omni.jar"))))
++ return nsnull;
++
++ if (NS_FAILED(path->Exists(&aIsOmnijar)))
++ return nsnull;
++#endif
++
++ if (!aIsOmnijar && NS_FAILED(aPath->Clone(getter_AddRefs(path))))
++ return nsnull;
++
++ return path.forget();
++}
++
++nsresult
++Omnijar::SetBase(nsIFile *aGrePath, nsIFile *aAppPath)
++{
++ NS_ABORT_IF_FALSE(aGrePath || !aAppPath, "Omnijar::SetBase(NULL, something) call forbidden");
++
++#ifdef MOZ_ENABLE_LIBXUL
++ if (sReader[GRE]) {
++ sReader[GRE]->CloseArchive();
++ delete sReader[GRE];
++ }
++ if (sReader[APP]) {
++ sReader[APP]->CloseArchive();
++ delete sReader[APP];
++ }
++ sReader[APP] = sReader[GRE] = nsnull;
++#endif
++
++ nsresult rv;
++ PRBool equals;
++ if (aAppPath) {
++ rv = aAppPath->Equals(aGrePath, &equals);
++ NS_ENSURE_SUCCESS(rv, rv);
++ } else {
++ equals = PR_TRUE;
+ }
+
+- nsZipArchive* zipReader = new nsZipArchive();
+- if (!zipReader) {
+- NS_IF_RELEASE(sOmnijarPath);
+- return;
++ nsCOMPtr<nsIFile> grePath = ComputePath(aGrePath, sIsOmnijar[GRE]);
++ nsCOMPtr<nsIFile> appPath = ComputePath(equals ? nsnull : aAppPath, sIsOmnijar[APP]);
++
++ NS_IF_RELEASE(sPath[GRE]);
++ sPath[GRE] = grePath;
++ NS_IF_ADDREF(sPath[GRE]);
++
++ NS_IF_RELEASE(sPath[APP]);
++ sPath[APP] = appPath;
++ NS_IF_ADDREF(sPath[APP]);
++
++ return NS_OK;
++}
++
++already_AddRefed<nsIFile>
++Omnijar::GetBase(Type aType)
++{
++ NS_ABORT_IF_FALSE(sPath[0], "Omnijar not initialized");
++
++ if (!sIsOmnijar[aType]) {
++ NS_IF_ADDREF(sPath[aType]);
++ return sPath[aType];
+ }
+
+- if (NS_FAILED(zipReader->OpenArchive(sOmnijarPath))) {
++ nsCOMPtr<nsIFile> file, path;
++ if (NS_FAILED(sPath[aType]->Clone(getter_AddRefs(file))))
++ return nsnull;
++
++ if (NS_FAILED(file->GetParent(getter_AddRefs(path))))
++ return nsnull;
++ return path.forget();
++}
++
++#ifdef MOZ_ENABLE_LIBXUL
++nsZipArchive *
++Omnijar::GetReader(Type aType)
++{
++ if (!sIsOmnijar[aType])
++ return nsnull;
++
++ if (sReader[aType])
++ return sReader[aType];
++
++ nsZipArchive* zipReader = new nsZipArchive();
++ if (!zipReader)
++ return nsnull;
++
++ if (NS_FAILED(zipReader->OpenArchive(sPath[aType]))) {
+ delete zipReader;
+- NS_IF_RELEASE(sOmnijarPath);
+- return;
++ return nsnull;
+ }
+
+- sOmnijarReader = zipReader;
++ return (sReader[aType] = zipReader);
+ }
+
+-nsILocalFile*
+-mozilla::OmnijarPath()
++nsZipArchive *
++Omnijar::GetReader(nsIFile *aPath)
+ {
+- if (!sOmnijarReader)
+- SetupReader();
++ PRBool equals;
++ nsresult rv;
+
+- return sOmnijarPath;
++ if (sIsOmnijar[GRE]) {
++ rv = sPath[GRE]->Equals(aPath, &equals);
++ if (NS_SUCCEEDED(rv) && equals)
++ return GetReader(GRE);
++ }
++ if (sIsOmnijar[APP]) {
++ rv = sPath[APP]->Equals(aPath, &equals);
++ if (NS_SUCCEEDED(rv) && equals)
++ return GetReader(APP);
++ }
++ return nsnull;
++}
++#endif
++
++nsresult
++Omnijar::GetURIString(Type aType, nsCString &result)
++{
++ NS_ABORT_IF_FALSE(sPath[0], "Omnijar not initialized");
++
++ result = "";
++
++ if ((aType == APP) && (!sPath[APP]))
++ return NS_OK;
++
++ nsCAutoString omniJarSpec;
++ nsresult rv = NS_GetURLSpecFromActualFile(sPath[aType], omniJarSpec);
++ NS_ENSURE_SUCCESS(rv, rv);
++
++ if (sIsOmnijar[aType]) {
++ result = "jar:";
++ result += omniJarSpec;
++ result += "!";
++ } else {
++ result = omniJarSpec;
++ }
++ result += "/";
++ return NS_OK;
+ }
+
+-nsZipArchive*
+-mozilla::OmnijarReader()
+-{
+- if (!sOmnijarReader)
+- SetupReader();
+-
+- return sOmnijarReader;
+-}
+-
+-void
+-mozilla::SetOmnijar(nsILocalFile* aPath)
+-{
+- NS_IF_RELEASE(sOmnijarPath);
+- if (sOmnijarReader) {
+- sOmnijarReader->CloseArchive();
+- delete sOmnijarReader;
+- sOmnijarReader = nsnull;
+- }
+-
+- sOmnijarPath = aPath;
+- NS_IF_ADDREF(sOmnijarPath);
+-}
+-
++} /* namespace mozilla */
+diff --git a/xpcom/build/Omnijar.h b/xpcom/build/Omnijar.h
+--- a/xpcom/build/Omnijar.h
++++ b/xpcom/build/Omnijar.h
+@@ -16,16 +16,17 @@
+ *
+ * The Initial Developer of the Original Code is
+ * Mozilla Foundation.
+ * Portions created by the Initial Developer are Copyright (C) 2010
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * Michael Wu <mwu@mozilla.com>
++ * Mike Hommey <mh@glandium.org>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+@@ -34,29 +35,137 @@
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+ #ifndef mozilla_Omnijar_h
+ #define mozilla_Omnijar_h
+
+-class nsILocalFile;
++#include "nscore.h"
++#include "nsTArray.h"
++#include "nsCOMPtr.h"
++#include "nsString.h"
++
++class nsIFile;
+ class nsZipArchive;
+-
+-#ifdef MOZ_OMNIJAR
++class nsIURI;
+
+ namespace mozilla {
+
++#ifdef MOZ_ENABLE_LIBXUL
++#define OMNIJAR_EXPORT
++#else
++#define OMNIJAR_EXPORT NS_EXPORT
++#endif
++
++class OMNIJAR_EXPORT Omnijar {
++private:
+ /**
+- * This returns the path to the omnijar.
+- * If the omnijar isn't available, this function will return null.
+- * Callers should fallback to flat packaging if null.
++ * Store an nsIFile for either a base directory when there is no omni.jar,
++ * or omni.jar itself. We can store two paths here, one for GRE
++ * (corresponding to resource://gre/) and one for APP
++ * (corresponding to resource:/// and resource://app/), but only
++ * store one when both point to the same location (unified).
+ */
+-nsILocalFile *OmnijarPath();
+-nsZipArchive *OmnijarReader();
+-void SetOmnijar(nsILocalFile* aPath);
++static nsIFile *sPath[2];
++/**
++ * Store whether the corresponding sPath is an omni.jar or a directory
++ */
++static PRBool sIsOmnijar[2];
++
++#ifdef MOZ_ENABLE_LIBXUL
++/**
++ * Cached nsZipArchives for the corresponding sPath
++ */
++static nsZipArchive *sReader[2];
++#endif
++
++public:
++enum Type {
++ GRE = 0,
++ APP = 1
++};
++
++/**
++ * Returns whether SetBase has been called at least once with
++ * a valid nsIFile
++ */
++static PRBool
++IsInitialized()
++{
++ // GRE path is always set after initialization.
++ return sPath[0] != nsnull;
++}
++
++/**
++ * Sets the base directories for GRE and APP. APP base directory
++ * may be nsnull, in case the APP and GRE directories are the same.
++ */
++static nsresult SetBase(nsIFile *aGrePath, nsIFile *aAppPath);
++
++/**
++ * Returns an nsIFile pointing to the omni.jar file for GRE or APP.
++ * Returns nsnull when there is no corresponding omni.jar.
++ * Also returns nsnull for APP in the unified case.
++ */
++static already_AddRefed<nsIFile>
++GetPath(Type aType)
++{
++ NS_ABORT_IF_FALSE(sPath[0], "Omnijar not initialized");
++
++ if (sIsOmnijar[aType]) {
++ NS_IF_ADDREF(sPath[aType]);
++ return sPath[aType];
++ }
++ return nsnull;
++}
++
++/**
++ * Returns whether GRE or APP use an omni.jar. Returns PR_False when
++ * using an omni.jar in the unified case.
++ */
++static PRBool
++HasOmnijar(Type aType)
++{
++ return sIsOmnijar[aType];
++}
++
++/**
++ * Returns the base directory for GRE or APP. In the unified case,
++ * returns nsnull for APP.
++ */
++static already_AddRefed<nsIFile> GetBase(Type aType);
++
++/**
++ * Returns a nsZipArchive pointer for the omni.jar file for GRE or
++ * APP. Returns nsnull in the same cases GetPath() would.
++ */
++#ifdef MOZ_ENABLE_LIBXUL
++static nsZipArchive *GetReader(Type aType);
++#else
++static nsZipArchive *GetReader(Type aType) { return nsnull; }
++#endif
++
++/**
++ * Returns a nsZipArchive pointer for the given path IAOI the given
++ * path is the omni.jar for either GRE or APP.
++ */
++#ifdef MOZ_ENABLE_LIBXUL
++static nsZipArchive *GetReader(nsIFile *aPath);
++#else
++static nsZipArchive *GetReader(nsIFile *aPath) { return nsnull; }
++#endif
++
++/**
++ * Returns the URI string corresponding to the omni.jar or directory
++ * for GRE or APP. i.e. jar:/path/to/omni.jar!/ for omni.jar and
++ * /path/to/base/dir/ otherwise. Returns an empty string for APP in
++ * the unified case.
++ * The returned URI is guaranteed to end with a slash.
++ */
++static nsresult GetURIString(Type aType, nsCString &result);
++
++}; /* class Omnijar */
+
+ } /* namespace mozilla */
+
+-#endif /* MOZ_OMNIJAR */
+-
+ #endif /* mozilla_Omnijar_h */
+diff --git a/xpcom/build/nsXPComInit.cpp b/xpcom/build/nsXPComInit.cpp
+--- a/xpcom/build/nsXPComInit.cpp
++++ b/xpcom/build/nsXPComInit.cpp
+@@ -462,35 +462,35 @@ NS_InitXPCOM2(nsIServiceManager* *result
+ nsDirectoryService::gService->Set(NS_XPCOM_LIBRARY_FILE, xpcomLib);
+ }
+
+ if (appFileLocationProvider) {
+ rv = nsDirectoryService::gService->RegisterProvider(appFileLocationProvider);
+ if (NS_FAILED(rv)) return rv;
+ }
+
+-#ifdef MOZ_OMNIJAR
+ NS_TIME_FUNCTION_MARK("Next: Omnijar init");
+
+- if (!mozilla::OmnijarPath()) {
+- nsCOMPtr<nsILocalFile> omnijar;
++ if (!mozilla::Omnijar::IsInitialized()) {
++ nsCOMPtr<nsILocalFile> greDir, appDir;
+ nsCOMPtr<nsIFile> file;
+
+- rv = NS_ERROR_FAILURE;
+ nsDirectoryService::gService->Get(NS_GRE_DIR,
+ NS_GET_IID(nsIFile),
+ getter_AddRefs(file));
+- if (file)
+- rv = file->Append(NS_LITERAL_STRING("omni.jar"));
+- if (NS_SUCCEEDED(rv))
+- omnijar = do_QueryInterface(file);
+- if (NS_SUCCEEDED(rv))
+- mozilla::SetOmnijar(omnijar);
++ greDir = do_QueryInterface(file);
++
++ nsDirectoryService::gService->Get(NS_XPCOM_CURRENT_PROCESS_DIR,
++ NS_GET_IID(nsIFile),
++ getter_AddRefs(file));
++ appDir = do_QueryInterface(file);
++
++ rv = mozilla::Omnijar::SetBase(greDir, appDir);
++ NS_ENSURE_SUCCESS(rv, rv);
+ }
+-#endif
+
+ #ifdef MOZ_IPC
+ if ((sCommandLineWasInitialized = !CommandLine::IsInitialized())) {
+ NS_TIME_FUNCTION_MARK("Next: IPC command line init");
+
+ #ifdef OS_WIN
+ CommandLine::Init(0, nsnull);
+ #else
+@@ -769,18 +769,16 @@ ShutdownXPCOM(nsIServiceManager* servMgr
+ sCommandLineWasInitialized = false;
+ }
+ if (sExitManager) {
+ delete sExitManager;
+ sExitManager = nsnull;
+ }
+ #endif
+
+-#ifdef MOZ_OMNIJAR
+- mozilla::SetOmnijar(nsnull);
+-#endif
++ mozilla::Omnijar::SetBase(nsnull, nsnull);
+
+ NS_LogTerm();
+
+ return NS_OK;
+ }
+
+ } // namespace mozilla
+diff --git a/xpcom/components/nsComponentManager.cpp b/xpcom/components/nsComponentManager.cpp
+--- a/xpcom/components/nsComponentManager.cpp
++++ b/xpcom/components/nsComponentManager.cpp
+@@ -175,18 +175,16 @@ NS_DEFINE_CID(kCategoryManagerCID, NS_CA
+ #define COMPMGR_TIME_FUNCTION_CONTRACTID(cid) \
+ NS_TIME_FUNCTION_MIN_FMT(5, "%s (line %d) (contractid: %s)", MOZ_FUNCTION_NAME, \
+ __LINE__, (cid))
+ #else
+ #define COMPMGR_TIME_FUNCTION_CID(cid) do {} while (0)
+ #define COMPMGR_TIME_FUNCTION_CONTRACTID(cid) do {} while (0)
+ #endif
+
+-#define kOMNIJAR_PREFIX NS_LITERAL_CSTRING("resource:///")
+-
+ nsresult
+ nsGetServiceFromCategory::operator()(const nsIID& aIID, void** aInstancePtr) const
+ {
+ nsresult rv;
+ nsXPIDLCString value;
+ nsCOMPtr<nsICategoryManager> catman;
+ nsComponentManagerImpl *compMgr = nsComponentManagerImpl::gComponentManager;
+ if (!compMgr) {
+@@ -390,47 +388,44 @@ nsresult nsComponentManagerImpl::Init()
+
+ nsCategoryManager::GetSingleton()->SuppressNotifications(true);
+
+ RegisterModule(&kXPCOMModule, NULL);
+
+ for (PRUint32 i = 0; i < sStaticModules->Length(); ++i)
+ RegisterModule((*sStaticModules)[i], NULL);
+
+-#ifdef MOZ_OMNIJAR
+- if (mozilla::OmnijarPath()) {
+- nsCOMPtr<nsIZipReader> omnijarReader = new nsJAR();
+- rv = omnijarReader->Open(mozilla::OmnijarPath());
+- if (NS_SUCCEEDED(rv))
+- RegisterJarManifest(omnijarReader, "chrome.manifest", false);
++ nsCOMPtr<nsIFile> appOmnijar = mozilla::Omnijar::GetPath(mozilla::Omnijar::APP);
++ if (appOmnijar) {
++ cl = sModuleLocations->InsertElementAt(1); // Insert after greDir
++ cl->type = NS_COMPONENT_LOCATION;
++ cl->location = do_QueryInterface(appOmnijar);
++ cl->jar = true;
+ }
+-#endif
++ nsCOMPtr<nsIFile> greOmnijar = mozilla::Omnijar::GetPath(mozilla::Omnijar::GRE);
++ if (greOmnijar) {
++ cl = sModuleLocations->InsertElementAt(0);
++ cl->type = NS_COMPONENT_LOCATION;
++ cl->location = do_QueryInterface(greOmnijar);
++ cl->jar = true;
++ }
+
+ for (PRUint32 i = 0; i < sModuleLocations->Length(); ++i) {
+ ComponentLocation& l = sModuleLocations->ElementAt(i);
+ if (!l.jar) {
+ RegisterManifestFile(l.type, l.location, false);
+ continue;
+ }
+
+ nsCOMPtr<nsIZipReader> reader = do_CreateInstance(kZipReaderCID, &rv);
+ rv = reader->Open(l.location);
+ if (NS_SUCCEEDED(rv))
+ RegisterJarManifest(reader, "chrome.manifest", false);
+ }
+
+-#ifdef MOZ_OMNIJAR
+- if (mozilla::OmnijarPath()) {
+- cl = sModuleLocations->InsertElementAt(0);
+- cl->type = NS_COMPONENT_LOCATION;
+- cl->location = mozilla::OmnijarPath();
+- cl->jar = true;
+- }
+-#endif
+-
+ nsCategoryManager::GetSingleton()->SuppressNotifications(false);
+
+ mStatus = NORMAL;
+
+ return NS_OK;
+ }
+
+ void
+# HG changeset patch
+# Parent ff1b810f78226d7f4010909d3cde05a57fdcf20c
+Bug 620931 part 4 - Fix resource://app/ to always point to the same as resource:///
+
+diff --git a/netwerk/protocol/res/nsResProtocolHandler.cpp b/netwerk/protocol/res/nsResProtocolHandler.cpp
+--- a/netwerk/protocol/res/nsResProtocolHandler.cpp
++++ b/netwerk/protocol/res/nsResProtocolHandler.cpp
+@@ -74,16 +74,17 @@ static nsResProtocolHandler *gResHandler
+ // set NSPR_LOG_FILE=log.txt
+ //
+ // this enables PR_LOG_ALWAYS level information and places all output in
+ // the file log.txt
+ //
+ static PRLogModuleInfo *gResLog;
+ #endif
+
++#define kAPP NS_LITERAL_CSTRING("app")
+ #define kGRE NS_LITERAL_CSTRING("gre")
+
+ //----------------------------------------------------------------------------
+ // nsResURL : overrides nsStandardURL::GetFile to provide nsIFile resolution
+ //----------------------------------------------------------------------------
+
+ nsresult
+ nsResURL::EnsureFile()
+@@ -179,16 +180,22 @@ nsResProtocolHandler::Init()
+ nsCOMPtr<nsIURI> uri;
+ rv = NS_NewURI(getter_AddRefs(uri), appURI.Length() ? appURI : greURI);
+ NS_ENSURE_SUCCESS(rv, rv);
+
+ rv = SetSubstitution(EmptyCString(), uri);
+ NS_ENSURE_SUCCESS(rv, rv);
+
+ //
++ // make resource://app/ point to the application directory or omnijar
++ //
++ rv = SetSubstitution(kAPP, uri);
++ NS_ENSURE_SUCCESS(rv, rv);
++
++ //
+ // make resource://gre/ point to the GRE directory
+ //
+ if (appURI.Length()) { // We already have greURI in uri if appURI.Length() is 0.
+ rv = NS_NewURI(getter_AddRefs(uri), greURI);
+ NS_ENSURE_SUCCESS(rv, rv);
+ }
+
+ rv = SetSubstitution(kGRE, uri);
+diff --git a/toolkit/xre/nsXREDirProvider.cpp b/toolkit/xre/nsXREDirProvider.cpp
+--- a/toolkit/xre/nsXREDirProvider.cpp
++++ b/toolkit/xre/nsXREDirProvider.cpp
+@@ -300,19 +300,16 @@ nsXREDirProvider::GetFile(const char* aP
+ }
+ }
+ else if (!strcmp(aProperty, XRE_EXECUTABLE_FILE) && gArgv[0]) {
+ nsCOMPtr<nsILocalFile> lf;
+ rv = XRE_GetBinaryPath(gArgv[0], getter_AddRefs(lf));
+ if (NS_SUCCEEDED(rv))
+ file = lf;
+ }
+- else if (!strcmp(aProperty, "resource:app")) {
+- rv = GetAppDir()->Clone(getter_AddRefs(file));
+- }
+
+ else if (!strcmp(aProperty, NS_APP_PROFILE_DIR_STARTUP) && mProfileDir) {
+ return mProfileDir->Clone(aFile);
+ }
+ else if (!strcmp(aProperty, NS_APP_PROFILE_LOCAL_DIR_STARTUP)) {
+ if (mProfileLocalDir)
+ return mProfileLocalDir->Clone(aFile);
+
+# HG changeset patch
+# Parent 7d2228db71a299afca60babff632a967d2d6c456
+Bug 620931 part 5 - Enable omni.jar by default on xulrunner
+
+diff --git a/xulrunner/confvars.sh b/xulrunner/confvars.sh
+--- a/xulrunner/confvars.sh
++++ b/xulrunner/confvars.sh
+@@ -36,15 +36,16 @@
+ #
+ # ***** END LICENSE BLOCK *****
+
+ MOZ_APP_NAME=xulrunner
+ MOZ_APP_DISPLAYNAME=XULRunner
+ MOZ_UPDATER=1
+ MOZ_XULRUNNER=1
+ MOZ_ENABLE_LIBXUL=1
++MOZ_CHROME_FILE_FORMAT=omni
+ MOZ_STATIC_BUILD_UNSUPPORTED=1
+ MOZ_APP_VERSION=$MOZILLA_VERSION
+ if test "$MOZ_STORAGE"; then
+ MOZ_PLACES=1
+ fi
+ MOZ_EXTENSIONS_DEFAULT=" gnomevfs"
+ MOZ_URL_CLASSIFIER=1
diff --git a/community-staging/xulrunner-oss/xulrunner-version.patch b/community-staging/xulrunner-oss/xulrunner-version.patch
new file mode 100644
index 000000000..8e81b23ea
--- /dev/null
+++ b/community-staging/xulrunner-oss/xulrunner-version.patch
@@ -0,0 +1,12 @@
+diff -Nur mozilla-2.0.orig/xulrunner/installer/Makefile.in mozilla-2.0/xulrunner/installer/Makefile.in
+--- mozilla-2.0.orig/xulrunner/installer/Makefile.in 2011-03-03 14:12:04.000000000 -0800
++++ mozilla-2.0/xulrunner/installer/Makefile.in 2011-03-13 01:58:19.663360705 -0800
+@@ -44,6 +44,8 @@
+
+ include $(DEPTH)/config/autoconf.mk
+
++MOZ_APP_VERSION="2.0"
++
+ NO_PKG_FILES = \
+ xulrunner-config \
+ regchrome* \
diff --git a/community-staging/yaz/PKGBUILD b/community-staging/yaz/PKGBUILD
new file mode 100644
index 000000000..bf42c005f
--- /dev/null
+++ b/community-staging/yaz/PKGBUILD
@@ -0,0 +1,38 @@
+# $Id: PKGBUILD 48643 2011-06-03 16:57:46Z stephane $
+# Maintainer: Ray Rashif <schiv@archlinux.org>
+# Contributor: Andrea Scarpino <andrea@archlinux.org>
+# Contributor: Stefan Husmann <stefan-husmann@t-online.de>
+# Contributor: William Rea <sillywilly@gmail.com>
+# Contributor: Robert Emil Berge <filoktetes@linuxophic.org>
+
+pkgname=yaz
+pkgver=4.1.7
+pkgrel=2
+pkgdesc="A toolkit supporting the development of Z39.50/SRW/SRU clients and servers"
+arch=('i686' 'x86_64')
+license=('BSD')
+url="http://www.indexdata.dk/yaz"
+depends=('openssl' 'libxslt' 'icu')
+options=('!libtool')
+source=("http://ftp.indexdata.dk/pub/$pkgname/$pkgname-$pkgver.tar.gz")
+md5sums=('d4b94fc70bfc105fc034c4b51b7b5cae')
+
+build() {
+ cd "$srcdir/$pkgname-$pkgver"
+
+ ./configure --prefix=/usr \
+ --enable-shared=yaz \
+ --with-openssl=/usr
+ make
+}
+
+package() {
+ cd "$srcdir/$pkgname-$pkgver"
+
+ make DESTDIR="$pkgdir/" install
+
+ install -Dm644 LICENSE \
+ "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
+}
+
+# vim:set ts=2 sw=2 et:
diff --git a/community/etherape/PKGBUILD b/community/etherape/PKGBUILD
index a1d5cf3da..eb7e1f045 100644
--- a/community/etherape/PKGBUILD
+++ b/community/etherape/PKGBUILD
@@ -1,10 +1,10 @@
-# $Id: PKGBUILD 40756 2011-02-26 14:25:14Z jlichtblau $
+# $Id: PKGBUILD 48609 2011-06-03 09:54:50Z ttopper $
# Maintainer: Thorsten Töpper <atsutane-tu@freethoughts.de>
# Contributor: kevin <kevin@archlinux.org>
# Contributor: Damir Perisa <damir.perisa@bluewin.ch>
pkgname=etherape
-pkgver=0.9.10
+pkgver=0.9.12
pkgrel=1
pkgdesc="A graphical network monitor for various OSI layers and protocols"
arch=('i686' 'x86_64')
@@ -13,7 +13,7 @@ license=('GPL2')
depends=('libgnomeui' 'libpcap')
makedepends=('rarian' 'gnome-doc-utils')
source=(http://downloads.sourceforge.net/${pkgname}/${pkgname}-${pkgver}.tar.gz)
-md5sums=('e763b919b46f94f3cccc72f05d9075bb')
+sha1sums=('8e9cc85e73e44eccb236f488111e02f418ab095d')
build() {
cd ${srcdir}/${pkgname}-${pkgver}
diff --git a/community/john/PKGBUILD b/community/john/PKGBUILD
index 03d3c092b..c4f02caa8 100644
--- a/community/john/PKGBUILD
+++ b/community/john/PKGBUILD
@@ -6,26 +6,27 @@
pkgname=john
pkgver=1.7.7
-pkgrel=1
-pkgdesc="John The Ripper - A fast password cracker. Additional patches (NTLM, MySQL, Kerberos V5, etc.) included."
+pkgrel=2
+_jumbover=5
+pkgdesc="John The Ripper - A fast password cracker (jumbo-$_jumbover included)"
arch=('i686' 'x86_64')
url="http://www.openwall.com/$pkgname/"
license=('GPL2' 'custom')
depends=('openssl')
backup=('etc/john/john.conf')
source=(http://www.openwall.com/$pkgname/g/$pkgname-$pkgver.tar.bz2
- http://www.openwall.com/john/g/john-$pkgver-jumbo-1.diff.gz
+ http://www.openwall.com/john/g/john-$pkgver-jumbo-$_jumbover.diff.gz
ftp://ftp.kfki.hu/pub/packages/security/ssh/ossh/libdes-4.04b.tar.gz
params.h.patch)
md5sums=('be316618de834a58573a21225d4a2674'
- 'ee776d17726e7c15e90f2cf7ca85492f'
+ '40efadf002fb68d8287e60654593a531'
'c8d5c69f86c2eedb485583b0305284a1'
'f69ed632eba8fb9e45847a4b4a323787')
build() {
# jumbo patch
cd ${srcdir}/$pkgname-$pkgver
- patch -p1 < ${srcdir}/$pkgname-$pkgver-jumbo-1.diff
+ patch -p1 < ${srcdir}/$pkgname-$pkgver-jumbo-$_jumbover.diff
cd ${srcdir}/john-$pkgver/src/
# patch default params
diff --git a/community/roxterm/PKGBUILD b/community/roxterm/PKGBUILD
index 95406a443..6cad15be5 100644
--- a/community/roxterm/PKGBUILD
+++ b/community/roxterm/PKGBUILD
@@ -1,9 +1,9 @@
-# $Id: PKGBUILD 42205 2011-03-15 16:59:11Z ttopper $
+# $Id: PKGBUILD 48623 2011-06-03 14:19:38Z ttopper $
# Maintainer: Thorsten Töpper <atsutane-tu@freethoughts.de>
# Contributor: Alexander Fehr <pizzapunk gmail com>
pkgname=roxterm
-pkgver=1.21.4
+pkgver=1.22.1
pkgrel=1
pkgdesc="Tabbed, VTE-based terminal emulator"
arch=('i686' 'x86_64')
@@ -13,8 +13,9 @@ depends=('libglade' 'dbus-glib' 'vte' 'hicolor-icon-theme' 'dbus' 'dbus-core' 'g
makedepends=('docbook-xsl' 'xmlto' 'po4a')
install=roxterm.install
source=(http://downloads.sourceforge.net/roxterm/roxterm-$pkgver.tar.gz)
-md5sums=('a3ac0c34ce5ae82063ff4b4b518e07c1')
-sha1sums=('0667ec61ef7ba30e6602faec80959e59e75104f0')
+md5sums=('522067d466545753cb3df369b582ce60')
+sha1sums=('40743fa8d93c5ddf76676bb7df4bf0c6f97351ad')
+
build() {
cd "${srcdir}/roxterm-${pkgver}"
diff --git a/community/vnstat/PKGBUILD b/community/vnstat/PKGBUILD
index c50e19e51..2fd7788ae 100644
--- a/community/vnstat/PKGBUILD
+++ b/community/vnstat/PKGBUILD
@@ -1,9 +1,10 @@
-# $Id: PKGBUILD 20111 2010-07-02 14:00:19Z tdziedzic $
+# $Id: PKGBUILD 48601 2011-06-03 09:15:53Z ttopper $
# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
+# Maintainer: Thorsten Töpper <atsutane-tu@freethoughts.de>
pkgname=vnstat
-pkgver=1.10
-pkgrel=5
+pkgver=1.11
+pkgrel=1
pkgdesc="A console-based network traffic monitor"
arch=('i686' 'x86_64')
url="http://humdi.net/vnstat/"
@@ -15,7 +16,7 @@ backup=(etc/vnstat.conf)
install=vnstat.install
source=(http://humdi.net/vnstat/$pkgname-$pkgver.tar.gz
http://humdi.net/vnstat/init.d/arch/vnstat)
-md5sums=('95421d968689130590348ceb80ff74a8'
+md5sums=('a5a113f9176cd61fb954f2ba297f5fdb'
'e89a566dd7514ff0d2d3fc77b2d4ca7e')
build() {
@@ -26,8 +27,8 @@ build() {
make all
make DESTDIR=$pkgdir install
- install -D -m0755 $srcdir/vnstat $pkgdir/etc/rc.d/vnstat && \
- install -D -m0644 examples/vnstat.cron $pkgdir/usr/share/doc/vnstat/examples/vnstat.cron && \
- install -D -m0755 examples/vnstat.cgi $pkgdir/usr/share/doc/vnstat/examples/vnstat.cgi && \
+ install -D -m0755 $srcdir/vnstat $pkgdir/etc/rc.d/vnstat
+ install -D -m0644 examples/vnstat.cron $pkgdir/usr/share/doc/vnstat/examples/vnstat.cron
+ install -D -m0755 examples/vnstat.cgi $pkgdir/usr/share/doc/vnstat/examples/vnstat.cgi
sed -i 's#root##' $pkgdir/usr/share/doc/vnstat/examples/vnstat.cron
}
diff --git a/core/bison/PKGBUILD b/core/bison/PKGBUILD
index 1e04f381e..ebf2c0fc5 100644
--- a/core/bison/PKGBUILD
+++ b/core/bison/PKGBUILD
@@ -1,9 +1,9 @@
-# $Id: PKGBUILD 87221 2010-08-11 03:29:16Z allan $
+# $Id: PKGBUILD 124065 2011-05-16 12:02:28Z allan $
# Maintainer: Allan McRae <allan@archlinux.org>
# Contributor: Eric Belanger <eric@archlinux.org>
pkgname=bison
-pkgver=2.4.3
+pkgver=2.5
pkgrel=1
pkgdesc="The GNU general-purpose parser generator"
arch=('i686' 'x86_64')
@@ -13,12 +13,16 @@ depends=('glibc' 'm4' 'sh')
groups=('base-devel')
install=bison.install
source=(ftp://ftp.gnu.org/gnu/bison/${pkgname}-${pkgver}.tar.bz2)
-md5sums=('c1d3ea81bc370dbd43b6f0b2cd21287e')
+md5sums=('9dba20116b13fc61a0846b0058fbe004')
build() {
cd "${srcdir}/${pkgname}-${pkgver}"
./configure --prefix=/usr --datadir=/usr/share
make
+}
+
+check() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
make check
}
diff --git a/core/bison/bison.install b/core/bison/bison.install
index 890eb0366..0081a194f 100644
--- a/core/bison/bison.install
+++ b/core/bison/bison.install
@@ -1,4 +1,4 @@
-infodir=/usr/share/info
+infodir=usr/share/info
file=bison.info.gz
post_install() {
diff --git a/core/module-init-tools/PKGBUILD b/core/module-init-tools/PKGBUILD
index 9cf28c18d..4ecfab9c9 100644
--- a/core/module-init-tools/PKGBUILD
+++ b/core/module-init-tools/PKGBUILD
@@ -1,10 +1,10 @@
-# $Id: PKGBUILD 105077 2011-01-06 02:59:10Z allan $
+# $Id: PKGBUILD 126053 2011-06-01 05:32:56Z andyrtr $
# Maintainer: Aaron Griffin <aaron@archlinux.org>
# Contributor: judd <jvinet@zeroflux.org>
pkgname=module-init-tools
-pkgver=3.12
-pkgrel=2
+pkgver=3.13
+pkgrel=1
pkgdesc="utilities needed by Linux systems for managing loadable kernel modules"
arch=('i686' 'x86_64')
url="http://kerneltools.org"
@@ -13,7 +13,7 @@ depends=('glibc')
backup=('etc/modprobe.d/modprobe.conf')
source=(http://www.kernel.org/pub/linux/utils/kernel/module-init-tools/module-init-tools-$pkgver.tar.bz2
modprobe.conf)
-md5sums=('8b2257ce9abef74c4a44d825d23140f3'
+md5sums=('dc575e7df00d9f745bf23b32f927b7a6'
'316f1bda4c21af02b30252eb014a0a55')
build() {
diff --git a/extra/cppunit/PKGBUILD b/extra/cppunit/PKGBUILD
new file mode 100644
index 000000000..b7dd30d27
--- /dev/null
+++ b/extra/cppunit/PKGBUILD
@@ -0,0 +1,32 @@
+# $Id: PKGBUILD 126261 2011-06-03 13:02:27Z stephane $
+# Maintainer: Stéphane Gaudreault <stephane@archlinux.org>
+# Contributor: Jeff 'codemac' Mickey <jeff@archlinux.org>
+
+pkgname=cppunit
+pkgver=1.12.1
+pkgrel=3
+pkgdesc="A C++ unit testing framework"
+arch=('i686' 'x86_64')
+url="http://cppunit.sourceforge.net"
+license=('LGPL')
+depends=('sh' 'gcc-libs')
+makedepends=('gcc')
+options=('!libtool')
+source=("http://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.gz"
+ 'gcc4.5.patch')
+md5sums=('bd30e9cf5523cdfc019b94f5e1d7fd19'
+ '7f4e3b50fa1ee8bc854ab431848dddec')
+
+build() {
+ cd "${srcdir}/$pkgname-$pkgver"
+ patch -Np1 -i ../gcc4.5.patch
+ autoreconf
+ libtoolize -f
+ ./configure --prefix=/usr
+ make
+}
+
+package() {
+ cd "${srcdir}/$pkgname-$pkgver"
+ make DESTDIR="${pkgdir}" install
+}
diff --git a/extra/cppunit/gcc4.5.patch b/extra/cppunit/gcc4.5.patch
new file mode 100644
index 000000000..86d4a424d
--- /dev/null
+++ b/extra/cppunit/gcc4.5.patch
@@ -0,0 +1,15 @@
+--- cppunit-1.12.1.orig/src/cppunit/Makefile.am
++++ cppunit-1.12.1/src/cppunit/Makefile.am
+@@ -63,5 +63,11 @@
+
+ libcppunit_la_LDFLAGS= \
+ -no-undefined -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
+- -release $(LT_RELEASE)
++ -release $(LT_RELEASE) @LIBADD_DL@
+
++TESTS = t_link
++
++check_PROGRAMS = t_link
++
++t_link_SOURCES = t_link.cpp
++t_link_LDADD = libcppunit.la
diff --git a/extra/telepathy-gabble/PKGBUILD b/extra/telepathy-gabble/PKGBUILD
index 0eaff4907..1bff1b38b 100644
--- a/extra/telepathy-gabble/PKGBUILD
+++ b/extra/telepathy-gabble/PKGBUILD
@@ -1,10 +1,10 @@
-# $Id: PKGBUILD 120355 2011-04-22 18:03:17Z ibiru $
+# $Id: PKGBUILD 126264 2011-06-03 13:39:35Z ibiru $
# Maintainer : Ionut Biru <ibiru@archlinux.org>
# Contributor: Daniel Balieiro <daniel@balieiro.com>
# Contributor: Rodrigo L. M. Flores <mail@rodrigoflores.org>
pkgname=telepathy-gabble
-pkgver=0.12.0
-pkgrel=2
+pkgver=0.12.1
+pkgrel=1
pkgdesc="A Jabber/XMPP connection manager for Telepathy"
arch=('i686' 'x86_64')
url="http://telepathy.freedesktop.org"
@@ -15,7 +15,7 @@ makedepends=('libxslt' 'python2')
options=('!libtool')
source=(http://telepathy.freedesktop.org/releases/telepathy-gabble/${pkgname}-${pkgver}.tar.gz)
install=telepathy-gabble.install
-md5sums=('89e47b131911a969cc2a2ccefa1fc015')
+md5sums=('9bf48f34651545547f52712b3c117aa9')
build() {
cd ${srcdir}/${pkgname}-${pkgver}
diff --git a/extra/telepathy-qt4/PKGBUILD b/extra/telepathy-qt4/PKGBUILD
index 033611f63..e3e65a267 100644
--- a/extra/telepathy-qt4/PKGBUILD
+++ b/extra/telepathy-qt4/PKGBUILD
@@ -1,9 +1,9 @@
-# $Id: PKGBUILD 124315 2011-05-19 11:49:47Z andrea $
+# $Id: PKGBUILD 126269 2011-06-03 14:35:07Z ibiru $
# Maintainer: Ionut Biru <ibiru@archlinux.org>
# Contributor: Andrea Scarpino <andrea@archlinux.org>
pkgname=telepathy-qt4
-pkgver=0.6.0
+pkgver=0.6.1
pkgrel=1
pkgdesc="A library for Qt-based Telepathy clients"
arch=('i686' 'x86_64')
@@ -13,7 +13,7 @@ options=('!libtool')
depends=('qt' 'telepathy-farsight')
makedepends=('libxslt' 'python2' 'cmake')
source=("http://telepathy.freedesktop.org/releases/${pkgname}/${pkgname}-${pkgver}.tar.gz")
-md5sums=('2acb266af1a3f55f7104830ac8db2090')
+md5sums=('c429458a365f5114bbc9ea3fc971fc45')
build() {
cd "${srcdir}"
diff --git a/libre/abuse-libre/PKGBUILD b/libre/abuse-libre/PKGBUILD
new file mode 100644
index 000000000..d8e5d8e4f
--- /dev/null
+++ b/libre/abuse-libre/PKGBUILD
@@ -0,0 +1,50 @@
+# $Id: PKGBUILD 46622 2011-05-10 10:00:25Z lfleischer $
+# Maintainer: Lukas Fleischer <archlinux at cryptocrack dot de>
+# Contributor: jlvsimoes <jlvsimoes@oninet.pt>
+# Contributor: kevin <kevin@archlinux.org>
+
+pkgname=abuse-libre
+pkgver=0.8
+pkgrel=1
+pkgdesc='A side-scroller action game that pits you against ruthless alien killers. Without unfree "Claudio"'
+arch=('i686' 'x86_64')
+url='http://abuse.zoy.org/'
+license=('GPL' 'custom:PublicDomain')
+depends=('gcc-libs' 'libgl' 'sdl' 'sdl_mixer')
+install='abuse.install'
+source=("http://repo.parabolagnulinux.org/other/${pkgname}-${pkgver}.tar.gz")
+
+# Remove the unfree 'claudio' addon
+# $ source PKGBUILD
+# $ mksource
+mksource() {
+ pushd /tmp >/dev/null
+
+ wget http://abuse.zoy.org/raw-attachment/wiki/download/${pkgname%-libre}-${pkgver}.tar.gz \
+ -O - | tar xzf -
+
+ rm -rvf ./abuse-$pkgver/data/addon/claudio
+ tar czvf ${pkgname}-${pkgver}.tar.gz ./abuse-$pkgver
+
+ popd >/dev/null
+
+ mv -v /tmp/${pkgname}-${pkgver}.tar.gz .
+}
+
+build() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+
+ ./configure --prefix=/usr --with-assetdir=/usr/share/abuse/orig --with-x
+ make
+}
+
+package() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+
+ make DESTDIR="${pkgdir}" install
+
+ install -d "${pkgdir}/usr/share/licenses/abuse"
+ sed -n '1,/^$/p' src/view.cpp > "${pkgdir}/usr/share/licenses/abuse/orig.code.license"
+}
+
+md5sums=('10cac59308bff0dadb8437eff8b4d87e')
diff --git a/libre/abuse-libre/abuse.install b/libre/abuse-libre/abuse.install
new file mode 100644
index 000000000..ca888f196
--- /dev/null
+++ b/libre/abuse-libre/abuse.install
@@ -0,0 +1,14 @@
+# arg 1: the new package version
+post_install() {
+# echo "If you get a BOSS_ANT error trying to run abuse, copy /usr/share/games/abuse/gamma.lsp to ~/.abuse"
+ echo "Abuse uses the original game levels by default. To use the frabs levels"
+ echo "use '-datadir' or set 'datadir' in the abuserc to /usr/share/abuse/frabs"
+}
+
+# arg 1: the new package version
+# arg 2: the old package version
+post_upgrade() {
+ post_install
+}
+
+
diff --git a/libre/abuse-libre/rePKGBUILD b/libre/abuse-libre/rePKGBUILD
new file mode 100644
index 000000000..3c9a0082d
--- /dev/null
+++ b/libre/abuse-libre/rePKGBUILD
@@ -0,0 +1,33 @@
+# This is an example rePKGBUILD file. Use this as a start to creating your own,
+# and remove these comments. For more information, see 'man PKGBUILD'.
+# NOTE: Please fill out the license field for your package! If it is unknown,
+# then please put 'unknown'.
+
+# Maintainer: Nicolas Reynolds <fauno@kiwwwi.com.ar>
+source PKGBUILD
+CARCH=x86_64
+unset build package md5sums source
+_repo=community
+options=(!strip)
+source=(PKGBUILD
+ http://mirrors.kernel.org/archlinux/${_repo}/os/$CARCH/${pkgname%-libre}-$pkgver-$pkgrel-$CARCH$PKGEXT
+ # files for pkg modifications
+ )
+
+build() {
+ cd "${srcdir}/"
+ rm -v .{INSTALL,PKGINFO} ${pkgname%-libre}-$pkgver-$pkgrel-$CARCH.pkg.tar.xz
+ # actions for package modifications
+ # be sure to remove source files
+
+ msg "Removing unfree 'Claudio' addon"
+ rm -rvf usr/share/abuse/orig/addon/claudio/
+}
+
+package() {
+ cd ${srcdir}
+ cp -a ./* ${pkgdir}
+}
+
+
+# vim:set ts=2 sw=2 et:
diff --git a/libre/initscripts/PKGBUILD b/libre/initscripts/PKGBUILD
index 63a7c1545..5fe5f654f 100644
--- a/libre/initscripts/PKGBUILD
+++ b/libre/initscripts/PKGBUILD
@@ -5,7 +5,7 @@
# Maintainer (Parabola): Nicolas Reynolds <fauno@kiwwwi.com.ar>
pkgname=initscripts
-pkgver=2011.05.2
+pkgver=2011.06.1
pkgrel=1.1
pkgdesc="System initialization/bootup scripts (Parabola branding)"
arch=('i686' 'x86_64')
@@ -21,8 +21,6 @@ optdepends=('bridge-utils: Network bridging support'
install=initscripts.install
source=("https://projects.parabolagnulinux.org/initscripts.git/snapshot/initscripts-${pkgver}.tar.bz2"
'wireless.conf.d')
-md5sums=('f807b43a4dd43a6cf562f10651577ad2'
- '027576534885b8d5dded9be546057b12')
package() {
cd ${srcdir}/${pkgname}-${pkgver}
diff --git a/libre/kernel26-libre/PKGBUILD b/libre/kernel26-libre/PKGBUILD
index 4cee4bf0b..736bb1c9b 100644
--- a/libre/kernel26-libre/PKGBUILD
+++ b/libre/kernel26-libre/PKGBUILD
@@ -6,10 +6,11 @@ pkgname=('kernel26-libre' 'kernel26-libre-headers' 'kernel26-libre-docs') # Buil
_kernelname=${pkgname#kernel26-libre}
_basekernel=2.6.39
-pkgver=${_basekernel}
+pkgver=${_basekernel}.1
pkgrel=1
makedepends=('xmlto' 'docbook-xsl')
-_patchname="patch-${pkgver}-${pkgrel}-LIBRE"
+#_patchname="patch-${pkgver}-${pkgrel}-LIBRE"
+_patchname="patch-2.6.39-1-LIBRE"
arch=(i686 x86_64)
license=('GPL2')
url="http://linux-libre.fsfla.org/"
@@ -239,7 +240,7 @@ find $pkgdir -type d -exec chmod 755 {} \;
# remove a file already in kernel26 package
rm -f $pkgdir/usr/src/linux-$_kernver/Documentation/DocBook/Makefile
}
-md5sums=('8feab9fb6c177052cb79248a223fbf66'
+md5sums=('923210b0c4190733bf314e48f588c112'
'abad63eab1f9485f6b1af76f5109f1e4'
'5d40a23419b48f5b49f1f10be0e733c3'
'af5937ac06a78907ceb499351bdff7ab'
diff --git a/staging/libreoffice/PKGBUILD b/staging/libreoffice/PKGBUILD
new file mode 100644
index 000000000..4fd0cf1a8
--- /dev/null
+++ b/staging/libreoffice/PKGBUILD
@@ -0,0 +1,701 @@
+# $Id: PKGBUILD 126270 2011-06-03 14:47:40Z stephane $
+# Maintainer: AndyRTR <andyrtr@archlinux.org>
+
+pkgbase="libreoffice"
+pkgname=('libreoffice' 'libreoffice-sdk'
+ #'libreoffice-extension-barcode' #
+ 'libreoffice-extension-diagram'
+ 'libreoffice-extension-google-docs'
+ 'libreoffice-extension-hunart'
+ #'libreoffice-extension-lightproof' # no source integration
+ #'libreoffice-extension-mysql-connector' # missing libmysqlcppconn-dev configure: error: mysql_driver.h not found. install MySQL C++ Connectivity
+ 'libreoffice-extension-nlpsolver'
+ 'libreoffice-extension-ct2n'
+ 'libreoffice-extension-numbertext'
+ 'libreoffice-extension-oooblogger'
+ 'libreoffice-extension-pdfimport'
+ 'libreoffice-extension-presenter-screen'
+ 'libreoffice-extension-presentation-minimizer'
+ 'libreoffice-extension-report-builder'
+ 'libreoffice-extension-scripting-beanshell'
+ 'libreoffice-extension-scripting-javascript'
+ 'libreoffice-extension-scripting-python'
+ 'libreoffice-extension-typo'
+ 'libreoffice-extension-validator'
+ 'libreoffice-extension-watch-window'
+ 'libreoffice-extension-wiki-publisher')
+_LOver=3.4.0.2
+pkgver=3.4.0
+pkgrel=2
+arch=('i686' 'x86_64')
+#_LO_tree="3.4"
+_OFFICEUPD="340"
+license=('LGPL3')
+url="http://www.libreoffice.org/"
+makedepends=( # makedepends
+ 'sane' 'perl-archive-zip' 'zip' 'unzip' 'xulrunner' 'unixodbc' 'hsqldb-java' #'boost' - we use internal one for now that has some gcc4.6 fixes.
+ 'apache-ant' 'gperf' 'poppler' 'kdelibs' 'gconf' 'cppunit' #'libmysqlclient'
+ 'beanshell' 'vigra' 'libldap' 'lucene' 'libmythes' 'junit' 'libwpg' 'imagemagick'
+ 'mesa' 'gstreamer0.10-base' 'java-runtime'
+ #'saxon' - currently broken
+ # the depends from libreoffice main pkg
+ "curl>=7.20.0" "hunspell>=1.2.8" "python2>=2.7" 'libwpd>=0.9.2' 'libwps' 'libxaw' "neon>=0.28.6"
+ 'pango' 'nspr' 'libjpeg' 'libxrandr' 'libgl' 'dbus-glib' "icu>=4.6" 'libxslt'
+ 'redland' 'libgraphite' 'hyphen' 'lpsolve' 'gcc-libs' 'sh' 'libtextcat'
+ 'hicolor-icon-theme' 'desktop-file-utils' 'shared-mime-info' 'gtk2' # keep gtk2 for install script
+ 'ttf-dejavu') # to satisfy regression tests
+ # translate-toolkit - todo move them to extra to allow --with-system-foo builds
+# http://download.documentfoundation.org/mirrors/all.html
+# http://wiki.documentfoundation.org/Mirrors
+_mirror="http://download.documentfoundation.org/libreoffice/src"
+#_mirror="http://dev-builds.libreoffice.org/pre-releases/src/"
+_additional_source_url="http://hg.services.openoffice.org/binaries"
+source=(${_mirror}/${pkgbase}-{artwork,base,bootstrap,calc,components,extensions,extras,filters,help,impress,libs-core,libs-extern,libs-extern-sys,libs-gui,postprocess,sdk,testing,ure,writer}-${_LOver}.tar.bz2 #,translations
+ ${_additional_source_url}/1f24ab1d39f4a51faf22244c94a6203f-xmlsec1-1.2.14.tar.gz
+ ${_additional_source_url}/35c94d2df8893241173de1d16b6034c0-swingExSrc.zip
+ ${_additional_source_url}/798b2ffdc8bcfe7bca2cf92b62caf685-rhino1_5R5.zip
+ ${_additional_source_url}/fdb27bfe2dbe2e7b57ae194d9bf36bab-SampleICC-1.3.2.tar.gz
+ ${_additional_source_url}/ada24d37d8d638b3d8a9985e80bc2978-source-9.0.0.7-bj.zip
+ ${_additional_source_url}/2a177023f9ea8ec8bd00837605c5df1b-jakarta-tomcat-5.0.30-src.tar.gz
+ ${_additional_source_url}/a7983f859eafb2677d7ff386a023bc40-xsltml_2.1.2.zip
+ ${_additional_source_url}/3c219630e4302863a9a83d0efde889db-commons-logging-1.1.1-src.tar.gz
+ ${_additional_source_url}/2ae988b339daec234019a7066f96733e-commons-lang-2.3-src.tar.gz
+ ${_additional_source_url}/2c9b0f83ed5890af02c0df1c1776f39b-commons-httpclient-3.1-src.tar.gz
+ ${_additional_source_url}/af3c3acf618de6108d65fcdc92b492e1-commons-codec-1.3-src.tar.gz
+ ${_additional_source_url}/eeb2c7ddf0d302fba4bfc6e97eac9624-libbase-1.1.6.zip
+ ${_additional_source_url}/39bb3fcea1514f1369fcfc87542390fd-sacjava-1.3.zip
+ ${_additional_source_url}/3404ab6b1792ae5f16bbd603bd1e1d03-libformula-1.1.7.zip
+ ${_additional_source_url}/97b2d4dba862397f446b217e2b623e71-libloader-1.1.6.zip
+ ${_additional_source_url}/f94d9870737518e3b597f9265f4e9803-libserializer-1.1.6.zip
+ ${_additional_source_url}/8ce2fcd72becf06c41f7201d15373ed9-librepository-1.1.6.zip
+ ${_additional_source_url}/d8bd5eed178db6e2b18eeed243f85aa8-flute-1.1.6.zip
+ ${_additional_source_url}/3bdf40c0d199af31923e900d082ca2dd-libfonts-1.1.6.zip
+ ${_additional_source_url}/ace6ab49184e329db254e454a010f56d-libxml-1.1.7.zip
+ ${_additional_source_url}/db60e4fde8dd6d6807523deb71ee34dc-liblayout-0.2.10.zip
+ ${_additional_source_url}/ba2930200c9f019c2d93a8c88c651a0f-flow-engine-0.9.4.zip
+ ${_additional_source_url}/18f577b374d60b3c760a3a3350407632-STLport-4.5.tar.gz
+ http://download.go-oo.org/src/7a0dcb3fe1e8c7229ab4fb868b7325e6-mdds_0.5.2.tar.bz2
+ http://download.go-oo.org/extern/185d60944ea767075d27247c3162b3bc-unowinreg.dll
+ http://download.go-oo.org/extern/b4cae0700aa1c2aef7eb7f345365e6f1-translate-toolkit-1.8.1.tar.bz2
+ http://download.go-oo.org/src/451ccf439a36a568653b024534669971-ConvertTextToNumber-1.3.2.oxt
+ http://download.go-oo.org/src/90401bca927835b6fbae4a707ed187c8-nlpsolver-0.9.tar.bz2
+ http://download.go-oo.org/src/f02578f5218f217a9f20e9c30e119c6a-boost_1_44_0.tar.bz2
+ http://ooo.itc.hu/oxygenoffice/download/libreoffice/7e7efc5d4a03126bb9ae3ae9aa2c4e87-Barcode_1.3.1.0.oxt
+ http://ooo.itc.hu/oxygenoffice/download/libreoffice/41c9b65ad60af4b3255bbecdfef11736-Diagram_1.1.0.0.oxt
+ http://ooo.itc.hu/oxygenoffice/download/libreoffice/451ccf439a36a568653b024534669971-ConvertTextToNumber-1.3.2.oxt
+ http://ooo.itc.hu/oxygenoffice/download/libreoffice/bbdd5639ada63e3130761daaecae1a10-Validator_1.1.0.0.oxt
+ http://ooo.itc.hu/oxygenoffice/download/libreoffice/23bd75552206dfcd8fd4e29137dcac84-WatchWindow_1.2.0.0.oxt
+ http://ooo.itc.hu/oxygenoffice/download/libreoffice/b8cbca7b3363e6ca2d02bc0ba2b63904-numbertext_0.9.4.oxt
+ http://ooo.itc.hu/oxygenoffice/download/libreoffice/b632bdd25649cc4067bcb410bae23d2b-hunart_0.3.oxt
+ http://ooo.itc.hu/oxygenoffice/download/libreoffice/9d60b6cfa3ef1926848710bbcd11115b-typo_0.4.2.oxt
+ http://ooo.itc.hu/oxygenoffice/download/libreoffice/dbaafd21de055e582d92d7d32fe9da13-gdocs_2.3.1.oxt
+ http://ooo.itc.hu/oxygenoffice/download/libreoffice/b7b2d0e04e142f26dd96119c80757d1f-oooblogger_0.1.oxt
+ buildfix_i116795.diff
+ buildfix_boost.diff
+ buildfix_ct2n.diff
+ vbahelper.visibility.patch
+ buildfix_bison25.diff)
+noextract=(185d60944ea767075d27247c3162b3bc-unowinreg.dll
+ b4cae0700aa1c2aef7eb7f345365e6f1-translate-toolkit-1.8.1.tar.bz2
+ 7a0dcb3fe1e8c7229ab4fb868b7325e6-mdds_0.5.2.tar.bz2
+ ada24d37d8d638b3d8a9985e80bc2978-source-9.0.0.7-bj.zip
+ 798b2ffdc8bcfe7bca2cf92b62caf685-rhino1_5R5.zip
+ 1f24ab1d39f4a51faf22244c94a6203f-xmlsec1-1.2.14.tar.gz
+ fdb27bfe2dbe2e7b57ae194d9bf36bab-SampleICC-1.3.2.tar.gz
+ 35c94d2df8893241173de1d16b6034c0-swingExSrc.zip
+ 2a177023f9ea8ec8bd00837605c5df1b-jakarta-tomcat-5.0.30-src.tar.gz
+ a7983f859eafb2677d7ff386a023bc40-xsltml_2.1.2.zip
+ 3c219630e4302863a9a83d0efde889db-commons-logging-1.1.1-src.tar.gz
+ 2ae988b339daec234019a7066f96733e-commons-lang-2.3-src.tar.gz
+ 2c9b0f83ed5890af02c0df1c1776f39b-commons-httpclient-3.1-src.tar.gz
+ af3c3acf618de6108d65fcdc92b492e1-commons-codec-1.3-src.tar.gz
+ eeb2c7ddf0d302fba4bfc6e97eac9624-libbase-1.1.6.zip
+ 39bb3fcea1514f1369fcfc87542390fd-sacjava-1.3.zip
+ 3404ab6b1792ae5f16bbd603bd1e1d03-libformula-1.1.7.zip
+ 97b2d4dba862397f446b217e2b623e71-libloader-1.1.6.zip
+ f94d9870737518e3b597f9265f4e9803-libserializer-1.1.6.zip
+ 8ce2fcd72becf06c41f7201d15373ed9-librepository-1.1.6.zip
+ d8bd5eed178db6e2b18eeed243f85aa8-flute-1.1.6.zip
+ 3bdf40c0d199af31923e900d082ca2dd-libfonts-1.1.6.zip
+ ace6ab49184e329db254e454a010f56d-libxml-1.1.7.zip
+ db60e4fde8dd6d6807523deb71ee34dc-liblayout-0.2.10.zip
+ ba2930200c9f019c2d93a8c88c651a0f-flow-engine-0.9.4.zip
+ 18f577b374d60b3c760a3a3350407632-STLport-4.5.tar.gz
+ 7e7efc5d4a03126bb9ae3ae9aa2c4e87-Barcode_1.3.1.0.oxt
+ 41c9b65ad60af4b3255bbecdfef11736-Diagram_1.1.0.0.oxt
+ 451ccf439a36a568653b024534669971-ConvertTextToNumber-1.3.2.oxt
+ bbdd5639ada63e3130761daaecae1a10-Validator_1.1.0.0.oxt
+ 23bd75552206dfcd8fd4e29137dcac84-WatchWindow_1.2.0.0.oxt
+ b8cbca7b3363e6ca2d02bc0ba2b63904-numbertext_0.9.4.oxt
+ b632bdd25649cc4067bcb410bae23d2b-hunart_0.3.oxt
+ 9d60b6cfa3ef1926848710bbcd11115b-typo_0.4.2.oxt
+ dbaafd21de055e582d92d7d32fe9da13-gdocs_2.3.1.oxt
+ b7b2d0e04e142f26dd96119c80757d1f-oooblogger_0.1.oxt
+ 90401bca927835b6fbae4a707ed187c8-nlpsolver-0.9.tar.bz2
+ f02578f5218f217a9f20e9c30e119c6a-boost_1_44_0.tar.bz2)
+md5sums=('7427ddd5ae63b6ee7aa868201dfbccaa'
+ 'a78a8e08731213da02c65060cedc5589'
+ '596da255e2728faccc8f2361171270ec'
+ '8ed9803a34d13da1764e7523d550d6b0'
+ '9be46d7c4bf3a60ee8dd0a5ef3638f82'
+ 'b60db802866ab71c485de42e6382d1bb'
+ '09e374cf3bd8f07a043883393012d69b'
+ 'af9f25aa04dc4ef7b797f7bcc743877c'
+ 'ad29de786d76d67759f9d2dd574b29be'
+ 'ff13a8ac0ea324122b75773fd80a9245'
+ '6eb8f53e01da7a945ee4cd42b7297732'
+ '90df27d4cbf490668ce4f03ff7dba521'
+ 'c0ea197183564c49306a1c79ca571e51'
+ '91e69ed3c0be542fa7f69ca3da2d7808'
+ 'a81c787b2e5469c2acc9f335b2c9e52f'
+ 'ee1c78af6553657614b1a43adf4750ac'
+ 'c970d6212618fc9b34526907eb030ce6'
+ '6d25488c81af09d87015bf487243042f'
+ '9a39234a49516b7035309e28dd4f0784'
+ '1f24ab1d39f4a51faf22244c94a6203f'
+ '35c94d2df8893241173de1d16b6034c0'
+ '798b2ffdc8bcfe7bca2cf92b62caf685'
+ 'fdb27bfe2dbe2e7b57ae194d9bf36bab'
+ 'ada24d37d8d638b3d8a9985e80bc2978'
+ '2a177023f9ea8ec8bd00837605c5df1b'
+ 'a7983f859eafb2677d7ff386a023bc40'
+ '3c219630e4302863a9a83d0efde889db'
+ '2ae988b339daec234019a7066f96733e'
+ '2c9b0f83ed5890af02c0df1c1776f39b'
+ 'af3c3acf618de6108d65fcdc92b492e1'
+ 'eeb2c7ddf0d302fba4bfc6e97eac9624'
+ '39bb3fcea1514f1369fcfc87542390fd'
+ '3404ab6b1792ae5f16bbd603bd1e1d03'
+ '97b2d4dba862397f446b217e2b623e71'
+ 'f94d9870737518e3b597f9265f4e9803'
+ '8ce2fcd72becf06c41f7201d15373ed9'
+ 'd8bd5eed178db6e2b18eeed243f85aa8'
+ '3bdf40c0d199af31923e900d082ca2dd'
+ 'ace6ab49184e329db254e454a010f56d'
+ 'db60e4fde8dd6d6807523deb71ee34dc'
+ 'ba2930200c9f019c2d93a8c88c651a0f'
+ '18f577b374d60b3c760a3a3350407632'
+ '7a0dcb3fe1e8c7229ab4fb868b7325e6'
+ '185d60944ea767075d27247c3162b3bc'
+ 'b4cae0700aa1c2aef7eb7f345365e6f1'
+ '451ccf439a36a568653b024534669971'
+ '90401bca927835b6fbae4a707ed187c8'
+ 'f02578f5218f217a9f20e9c30e119c6a'
+ '7e7efc5d4a03126bb9ae3ae9aa2c4e87'
+ '41c9b65ad60af4b3255bbecdfef11736'
+ '451ccf439a36a568653b024534669971'
+ 'bbdd5639ada63e3130761daaecae1a10'
+ '23bd75552206dfcd8fd4e29137dcac84'
+ 'b8cbca7b3363e6ca2d02bc0ba2b63904'
+ 'b632bdd25649cc4067bcb410bae23d2b'
+ '9d60b6cfa3ef1926848710bbcd11115b'
+ 'dbaafd21de055e582d92d7d32fe9da13'
+ 'b7b2d0e04e142f26dd96119c80757d1f'
+ '0520d63c946e272ed3bdfc863fbdc42e'
+ 'bc228237108cab7745897a9f466b6d39'
+ 'eee273f501ff45dc5f1365e78c6d57c0'
+ '43b145db28e6c0d73578ae6fd35e510d'
+ '4fa96e04b41a6e86774e74a972024b3e')
+
+build() {
+
+ unset J2REDIR; unset J2SDKDIR; unset JAVA_HOME; unset CLASSPATH; unset EXTRAOPTS
+ [ -z "${JAVA_HOME}" ] && . /etc/profile.d/openjdk6.sh
+ [ -z "${MOZ_PLUGIN_PATH}" ] && . /etc/profile.d/mozilla-common.sh
+ [ -z "${ANT_HOME}" ] && . /etc/profile.d/apache-ant.sh
+
+ # move all LibO sources into one build directory
+ mkdir ${srcdir}/build && cd ${srcdir}/build
+ for i in libreoffice-{artwork,base,bootstrap,calc,components,extensions,extras,filters,help,impress,libs-core,libs-extern,libs-extern-sys,libs-gui,postprocess,sdk,testing,ure,writer}-${_LOver}; do #,translations
+ mv ${srcdir}/$i/* .
+ done
+
+ # move external sources into place
+ mkdir ${srcdir}/ext_sources && cd ${srcdir}/ext_sources
+ for source in "${noextract[@]}"; do
+ ln -s ${srcdir}/$source .
+ done
+
+ cd ${srcdir}/build
+
+ # buildfixes & bugfixes
+ patch -Np1 -i ${srcdir}/buildfix_i116795.diff
+ patch -Np1 -i ${srcdir}/buildfix_boost.diff
+ patch -Np1 -i ${srcdir}/buildfix_ct2n.diff
+ patch -Np0 -i ${srcdir}/vbahelper.visibility.patch
+ patch -Np0 -i ${srcdir}/buildfix_bison25.diff
+
+ # unset C(XX)FLAGS
+ # http://www.openoffice.org/issues/show_bug.cgi?id=103205
+# unset CFLAGS
+# unset CXXFLAGS
+
+ #use the CFLAGS but remove the LibO overridden ones
+ for i in $CFLAGS; do
+ case "$i" in
+ -O?|-pipe|-Wall|-g|-fexceptions) continue;;
+ esac
+ ARCH_FLAGS="$ARCH_FLAGS $i"
+ done
+
+ # python2 fix
+ export PYTHON=python2
+
+ # http://wiki.documentfoundation.org/Development/How_to_build/Configure_options
+
+# if [ "$CARCH" = "x86_64" ]; then
+# EXTRAOPTS="--without-stlport"
+# else
+# EXTRAOPTS="--with-stlport" # --without-system-boost"
+# # # avoid problems with ixion for now
+# sed -i '/fields-table-formula.diff/d' patches/dev300/apply || return 1
+# fi
+
+# autoconf -v -f
+
+ # non-SMP test build
+# export MAKEFLAGS="-j1"
+ ./configure --with-build-version="${_LOver} ArchLinux build-${pkgrel}" --with-vendor="ArchLinux" \
+ --with-unix-wrapper="libreoffice" \
+ --with-max-jobs=${MAKEFLAGS/-j/} --with-num-cpus=${MAKEFLAGS/-j/} \
+ --with-external-tar="${srcdir}/ext_sources" \
+ --prefix=/usr --exec-prefix=/usr --sysconfdir=/etc \
+ --with-install-dirname="${pkgbase}" --libdir=/usr/lib --mandir=/usr/share/man \
+ --with-lang="" \
+ --disable-verbose \
+ --enable-cairo\
+ --enable-crashdump \
+ --enable-dbus \
+ --enable-evolution2\
+ --disable-graphite\
+ --enable-gio\
+ --disable-gnome-vfs\
+ --disable-kde\
+ --enable-kde4\
+ --enable-ldap \
+ --enable-lockdown\
+ --enable-opengl \
+ --enable-odk\
+ --enable-opengl\
+ --enable-ext-barcode \
+ --enable-ext-diagram \
+ --enable-ext-google-docs \
+ --enable-ext-hunart \
+ --disable-ext-lightproof \
+ --disable-ext-mysql-connector \
+ --with-system-mysql \
+ --enable-ext-nlpsolver \
+ --enable-ext-ct2n \
+ --enable-ext-numbertext \
+ --enable-ext-oooblogger \
+ --enable-ext-pdfimport \
+ --enable-ext-presenter-console \
+ --enable-ext-presenter-minimizer \
+ --enable-ext-report-builder \
+ --enable-ext-scripting-beanshell \
+ --enable-ext-scripting-javascript \
+ --enable-ext-scripting-python \
+ --enable-ext-typo \
+ --enable-ext-validator \
+ --enable-ext-watch-window \
+ --enable-ext-wiki-publisher \
+ --without-fonts\
+ --without-afms\
+ --without-ppds\
+ --without-system-libwps\
+ --without-system-mdds\
+ --without-myspell-dicts \
+ --with-system-dicts \
+ --with-external-dict-dir=/usr/share/hunspell \
+ --with-external-hyph-dir=/usr/share/hyphen \
+ --with-external-thes-dir=/usr/share/mythes \
+ --with-system-cppunit\
+ --with-system-libwpg \
+ --with-system-libwps \
+ --with-system-redland\
+ --without-system-saxon\
+ --with-system-libtextcat \
+ --with-external-libtextcat-data \
+ --with-openldap\
+ --with-ant-home="/usr/share/java/apache-ant"\
+ --without-system-boost\
+ --with-system-cairo\
+ --with-system-libs\
+ --with-system-mozilla\
+ --with-system-mythes\
+ --with-system-xrender-headers\
+ --with-system-headers\
+ --with-alloc=system\
+ --with-system-lucene\
+ --with-lucene-core-jar=/usr/share/java/lucene-core.jar\
+ --with-lucene-analyzers-jar=/usr/share/java/lucene-analyzers.jar\
+ $EXTRAOPTS || return 1
+
+#--with-system-graphite --enable-graohite ?
+#--with-servlet-api-jar=JARFILE
+# see http://qa.openoffice.org/issues/show_bug.cgi?id=110136
+# --with-system-saxon\
+# --with-saxon-jar=/usr/share/java/saxon/saxon9he.jar\
+
+ touch src.downloaded
+ #./download
+ unset MAKEFLAGS
+ ./bootstrap
+ make
+}
+
+#check() {
+# cd ${srcdir}/build
+# make check
+#}
+
+package_libreoffice() {
+
+ pkgdesc="a productivity suite that is compatible with other major office suites"
+ install=${pkgbase}.install
+ depends=("curl>=7.20.0" "hunspell>=1.2.8" "python2>=2.7" 'libwpd>=0.9.2' 'libwps' 'libxaw' "neon>=0.28.6"
+ 'pango' 'nspr' 'libjpeg' 'libxrandr' 'libgl' 'dbus-glib' "icu>=4.6" 'libxslt'
+ 'redland' 'libgraphite' 'hyphen' 'lpsolve' 'gcc-libs' 'sh' 'libtextcat'
+ 'hicolor-icon-theme' 'desktop-file-utils' 'shared-mime-info' 'gtk2') # keep gtk2 for install script
+ #'java-runtime'
+ #'saxon'
+ optdepends=('java-runtime: adds java support'
+ 'libcups: adds printing support'
+ 'gconf: adds additional gnome support'
+ 'nss: adds support for signed files/macros'
+ 'pstoedit: translates PostScript and PDF graphics into other vector formats'
+ 'poppler: for shipped pdfimport extension'
+ 'kdelibs: for kde integration'
+ 'libmythes: for use in thesaurus'
+ 'hsqldb-java: default database format for OpenOffice.org'
+ 'beanshell: interactive java -- good for prototyping /macros'
+ 'vigra: C++ computer vision library, usable in Basebmp'
+ 'libmspack: library for Microsoft compression formats for use in FontOOo'
+ 'libwpg: library for importing and converting Corel WordPerfect(tm) Graphics images'
+ 'libldap: to get profiles via ldap'
+ 'lucene: full-text search engine library for Java needed in the help section'
+ 'sane: for scanner access'
+ 'unixodbc: adds ODBC database support'
+ 'mesa: for the OGLTrans extension'
+ 'gstreamer0.10-base: + some gstr-plugins to support multimedia content, e.g. in impress')
+ backup=(etc/libreoffice/sofficerc
+ etc/libreoffice/bootstraprc
+ etc/libreoffice/psprint.conf)
+ provides=('go-openoffice')
+ conflicts=('go-openoffice')
+ replaces=('go-openoffice' 'openoffice-base' )
+
+ cd ${srcdir}/build
+ make DESTDIR=${pkgdir} install
+
+ # fix missing desktop integration
+ install -dm755 ${pkgdir}/usr/bin
+ pushd ${pkgdir}/usr/bin
+ ln -vs /usr/lib/libreoffice/program/soffice ./libreoffice
+ ln -vs /usr/lib/libreoffice/program/soffice ./soffice
+ ln -vs /usr/lib/libreoffice/program/sbase ./lobase
+ ln -vs /usr/lib/libreoffice/program/scalc ./localc
+ ln -vs /usr/lib/libreoffice/program/sdraw ./lodraw
+ ln -vs /usr/lib/libreoffice/program/simpress ./loimpress
+ ln -vs /usr/lib/libreoffice/program/smath ./lomath
+ ln -vs /usr/lib/libreoffice/program/swriter ./lowriter
+ ln -vs /usr/lib/libreoffice/program/unopkg ./unopkg
+ popd
+
+ # move sysui desktop files into place we want to use - javafilter and qstarter, but not unneeded printeradmin
+ install -dm755 ${pkgdir}/usr/share/{applications,icons,mime/packages,pixmaps}
+ rm ${pkgdir}/usr/lib/libreoffice/share/xdg/printeradmin.desktop
+ for i in base calc draw impress javafilter math qstart startcenter writer; do
+ cp ${pkgdir}/usr/lib/libreoffice/share/xdg/$i.desktop ${pkgdir}/usr/share/applications/libreoffice-$i.desktop
+ done
+ # remove version in menu entry and make it visible
+ sed -i -e "s/3.4//g" ${pkgdir}/usr/share/applications/*.desktop
+ sed -i -e "s/Icon=libreoffice34-/Icon=/g" ${pkgdir}/usr/share/applications/*.desktop
+ sed -i -e "/NoDisplay=true/d" ${pkgdir}/usr/share/applications/libreoffice-qstart.desktop
+ echo "Icon=startcenter" >> ${pkgdir}/usr/share/applications/libreoffice-qstart.desktop
+ # remove unneeded .desktop files
+ rm -rf ${pkgdir}/usr/lib/libreoffice/share/xdg
+
+ # add missing icon files
+ cp -R ${srcdir}/build/sysui/desktop/icons/{hi,lo}color ${pkgdir}/usr/share/icons/
+ pushd ${pkgdir}/usr/share/pixmaps
+ for i in base calc draw impress main math printeradmin startcenter writer; do
+ ln -vs /usr/share/icons/hicolor/48x48/apps/$i.png .
+ done
+ popd
+ sed -i -e 's/Icon=libreoffice-/Icon=/' ${pkgdir}/usr/share/applications/*.desktop
+
+ # add missing mimetype file
+ install -m644 ${srcdir}/build/sysui/unxlng*/misc/libreoffice/openoffice.org.xml ${pkgdir}/usr/share/mime/packages/libreoffice.xml
+
+ # put configuration files into place
+ install -dm755 ${pkgdir}/etc/libreoffice
+ install -m644 ${pkgdir}/usr/lib/libreoffice/program/{bootstraprc,sofficerc} ${pkgdir}/etc/libreoffice/
+ install -m644 ${pkgdir}/usr/lib/libreoffice/basis3.4/share/psprint/psprint.conf ${pkgdir}/etc/libreoffice/
+ # install dummy links to make them found by LibO
+ cd ${pkgdir}/usr/lib/libreoffice/program/
+ ln -vsf /etc/libreoffice/{bootstraprc,sofficerc} .
+ cd ${pkgdir}/usr/lib/libreoffice/basis3.4/share/psprint/
+ ln -vsf /etc/libreoffice/psprint.conf .
+
+ #fix http://bugs.archlinux.org/task/17656
+ find ${pkgdir} -perm 444 -exec ls -lh {} \;
+ find ${pkgdir} -perm 444 -exec chmod 644 {} \;
+ find ${pkgdir} -perm 555 -exec ls -lh {} \;
+ find ${pkgdir} -perm 555 -exec chmod 755 {} \;
+
+ # split out extensions
+ mv ${pkgdir}/usr/lib/libreoffice/share/extensions ${srcdir}/extensions-install
+ install -dm755 ${pkgdir}/usr/lib/libreoffice/share/extensions
+ install -m644 ${srcdir}/extensions-install/package.txt ${pkgdir}/usr/lib/libreoffice/share/extensions/
+
+ # move SDK to separated package
+ mkdir -p ${srcdir}/sdk-install/usr/lib/libreoffice/basis3.4/sdk
+ mv ${pkgdir}/usr/lib/libreoffice/basis3.4/sdk ${srcdir}/sdk-install/usr/lib/libreoffice/basis3.4/
+
+ # cleanup gid_Module files
+ mkdir ${srcdir}/splitlist
+ mv -f ${pkgdir}/gid_Module* ${srcdir}/splitlist/
+}
+
+package_libreoffice-sdk() {
+
+ pkgdesc="Software development kit for LibreOffice"
+ depends=('libreoffice' 'gcc-libs' 'sh')
+
+ cd ${srcdir}/sdk-install
+ cp -r * ${pkgdir}
+
+ cd ${pkgdir}/usr/lib/libreoffice/basis3.4/sdk
+ mv setsdkenv_unix setsdkenv_unix.sh && chmod 755 setsdkenv_unix.sh
+ rm -f ${pkgdir}/usr/lib/libreoffice/basis3.4/sdk/setsdkenv_unix.{csh,sh}.in
+ #fix permissions
+ find examples -type f -exec chmod -x {} \;
+}
+
+package_libreoffice-extension-barcode() {
+
+ pkgdesc="This extension generates UPC-A, EAN-13, ISBN and JAN barcodes in Draw "
+ #arch=('any')
+ depends=('libreoffice')
+ groups=('libreoffice-extensions')
+
+ install -dm755 ${pkgdir}/usr/lib/libreoffice/share/extensions
+ unzip -q ${srcdir}/7e7efc5d4a03126bb9ae3ae9aa2c4e87-Barcode_1.3.1.0.oxt -d ${pkgdir}/usr/lib/libreoffice/share/extensions/Barcode
+ chmod o-w -R ${pkgdir}/usr/lib/libreoffice/share/extensions/Barcode
+}
+
+package_libreoffice-extension-diagram() {
+
+ pkgdesc="An OOo Draw and Impress extension that creates your favorite diagrams with a few clicks"
+ #arch=('any')
+ depends=('libreoffice')
+ groups=('libreoffice-extensions')
+
+ install -dm755 ${pkgdir}/usr/lib/libreoffice/share/extensions
+ unzip -q ${srcdir}/41c9b65ad60af4b3255bbecdfef11736-Diagram_1.1.0.0.oxt -d ${pkgdir}/usr/lib/libreoffice/share/extensions/diagram
+}
+
+package_libreoffice-extension-google-docs() {
+
+ pkgdesc="Google Documents extension for LibreOffice"
+ #arch=('any')
+ depends=('libreoffice')
+ groups=('libreoffice-extensions')
+
+ install -dm755 ${pkgdir}/usr/lib/libreoffice/share/extensions
+ unzip -q ${srcdir}/dbaafd21de055e582d92d7d32fe9da13-gdocs_2.3.1.oxt -d ${pkgdir}/usr/lib/libreoffice/share/extensions/google-docs
+}
+
+package_libreoffice-extension-hunart() {
+
+ pkgdesc="Hungarian cross-reference toolbar extension"
+ #arch=('any')
+ depends=('libreoffice')
+ groups=('libreoffice-extensions')
+
+ install -dm755 ${pkgdir}/usr/lib/libreoffice/share/extensions
+ unzip -q ${srcdir}/b632bdd25649cc4067bcb410bae23d2b-hunart_0.3.oxt -d ${pkgdir}/usr/lib/libreoffice/share/extensions/hunart
+}
+
+#package_libreoffice-extension-lightproof() {
+
+# pkgdesc="Lightproof extension for LibreOffice"
+ #arch=('any')
+# depends=('libreoffice')
+# groups=('libreoffice-extensions')
+
+# install -dm755 ${pkgdir}/usr/lib/libreoffice/share/extensions
+# unzip -q ${srcdir}/${pkgbase}-build-${_LOver}/build/libreoffice-${_LOver}/solver/${_OFFICEUPD}/unxlng*/bin/Lightproof.oxt -d ${pkgdir}/usr/lib/libreoffice/share/extensions/lightproof
+#}
+
+#package_libreoffice-extension-mysql-connector() {
+
+# pkgdesc="MySQL Connector extension for LibreOffice"
+ #arch=('any')
+# depends=('libreoffice')
+# groups=('libreoffice-extensions')
+
+# install -dm755 ${pkgdir}/usr/lib/libreoffice/share/extensions
+# unzip -q ${srcdir}/${pkgbase}-build-${_LOver}/build/libreoffice-${_LOver}/solver/${_OFFICEUPD}/unxlng*/bin/Mysql-connector.oxt -d ${pkgdir}/usr/lib/libreoffice/share/extensions/mysql-connector
+#}
+
+package_libreoffice-extension-nlpsolver() {
+
+ pkgdesc="This extension integrates into Calc and offers new Solver engines to use for optimizing nonlinear programming models"
+ #arch=('any')
+ depends=('libreoffice')
+ groups=('libreoffice-extensions')
+
+ install -dm755 ${pkgdir}/usr/lib/libreoffice/share/extensions
+ unzip -q ${srcdir}/build/solver/${_OFFICEUPD}/unxlng*/bin/NLPSolver.oxt -d ${pkgdir}/usr/lib/libreoffice/share/extensions/nlpsolver
+}
+
+package_libreoffice-extension-ct2n() {
+
+ pkgdesc="This extension enables you to convert text-cells in Calc with numbers and dates, to real numbers and dates."
+ #arch=('any')
+ depends=('libreoffice')
+ groups=('libreoffice-extensions')
+
+ install -dm755 ${pkgdir}/usr/lib/libreoffice/share/extensions
+ unzip -q ${srcdir}/build/solver/${_OFFICEUPD}/unxlng*/bin/ConvertTextToNumber.oxt -d ${pkgdir}/usr/lib/libreoffice/share/extensions/ct2n
+}
+
+package_libreoffice-extension-numbertext() {
+
+ pkgdesc="NUMBERTEXT/MONEYTEXT extensions"
+ #arch=('any')
+ depends=('libreoffice')
+ groups=('libreoffice-extensions')
+
+ install -dm755 ${pkgdir}/usr/lib/libreoffice/share/extensions
+ unzip -q ${srcdir}/b8cbca7b3363e6ca2d02bc0ba2b63904-numbertext_0.9.4.oxt -d ${pkgdir}/usr/lib/libreoffice/share/extensions/numbertext
+}
+
+package_libreoffice-extension-oooblogger() {
+
+ pkgdesc="An extensions for blogging"
+ #arch=('any')
+ depends=('libreoffice' 'coreutils')
+ groups=('libreoffice-extensions')
+
+ install -dm755 ${pkgdir}/usr/lib/libreoffice/share/extensions
+ unzip -q ${srcdir}/b7b2d0e04e142f26dd96119c80757d1f-oooblogger_0.1.oxt -d ${pkgdir}/usr/lib/libreoffice/share/extensions/oooblogger
+}
+
+package_libreoffice-extension-pdfimport() {
+
+ pkgdesc="This extension allows you to import and modify PDF documents"
+ depends=('libreoffice' 'poppler')
+ groups=('libreoffice-extensions')
+
+ install -dm755 ${pkgdir}/usr/lib/libreoffice/share/extensions
+ unzip -q ${srcdir}/build/solver/${_OFFICEUPD}/unxlng*/bin/pdfimport/pdfimport.oxt -d ${pkgdir}/usr/lib/libreoffice/share/extensions/pdfimport
+}
+
+package_libreoffice-extension-presenter-screen() {
+
+ pkgdesc="This extension provides more control over your slide show presentation, such as the ability to see the upcoming slide, the slide notes, and a presentation timer whereas the audience see only the current slide"
+ depends=('libreoffice')
+ groups=('libreoffice-extensions')
+
+ install -dm755 ${pkgdir}/usr/lib/libreoffice/share/extensions
+ unzip -q ${srcdir}/build/solver/${_OFFICEUPD}/unxlng*/bin/presenter-screen.oxt -d ${pkgdir}/usr/lib/libreoffice/share/extensions/presenter-screen
+}
+
+package_libreoffice-extension-presentation-minimizer() {
+
+ pkgdesc="This extension reduce the file size of the current presentation"
+ depends=('libreoffice' 'gcc-libs')
+ groups=('libreoffice-extensions')
+
+ install -dm755 ${pkgdir}/usr/lib/libreoffice/share/extensions
+ unzip -q ${srcdir}/build/solver/${_OFFICEUPD}/unxlng*/bin/presentation-minimizer.oxt -d ${pkgdir}/usr/lib/libreoffice/share/extensions/presentation-minimizer
+}
+
+package_libreoffice-extension-report-builder() {
+
+ pkgdesc="This extension creates smart-looking database reports"
+ #arch=('any')
+ depends=('libreoffice')
+ groups=('libreoffice-extensions')
+
+ install -dm755 ${pkgdir}/usr/lib/libreoffice/share/extensions
+ unzip -q ${srcdir}/build/solver/${_OFFICEUPD}/unxlng*/bin/report-builder.oxt -d ${pkgdir}/usr/lib/libreoffice/share/extensions/report-builder
+}
+
+package_libreoffice-extension-scripting-beanshell() {
+
+ pkgdesc="LibreOffice extension - Enables support for scripts in BeanShell"
+ depends=('libreoffice')
+ groups=('libreoffice-extensions')
+
+ install -dm755 ${pkgdir}/usr/lib/libreoffice/share/extensions
+ unzip -q ${srcdir}/build/solver/${_OFFICEUPD}/unxlng*/bin/script-provider-for-beanshell.oxt -d ${pkgdir}/usr/lib/libreoffice/share/extensions/script-provider-for-beanshell
+}
+
+package_libreoffice-extension-scripting-javascript() {
+
+ pkgdesc="LibreOffice extension - Enables support for scripts in JavaScript"
+ depends=('libreoffice')
+ groups=('libreoffice-extensions')
+
+ install -dm755 ${pkgdir}/usr/lib/libreoffice/share/extensions
+ unzip -q ${srcdir}/build/solver/${_OFFICEUPD}/unxlng*/bin/script-provider-for-javascript.oxt -d ${pkgdir}/usr/lib/libreoffice/share/extensions/script-provider-for-javascript
+}
+
+package_libreoffice-extension-scripting-python() {
+
+ pkgdesc="LibreOffice extension - Enables support for scripts in Python"
+ depends=('libreoffice')
+ groups=('libreoffice-extensions')
+
+ install -dm755 ${pkgdir}/usr/lib/libreoffice/share/extensions
+ unzip -q ${srcdir}/build/solver/${_OFFICEUPD}/unxlng*/bin/script-provider-for-python.oxt -d ${pkgdir}/usr/lib/libreoffice/share/extensions/script-provider-for-python
+}
+
+package_libreoffice-extension-typo() {
+
+ pkgdesc="Typography toolbar extension"
+ #arch=('any')
+ depends=('libreoffice')
+ groups=('libreoffice-extensions')
+
+ install -dm755 ${pkgdir}/usr/lib/libreoffice/share/extensions
+ unzip -q ${srcdir}/9d60b6cfa3ef1926848710bbcd11115b-typo_0.4.2.oxt -d ${pkgdir}/usr/lib/libreoffice/share/extensions/typo
+ chmod o+r -R ${pkgdir}/usr/lib/libreoffice/share/extensions/typo
+}
+
+package_libreoffice-extension-validator() {
+
+ pkgdesc="Validator extension for LibreOffice"
+ #arch=('any')
+ depends=('libreoffice')
+ groups=('libreoffice-extensions')
+
+ install -dm755 ${pkgdir}/usr/lib/libreoffice/share/extensions
+ unzip -q ${srcdir}/bbdd5639ada63e3130761daaecae1a10-Validator_1.1.0.0.oxt -d ${pkgdir}/usr/lib/libreoffice/share/extensions/validator
+}
+
+package_libreoffice-extension-wiki-publisher() {
+
+ pkgdesc="This extension enables you to create Wiki articles on MediaWiki servers without having to know the syntax of the MediaWiki markup language"
+ #arch=('any')
+ depends=('libreoffice')
+ groups=('libreoffice-extensions')
+
+ install -dm755 ${pkgdir}/usr/lib/libreoffice/share/extensions
+ unzip -q ${srcdir}/build/solver/${_OFFICEUPD}/unxlng*/bin/wiki-publisher.oxt -d ${pkgdir}/usr/lib/libreoffice/share/extensions/wiki-publisher
+}
+
+package_libreoffice-extension-watch-window() {
+
+ pkgdesc="A OOo Calc extension to add a Watch Window, which keeps the value of the monitored cell on the screen."
+ #arch=('any')
+ depends=('libreoffice')
+ groups=('libreoffice-extensions')
+
+ install -dm755 ${pkgdir}/usr/lib/libreoffice/share/extensions
+ unzip -q ${srcdir}/23bd75552206dfcd8fd4e29137dcac84-WatchWindow_1.2.0.0.oxt -d ${pkgdir}/usr/lib/libreoffice/share/extensions/watch-window
+}
diff --git a/staging/libreoffice/buildfix_64bit_system_libjpeg.diff b/staging/libreoffice/buildfix_64bit_system_libjpeg.diff
new file mode 100644
index 000000000..1f4eb110f
--- /dev/null
+++ b/staging/libreoffice/buildfix_64bit_system_libjpeg.diff
@@ -0,0 +1,11 @@
+--- solenv/inc/libs.mk 2009-07-02 09:44:33.084467312 +0000
++++ solenv/inc/libs.mk.new 2009-07-02 10:44:03.420819776 +0000
+@@ -211,7 +211,7 @@
+ .IF "$(OS)" == "FREEBSD"
+ JPEG3RDLIB=/usr/local/lib/libjpeg.so
+ .ELIF "$(CPUNAME)" == "X86_64" || "$(CPUNAME)" == "S390X" || "$(CPUNAME)" == "POWERPC64"
+-JPEG3RDLIB=/usr/lib64/libjpeg.so
++JPEG3RDLIB=/usr/lib/libjpeg.so
+ .ELSE
+ JPEG3RDLIB=/usr/lib/libjpeg.so
+ .ENDIF
diff --git a/staging/libreoffice/buildfix_bison25.diff b/staging/libreoffice/buildfix_bison25.diff
new file mode 100644
index 000000000..869b6c81e
--- /dev/null
+++ b/staging/libreoffice/buildfix_bison25.diff
@@ -0,0 +1,23 @@
+--- connectivity/source/parse/sqlbison.y 2011-05-20 13:21:02.000000000 -0600
++++ connectivity/source/parse/sqlbison.y 2011-05-20 13:22:11.000000000 -0600
+@@ -4338,7 +4338,7 @@
+ }
+
+ // -------------------------------------------------------------------------
+-void OSQLParser::error(sal_Char *fmt)
++void OSQLParser::error(const sal_Char *fmt)
+ {
+ if(!m_sErrorMessage.getLength())
+ {
+--- connectivity/inc/connectivity/sqlparse.hxx 2011-05-20 13:23:58.000000000 -0600
++++ connectivity/inc/connectivity/sqlparse.hxx 2011-05-20 13:23:46.000000000 -0600
+@@ -233,7 +233,7 @@
+ // returns the type for a parameter in a given function name
+ static sal_Int32 getFunctionParameterType(sal_uInt32 _nTokenId,sal_uInt32 _nPos);
+
+- void error(sal_Char *fmt);
++ void error(const sal_Char *fmt);
+ int SQLlex();
+ #ifdef YYBISON
+ void setParseTree(OSQLParseNode * pNewParseTree);
+
diff --git a/staging/libreoffice/buildfix_boost.diff b/staging/libreoffice/buildfix_boost.diff
new file mode 100644
index 000000000..d8608d0d4
--- /dev/null
+++ b/staging/libreoffice/buildfix_boost.diff
@@ -0,0 +1,40 @@
+From bae4fdbd105142cd3f317445eddc826da529a732 Mon Sep 17 00:00:00 2001
+From: Caolán McNamara <caolanm@redhat.com>
+Date: Tue, 05 Apr 2011 14:07:02 +0000
+Subject: silence some more of that annoying gcc#47679
+
+---
+diff --git a/boost/boost.gcc47679.patch b/boost/boost.gcc47679.patch
+index 1c804aa..9b33a5f 100644
+--- a/boost/boost.gcc47679.patch
++++ b/boost/boost.gcc47679.patch
+@@ -36,3 +36,26 @@
+ template <int MaxDigits>
+ inline bool allow_more_digits(std::size_t i)
+ {
++--- misc/boost_1_44_0/boost/optional/optional.hpp 2011-04-05 13:19:01.223587256 +0100
+++++ misc/build/boost_1_44_0/boost/optional/optional.hpp 2011-04-05 13:19:01.223587256 +0100
++@@ -31,6 +31,8 @@
++
++ #include "boost/optional/optional_fwd.hpp"
++
+++#include <string.h>
+++
++ #if BOOST_WORKAROUND(BOOST_MSVC, == 1200)
++ // VC6.0 has the following bug:
++ // When a templated assignment operator exist, an implicit conversion
++@@ -114,6 +116,11 @@
++
++ public:
++
+++ aligned_storage()
+++ {
+++ memset(&dummy_, 0, sizeof(dummy_));
+++ }
+++
++ void const* address() const { return &dummy_.data[0]; }
++ void * address() { return &dummy_.data[0]; }
++ } ;
+--
+cgit v0.8.3-6-g21f6
+
diff --git a/staging/libreoffice/buildfix_ct2n.diff b/staging/libreoffice/buildfix_ct2n.diff
new file mode 100644
index 000000000..979587f79
--- /dev/null
+++ b/staging/libreoffice/buildfix_ct2n.diff
@@ -0,0 +1,17 @@
+From 90de903b28cb1884042be0eae3f8a55458c5bc29 Mon Sep 17 00:00:00 2001
+From: Caolán McNamara <caolanm@redhat.com>
+Date: Tue, 12 Apr 2011 19:35:51 +0000
+Subject: duplicate NULLs
+
+---
+diff --git a/ct2n/prj/build.lst b/ct2n/prj/build.lst
+index 91f44b7..714d926 100644
+--- a/ct2n/prj/build.lst
++++ b/ct2n/prj/build.lst
+@@ -1,3 +1,3 @@
+-ct2n ct2n : solenv NULL NULL
++ct2n ct2n : solenv NULL
+ ct2n ct2n usr1 - all ct2n_mkout NULL
+ ct2n ct2n nmake - all ct2n_ct2n NULL
+--
+cgit v0.8.3-6-g21f6
diff --git a/staging/libreoffice/buildfix_i116795.diff b/staging/libreoffice/buildfix_i116795.diff
new file mode 100644
index 000000000..8601bc164
--- /dev/null
+++ b/staging/libreoffice/buildfix_i116795.diff
@@ -0,0 +1,22 @@
+diff -r 4ab9e11cb892 connectivity/qa/makefile.mk
+--- a/connectivity/qa/makefile.mk Thu Mar 03 15:22:23 2011 +0100
++++ b/connectivity/qa/makefile.mk Fri Mar 04 09:51:48 2011 +0100
+@@ -35,9 +35,16 @@
+
+ #----- compile .java files -----------------------------------------
+
+-JARFILES = ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar hsqldb.jar
+ JAVAFILES := $(shell @$(FIND) complex -name "*.java")
+
++JARFILES = ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar
++
++.IF "$(SYSTEM_HSQLDB)" == "YES"
++EXTRAJARFILES = $(HSQLDB_JAR)
++.ELSE
++JARFILES += hsqldb.jar
++.ENDIF
++
+ #----- make a jar from compiled files ------------------------------
+
+ JARCLASSDIRS = $(PACKAGE)
+
diff --git a/staging/libreoffice/libreoffice.install b/staging/libreoffice/libreoffice.install
new file mode 100644
index 000000000..27f3173ae
--- /dev/null
+++ b/staging/libreoffice/libreoffice.install
@@ -0,0 +1,25 @@
+post_install() {
+
+gtk-update-icon-cache -f -q /usr/share/icons/hicolor
+update-desktop-database -q
+update-mime-database usr/share/mime > /dev/null 2>&1
+
+echo " * see http://wiki.archlinux.org/index.php/Openoffice"
+echo " * you may want to pacman -Ss libreoffice-extensions"
+echo " to see what extensions are prepared to install"
+echo " * it's recommended to install {hunspell,mythes,hyphen}-xx pkg for spell checking"
+echo " * make sure you have installed some ttf font (ttf-dejavu recommended)"
+}
+
+post_upgrade() {
+# post_install $1
+gtk-update-icon-cache -f -q /usr/share/icons/hicolor
+update-desktop-database -q
+update-mime-database usr/share/mime > /dev/null 2>&1
+}
+
+post_remove() {
+update-desktop-database -q
+gtk-update-icon-cache -f -q /usr/share/icons/hicolor
+update-mime-database usr/share/mime > /dev/null 2>&1
+}
diff --git a/staging/libreoffice/vbahelper.visibility.patch b/staging/libreoffice/vbahelper.visibility.patch
new file mode 100644
index 000000000..5739100d0
--- /dev/null
+++ b/staging/libreoffice/vbahelper.visibility.patch
@@ -0,0 +1,33 @@
+--- vbahelper/inc/vbahelper/vbacollectionimpl.hxx 2011-01-28 20:27:51.507604173 +0000
++++ vbahelper/inc/vbahelper/vbacollectionimpl.hxx 2011-01-28 20:28:26.230045727 +0000
+@@ -238,7 +238,7 @@
+
+ // including a HelperInterface implementation
+ template< typename Ifc1 >
+-class ScVbaCollectionBase : public InheritedHelperInterfaceImpl< Ifc1 >
++class VBAHELPER_DLLPUBLIC ScVbaCollectionBase : public InheritedHelperInterfaceImpl< Ifc1 >
+ {
+ typedef InheritedHelperInterfaceImpl< Ifc1 > BaseColBase;
+ protected:
+--- sc/Library_vbaobj.mk
++++ sc/Library_vbaobj.mk
+@@ -118,7 +118,6 @@ $(eval $(call gb_Library_add_exception_objects,vbaobj,\
+ sc/source/ui/vba/vbaquerytable \
+ sc/source/ui/vba/vbarange \
+ sc/source/ui/vba/vbasheetobject \
+- sc/source/ui/vba/vbasheetobjects \
+ sc/source/ui/vba/vbastyle \
+ sc/source/ui/vba/vbastyles \
+ sc/source/ui/vba/vbatextboxshape \
+@@ -133,6 +132,11 @@ $(eval $(call gb_Library_add_exception_objects,vbaobj,\
+ sc/source/ui/vba/vbawsfunction \
+ ))
+
++$(eval $(call gb_Library_add_cxxobjects,vbaobj,\
++ sc/source/ui/vba/vbasheetobjects \
++ , $(gb_COMPILERNOOPTFLAGS) $(gb_LinkTarget_EXCEPTIONFLAGS) \
++))
++
+ ifneq (,$(filter LINUX DRAGONFLY OPENBSD FREEBSD NETBSD, $(OS)))
+ $(eval $(call gb_Library_set_ldflags,vbaobj,\
+ $$(LDFLAGS) \