#!/bin/sh # $Id$ # Copyright 2010, 2011 Eric Hameleers, Eindhoven, NL # All rights reserved. # # Permission to use, copy, modify, and distribute this software for # any purpose with or without fee is hereby granted, provided that # the above copyright notice and this permission notice appear in all # copies. # # THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. # IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF # USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # ----------------------------------------------------------------------------- # # Slackware SlackBuild script # =========================== # By: Eric Hameleers # For: libreoffice # Descr: free office suite # URL: http://www.documentfoundation.org/ # Needs: # Build-time: apache-ant,jdk,perl-archive-zip,xulrunner # (and removepkg seamonkey as well as seamonkey-solibs !) # Changelog: # 20101010-1: 10/oct/2010 by Eric Hameleers # * Initial build from git. I will refine this SlackBuild, once a # stable software version becomes available. # 20101012-1: 12/oct/2010 by Eric Hameleers # * Add the internal version number to the package name, # so that the package version will be like "3.2.99.2_20101012". # Remove the slack-required file, since this package has no # run-time dependencies any more. # 3.2.99.3-1: 21/nov/2010 by Eric Hameleers # * LibreOffice 3.3-beta3. # Fix permissions of LICENSE.odt file. # 3.2.99.3-2: 28/nov/2010 by Eric Hameleers # * Do not create a language pack for the default language. # Compile -without "-O2" - this seems to be required to stay # compatible with OOo extensions. # Use the correct location of apache-ant in Slackware.conf.in. # Make preparations for off-line build (the SlackBuild downloads # all sources first). # 3.3.0.1-1: 06/dec/2010 by Eric Hameleers # * Update to 3.3.0-rc1 # 3.3.0.2-1: 24/dec/2010 by Eric Hameleers # * Update to 3.3.0-rc2 # 3.3.0.3-1: 14/jan/2011 by Eric Hameleers # * Update to 3.3.0-rc3 # 3.3.0.3-2: 15/jan/2011 by Eric Hameleers # * Had to fix the menu entries (.desktop files) because the # program names changed (like oowriter -> lowriter). # 3.3.0.4-1: 21/jan/2011 by Eric Hameleers # * Updated to Release Candidate 4 of the upcoming 3.3.0. # 3.3.0-1: 25/jan/2011 by Eric Hameleers # * Release 3.3.0, the first ever LibreOffice after the split-off # from OpenOffice.org. In fact, this is the same code as the RC4. # I rebuilt it anyway because I promised to add a couple of # language packs. # 3.3.1-1: 24/feb/2011 by Eric Hameleers # * Update to new release 3.3.1, added more language packs. # Also this time, really add the dictionaries for some of the # major world languages. # 3.3.1-2: 04/mar/2011 by Eric Hameleers # * Not really a rebuild, but I uploaded the wrong 64bit packages, # and had to change the BUILD number for when I upload the # correct packages... # 3.3.2-1: 23/mar/2011 by Eric Hameleers # * Update to a new release. # The SlackBuild has been updated to use new LibreOffice menu # icons instead of the old OOo versions. # Also add italian dictionary (request). # 3.3.3-1: 18/jun/2011 by Eric Hameleers # * Another update in the "stable" 3.3.x series of releases. # The sources are identical to 3.3.3-rc1. # Added german dictionary (dict-de-DE_frami) and polish pl-dict # on request. Added bundled scripting extensions. # Stopped building from the 'build' tarball since that seems # to be deprecated soon. Stupid decision folks! It makes proper # packaging so much harder. # # Run 'sh libreoffice.SlackBuild' to build a Slackware package. # The package (.tgz) and .txt file as well as build logs are created in /tmp . # Install it using 'installpkg'. # # ----------------------------------------------------------------------------- # Set initial variables: PRGNAM=libreoffice BUILD=${BUILD:-1} TAG=${TAG:-alien} # SRCVER is the variable you control. It can be one of: # "HEAD" - in which case a new git # snapshot will be pulled, # "yyyymmdd" - like "20101126", if you downloaded a git snapshot before, or # "X.Y.Z" - like "3.2.99.3", meaning a release tarball is used. # ** # ** NOTE: the script may be broken for GIT builds at the moment! ** # ** #SRCVER=${SRCVER:-20101121} #SRCVER=${SRCVER:-HEAD} #SRCVER=${SRCVER:-3.3.0.4} SRCVER=${SRCVER:-3.3.3} SUBVER=".1" # If we pull a git shapshot, use today's date as the VERSION: # If we are building offline, we do not want git checks: if [ "$SRCVER" = "HEAD" ]; then VERSION=$(date +%Y%m%d) USE_GIT="yes" COMPR="xz" elif [ "$(echo $SRCVER |cut -c1,2)" = "20" ]; then VERSION=$SRCVER USE_GIT="yes" COMPR="xz" else VERSION=$SRCVER USE_GIT="no" COMPR="bz2" fi DOCS="AUTHORS COPYING* MAINTAINERS NEWS README* TODO" NUMCPUS=${NUMCPUS:-2} PACKAGER="Eric Hameleers" # Where do we look for sources? SRCDIR=$(cd $(dirname $0); pwd) # Select default langue for the libreoffice package: DEF_LANG=${DEF_LANG:-"en_US"} # If this variable is non-empty, we will build additional languuage packs; # otherwise LibreOffice will be built for one language, defined in DEF_LANG: # Note: # The languages plus their descriptive names are kept in an external file # called 'languages' in the same directory as the SlackBuild script. # Edit that file if you want to add more languages. # Note: # The packagenames use official language code like 'en_US' while LibreOffice # uses 'en-US'. # #ADD_LANGUAGES="" ADD_LANGUAGES="$(cat $SRCDIR/languages |grep -v "^#" |cut -f1 -d= |tr '\n' ' ' |tr -s ' ' |sed -e 's/ *$//')" # Place to build (TMP) package (PKG) and output (OUTPUT) the program: TMP=${TMP:-/tmp/build} PKG=$TMP/package-$PRGNAM OUTPUT=${OUTPUT:-/tmp} # Base resource locators for tarballs and snapshots # - if you are building from git snapshots, it is wise to point GITBASE to # a local directory where you keep clones of the remote repositories: SRCBASE="http://download.documentfoundation.org/libreoffice/src" GITBASE="git://anongit.freedesktop.org/git/libreoffice" # Core components of LibreOffice (downloaded or checked-out) are: # artwork base bootstrap build calc components extras filters help # impress libs-gui libs-core libs-extern postprocess sdk testing # ure writer libs-extern-sys extensions l10n # We will need the "build" tarball first. # Use SRCURL for tarball releases and GITURI for git snapshots: SOURCE[0]="$SRCDIR/sources33/libreoffice-build-${VERSION}${SUBVER}.tar.gz" SRCURL[0]="$SRCBASE/libreoffice-build-${VERSION}${SUBVER}.tar.gz" GITURI[0]="$GITBASE/build" # And the rest... SOURCE[1]="$SRCDIR/sources33/libreoffice-artwork-${VERSION}${SUBVER}.tar.${COMPR}" SRCURL[1]="$SRCBASE/libreoffice-artwork-${VERSION}${SUBVER}.tar.${COMPR}" GITURI[1]="$GITBASE/artwork" SOURCE[2]="$SRCDIR/sources33/libreoffice-base-${VERSION}${SUBVER}.tar.${COMPR}" SRCURL[2]="$SRCBASE/libreoffice-base-${VERSION}${SUBVER}.tar.${COMPR}" GITURI[2]="$GITBASE/base" SOURCE[3]="$SRCDIR/sources33/libreoffice-bootstrap-${VERSION}${SUBVER}.tar.${COMPR}" SRCURL[3]="$SRCBASE/libreoffice-bootstrap-${VERSION}${SUBVER}.tar.${COMPR}" GITURI[3]="$GITBASE/bootstrap" SOURCE[4]="$SRCDIR/sources33/libreoffice-calc-${VERSION}${SUBVER}.tar.${COMPR}" SRCURL[4]="$SRCBASE/libreoffice-calc-${VERSION}${SUBVER}.tar.${COMPR}" GITURI[4]="$GITBASE/calc" SOURCE[5]="$SRCDIR/sources33/libreoffice-components-${VERSION}${SUBVER}.tar.${COMPR}" SRCURL[5]="$SRCBASE/libreoffice-components-${VERSION}${SUBVER}.tar.${COMPR}" GITURI[5]="$GITBASE/components" SOURCE[6]="$SRCDIR/sources33/libreoffice-extras-${VERSION}${SUBVER}.tar.${COMPR}" SRCURL[6]="$SRCBASE/libreoffice-extras-${VERSION}${SUBVER}.tar.${COMPR}" GITURI[6]="$GITBASE/extras" SOURCE[7]="$SRCDIR/sources33/libreoffice-filters-${VERSION}${SUBVER}.tar.${COMPR}" SRCURL[7]="$SRCBASE/libreoffice-filters-${VERSION}${SUBVER}.tar.${COMPR}" GITURI[7]="$GITBASE/filters" SOURCE[8]="$SRCDIR/sources33/libreoffice-help-${VERSION}${SUBVER}.tar.${COMPR}" SRCURL[8]="$SRCBASE/libreoffice-help-${VERSION}${SUBVER}.tar.${COMPR}" GITURI[8]="$GITBASE/help" SOURCE[9]="$SRCDIR/sources33/libreoffice-impress-${VERSION}${SUBVER}.tar.${COMPR}" SRCURL[9]="$SRCBASE/libreoffice-impress-${VERSION}${SUBVER}.tar.${COMPR}" GITURI[9]="$GITBASE/impress" SOURCE[10]="$SRCDIR/sources33/libreoffice-libs-gui-${VERSION}${SUBVER}.tar.${COMPR}" SRCURL[10]="$SRCBASE/libreoffice-libs-gui-${VERSION}${SUBVER}.tar.${COMPR}" GITURI[10]="$GITBASE/libs-gui" SOURCE[11]="$SRCDIR/sources33/libreoffice-libs-core-${VERSION}${SUBVER}.tar.${COMPR}" SRCURL[11]="$SRCBASE/libreoffice-libs-core-${VERSION}${SUBVER}.tar.${COMPR}" GITURI[11]="$GITBASE/libs-core" SOURCE[12]="$SRCDIR/sources33/libreoffice-libs-extern-${VERSION}${SUBVER}.tar.${COMPR}" SRCURL[12]="$SRCBASE/libreoffice-libs-extern-${VERSION}${SUBVER}.tar.${COMPR}" GITURI[12]="$GITBASE/libs-extern" SOURCE[13]="$SRCDIR/sources33/libreoffice-postprocess-${VERSION}${SUBVER}.tar.${COMPR}" SRCURL[13]="$SRCBASE/libreoffice-postprocess-${VERSION}${SUBVER}.tar.${COMPR}" GITURI[13]="$GITBASE/postprocess" SOURCE[14]="$SRCDIR/sources33/libreoffice-sdk-${VERSION}${SUBVER}.tar.${COMPR}" SRCURL[14]="$SRCBASE/libreoffice-sdk-${VERSION}${SUBVER}.tar.${COMPR}" GITURI[14]="$GITBASE/sdk" SOURCE[15]="$SRCDIR/sources33/libreoffice-testing-${VERSION}${SUBVER}.tar.${COMPR}" SRCURL[15]="$SRCBASE/libreoffice-testing-${VERSION}${SUBVER}.tar.${COMPR}" GITURI[15]="$GITBASE/testing" SOURCE[16]="$SRCDIR/sources33/libreoffice-ure-${VERSION}${SUBVER}.tar.${COMPR}" SRCURL[16]="$SRCBASE/libreoffice-ure-${VERSION}${SUBVER}.tar.${COMPR}" GITURI[16]="$GITBASE/ure" SOURCE[17]="$SRCDIR/sources33/libreoffice-writer-${VERSION}${SUBVER}.tar.${COMPR}" SRCURL[17]="$SRCBASE/libreoffice-writer-${VERSION}${SUBVER}.tar.${COMPR}" GITURI[17]="$GITBASE/writer" SOURCE[18]="$SRCDIR/sources33/libreoffice-libs-extern-sys-${VERSION}${SUBVER}.tar.${COMPR}" SRCURL[18]="$SRCBASE/libreoffice-libs-extern-sys-${VERSION}${SUBVER}.tar.${COMPR}" GITURI[18]="$GITBASE/libs-extern-sys" SOURCE[19]="$SRCDIR/sources33/libreoffice-extensions-${VERSION}${SUBVER}.tar.${COMPR}" SRCURL[19]="$SRCBASE/libreoffice-extensions-${VERSION}${SUBVER}.tar.${COMPR}" GITURI[19]="$GITBASE/extensions" SOURCE[20]="$SRCDIR/sources33/libreoffice-l10n-${VERSION}${SUBVER}.tar.${COMPR}" SRCURL[20]="$SRCBASE/libreoffice-l10n-${VERSION}${SUBVER}.tar.${COMPR}" GITURI[20]="$GITBASE/l10n" # Extra libraries / binaries required to build LibreOffice from source: SOURCE[21]="$SRCDIR/sources33/ooo-cli-prebuilt-3.3.tar.bz2" SRCURL[21]="http://download.go-oo.org//DEV300/ooo-cli-prebuilt-3.3.tar.bz2" SOURCE[22]="$SRCDIR/sources33/cairo-1.4.10.tar.gz" SRCURL[22]="http://cairographics.org/releases//cairo-1.4.10.tar.gz" SOURCE[23]="$SRCDIR/sources33/mdbtools-0.6pre1.tar.gz" SRCURL[23]="http://download.go-oo.org//SRC680/mdbtools-0.6pre1.tar.gz" # Gzipped archive erroneously named .bz2 : SOURCE[24]="$SRCDIR/sources33/extras-3.1.tar.gz" SRCURL[24]="http://download.go-oo.org//SRC680/extras-3.1.tar.bz2" SOURCE[25]="$SRCDIR/sources33/biblio.tar.bz2" SRCURL[25]="http://download.go-oo.org//SRC680/biblio.tar.bz2" # Further tarballs of which I am not sure which one are really needed. # The list can be obtained by running ($VERSION being an actual git tag): # "http://cgit.freedesktop.org/libreoffice/bootstrap/plain/ooo.lst?id=$(echo $PRGNAM-$VERSION)" # # A quick way to find if the array needs editing is to run this command # (it should output nothing): # for FILE in `wget -q -O - "http://cgit.freedesktop.org/libreoffice/bootstrap/plain/ooo.lst?id=$(echo $PRGNAM-$VERSION)" | grep -v "^http://"` ; do if [ ! -f sources33/$FILE ]; then echo $FILE; fi ; done; # SOURCE[26]="$SRCDIR/sources33/63ddc5116488985e820075e65fbe6aa4-openssl-0.9.8o.tar.gz" SRCURL[26]="http://hg.services.openoffice.org/binaries/63ddc5116488985e820075e65fbe6aa4-openssl-0.9.8o.tar.gz" SOURCE[27]="$SRCDIR/sources33/09357cc74975b01714e00c5899ea1881-pixman-0.12.0.tar.gz" SRCURL[27]="http://hg.services.openoffice.org/binaries/09357cc74975b01714e00c5899ea1881-pixman-0.12.0.tar.gz" SOURCE[28]="$SRCDIR/sources33/0b49ede71c21c0599b0cc19b353a6cb3-README_apache-commons.txt" SRCURL[28]="http://hg.services.openoffice.org/binaries/0b49ede71c21c0599b0cc19b353a6cb3-README_apache-commons.txt" SOURCE[29]="$SRCDIR/sources33/68dd2e8253d9a7930e9fd50e2d7220d0-hunspell-1.2.9.tar.gz" SRCURL[29]="http://hg.services.openoffice.org/binaries/68dd2e8253d9a7930e9fd50e2d7220d0-hunspell-1.2.9.tar.gz" SOURCE[30]="$SRCDIR/sources33/128cfc86ed5953e57fe0f5ae98b62c2e-libtextcat-2.2.tar.gz" SRCURL[30]="http://hg.services.openoffice.org/binaries/128cfc86ed5953e57fe0f5ae98b62c2e-libtextcat-2.2.tar.gz" SOURCE[31]="$SRCDIR/sources33/17410483b5b5f267aa18b7e00b65e6e0-hsqldb_1_8_0.zip" SRCURL[31]="http://hg.services.openoffice.org/binaries/17410483b5b5f267aa18b7e00b65e6e0-hsqldb_1_8_0.zip" SOURCE[32]="$SRCDIR/sources33/1756c4fa6c616ae15973c104cd8cb256-Adobe-Core35_AFMs-314.tar.gz" SRCURL[32]="http://hg.services.openoffice.org/binaries/1756c4fa6c616ae15973c104cd8cb256-Adobe-Core35_AFMs-314.tar.gz" SOURCE[33]="$SRCDIR/sources33/18f577b374d60b3c760a3a3350407632-STLport-4.5.tar.gz" SRCURL[33]="http://hg.services.openoffice.org/binaries/18f577b374d60b3c760a3a3350407632-STLport-4.5.tar.gz" SOURCE[34]="$SRCDIR/sources33/1f24ab1d39f4a51faf22244c94a6203f-xmlsec1-1.2.14.tar.gz" SRCURL[34]="http://hg.services.openoffice.org/binaries/1f24ab1d39f4a51faf22244c94a6203f-xmlsec1-1.2.14.tar.gz" SOURCE[35]="$SRCDIR/sources33/24be19595acad0a2cae931af77a0148a-LICENSE_source-9.0.0.7-bj.html" SRCURL[35]="http://hg.services.openoffice.org/binaries/24be19595acad0a2cae931af77a0148a-LICENSE_source-9.0.0.7-bj.html" SOURCE[36]="$SRCDIR/sources33/26b3e95ddf3d9c077c480ea45874b3b8-lp_solve_5.5.tar.gz" SRCURL[36]="http://hg.services.openoffice.org/binaries/26b3e95ddf3d9c077c480ea45874b3b8-lp_solve_5.5.tar.gz" SOURCE[37]="$SRCDIR/sources33/284e768eeda0e2898b0d5bf7e26a016e-raptor-1.4.18.tar.gz" SRCURL[37]="http://hg.services.openoffice.org/binaries/284e768eeda0e2898b0d5bf7e26a016e-raptor-1.4.18.tar.gz" SOURCE[38]="$SRCDIR/sources33/2a177023f9ea8ec8bd00837605c5df1b-jakarta-tomcat-5.0.30-src.tar.gz" SRCURL[38]="http://hg.services.openoffice.org/binaries/2a177023f9ea8ec8bd00837605c5df1b-jakarta-tomcat-5.0.30-src.tar.gz" SOURCE[39]="$SRCDIR/sources33/2ae988b339daec234019a7066f96733e-commons-lang-2.3-src.tar.gz" SRCURL[39]="http://hg.services.openoffice.org/binaries/2ae988b339daec234019a7066f96733e-commons-lang-2.3-src.tar.gz" SOURCE[40]="$SRCDIR/sources33/2c9b0f83ed5890af02c0df1c1776f39b-commons-httpclient-3.1-src.tar.gz" SRCURL[40]="http://hg.services.openoffice.org/binaries/2c9b0f83ed5890af02c0df1c1776f39b-commons-httpclient-3.1-src.tar.gz" SOURCE[41]="$SRCDIR/sources33/2f6ecca935948f7db92d925d88d0d078-icu4c-4_0_1-src.tgz" SRCURL[41]="http://hg.services.openoffice.org/binaries/2f6ecca935948f7db92d925d88d0d078-icu4c-4_0_1-src.tgz" SOURCE[42]="$SRCDIR/sources33/ca4870d899fd7e943ffc310a5421ad4d-liberation-fonts-ttf-1.06.0.20100721.tar.gz" SRCURL[42]="http://hg.services.openoffice.org/binaries/ca4870d899fd7e943ffc310a5421ad4d-liberation-fonts-ttf-1.06.0.20100721.tar.gz" SOURCE[43]="$SRCDIR/sources33/35c94d2df8893241173de1d16b6034c0-swingExSrc.zip" SRCURL[43]="http://hg.services.openoffice.org/binaries/35c94d2df8893241173de1d16b6034c0-swingExSrc.zip" SOURCE[44]="$SRCDIR/sources33/35efabc239af896dfb79be7ebdd6e6b9-gentiumbasic-fonts-1.10.zip" SRCURL[44]="http://hg.services.openoffice.org/binaries/35efabc239af896dfb79be7ebdd6e6b9-gentiumbasic-fonts-1.10.zip" SOURCE[45]="$SRCDIR/sources33/377a60170e5185eb63d3ed2fae98e621-README_silgraphite-2.3.1.txt" SRCURL[45]="http://hg.services.openoffice.org/binaries/377a60170e5185eb63d3ed2fae98e621-README_silgraphite-2.3.1.txt" SOURCE[46]="$SRCDIR/sources33/39bb3fcea1514f1369fcfc87542390fd-sacjava-1.3.zip" SRCURL[46]="http://hg.services.openoffice.org/binaries/39bb3fcea1514f1369fcfc87542390fd-sacjava-1.3.zip" SOURCE[47]="$SRCDIR/sources33/3ade8cfe7e59ca8e65052644fed9fca4-epm-3.7.tar.gz" SRCURL[47]="http://hg.services.openoffice.org/binaries/3ade8cfe7e59ca8e65052644fed9fca4-epm-3.7.tar.gz" SOURCE[48]="$SRCDIR/sources33/3c219630e4302863a9a83d0efde889db-commons-logging-1.1.1-src.tar.gz" SRCURL[48]="http://hg.services.openoffice.org/binaries/3c219630e4302863a9a83d0efde889db-commons-logging-1.1.1-src.tar.gz" SOURCE[49]="$SRCDIR/sources33/48470d662650c3c074e1c3fabbc67bbd-README_source-9.0.0.7-bj.txt" SRCURL[49]="http://hg.services.openoffice.org/binaries/48470d662650c3c074e1c3fabbc67bbd-README_source-9.0.0.7-bj.txt" SOURCE[50]="$SRCDIR/sources33/48d8169acc35f97e05d8dcdfd45be7f2-lucene-2.3.2.tar.gz" SRCURL[50]="http://hg.services.openoffice.org/binaries/48d8169acc35f97e05d8dcdfd45be7f2-lucene-2.3.2.tar.gz" SOURCE[51]="$SRCDIR/sources33/4a660ce8466c9df01f19036435425c3a-glibc-2.1.3-stub.tar.gz" SRCURL[51]="http://hg.services.openoffice.org/binaries/4a660ce8466c9df01f19036435425c3a-glibc-2.1.3-stub.tar.gz" SOURCE[52]="$SRCDIR/sources33/4ea70ea87b47e92d318d4e7f5b940f47-cairo-1.8.0.tar.gz" SRCURL[52]="http://hg.services.openoffice.org/binaries/4ea70ea87b47e92d318d4e7f5b940f47-cairo-1.8.0.tar.gz" SOURCE[53]="$SRCDIR/sources33/599dc4cc65a07ee868cf92a667a913d2-xpdf-3.02.tar.gz" SRCURL[53]="http://hg.services.openoffice.org/binaries/599dc4cc65a07ee868cf92a667a913d2-xpdf-3.02.tar.gz" SOURCE[54]="$SRCDIR/sources33/5aba06ede2daa9f2c11892fbd7bc3057-libserializer.zip" SRCURL[54]="http://hg.services.openoffice.org/binaries/5aba06ede2daa9f2c11892fbd7bc3057-libserializer.zip" SOURCE[55]="$SRCDIR/sources33/67b42915c8432abf0a922438f00860a2-libxml.zip" SRCURL[55]="http://hg.services.openoffice.org/binaries/67b42915c8432abf0a922438f00860a2-libxml.zip" SOURCE[56]="$SRCDIR/sources33/7740a8ec23878a2f50120e1faa2730f2-libxml2-2.7.6.tar.gz" SRCURL[56]="http://hg.services.openoffice.org/binaries/7740a8ec23878a2f50120e1faa2730f2-libxml2-2.7.6.tar.gz" SOURCE[57]="$SRCDIR/sources33/7376930b0d3f3d77a685d94c4a3acda8-STLport-4.5-0119.tar.gz" SRCURL[57]="http://hg.services.openoffice.org/binaries/7376930b0d3f3d77a685d94c4a3acda8-STLport-4.5-0119.tar.gz" SOURCE[58]="$SRCDIR/sources33/79600e696a98ff95c2eba976f7a8dfbb-liblayout.zip" SRCURL[58]="http://hg.services.openoffice.org/binaries/79600e696a98ff95c2eba976f7a8dfbb-liblayout.zip" SOURCE[59]="$SRCDIR/sources33/798b2ffdc8bcfe7bca2cf92b62caf685-rhino1_5R5.zip" SRCURL[59]="http://hg.services.openoffice.org/binaries/798b2ffdc8bcfe7bca2cf92b62caf685-rhino1_5R5.zip" SOURCE[60]="$SRCDIR/sources33/ecb2e37e45c9933e2a963cabe03670ab-curl-7.19.7.tar.gz" SRCURL[60]="http://hg.services.openoffice.org/binaries/ecb2e37e45c9933e2a963cabe03670ab-curl-7.19.7.tar.gz" SOURCE[61]="$SRCDIR/sources33/8294d6c42e3553229af9934c5c0ed997-stax-api-1.0-2-sources.jar" SRCURL[61]="http://hg.services.openoffice.org/binaries/8294d6c42e3553229af9934c5c0ed997-stax-api-1.0-2-sources.jar" SOURCE[62]="$SRCDIR/sources33/8ea307d71d11140574bfb9fcc2487e33-libbase.zip" SRCURL[62]="http://hg.services.openoffice.org/binaries/8ea307d71d11140574bfb9fcc2487e33-libbase.zip" SOURCE[63]="$SRCDIR/sources33/bd30e9cf5523cdfc019b94f5e1d7fd19-cppunit-1.12.1.tar.gz" SRCURL[63]="http://hg.services.openoffice.org/binaries/bd30e9cf5523cdfc019b94f5e1d7fd19-cppunit-1.12.1.tar.gz" SOURCE[64]="$SRCDIR/sources33/a06a496d7a43cbdc35e69dbe678efadb-libloader.zip" SRCURL[64]="http://hg.services.openoffice.org/binaries/a06a496d7a43cbdc35e69dbe678efadb-libloader.zip" SOURCE[65]="$SRCDIR/sources33/a169ab152209200a7bad29a275cb0333-seamonkey-1.1.14.source.tar.gz" SRCURL[65]="http://hg.services.openoffice.org/binaries/a169ab152209200a7bad29a275cb0333-seamonkey-1.1.14.source.tar.gz" SOURCE[66]="$SRCDIR/sources33/a4d9b30810a434a3ed39fc0003bbd637-LICENSE_stax-api-1.0-2-sources.html" SRCURL[66]="http://hg.services.openoffice.org/binaries/a4d9b30810a434a3ed39fc0003bbd637-LICENSE_stax-api-1.0-2-sources.html" SOURCE[67]="$SRCDIR/sources33/a7983f859eafb2677d7ff386a023bc40-xsltml_2.1.2.zip" SRCURL[67]="http://hg.services.openoffice.org/binaries/a7983f859eafb2677d7ff386a023bc40-xsltml_2.1.2.zip" SOURCE[68]="$SRCDIR/sources33/ada24d37d8d638b3d8a9985e80bc2978-source-9.0.0.7-bj.zip" SRCURL[68]="http://hg.services.openoffice.org/binaries/ada24d37d8d638b3d8a9985e80bc2978-source-9.0.0.7-bj.zip" SOURCE[69]="$SRCDIR/sources33/af3c3acf618de6108d65fcdc92b492e1-commons-codec-1.3-src.tar.gz" SRCURL[69]="http://hg.services.openoffice.org/binaries/af3c3acf618de6108d65fcdc92b492e1-commons-codec-1.3-src.tar.gz" SOURCE[70]="$SRCDIR/sources33/ba1015b59c112d44d7797b62fe7bee51-neon-0.29.3.tar.gz" SRCURL[70]="http://hg.services.openoffice.org/binaries/ba1015b59c112d44d7797b62fe7bee51-neon-0.29.3.tar.gz" SOURCE[71]="$SRCDIR/sources33/bc702168a2af16869201dbe91e46ae48-LICENSE_Python-2.6.1" SRCURL[71]="http://hg.services.openoffice.org/binaries/bc702168a2af16869201dbe91e46ae48-LICENSE_Python-2.6.1" SOURCE[72]="$SRCDIR/sources33/c441926f3a552ed3e5b274b62e86af16-STLport-4.0.tar.gz" SRCURL[72]="http://hg.services.openoffice.org/binaries/c441926f3a552ed3e5b274b62e86af16-STLport-4.0.tar.gz" SOURCE[73]="$SRCDIR/sources33/ca66e26082cab8bb817185a116db809b-redland-1.0.8.tar.gz" SRCURL[73]="http://hg.services.openoffice.org/binaries/ca66e26082cab8bb817185a116db809b-redland-1.0.8.tar.gz" SOURCE[74]="$SRCDIR/sources33/d0b5af6e408b8d2958f3d83b5244f5e8-hyphen-2.4.tar.gz" SRCURL[74]="http://hg.services.openoffice.org/binaries/d0b5af6e408b8d2958f3d83b5244f5e8-hyphen-2.4.tar.gz" SOURCE[75]="$SRCDIR/sources33/d1a3205871c3c52e8a50c9f18510ae12-libformula.zip" SRCURL[75]="http://hg.services.openoffice.org/binaries/d1a3205871c3c52e8a50c9f18510ae12-libformula.zip" SOURCE[76]="$SRCDIR/sources33/d35724900f6a4105550293686688bbb3-silgraphite-2.3.1.tar.gz" SRCURL[76]="http://hg.services.openoffice.org/binaries/d35724900f6a4105550293686688bbb3-silgraphite-2.3.1.tar.gz" SOURCE[77]="$SRCDIR/sources33/d4c4d91ab3a8e52a2e69d48d34ef4df4-core.zip" SRCURL[77]="http://hg.services.openoffice.org/binaries/d4c4d91ab3a8e52a2e69d48d34ef4df4-core.zip" SOURCE[78]="$SRCDIR/sources33/d70951c80dabecc2892c919ff5d07172-db-4.7.25.NC-custom.tar.gz" SRCURL[78]="http://hg.services.openoffice.org/binaries/d70951c80dabecc2892c919ff5d07172-db-4.7.25.NC-custom.tar.gz" SOURCE[79]="$SRCDIR/sources33/dbb3757275dc5cc80820c0b4dd24ed95-librepository.zip" SRCURL[79]="http://hg.services.openoffice.org/binaries/dbb3757275dc5cc80820c0b4dd24ed95-librepository.zip" SOURCE[80]="$SRCDIR/sources33/dbd5f3b47ed13132f04c685d608a7547-jpeg-6b.tar.gz" SRCURL[80]="http://hg.services.openoffice.org/binaries/dbd5f3b47ed13132f04c685d608a7547-jpeg-6b.tar.gz" SOURCE[81]="$SRCDIR/sources33/e0707ff896045731ff99e99799606441-README_db-4.7.25.NC-custom.txt" SRCURL[81]="http://hg.services.openoffice.org/binaries/e0707ff896045731ff99e99799606441-README_db-4.7.25.NC-custom.txt" SOURCE[82]="$SRCDIR/sources33/e81c2f0953aa60f8062c05a4673f2be0-Python-2.6.1.tar.bz2" SRCURL[82]="http://hg.services.openoffice.org/binaries/e81c2f0953aa60f8062c05a4673f2be0-Python-2.6.1.tar.bz2" SOURCE[83]="$SRCDIR/sources33/e61d0364a30146aaa3001296f853b2b9-libxslt-1.1.26.tar.gz" SRCURL[83]="http://hg.services.openoffice.org/binaries/e61d0364a30146aaa3001296f853b2b9-libxslt-1.1.26.tar.gz" SOURCE[84]="$SRCDIR/sources33/ea570af93c284aa9e5621cd563f54f4d-bsh-2.0b1-src.tar.gz" SRCURL[84]="http://hg.services.openoffice.org/binaries/ea570af93c284aa9e5621cd563f54f4d-bsh-2.0b1-src.tar.gz" SOURCE[85]="$SRCDIR/sources33/ea91f2fb4212a21d708aced277e6e85a-vigra1.4.0.tar.gz" SRCURL[85]="http://hg.services.openoffice.org/binaries/ea91f2fb4212a21d708aced277e6e85a-vigra1.4.0.tar.gz" SOURCE[86]="$SRCDIR/sources33/ee8b492592568805593f81f8cdf2a04c-expat-2.0.1.tar.gz" SRCURL[86]="http://hg.services.openoffice.org/binaries/ee8b492592568805593f81f8cdf2a04c-expat-2.0.1.tar.gz" SOURCE[87]="$SRCDIR/sources33/f3e2febd267c8e4b13df00dac211dd6d-flute.zip" SRCURL[87]="http://hg.services.openoffice.org/binaries/f3e2febd267c8e4b13df00dac211dd6d-flute.zip" SOURCE[88]="$SRCDIR/sources33/f7925ba8491fe570e5164d2c72791358-libfonts.zip" SRCURL[88]="http://hg.services.openoffice.org/binaries/f7925ba8491fe570e5164d2c72791358-libfonts.zip" SOURCE[89]="$SRCDIR/sources33/fb7ba5c2182be4e73748859967455455-README_stax-api-1.0-2-sources.txt" SRCURL[89]="http://hg.services.openoffice.org/binaries/fb7ba5c2182be4e73748859967455455-README_stax-api-1.0-2-sources.txt" SOURCE[90]="$SRCDIR/sources33/fca8706f2c4619e2fa3f8f42f8fc1e9d-rasqal-0.9.16.tar.gz" SRCURL[90]="http://hg.services.openoffice.org/binaries/fca8706f2c4619e2fa3f8f42f8fc1e9d-rasqal-0.9.16.tar.gz" SOURCE[91]="$SRCDIR/sources33/fcc6df1160753d0b8c835d17fdeeb0a7-boost_1_39_0.tar.gz" SRCURL[91]="http://hg.services.openoffice.org/binaries/fcc6df1160753d0b8c835d17fdeeb0a7-boost_1_39_0.tar.gz" SOURCE[92]="$SRCDIR/sources33/fdb27bfe2dbe2e7b57ae194d9bf36bab-SampleICC-1.3.2.tar.gz" SRCURL[92]="http://hg.services.openoffice.org/binaries/fdb27bfe2dbe2e7b57ae194d9bf36bab-SampleICC-1.3.2.tar.gz" SOURCE[93]="$SRCDIR/sources33/37282537d0ed1a087b1c8f050dc812d9-dejavu-fonts-ttf-2.32.zip" SRCURL[93]="http://hg.services.openoffice.org/binaries/37282537d0ed1a087b1c8f050dc812d9-dejavu-fonts-ttf-2.32.zip" SOURCE[94]="$SRCDIR/sources33/831126a1ee5af269923cfab6050769fe-mysql-connector-cpp.zip" SRCURL[94]="http://hg.services.openoffice.org/binaries/831126a1ee5af269923cfab6050769fe-mysql-connector-cpp.zip" SOURCE[95]="$SRCDIR/sources33/067201ea8b126597670b5eff72e1f66c-mythes-1.2.0.tar.gz" SRCURL[95]="http://hg.services.openoffice.org/binaries/067201ea8b126597670b5eff72e1f66c-mythes-1.2.0.tar.gz" SOURCE[96]="$SRCDIR/sources33/cf8a6967f7de535ae257fa411c98eb88-mdds_0.3.0.tar.bz2" SRCURL[96]="http://hg.services.openoffice.org/binaries/cf8a6967f7de535ae257fa411c98eb88-mdds_0.3.0.tar.bz2" SOURCE[97]="$SRCDIR/sources33/47e1edaa44269bc537ae8cabebb0f638-JLanguageTool-1.0.0.tar.bz2" SRCURL[97]="http://download.go-oo.org/src/47e1edaa44269bc537ae8cabebb0f638-JLanguageTool-1.0.0.tar.bz2" SOURCE[98]="$SRCDIR/sources33/90401bca927835b6fbae4a707ed187c8-nlpsolver-0.9.tar.bz2" SRCURL[98]="http://download.go-oo.org/src/90401bca927835b6fbae4a707ed187c8-nlpsolver-0.9.tar.bz2" SOURCE[99]="$SRCDIR/sources33/debc62758716a169df9f62e6ab2bc634-zlib-1.2.3.tar.gz" SRCURL[99]="http://download.go-oo.org/src/debc62758716a169df9f62e6ab2bc634-zlib-1.2.3.tar.gz" SOURCE[100]="$SRCDIR/sources33/e3738abd0d3ce1870dc1fd1f22bba5b1-icu4c-4_2_1-src.tgz" SRCURL[100]="http://download.go-oo.org/src/e3738abd0d3ce1870dc1fd1f22bba5b1-icu4c-4_2_1-src.tgz" SOURCE[101]="$SRCDIR/sources33/0f63ee487fda8f21fafa767b3c447ac9-ixion-0.2.0.tar.gz" SRCURL[101]="http://download.go-oo.org/src/0f63ee487fda8f21fafa767b3c447ac9-ixion-0.2.0.tar.gz" SOURCE[102]="$SRCDIR/sources33/71474203939fafbe271e1263e61d083e-nss-3.12.8-with-nspr-4.8.6.tar.gz" SRCURL[102]="http://download.go-oo.org/src/71474203939fafbe271e1263e61d083e-nss-3.12.8-with-nspr-4.8.6.tar.gz" SOURCE[103]="$SRCDIR/sources33/5ba6a61a2f66dfd5fee8cdd4cd262a37-libwpg-0.2.0.tar.bz2" SRCURL[103]="http://download.go-oo.org/src/5ba6a61a2f66dfd5fee8cdd4cd262a37-libwpg-0.2.0.tar.bz2" SOURCE[104]="$SRCDIR/sources33/5ff846847dab351604ad859e2fd4ed3c-libwpd-0.9.1.tar.bz2" SRCURL[104]="http://download.go-oo.org/src/5ff846847dab351604ad859e2fd4ed3c-libwpd-0.9.1.tar.bz2" SOURCE[105]="$SRCDIR/sources33/9e436bff44c60dc8b97cba0c7fc11a5c-libwps-0.2.0.tar.bz2" SRCURL[105]="http://download.go-oo.org/src/9e436bff44c60dc8b97cba0c7fc11a5c-libwps-0.2.0.tar.bz2" SOURCE[106]="$SRCDIR/sources33/185d60944ea767075d27247c3162b3bc-unowinreg.dll" SRCURL[106]="http://download.go-oo.org/extern/185d60944ea767075d27247c3162b3bc-unowinreg.dll" SOURCE[107]="$SRCDIR/sources33/881af2b7dca9b8259abbca00bbbc004d-LinLibertineG-20110101.zip" SRCURL[107]="http://www.numbertext.org/linux/881af2b7dca9b8259abbca00bbbc004d-LinLibertineG-20110101.zip" # Two files that are used to determine what needs to be downloaded: SOURCE[108]="$SRCDIR/sources33/ooo.lst-${VERSION}${SUBVER}" SRCURL[108]="http://cgit.freedesktop.org/libreoffice/bootstrap/plain/ooo.lst?id=libreoffice-${VERSION}${SUBVER}" SOURCE[109]="$SRCDIR/sources33/fetch_tarballs.sh-${VERSION}${SUBVER}" SRCURL[109]="http://cgit.freedesktop.org/libreoffice/bootstrap/plain/fetch_tarballs.sh?id=libreoffice-${VERSION}${SUBVER}" # Additional dictionaries I'd like to have installed: SOURCE[110]="$SRCDIR/sources33/dict-en-US.oxt" SRCURL[110]="http://extensions.services.openoffice.org/e-files/1470/1/en_US.oxt" SOURCE[111]="$SRCDIR/sources33/dict-en-GB.oxt" SRCURL[111]="http://numbertext.org/tmp/dict-en.oxt" SOURCE[112]="$SRCDIR/sources33/dict-es.oxt" SRCURL[112]="http://extensions.services.openoffice.org/e-files/1639/1/es_ANY.oxt" SOURCE[113]="$SRCDIR/sources33/dict-fr.oxt" SRCURL[113]="http://extensions.services.openoffice.org/e-files/3554/3/ooo-dictionnaire-fr-moderne-v4.0.oxt" SOURCE[114]="$SRCDIR/sources33/dict-nl.oxt" SRCURL[114]="http://extensions.services.openoffice.org/e-files/1456/6/nl-dict-v2.00g.oxt" SOURCE[115]="$SRCDIR/sources33/dict-it.oxt" SRCURL[115]="http://extensions.services.openoffice.org/e-files/1064/0/dict-it-IT_and_Latin_2010-08-23.oxt" SOURCE[116]="$SRCDIR/sources33/dict-de.oxt" SRCURL[116]="http://extensions.services.openoffice.org/e-files/1075/8/dict-de_DE-frami_2010-12-04.oxt" SOURCE[117]="$SRCDIR/sources33/pl-dict.oxt" SRCURL[117]="http://extensions.services.openoffice.org/e-files/806/4/pl-dict.oxt" # Use the src_checkout() function if no downloadable tarball exists. # This function checks out sources from SVN/CVS and creates a tarball of them. src_checkout() { # Param #1 : index in the SOURCE[] array. # Param #2 : full path to where SOURCE[$1] tarball should be created. # Determine the tarball extension: PEXT=$(echo "${2}" | sed -r -e 's/.*[^.].(tar.xz|tar.gz|tar.bz2|tgz).*/\1/') case "$PEXT" in "tar.xz") TARCOMP="J" ;; "tar.gz") TARCOMP="z" ;; "tgz") TARCOMP="z" ;; "tar.bz2") TARCOMP="j" ;; *) echo "Archive can only have extension 'tar.xz', '.tar.gz' '.tar.bz2' or '.tgz'" ; exit 1 ;; esac # Determine the directory name to create for the archive root: PBASE=$(basename ${2} .${PEXT}) # Determine the directory where we create our checkout: CODIR=$(dirname ${2}) # LibreOffice checkout from git: BRANCH=${BRANCH[$1]:-master} # Checkout code from a certain branch and/or date; this will take a # long time because we have to clone the complete git-repository first: echo "Checking out $BRANCH at date $VERSION from '${GITURI[$1]}':" RETDIR=$(pwd) mkdir -p $CODIR/libreoffice_temp_checkout_$$ \ && cd $CODIR/libreoffice_temp_checkout_$$ if [ "$SRCVER" != "HEAD" ]; then git clone ${GITURI[$1]} ${PBASE} cd ${PBASE} # Differentiate between a git release tag and a snapshot date: if [ "$(echo $VERSION |cut -c1,2)" = "20" ]; then git checkout $BRANCH \ && git checkout $(git rev-list -n 1 --before="`date -d $VERSION`" $BRANCH) else #git checkout $(echo "libreoffice-$VERSION" | tr 'a-z.-' 'A-Z_') git checkout $(echo "libreoffice-$VERSION") fi cd .. else git clone --depth=1 ${GITURI[$1]} ${PBASE} fi if [ "$SRCVER" = "HEAD" ]; then # Shallow clone, does not contain a lot in .git tar -${TARCOMP}cf ${2} ${PBASE} else # Full clone, especially libreoffice-l10n is several GB in size: tar --exclude .git -${TARCOMP}cf ${2} ${PBASE} fi cd $RETDIR rm -rf $CODIR/libreoffice_temp_checkout_$$ } ## ## --- with a little luck, you won't have to edit below this point --- ## ## # Automatically determine the architecture we're building on: if [ -z "$ARCH" ]; then case "$( uname -m )" in i?86) export ARCH=i486 ;; arm*) export ARCH=arm ;; # Unless $ARCH is already set, use uname -m for all other archs: *) export ARCH=$( uname -m ) ;; esac fi case "$ARCH" in i486) SLKCFLAGS="-march=i486 -mtune=i686" SLKLDFLAGS=""; LIBDIRSUFFIX="" ;; x86_64) SLKCFLAGS="-fPIC" SLKLDFLAGS="-L/usr/lib64"; LIBDIRSUFFIX="64" ;; *) SLKCFLAGS="" SLKLDFLAGS=""; LIBDIRSUFFIX="" ;; esac # Exit the script on errors: set -e trap 'echo "$0 FAILED at line ${LINENO}" | tee $OUTPUT/error-${PRGNAM}.log' ERR # Catch unitialized variables: set -u P1=${1:-1} # Save old umask and set to 0022: _UMASK_=$(umask) umask 0022 if [ "$P1" == "--oldbuild" ]; then echo "Re-using a previous compilation." else # Create working directories: mkdir -p $OUTPUT # place for the package to be saved mkdir -p $TMP/tmp-$PRGNAM # location to build the source mkdir -p $PKG # place for the package to be built rm -rf $PKG/* # always erase old package's contents rm -rf $TMP/tmp-$PRGNAM/* # remove the remnants of previous build rm -rf $OUTPUT/{configure,make,install,error,makepkg}-$PRGNAM.log # remove old log files fi # Make variables for the working directories absolute now that they exist: TMP=$(cd $TMP; pwd) PKG=$(cd $PKG; pwd) OUTPUT=$(cd $OUTPUT; pwd) # Source file availability: for (( i = 0; i < ${#SOURCE[*]}; i++ )) ; do if ! [ -f ${SOURCE[$i]} ]; then echo "Source '$(basename ${SOURCE[$i]})' not available yet..." # Check if the $SRCDIR/sources33 is writable - if not, download to $OUTPUT mkdir "$SRCDIR/sources33" 2>/dev/null || true [ -w "$SRCDIR/sources33" ] || SOURCE[$i]="$OUTPUT/$(basename ${SOURCE[$i]})" if [ -f ${SOURCE[$i]} ]; then echo "Ah, found it!"; continue; fi if ! [ "x${SRCURL[$i]}" == "x" ]; then echo "Will download file to $(dirname $SOURCE[$i])" wget -nv -T 20 -O "${SOURCE[$i]}" "${SRCURL[$i]}" || true if [ $? -ne 0 -o ! -s "${SOURCE[$i]}" ]; then echo "Fail to download '$(basename ${SOURCE[$i]})'. Aborting the build." mv -f "${SOURCE[$i]}" "${SOURCE[$i]}".FAIL exit 1 fi else # Try if we have a SVN/CVS download routine for ${SOURCE[$i]} echo "Will checkout sources to $(dirname $SOURCE[$i])" src_checkout $i "${SOURCE[$i]}" 2>&1 > $OUTPUT/checkout-$(basename ${SOURCE[$i]}).log fi if [ ! -f "${SOURCE[$i]}" -o ! -s "${SOURCE[$i]}" ]; then echo "File '$(basename ${SOURCE[$i]})' not available. Aborting the build." exit 1 fi fi done # Maybe we need even more? echo "** Please examine the following output (enclosed in '-+-+-+' lines)." echo "** If you see any filenames there, it means that these are still missing." echo "** Since they will not be downloaded when LibreOffice starts compiling," echo "** you may run into problems later." echo "** NOTE: this indicates that this SlackBuild needs to be updated." echo "-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-" for FILE in $(wget -q -O - "http://cgit.freedesktop.org/libreoffice/bootstrap/plain/ooo.lst?id=$PRGNAM-$VERSION$SUBVER" | grep -vE "^http://|^@") ; do if [ ! -f $SRCDIR/sources33/$FILE ]; then echo $FILE; fi ; done; echo "-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-" if [ "$P1" == "--download" ]; then echo "Download complete." exit 0 fi # --- PACKAGE BUILDING --- echo "++" echo "|| $PRGNAM-$VERSION" echo "++" cd $TMP/tmp-$PRGNAM if [ "$P1" != "--oldbuild" ]; then echo "Extracting 'build' source archive(s) for $PRGNAM..." tar -xvf ${SOURCE[0]} fi cd ${PRGNAM}-build-${VERSION}${SUBVER} # Replace a "SlacwkareOnly" patch that fails to apply, thereby preventing # all subsequent patching to be aborted: cp $SRCDIR/patches/scp2-user-config-ooo3.diff patches/dev300/ # Disable this diff to prevent error in 32-bit compilation of 'sw' # ( undefined reference to `ixion::formula_lexer::swap_tokens ): sed -i -e 's/^fields-table-formula.diff.*/#&/' patches/dev300/apply # Add a patch to make the presenter console compile: cp $SRCDIR/patches/libreoffice.presenter.diff patches/hotfixes/ chown -R root:root . chmod -R u+w,go+r-w,a+X-s . echo Building ... if [ -z "$SRCURL[0]" ]; then # Git build; find out what this version of LibreOffice calls itself: # Look for something like: AC_INIT(libreoffice-build, 3.2.99.2) LOVER=$(cat configure.in | grep ^AC_INIT | sed -e 's/.*, \(.\+\))/\1/')_ else LOVER="" fi # Check for an installed KDE4 and assume Qt4: KDEDIRS=${KDEDIRS:-""} # to avoid "KDEDIRS: unbound variable" if [ ! -z "$KDEDIRS" ]; then # Stupid but what can I do... LibreOffice detection routines suck: export KDE4DIR="$KDEDIRS" export QT4INC="$QT4DIR/include" export QT4LIB="$QT4DIR/lib${LIBDIRSUFFIX}" KDEOPTS="--enable-kde4" else KDEOPTS="--disable-kde4" fi # Regular build flags: export LDFLAGS="$SLKLDFLAGS" export CXXFLAGS="$SLKCFLAGS" export CFLAGS="$SLKCFLAGS" # Make it install into proper directories: export OOInBase="/usr/lib${LIBDIRSUFFIX}/libreoffice" export OOInstall="/usr/lib${LIBDIRSUFFIX}/libreoffice" export OODESTDIR="$PKG" # Substitute our Slackware-specific configuration: cat $SRCDIR/Slackware.conf.in.33 | \ sed -e "s#@JAVA_HOME@#$JAVA_HOME#" \ -e "s#@BUILDVERSION@#${LOVER}$VERSION#" \ -e "s#@PACKAGER@#$PACKAGER#" \ > distro-configs/Slackware.conf.in # Compensate for ill-named artwork file: sed -i -e 's/^\(OOO_EXTRA_ARTWORK=.*\).tar.*/\1.tar.gz/' configure.in # If this local directory does not exist during configuration, # support for Open Clip Art will be disabled: mkdir -p /usr/share/openclipart # Do we generate language packs? if [ -z "$ADD_LANGUAGES" ]; then # Actually the compilation breaks if we specify "en_US" explicitly as the # one default language - in this case the string should be empty. The error: # " Error: ../unxlngx6.pro/misc/sysui/dummy/localize.sdf 0 Bytes! " [ "$DEF_LANG" = "en_US" ] && LANGUAGES="" || LANGUAGES="$DEF_LANG" else LANGUAGES="${DEF_LANG} $(echo ${ADD_LANGUAGES} |sed -e "s/${DEF_LANG} *//")" fi echo "Building for these languages: $LANGUAGES" [ "$USE_GIT" = "yes" ] && GITOPTS="--with-git" || GITOPTS="--with-git=no" enable_pam=no \ ./autogen.sh \ --with-arch-flags="$SLKCFLAGS" \ --with-distro=Slackware \ --with-docdir=/usr/doc/$PRGNAM-${LOVER}$VERSION \ --with-installed-ooo-dirname=$PRGNAM \ --with-lang="$(echo ${LANGUAGES} |tr _ -)" \ --with-num-cpus=${NUMCPUS} \ --without-binsuffix \ --docdir=/usr/doc/$PRGNAM-${LOVER}$VERSION \ --libdir=/usr/lib${LIBDIRSUFFIX} \ --sysconfdir=/etc \ --mandir=/usr/man \ ${GITOPTS} \ ${KDEOPTS} \ 2>&1 | tee $OUTPUT/configure-${PRGNAM}.log if [ "$P1" != "--oldbuild" ]; then mkdir -p src clone rawbuild build/${PRGNAM}-${LOVER%_}${VERSION}${SUBVER} if [ "$USE_GIT" = "yes" ]; then echo -n "Extracting additional component archive(s) for $PRGNAM" for (( i = 1; i < 21; i++ )) ; do echo -n " ." tar -C clone -xf ${SOURCE[$i]} done echo for PART in artwork base bootstrap calc components extras filters help \ impress libs-gui libs-core libs-extern postprocess sdk testing \ ure writer libs-extern-sys extensions l10n do mv clone/${PRGNAM}-${PART}-${VERSION}${SUBVER} clone/${PART} done else echo "Extracting additional component archive(s) for $PRGNAM..." for (( i = 1; i < 21; i++ )) ; do cp -a ${SOURCE[$i]} src/ done fi echo "Copying external sources into build directory for $PRGNAM..." for (( i = 21; i < ${#SOURCE[*]}; i++ )) ; do cp -a ${SOURCE[$i]} src/ done fi # The download script does more than downloading tarballs (which we already did) # so let's run it: echo "Starting 'download' script to check the prerequisites for $PRGNAM..." ./download \ 2>&1 | tee $OUTPUT/download-${PRGNAM}.log # Compile everything (takes many hours): echo "Starting $PRGNAM compilation (takes a long time)..." make -i VERBOSE=yes \ 2>&1 | tee -a $OUTPUT/make-${PRGNAM}.log # Install the lot: echo "Starting the packaging stage for $PRGNAM..." ( cd bin ./package-ooo \ 2>&1 | tee $OUTPUT/install-${PRGNAM}.log ) # Link the browser plugin into the mozilla plugins directory if we built one: if [ -f $PKG/usr/lib${LIBDIRSUFFIX}/$PRGNAM/program/libnpsoplugin.so ]; then ( mkdir -p $PKG/usr/lib${LIBDIRSUFFIX}/mozilla/plugins cd $PKG/usr/lib${LIBDIRSUFFIX}/mozilla/plugins ln -sf /usr/lib${LIBDIRSUFFIX}/$PRGNAM/program/libnpsoplugin.so ) fi # Replace redundant fonts with symlinks to save space: ( cd $PKG/usr/lib${LIBDIRSUFFIX}/$PRGNAM/basis-link/share/fonts/truetype/ for FONT in DejaVu*.ttf Liberation*.ttf ; do rm -f $FONT ln -sf /usr/share/fonts/TTF/$FONT done ) # Fix permissions of a license file: chmod 0644 $PKG/usr/lib${LIBDIRSUFFIX}/${PRGNAM}/LICENSE.odt # Fix weird permissions: find ${PKG} -perm 444 -exec chmod 644 {} \; find ${PKG} -perm 555 -exec chmod 755 {} \; # If we have any dictionaries in the sources directory, now is the time to # copy them into the package: mkdir -p $PKG/usr/lib${LIBDIRSUFFIX}/${PRGNAM}/share/extensions/install cp -a $SRCDIR/sources33/dict-*.oxt $PKG/usr/lib${LIBDIRSUFFIX}/${PRGNAM}/share/extensions/install/ # Create aliases for locales that have matching languages in LibreOffice. # This enables people with these locales to use the autocorrect function: # (code taken from Fedora's libreoffice.spec) cd $PKG/usr/lib${LIBDIRSUFFIX}/$PRGNAM/basis-link/share/autocorr en_GB_aliases="en-AG en-AU en-BS en-BW en-BZ en-CA en-DK en-GH en-HK en-IE en-IN en-JM en-NG en-NZ en-SG en-TT" for lang in $en_GB_aliases; do ln -sf acor_en-GB.dat acor_$lang.dat done en_US_aliases="en-PH" for lang in $en_US_aliases; do ln -sf acor_en-US.dat acor_$lang.dat done #en-ZA exists and has a good autocorrect file with two or three extras that make sense for #neighbouring english speaking territories en_ZA_aliases="en-NA en-ZW" for lang in $en_ZA_aliases; do ln -sf acor_en-ZA.dat acor_$lang.dat done if [ ! -z "$ADD_LANGUAGES" ]; then af_ZA_aliases="af-NA" for lang in $af_ZA_aliases; do ln -sf acor_af-ZA.dat acor_$lang.dat done de_DE_aliases="de-AT de-BE de-CH de-LI de-LU" for lang in $de_DE_aliases; do ln -sf acor_de-DE.dat acor_$lang.dat done es_ES_aliases="es-AR es-BO es-CL es-CO es-CR es-CU es-DO es-EC es-GT es-HN es-MX es-NI es-PA es-PE es-PR es-PY es-SV es-US es-UY es-VE" for lang in $es_ES_aliases; do ln -sf acor_es-ES.dat acor_$lang.dat done fr_FR_aliases="fr-BE fr-CA fr-CH fr-LU fr-MC" for lang in $fr_FR_aliases; do ln -sf acor_fr-FR.dat acor_$lang.dat done it_IT_aliases="it-CH" for lang in $it_IT_aliases; do ln -sf acor_it-IT.dat acor_$lang.dat done nl_NL_aliases="nl-AW nl-BE" for lang in $nl_NL_aliases; do ln -s acor_nl-NL.dat acor_$lang.dat done sv_SE_aliases="sv-FI" for lang in $sv_SE_aliases; do ln -s acor_sv-SE.dat acor_$lang.dat done [ -f acor_lt_LT.dat ] && mv acor_lt_LT.dat acor_lt-LT.dat else rm -f acor_[a-df-z]*.dat acor_e[su]*.dat fi cd - # Split out language packs if we have built additional languages: if [ ! -z "${ADD_LANGUAGES}" ]; then cd $PKG for lang in $(echo ${ADD_LANGUAGES} |sed -e "s/${DEF_LANG} *//") ; do langdesc="$(grep ^${lang}= $SRCDIR/languages |cut -f2 -d=)" lolang=$(echo $lang | tr _ -) echo "Splitting out '$lang' ($langdesc) - looking for '$lolang'..." rm -rf ${PKG}-l10n-$lang mkdir -p ${PKG}-l10n-$lang tar cf - --remove-files \ $(find . -depth -name "README*$lolang*" \ -o -name "LICENSE*${lolang}*" \ -o -type d -name "${lolang}" \ -o -name "Lang_*${lolang}.xba" \ -o -name "Langpack-${lolang}.xcu" \ -o -name "*${lolang}.oxt") \ | ( cd ${PKG}-l10n-$lang ; tar xf - ) # Create slack-desc and doinst.sh : mkdir -p ${PKG}-l10n-$lang/install cat $SRCDIR/slack-desc.l10n \ | sed -e "s/@LANG@/$lang/g" -e "s/@LANGDESC@/$langdesc/g" > \ ${PKG}-l10n-$lang/install/slack-desc # Install per-language dictionary: cat $SRCDIR/doinst.sh.l10n \ | sed -e "s/@LIBDIRSUFFIX@/${LIBDIRSUFFIX}/g" \ -e "s/@LANG@/${lolang}/g" -e "s/@PRGNAM@/$PRGNAM/" \ > ${PKG}-l10n-$lang/install/doinst.sh cd ${PKG}-l10n-$lang /sbin/makepkg -p -l y -c n $OUTPUT/${PRGNAM}-l10n-${lang}-${LOVER}${VERSION}-${ARCH}-${BUILD}${TAG}.${PKGTYPE:-txz} cd - cd $OUTPUT md5sum ${PRGNAM}-l10n-${lang}-${LOVER}${VERSION}-${ARCH}-${BUILD}${TAG}.${PKGTYPE:-txz} > ${PRGNAM}-l10n-$lang-${LOVER}${VERSION}-${ARCH}-${BUILD}${TAG}.${PKGTYPE:-txz}.md5 cd - cat $PKG-l10n-$lang/install/slack-desc | grep "^${PRGNAM}-l10n-$lang" > $OUTPUT/${PRGNAM}-l10n-$lang-${LOVER}${VERSION}-${ARCH}-${BUILD}${TAG}.txt done fi # End of splitting out language packs # Add the new icons and tell the menu entries to use those instead of ooo-* : find $PKG/usr/share/icons -name "ooo-*" -exec rm -f {} \; || true ( cd $TMP/tmp-$PRGNAM/${PRGNAM}-build-${VERSION}${SUBVER}/build/${PRGNAM}-${LOVER%_}${VERSION}${SUBVER}/sysui/desktop find icons/hicolor -path "*apps*" -name "*.png" | while read LINE do mkdir -p $PKG/usr/share/$(dirname $LINE) install -m0644 $LINE $PKG/usr/share/$(dirname $LINE)/${PRGNAM}-$(basename $LINE) done ) sed -i -e "s/^Icon=ooo-/Icon=${PRGNAM}-/" $PKG/usr/share/applications/*.desktop # Fix the call to the program name in desktop entries (3.3.0.3 needs this): if [ ! -f $PKG/usr/bin/oowriter ]; then sed -i -e "s/Exec=oo/Exec=lo/g" $PKG/usr/share/applications/*.desktop fi # Back to base: cd $TMP/tmp-$PRGNAM/${PRGNAM}-build-${VERSION}${SUBVER} # Create the package's post-install script: mkdir -p $PKG/install # Install language dictionary: cat $SRCDIR/doinst.sh.l10n \ | sed -e "s/@LIBDIRSUFFIX@/${LIBDIRSUFFIX}/g" \ -e "s/@LANG@/$(echo ${DEF_LANG} |tr _ -)/g" -e "s/@PRGNAM@/$PRGNAM/" \ > ${PKG}/install/doinst.sh cat <> $PKG/install/doinst.sh # Update the desktop database: if [ -x usr/bin/update-desktop-database ]; then chroot . /usr/bin/update-desktop-database usr/share/applications 1> /dev/null 2> /dev/null fi # Update the mime database: if [ -x usr/bin/update-mime-database ]; then chroot . /usr/bin/update-mime-database usr/share/mime 1> /dev/null 2> /dev/null fi # Update hicolor theme cache: if [ -d usr/share/icons/hicolor ]; then if [ -x /usr/bin/gtk-update-icon-cache ]; then chroot . /usr/bin/gtk-update-icon-cache -f -t usr/share/icons/hicolor 1> /dev/null 2> /dev/null fi fi EOT # Add documentation: mkdir -p $PKG/usr/doc/$PRGNAM-${LOVER}$VERSION cp -a $DOCS $PKG/usr/doc/$PRGNAM-${LOVER}$VERSION || true cat $SRCDIR/$(basename $0) > $PKG/usr/doc/$PRGNAM-${LOVER}$VERSION/$PRGNAM.SlackBuild cat $SRCDIR/Slackware.conf.in.33 > $PKG/usr/doc/$PRGNAM-${LOVER}$VERSION/Slackware.conf.in cp -a $SRCDIR/patches $PKG/usr/doc/$PRGNAM-${LOVER}$VERSION/ || true chown -R root:root $PKG/usr/doc/$PRGNAM-${LOVER}$VERSION find $PKG/usr/doc -type f -exec chmod 644 {} \; # Compress the man page(s): if [ -d $PKG/usr/man ]; then find $PKG/usr/man -type f -name "*.?" -exec gzip -9f {} \; for i in $(find $PKG/usr/man -type l -name "*.?") ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done fi # Strip binaries (if any): find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \ | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true # Add a package description: mkdir -p $PKG/install cat $SRCDIR/slack-desc > $PKG/install/slack-desc #cat $SRCDIR/slack-required > $PKG/install/slack-required # Build the package: cd $PKG /sbin/makepkg -p -l y -c n $OUTPUT/${PRGNAM}-${LOVER}${VERSION}-${ARCH}-${BUILD}${TAG}.${PKGTYPE:-txz} 2>&1 | tee $OUTPUT/makepkg-${PRGNAM}.log cd $OUTPUT md5sum ${PRGNAM}-${LOVER}${VERSION}-${ARCH}-${BUILD}${TAG}.${PKGTYPE:-txz} > ${PRGNAM}-${LOVER}${VERSION}-${ARCH}-${BUILD}${TAG}.${PKGTYPE:-txz}.md5 cd - cat $PKG/install/slack-desc | grep "^${PRGNAM}" > $OUTPUT/${PRGNAM}-${LOVER}${VERSION}-${ARCH}-${BUILD}${TAG}.txt #cat $PKG/install/slack-required > $OUTPUT/${PRGNAM}-${LOVER}${VERSION}-${ARCH}-${BUILD}${TAG}.dep # Restore the original umask: umask ${_UMASK_}