EnvironmentSetup/Linux/archlinuxPKGBUILD

Back to Environment setup Linux Archlinux

Below, the content of the current unofficial PKGBUILD file :


 * 1) Contributors:
 * 2) Calimero 
 * 3) ericb 
 * 4) Coolgeek 
 * 5) Gyo 


 * 1) WARNING : this compile needs 13GB of free disk space !

_langs=(ar de es fi fr it nb nl sl pt uk zh-CN zh-TW)
 * 1) Set of langs

_pkgname= for _l in ${_langs[*]}; do _pkgname=(${_pkgname[*]} "ooo4kids-${_l}") done
 * 1) Generate pkgname with _langs

pkgbase=ooo4kids pkgname=('ooo4kids-base' ${_pkgname[*]})

_revision=1206 pkgver=1.2 pkgrel=1 arch=('i686' 'x86_64') url="http://ooo4kids.org/" license=('LGPL3')
 * 1) r874 == v 1.0
 * 2) r964 == v 1.1
 * 3) r1206 == v 1.2

depends=('pango' 'vigra' 'hunspell' 'libcups' 'gstreamer0.10-base' 'python2' 'libxaw' 'libwpd' 'libjpeg' 'dbus-glib' 'libxslt' 'lpsolve' 'icu' 'libgraphite' 'hyphen' 'mesa' 'agg' 'redland' 'sane') makedepends=('svn' 'gconf' 'gperf' 'boost' 'pkg-config' 'perl-archive-zip' 'zip' 'unzip' 'curl' 'sane' 'agg' 'redland')

_my_svnmod="trunk" _my_svntrunk="svn://svn.adullact.net/svnroot/ooo4kids1"

if [ ! -n "$_revision" ]; then _svnmod=$_my_svnmod _svntrunk=$_my_svntrunk fi _application_name=OOo4Kids _project_short=ooo4kids12 _projectname="ooo4kids" _projectver="1.2" _project="${_projectname}${_projectver}"

build { cd ${srcdir}

msg "Downloading from svn repository..." if [ -n "$_revision" ]; then svn co -r $_revision --no-auth-cache ${_my_svntrunk}/${_my_svnmod} else svn co --no-auth-cache ${_my_svntrunk}/${_my_svnmod} fi msg "SVN checkout done or server timeout"

msg "Starting make..." cd ${_my_svnmod}


 * 1) TODO : corriger le --with-system-mythes

./configure --prefix=/usr --exec-prefix=/usr\ --disable-binfilter\ --without-fonts\ --disable-odk\ --with-system-lucene=no\ --with-system-saxon=no\ --with-lang="${_langs[*]}"\ --enable-dbus\ --with-dict=ALL\ --enable-opengl\ --disable-vba\ --disable-mozilla\ --with-system-stdlibs\ --with-system-libs\ --with-alloc=system\ --with-system-python\ --with-system-libxml\ --enable-cups\ --disable-gnome-vfs\ --with-use-shell=bash\ --with-java=no\ --with-${_application_name}\ --disable-gtk\ --with-package-format=native\ --enable-presenter-console\ --with-system-jpeg\ --with-system-vigra\ --with-system-icu\ --with-system-hunspell\ --with-system-lpsolve\ --enable-presenter-extra-ui\ --with-system-jars=no\ --with-package-format=installed\ --without-stlport\ --with-system-zlib\ --with-system-boost\ --with-system-sane-header\ --enable-xrender-link\ --with-system-agg\ --with-system-redland\ --with-system-db if [ "$CARCH" = "x86_64" ]; then source LinuxX86-64Env.Set.sh else source LinuxX86Env.Set.sh fi
 * 1) Setup environment for build

./bootstrap ||return 1
 * 1) Build

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)"
 * 1) exploit all the processors
 * 2) automatic config : load each processor with 2 objects at a time


 * 1) manual config example :
 * 2) 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.

cd ${srcdir}/${_my_svnmod}/instsetoo_native perl $SOLARENV/bin/build.pl --all ${CUSTOM_DMAKE} || return 1 }

package_ooo4kids-base { pkgdesc="OpenOffice lightened, relooked for kids" install=('ooo4kids.install') provides=('ooo4kids') conflicts=('ooo4kids')

cd ${srcdir}/${_my_svnmod}/instsetoo_native/util mkdir -p ${pkgdir}/usr/lib LOCALINSTALLDIR=${pkgdir}/usr/lib dmake openoffice_en-US PKGFORMAT=installed


 * 1) This is a /opt/-style installation, correcting ##

