updated on Tue Jan 17 12:00:36 UTC 2012
[aur-mirror.git] / libreoffice-git / PKGBUILD
blob3b1ca1351885d4d4fd7eae39fc43fbaa216656af
1 # Contributor: Vamp898 <vamp898@web.de>
3 pkgname=libreoffice-git
4 pkgver=20110124
5 pkgrel=1
6 pkgbase=libreoffice-git
7 _pkgbasever=${pkgver}
9 _gitroot="git://anongit.freedesktop.org/libreoffice/bootstrap"
10 _gitname="libo"
13 pkgrel=1
14 arch=('i686' 'x86_64')
15 pkgdesc="LibreOffice is a productivity suite that is compatible with other major office suites, and available on a variety of platforms."
16 url="http://www.documentfoundation.org/"
17 license="LGPL"
18 makedepends=( # makedepends
19              'boost' 'sane' 'perl-archive-zip' 'zip' 'unzip' 'xulrunner' 'unixodbc' 'hsqldb-java'
20              'apache-ant' 'gperf' 'poppler' 'kdelibs' 'gconf' 'cppunit'
21              'beanshell'  'vigra' 'libldap' 'lucene' 'libmythes' 'junit' 'libwpg' 'imagemagick'
22               # for additional ooo-build features
23                  'mesa>=7.5' 'gstreamer0.10-base>=0.10.26'  #'mono>=2.6.1'
24               #'saxon' - currently broken 
25              # the depends from libreoffice main pkg
26              "curl>=7.20.0" "hunspell>=1.2.8" "python2>=2.7" 'libwpd>=0.9.0' 'libxaw' "neon>=0.28.6"
27              'pango' 'nspr' 'libjpeg' 'libxrandr' 'libgl' 'dbus-glib' "icu>=4.6" 'libxslt'
28              'redland' 'libgraphite' 'hyphen' 'lpsolve' 'gcc-libs' 'sh'
29              'hicolor-icon-theme' 'desktop-file-utils' 'shared-mime-info' 'java-runtime' 'gtk2' 'gcc' 'git' 'rsync' 'hyphen')
31 conflicts=('openoffice-base' 'go-openoffice' 'go-oo-bin-base')
33 _nOfCpu="$(grep processor /proc/cpuinfo | grep -v "model name" | wc -l)"
35 build() {
36         unset J2REDIR; unset J2SDKDIR; unset JAVA_HOME; unset CLASSPATH
37         [ -z "${JAVA_HOME}" ] && . /etc/profile.d/openjdk6.sh
38         [ -z "${MOZ_PLUGIN_PATH}" ] && . /etc/profile.d/mozilla-common.sh
39         [ -z "${ANT_HOME}" ] && . /etc/profile.d/apache-ant.sh
40         # export C(XX)FLAGS
41         # http://www.openoffice.org/issues/show_bug.cgi?id=103205
42         unset CFLAGS
43         unset CXXFLAGS
45         # python2 fix
46         export PYTHON=python2
47         # mono2.8 hack
48         #       sed -i -e "s/mkbundle2/mkbundle/g" patches/mono/*.diff || return 1
49         if  [ !  -d ${_gitname} ] || [ ! -e fDownloads ]  ; then
50           if [ ! -d ${_gitname} ]; then
51                   git clone ${_gitroot} ${_gitname}
52           fi
53           
54           mkdir -p ${srcdir}/libo/patches/hotfixes/
55           cp ../buildfix_64bit_system_libjpeg.diff ${srcdir}/libo/patches/hotfixes/
56           
57           cd ${_gitname}
58           msg "Configuring"
60           if [ "$CARCH" = "x86_64" ]; then
61               EXTRAOPTS="--without-stlport"
62            # else EXTRAOPTS="--with-stlport --with-additional-sections=SystemGraphiteWithSTLport"
63            # fix i686 system cppunit with-stlport
64            else EXTRAOPTS="--without-stlport"
65           fi
66           # our ArchLinux distribution patch until we go upstream
67           #patch -Np1 -i ../../ArchLinux.patch || return 1
68          
69       
71         ${srcdir}/libo/autogen.sh --with-distro=ArchLinux \
72                 --with-build-version=" ArchLinux build-${pkgrel}" \
73                 --with-git \
74                 --with-srcdir=${srcdir} \
75                 --with-max-jobs=${MAKEFLAGS/-j/} \
76                 --with-installed-ooo-dirname="${pkgbase}" \
77                 --prefix=/usr --exec-prefix=/usr --sysconfdir=/etc \
78                 --with-docdir=/usr/share/doc/packages/"${pkgbase}" \
79                 --mandir=/usr/share/man \
80                 --with-lang="" \
81                 --with-binsuffix=no \
82                 --enable-cairo\
83                 --enable-crashdump\
84                 --enable-evolution2\
85                 --enable-graphite\
86                 --disable-gio\
87                 --disable-kde\
88                 --disable-mono\
89                 --enable-kde4\
90                 --enable-ldap \
91                 --enable-lockdown\
92                 --enable-opengl \
93                 --enable-odk\
94                 --enable-opengl\
95                 --enable-ogltrans \
96                 --enable-minimizer \
97                 --enable-pdfimport \
98                 --enable-presenter-console \
99                 --enable-presenter-extra-ui\
100                 --enable-report-builder\
101                 --enable-wiki-publisher \
102                 --with-ct2n \
103                 --with-hunart \
104                 --with-nlpsolver \
105                 --with-numbertext \
106                 --with-oooblogger \
107                 --with-typo \
108                 --with-watch-window \
109                 --with-diagram \
110                 --without-fonts\
111                 --without-afms\
112                 --without-ppds\
113                 --without-system-agg\
114                 --without-system-libwps\
115                 --without-system-mdds\
116                 --without-myspell-dicts \
117                 --with-system-dicts \
118                 --with-external-dict-dir=/usr/share/hunspell \
119                 --with-external-hyph-dir=/usr/share/hyphen \
120                 --with-external-thes-dir=/usr/share/mythes \
121                 --with-system-cppunit\
122                 --with-system-libwpg\
123                 --with-system-redland\
124                 --without-system-saxon\
125                 --with-openldap\
126                 --with-ant-home="/usr/share/java/apache-ant"\
127                 --with-system-boost\
128                 --with-system-cairo\
129                 --with-system-libs\
130                 --with-system-mythes\
131                 --with-system-unixodbc-headers\
132                 --with-system-xrender-headers\
133                 --with-system-headers\
134                 --with-alloc=system\
135                 --with-system-lucene\
136                 --with-lucene-core-jar=/usr/share/java/lucene-core.jar\
137                 --with-max-jobs=1 \
138                 --with-lucene-analyzers-jar=/usr/share/java/lucene-analyzers.jar\
139                 $EXTRAOPTS || return 1
141          
142           msg "Downloading"
143           make fetch
144           touch ../fDownloads
145           patch -Np0 -i patches/hotfixes/buildfix_64bit_system_libjpeg.diff 
146         else
147           cd ${_gitname}
148           msg "Updating Repository"
149           git stash
150           git pull -r
151           ./g stash
152           ./g pull -r        
153            patch -Np0 -i patches/hotfixes/buildfix_64bit_system_libjpeg.diff 
154          fi
155         LD_PRELOAD="" make  || return 1
156           
160 package() {
162  pkgdesc="a productivity suite that is compatible with other major office suites"
163  install=${pkgname}.install
164  depends=("curl>=7.20.0" "hunspell>=1.2.8" "python2>=2.7" 'libwpd>=0.9.0' 'libxaw' "neon>=0.28.6"
165           'pango' 'nspr' 'libjpeg' 'libxrandr' 'libgl' 'dbus-glib' "icu>=4.6" 'libxslt'
166           'redland' 'libgraphite' 'hyphen' 'lpsolve' 'gcc-libs' 'sh'
167           'hicolor-icon-theme' 'desktop-file-utils' 'shared-mime-info' 'java-runtime' 'gtk2') # keep gtk2 for install script
168           #'saxon'
169  optdepends=( #'java-runtime:     adds java support'
170              'libcups:          adds printing support'
171              'gconf:            adds additional gnome support'
172              'nss:              adds support for signed files/macros'
173              'pstoedit:         translates PostScript and PDF graphics into other vector formats'
174              'poppler:          for shipped pdfimport extension'
175              'kdelibs:          for kde integration'
176              'libmythes:        for use in thesaurus'
177              'hsqldb-java:      default database format for OpenOffice.org'
178              'beanshell:        interactive java -- good for prototyping /macros'
179              'vigra:            C++ computer vision library, usable in Basebmp'
180              'libmspack:        library for Microsoft compression formats for use in FontOOo'
181              'libwpg:           library for importing and converting Corel WordPerfect(tm) Graphics images'
182              'libldap:          to get profiles via ldap'
183              'lucene:           full-text search engine library for Java needed in the help section'
184              'sane:             for scanner access'
185              'unixodbc:         adds ODBC database support'
186              'mesa:             for the OGLTrans extension'
187              'gstreamer0.10-base: + some gstr-plugins to support multimedia content, e.g. in impress')
188 #             'mono:             allows UNO automation with Mono'
189  backup=(etc/libreoffice/sofficerc
190          etc/libreoffice/bootstraprc
191          etc/libreoffice/psprint.conf)
192  provides=('go-openoffice') #'openoffice-base' 
193  conflicts=('go-openoffice') #'openoffice-base' 
194  replaces=('go-openoffice')
196         
197         cd ${srcdir}/libo
198         . ./*[Ee]nv.[Ss]et.sh && \
199         ooinstall -l ${pkgdir}
200         
201         cd ${pkgdir}
202         mkdir -p usr/lib/libreoffice
203         mv basis3.3 usr/lib/libreoffice
204         mv CREDITS.odt usr/lib/libreoffice
205         mv LICENSE  usr/lib/libreoffice
206         mv LICENSE.odt usr/lib/libreoffice
207         mv program usr/lib/libreoffice
208         mv readmes usr/lib/libreoffice
209         mv share usr/lib/libreoffice
210         mv ure usr/lib/libreoffice
211         rm -rfv basis-link
212 # move sysui desktop files into place we want to use - javafilter and qstarter, but not unneeded printeradmin
213         mkdir -p ${pkgdir}/usr/share/applications
214         cp ${pkgdir}/usr/lib/libreoffice/share/xdg/javafilter.desktop ${pkgdir}/usr/share/applications/
215         cp ${pkgdir}/usr/lib/libreoffice/share/xdg/qstart.desktop ${pkgdir}/usr/share/applications/
216         # remove version in menu entry and make it visible
217         sed -i -e "s/3.3 Quickstarter/Quickstarter/g" ${pkgdir}/usr/share/applications/qstart.desktop
218         sed -i -e "/NoDisplay=true/d" ${pkgdir}/usr/share/applications/qstart.desktop
219         # remove unneeded .desktop files from vanilla sysui
220         rm -rf ${pkgdir}/usr/lib/libreoffice/share/xdg
222         # put configuration files into place
223         install -dm755 ${pkgdir}/etc/libreoffice
224         install -m644 ${pkgdir}/usr/lib/libreoffice/program/{bootstraprc,sofficerc} ${pkgdir}/etc/libreoffice/
225         install -m644 ${pkgdir}/usr/lib/libreoffice/basis3.3/share/psprint/psprint.conf ${pkgdir}/etc/libreoffice/
226         # install dummy links to make them found by LibO
227         cd ${pkgdir}/usr/lib/libreoffice/program/
228         ln -vsf /etc/libreoffice/{bootstraprc,sofficerc} .
229         cd ${pkgdir}/usr/lib/libreoffice/basis3.3/share/psprint/
230         ln -vsf /etc/libreoffice/psprint.conf .
232         #fix http://bugs.archlinux.org/task/17656
233         find ${pkgdir} -perm 444 -exec ls -lh {} \; 
234         find ${pkgdir} -perm 444 -exec chmod 644 {} \;
235         find ${pkgdir} -perm 555 -exec ls -lh {} \;
236         find ${pkgdir} -perm 555 -exec chmod 755 {} \;
237         
238         mkdir -p ${pkgdir}/usr/lib
239         cd ${pkgdir}/usr/lib/
240         ln -vsf ${pkgdir}/usr/lib/libreoffice/ure/lib/libuno_sal.so.3 .
241         ln -vsf ${pkgdir}/usr/lib/libreoffice/basis3.3/program/libsofficeapp.so .
242         cd ${pkgdir}/usr/lib/libreoffice/
243         ln -vsf ${pkgdir}/usr/lib/libreoffice/basis3.3 ./basis-link
244        
245        mkdir -p ${pkgdir}/usr/bin
246        cd ${pkgdir}/usr/bin
247        ln -vsf ${pkdir}/usr/lib/libreoffice/program/soffice .
250