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 !
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
14 for _l in ${_langs[*]}; do
15 _pkgname=(${_pkgname[*]} "ooo4kids-${_l}")
24 arch=('i686' 'x86_64')
25 url="http://ooo4kids.org/"
29 _my_svntrunk="svn://svn.adullact.net/svnroot/ooo4kids1"
31 if [ ! -n "$_revision" ]; then
33 _svntrunk=$_my_svntrunk
35 _application_name=OOo4Kids
36 _project_short=ooo4kids12
37 _projectname="ooo4kids"
39 _project="${_projectname}${_projectver}"
44 msg "Downloading from svn repository..."
45 if [ -n "$_revision" ]; then
46 svn co -r $_revision --no-auth-cache ${_my_svntrunk}/${_my_svnmod}
48 svn co --no-auth-cache ${_my_svntrunk}/${_my_svnmod}
50 msg "SVN checkout done or server timeout"
52 msg "Starting make..."
56 ./configure --prefix=/usr --exec-prefix=/usr\
59 --with-system-lucene=no\
60 --with-system-saxon=no\
61 --with-lang="${_langs[*]}"\
67 --with-system-stdlibs\
70 --with-system-jars=no\
75 --with-${_application_name}\
77 --with-package-format=native\
78 --enable-presenter-console\
81 --with-system-hunspell\
82 --with-system-lpsolve\
83 --enable-presenter-extra-ui\
84 --with-package-format=installed\
88 --with-system-sane-header\
89 --enable-xrender-link\
91 --with-system-redland\
94 --with-system-libwpd=no\
98 # Setup environment for build
99 if [ "$CARCH" = "x86_64" ]; then
100 source LinuxX86-64Env.Set.sh
102 source LinuxX86Env.Set.sh
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
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
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
147 _destdir=${pkgdir}/usr/lib/${_projectname}/share
148 mkdir -p ${_destdir}/icons/hicolor
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
165 # add _project to the name of *.desktop (avoiding OOo conflicts)
166 for _aFile in $(ls) ; do
167 mv ${_aFile} ${_projectname}-${_aFile}
171 mkdir -p ${pkgdir}/usr/share/applications
172 mv ${_destdir}/xdg/*.desktop ${pkgdir}/usr/share/applications
175 mkdir -p ${pkgdir}/usr/share/icons
177 for _icon in $(cd ${srcdir}/${_my_svnmod}/sysui/desktop/icons/hicolor; find ??x?? -name "*.png")
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}
185 _destfile=${_targetdir}/${_project:-}${_project:+-}$(basename ${_icon})
186 cp ${srcdir}/${_my_svnmod}/sysui/desktop/icons/hicolor/${_icon} $_destfile
187 chmod 0644 $_destfile
192 mkdir -p ${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
201 rm -rf ${pkgdir}/usr/log
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
219 mv ${pkgdir}/usr/lib/'${_project}' ${pkgdir}/usr/lib/'${_projectname}'
220 cd ${pkgdir}/usr/lib/'${_projectname}' && mv basis'${_projectver}' basis-link
223 chmod -R 755 ${pkgdir}/usr/lib
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'