cd ${pkgdir}/usr/lib mv ${_project} ${_projectname} cd ${pkgdir}/usr/lib/${_projectname} || return 1 mv ure basis${_projectver}/ || return 1 cd basis${_projectver} || return 1 rm ure-link && mv ure ure-link || return 1 cd ${pkgdir}/usr/lib/${_projectname}/ || return 1 rm basis-link && mv basis${_projectver} basis-link || return 1
 * 1) Replace symlinks with real folders
 * 2) Step 1
 * 1) Step 2

cd ${pkgdir}/usr/lib/${_projectname} || return 1

_destdir=${pkgdir}/usr/lib/${_projectname}/share mkdir -p ${_destdir}/icons/hicolor cd ${_destdir}/xdg
 * 1) .desktop files

sed -i -e "s|Exec=/usr/bin/${_project}-printeradmin|Exec=/usr/bin/spadmin|g" printeradmin.desktop || return 1 sed -i -e "s|${_project} -writer %U|${_projectname} -writer|g" writer.desktop || return 1 sed -i -e "s|${_project} -calc %U|${_projectname} -calc|g" calc.desktop || return 1 sed -i -e "s|${_project} -draw %U|${_projectname} -draw|g" draw.desktop || return 1 sed -i -e "s|${_project} -impress %U|${_projectname} -impress|g" impress.desktop || return 1 sed -i -e "s|${_project} -math %U|${_projectname} -math|g" math.desktop || return 1 sed -i -e "s|${_project}-printeradmin|${_projectname}-printeradmin|g" printeradmin.desktop || return 1 sed -i -e "s|${_project} %U|${_projectname}|g" ${_projectname}.desktop || return 1 sed -i -e "s|Icon=${_project_short}|Icon=${_project}|g" *.desktop || return 1
 * 1) fix exec commands and icon names

rm -f qstart.desktop
 * 1) remove quickstarter, we disabled it above

for _aFile in $(ls) ; do mv ${_aFile} ${_projectname}-${_aFile} done
 * 1) add _project to the name of *.desktop (avoiding OOo conflicts)

cd ${_destdir} mkdir -p ${pkgdir}/usr/share/applications mv ${_destdir}/xdg/*.desktop ${pkgdir}/usr/share/applications

mkdir -p ${pkgdir}/usr/share/icons
 * 1) install icons

for _icon in $(cd ${srcdir}/${_my_svnmod}/sysui/desktop/icons/hicolor; find ??x?? -name "*.png") do # only paths containing our app name are useful if test "x${_icon}" != "x${_icon/${_application_name}}" ; then # create the target dir _targetdir=${pkgdir}/usr/share/icons/hicolor/$(dirname ${_icon/${_application_name}}) mkdir -p ${_targetdir} # copy the icon _destfile=${_targetdir}/${_project:-}${_project:+-}$(basename ${_icon}) cp ${srcdir}/${_my_svnmod}/sysui/desktop/icons/hicolor/${_icon} $_destfile chmod 0644 $_destfile fi done

mkdir -p ${pkgdir}/usr/bin cd ${pkgdir}/usr/bin ln -sf ../lib/${_projectname}/program/soffice ${_projectname} ln -sf ../lib/${_projectname}/program/spadmin ${_projectname}-printeradmin
 * 1) make symlinks

sed -i 's|$SYSUSERCONFIG/.|$SYSUSERCONFIG/|' ${pkgdir}/usr/lib/${_projectname}/program/bootstraprc || return 1
 * 1) fix home config path s|~/.config/.appname|~/.config/appname|

rm -rf ${pkgdir}/usr/log
 * 1) remove logs

chmod -R 755 ${pkgdir}/usr/lib }
 * 1) Fix permissions

for _lang in ${_langs[*]};do eval 'package_'${_projectname}'-'"$_lang"' { depends=("'${_projectname}'-base") pkgdesc=("'"$_lang"' language pack for '${_projectname}'") provides=("'${_projectname}'-'"$_lang"'") conflicts=("'${_projectname}'-'"$_lang"'")

cd ${srcdir}/${_my_svnmod}/instsetoo_native/util mkdir -p ${pkgdir}/usr/lib LOCALINSTALLDIR=${pkgdir}/usr/lib dmake ooolanguagepack_'"$_lang"' PKGFORMAT=installed || return 1

# Adapt path mv ${pkgdir}/usr/lib/'${_project}' ${pkgdir}/usr/lib/'${_projectname}' cd ${pkgdir}/usr/lib/'${_projectname}' && mv basis'${_projectver}' basis-link

# Fix permissions chmod -R 755 ${pkgdir}/usr/lib }' done