updated on Thu Jan 19 20:01:47 UTC 2012
[aur-mirror.git] / ooo4kids-svn / PKGBUILD
blob8175b888e3005d295426df0def372f9ab3083290
1 #Contributors:
2 # Calimero <calimeroteknik@free.fr>
3 # ericb <ericb@openoffice.org>
4 # Coolgeek <coolman_789 at hotmail dot com>
5 # Gyo <gyo_at_archlinux_dot_fr>
7 # WARNING : this compile needs 13GB of free disk space !
9 # Set of langs                                                                  
10 _langs=(ar de es fi fr it nb nl sl pt uk zh-CN zh-TW da el ru)
12 # Generate pkgname with _langs
13 _pkgname=()
14 for _l in ${_langs[*]}; do
15   _pkgname=(${_pkgname[*]} "ooo4kids-${_l}")
16 done
18 # r874 == v 1.0
19 # r964 == v 1.1
20 # r1205 == v 1.2
21 #_revision=1205
22 pkgver=1236
23 pkgrel=1
24 arch=('i686' 'x86_64')
25 url="http://ooo4kids.org/"
26 license=('LGPL3')
28 _my_svnmod="trunk"
29 _my_svntrunk="svn://svn.adullact.net/svnroot/ooo4kids1"
31 if [ ! -n "$_revision" ]; then
32         _svnmod=$_my_svnmod
33         _svntrunk=$_my_svntrunk
35 _application_name=OOo4Kids
36 _project_short=ooo4kids12
37 _projectname="ooo4kids"
38 _projectver="1.2"
39 _project="${_projectname}${_projectver}"
41 build() {
42  cd ${srcdir}
44  msg "Downloading from svn repository..."
45  if [ -n "$_revision" ]; then
46    svn co -r $_revision --no-auth-cache ${_my_svntrunk}/${_my_svnmod}
47  else
48    svn co --no-auth-cache ${_my_svntrunk}/${_my_svnmod}
49  fi
50  msg "SVN checkout done or server timeout"
52  msg "Starting make..."
53  cd ${_my_svnmod}
56  ./configure --prefix=/usr --exec-prefix=/usr\
57              --without-fonts\
58              --disable-odk\
59              --with-system-lucene=no\
60              --with-system-saxon=no\
61              --with-lang="${_langs[*]}"\
62              --enable-dbus\
63              --with-dict=ALL\
64              --enable-opengl\
65              --disable-vba\
66              --disable-mozilla\
67              --with-system-stdlibs\
68              --with-system-libs\
69              --with-alloc=system\
70              --with-system-jars=no\
71              --with-system-python\
72              --with-system-libxml\
73              --enable-cups\
74              --disable-gnome-vfs\
75              --with-${_application_name}\
76              --disable-gtk\
77              --with-package-format=native\
78              --enable-presenter-console\
79              --with-system-jpeg\
80              --with-system-vigra\
81              --with-system-hunspell\
82              --with-system-lpsolve\
83              --enable-presenter-extra-ui\
84              --with-package-format=installed\
85              --without-stlport\
86              --with-system-zlib\
87              --with-system-boost\
88              --with-system-sane-header\
89              --enable-xrender-link\
90              --with-system-agg\
91              --with-system-redland\
92              --with-system-db\
93              --with-system-mythes\
94              --with-system-libwpd=no\
95              --with-system-icu
98  # Setup environment for build
99  if [ "$CARCH" = "x86_64" ]; then
100   source LinuxX86-64Env.Set.sh
101  else
102   source LinuxX86Env.Set.sh
103  fi
105  # Build
106   ./bootstrap ||return 1
109  ## exploit all the processors
110  # automatic config : load each processor with 2 objects at a time
111  export CUSTOM_DMAKE="$(_init=1;for _i in `grep -o processor /proc/cpuinfo`;do if [ "$_init" == "1" ];then echo -n '-P2';_init=0;else echo -n ' -- -P2';fi;done;echo)" 
113  # manual config example :
114  #export CUSTOM_DMAKE="-P5 -- -P5" #for 2 parallel threads loading each core with 5 objects at a time : on a dual core with a lot of ram.
116  cd ${srcdir}/${_my_svnmod}/instsetoo_native
117  perl $SOLARENV/bin/build.pl --all ${CUSTOM_DMAKE} || return 1
120 package_ooo4kids-base() {
121  pkgdesc="OpenOffice lightened, relooked for kids"
122  install=('ooo4kids.install')
123  provides=('ooo4kids')
124  conflicts=('ooo4kids')
126  cd ${srcdir}/${_my_svnmod}/instsetoo_native/util
127  mkdir -p ${pkgdir}/usr/lib
128  LOCALINSTALLDIR=${pkgdir}/usr/lib dmake openoffice_en-US PKGFORMAT=installed
130  ## This is a /opt/-style installation, correcting ##
132  # Replace symlinks with real folders
133  # Step 1
134  cd ${pkgdir}/usr/lib
135  mv ${_project} ${_projectname}
136  cd ${pkgdir}/usr/lib/${_projectname} || return 1
137  mv ure basis${_projectver}/ || return 1
138  cd basis${_projectver} || return 1
139  rm ure-link && mv ure ure-link || return 1
140  # Step 2
141  cd ${pkgdir}/usr/lib/${_projectname}/ || return 1
142  rm basis-link && mv basis${_projectver} basis-link || return 1
144  cd ${pkgdir}/usr/lib/${_projectname} || return 1
146  # .desktop files
147  _destdir=${pkgdir}/usr/lib/${_projectname}/share
148  mkdir -p ${_destdir}/icons/hicolor
149  cd ${_destdir}/xdg
151  # fix exec commands and icon names
152  sed -i -e "s|Exec=/usr/bin/${_project}-printeradmin|Exec=/usr/bin/spadmin|g" printeradmin.desktop || return 1
153  sed -i -e "s|${_project} -writer %U|${_projectname} -writer|g" writer.desktop || return 1
154  sed -i -e "s|${_project} -calc %U|${_projectname} -calc|g" calc.desktop || return 1
155  sed -i -e "s|${_project} -draw %U|${_projectname} -draw|g" draw.desktop || return 1
156  sed -i -e "s|${_project} -impress %U|${_projectname} -impress|g" impress.desktop || return 1
157  sed -i -e "s|${_project} -math %U|${_projectname} -math|g" math.desktop || return 1
158  sed -i -e "s|${_project}-printeradmin|${_projectname}-printeradmin|g" printeradmin.desktop || return 1
159  sed -i -e "s|${_project} %U|${_projectname}|g" ${_projectname}.desktop || return 1
160  sed -i -e "s|Icon=${_project_short}|Icon=${_project}|g" *.desktop || return 1
162  # remove quickstarter, we disabled it above
163  rm -f qstart.desktop
165  # add _project to the name of *.desktop (avoiding OOo conflicts)
166  for _aFile in $(ls) ; do
167   mv ${_aFile} ${_projectname}-${_aFile}
168  done
170  cd ${_destdir}
171  mkdir -p ${pkgdir}/usr/share/applications
172  mv ${_destdir}/xdg/*.desktop ${pkgdir}/usr/share/applications
174  # install icons
175  mkdir -p ${pkgdir}/usr/share/icons
177  for _icon in $(cd ${srcdir}/${_my_svnmod}/sysui/desktop/icons/hicolor; find ??x?? -name "*.png")
178   do
179   # only paths containing our app name are useful
180   if test "x${_icon}" != "x${_icon/${_application_name}}" ; then
181    # create the target dir
182    _targetdir=${pkgdir}/usr/share/icons/hicolor/$(dirname ${_icon/${_application_name}})
183    mkdir -p ${_targetdir}
184    # copy the icon
185    _destfile=${_targetdir}/${_project:-}${_project:+-}$(basename ${_icon})
186    cp ${srcdir}/${_my_svnmod}/sysui/desktop/icons/hicolor/${_icon} $_destfile
187    chmod 0644 $_destfile
188   fi
189  done
191  # make symlinks
192  mkdir -p  ${pkgdir}/usr/bin
193  cd ${pkgdir}/usr/bin
194  ln -sf ../lib/${_projectname}/program/soffice ${_projectname}
195  ln -sf ../lib/${_projectname}/program/spadmin ${_projectname}-printeradmin
197  # fix home config path s|~/.config/.appname|~/.config/appname|
198  sed -i 's|$SYSUSERCONFIG/.|$SYSUSERCONFIG/|' ${pkgdir}/usr/lib/${_projectname}/program/bootstraprc || return 1
200  # remove logs
201  rm -rf ${pkgdir}/usr/log
203  # Fix permissions
204  chmod -R 755 ${pkgdir}/usr/lib
207 for _lang in ${_langs[*]};do
208  eval 'package_'${_projectname}'-'"$_lang"'() {
209    depends=("'${_projectname}'-base")
210    pkgdesc=("'"$_lang"' language pack for '${_projectname}'")
211    provides=("'${_projectname}'-'"$_lang"'")
212    conflicts=("'${_projectname}'-'"$_lang"'")
214    cd ${srcdir}/${_my_svnmod}/instsetoo_native/util
215    mkdir -p ${pkgdir}/usr/lib
216    LOCALINSTALLDIR=${pkgdir}/usr/lib dmake ooolanguagepack_'"$_lang"' PKGFORMAT=installed || return 1
218    # Adapt path
219    mv ${pkgdir}/usr/lib/'${_project}' ${pkgdir}/usr/lib/'${_projectname}'
220    cd ${pkgdir}/usr/lib/'${_projectname}' && mv basis'${_projectver}' basis-link
222    # Fix permissions
223    chmod -R 755 ${pkgdir}/usr/lib
224  }'
225 done
227 pkgbase=ooo4kids-svn
228 pkgname=ooo4kids-svn
229 pkgdesc="OpenOffice lightened, relooked for kids"
230 provides=('ooo4kids')
231 conflicts=('ooo4kids')
233 # Hack to upload it on AUR
234 (( 42 )) && pkgname=('ooo4kids-base' ${_pkgname[*]})
236 depends=('pango' 'hunspell' 'python2' 'libxaw' 'libjpeg' 'dbus-glib' 'libxslt' 'lpsolve' 'libgraphite' 'hyphen' 'mesa' 'agg' 'redland' 'icu')
238 makedepends=('libcups' 'libmythes' 'vigra' 'gstreamer0.10-base' 'subversion' 'gconf' 'gperf' 'boost' 'pkg-config' 'perl-archive-zip' 'zip' 'unzip' 'curl' 'sane' 'agg')
239 optdepends=( 'sane:             for scanner access'
240              'libcups:          adds printing support' 
241              'libmythes:        for use in thesaurus'
242              'vigra:            C++ computer vision library, usable in Basebmp'
243              'gstreamer0.10-base: + some gstr-plugins to support multimedia content, e.g. in impress'
244              )