Ho avuto la "malsana" idea di abbozzare uno slackbuild che mi
compilasse openoffice dai sorgenti.
E' da qualche mese che ci sto lavorando, a singhiozzo nelle pause pranzo.
Avevo inziato co go-oo poi e' uscita la 3.1 di oo e ho cambiato rotta.
Lo script ha l'unico pregio di prendere i sorgenti e compilarli, il make finale
genera gli rpm (in italiano) e da questi pacchettizzo il tgz.
Lo sto usando sul pc di lavoro da qualche settimana (12.1), veloce e non
crasha, neanche con varie estensioni installate come l'import pdf.
Ho un unico problema: i menu di Impression e Draw sono incompleti (e
solo quelli), mancano di alcune voci, o meglio le voci ci sono, si cliccano
ma non si vedono le scritte, errori di compilazione non ne ho visto.
Sono riuscito a provarlo anche su una slackware 12.2 nuova di zecca con
xfce ma il problema rimane.
Se a qualcuno puo' interessare e magari mi puo' dare una mano a capire il
problema piu' sotto trovate lo script.
Avverto che lo script si prende il suo tempo (nell'ordine delle ore)
anche su pc abbastanza recenti.
Le dipendenze piu' importanti sono il java jdk (in extra) e apache-ant.
Inoltre richiede i moduli perl:
Archive-Zip
Compress-Raw-Zlib
Compress-Zlib
IO-Compress-Base
IO-Compress-Zlib
(se volete ho anche gli SB di quest'ultimi)
# cat OOo.SlackBuild
Codice: Seleziona tutto
#!/bin/sh
# Copyright 2009 Loris Vincenzi (http://www.slacky.eu)
# All rights reserved.
#
# Heavily based on the Slackware 12.2 SlackBuild
# http://www.openoffice.org/
#
# Redistribution and use of this script, with or without modification, is
# permitted provided that the following conditions are met:
#
# 1. Redistributions of this script must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS 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 AUTHOR 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.
CWD=`pwd`
TMP=${TMP:-/tmp/tgz}
PKG=$TMP/package-ooo
NAME=OOo
VERSION=3.1.0
CHOST=i486
ARCH=${ARCH:-i486}
BUILD=1ld
SOURCES=$NAME-build-$VERSION
COMPONENT="binfilter core extensions l10n system testautomation"
URL=http://ooo.mirror.garr.it/mirrors/openoffice/stable/$VERSION/
SOURCES=""
for file in $COMPONENT
do
SOURCES+="$NAME"_"$VERSION"_src_"$file".tar.bz2" "
done
for source in $SOURCES
do
if [ ! -e $source ]; then
wget -c $URL$source
if [[ "$?" > "0" ]]
then
echo -e "Sorgente $source non trovato\n"
exit
fi
fi
done
# Scarico i sorgenti di Mozilla
if [ ! -e mozilla-source-1.7.5.tar.bz2 ]; then
wget http://ftp.mozilla.org/pub/mozilla.org/mozilla/releases/mozilla1.7.5/source/mozilla-source-1.7.5.tar.bz2
fi
if [ "$ARCH" = "i386" ]; then
SLKCFLAGS="-O2 -march=i386 -mcpu=i686"
elif [ "$ARCH" = "i486" ]; then
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2"
elif [ "$ARCH" = "s390" ]; then
SLKCFLAGS="-O2"
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2"
fi
if [ ! -d $TMP ]; then
mkdir -p $TMP
fi
if [ ! -d $PKG ]; then
mkdir -p $PKG
fi
cd $TMP
## Scarico i Sorgenti
for source in $SOURCES
do
if [ -e $CWD/$source ]; then
tar xjvf $CWD/$source
if [[ "$?" > "0" ]]
then
echo -e "Sorgente $source non e' un tar.bz2\n"
exit
fi
fi
done
SOURCETGZ=`find . -type d -maxdepth 1 | grep OOO`
cd $SOURCETGZ
(
cd moz/download
echo `pwd`
if [ ! -e mozilla-source-1.7.5.tar.bz2 ]; then
cp $CWD/mozilla-source-1.7.5.tar.bz2 .
fi
)
## Sistemo i Permessi
find . \( -perm 777 -o -perm 775 -o -perm 711 \) -exec chmod 755 {} \;
find . \( -perm 700 -o -perm 555 -o -perm 511 \) -exec chmod 755 {} \;
find . \( -perm 666 -o -perm 664 -o -perm 600 \) -exec chmod 644 {} \;
find . \( -perm 444 -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
chown -R root:root .
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
./configure --prefix=/usr \
--datarootdir=/usr/share \
--docdir=/usr/doc/$NAME-$VERSION \
--with-installed-ooo-dirname=openoffice.org \
--sysconfdir=/etc \
--mandir=/usr/man \
--disable-pam \
--disable-kde \
--disable-odk \
--disable-lockdown \
--disable-gconf \
--disable-cairo \
--disable-opengl \
--enable-dbus \
--disable-gio \
--disable-pam \
--disable-pam-link \
--disable-xrender-link \
--disable-gnome-vfs \
--with-mozilla-toolkit=gtk2 \
--without-system-lucene \
--without-system-hsqldb \
--without-system-beanshell \
--without-system-saxon \
--without-system-vigra \
--without-system-mozilla \
--with-java \
--with-lang="it" \
--with-dict=ENGB,ENUS,ITIT \
--with-unix-wrapper=ooffice \
--with-build-version="Built by Diego @ slacky.it" \
--with-x
make all || exit 1
(
cd $PKG
mkdir tmp
cd tmp
find $TMP/$SOURCETGZ/instsetoo_native/unxlngi6.pro/OpenOffice/rpm/install/it/RPMS -iname "*.rpm" -maxdepth 1 -exec rpm2tgz {} \;
find $TMP/$SOURCETGZ/instsetoo_native/unxlngi6.pro/OpenOffice/rpm/install/it/RPMS/desktop-integration/ -iname "*freedesktop*.rpm" -maxdepth 1 -exec rpm2tgz {} \;
cp $TMP/$SOURCETGZ/instsetoo_native/unxlngi6.pro/OpenOffice/rpm/install/it/RPMS/desktop-integration/*freedesktop*.tgz .
cd ..
find tmp/ "*.tgz" -exec explodepkg {} \;
rm -rf tmp
)
# Sistemo alcuni link
( cd $PKG/usr/share/applications ; rm -rf openoffice.org3-startcenter.desktop )
( cd $PKG/usr/share/applications ; ln -sf /opt/openoffice.org3/share/xdg/qstart.desktop openoffice.org3-startcenter.desktop )
( cd $PKG/usr/bin ; rm -rf ooffice )
( cd $PKG/usr/bin ; ln -sf /usr/bin/openoffice.org3 ooffice )
( cd $PKG/usr/bin ; rm -rf ooffice-printeradmin )
( cd $PKG/usr/bin ; ln -sf /usr/bin/openoffice.org3-printeradmin ooffice-printeradmin )
cd $PKG
find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
#find $PKG/usr/man -type f -exec gzip -9 {} \;
mkdir -p $PKG/usr/doc/$NAME-$VERSION
mkdir -p $PKG/install
echo "update-desktop-database -q /usr/share/applications" >> $PKG/install/doinst.sh
echo "update-mime-database /usr/share/mime" >> $PKG/install/doinst.sh
cat $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/slack-desc > $PKG/usr/doc/$NAME-$VERSION/slack-desc
cat $CWD/$NAME.SlackBuild > $PKG/usr/doc/$NAME-$VERSION/$NAME.SlackBuild
requiredbuilder -v -y -s $CWD $PKG
makepkg -l y -c n $CWD/$NAME-$VERSION-$ARCH-$BUILD.tgz
if [ "$1" = "--cleanup" ]; then
rm -rf $TMP
fi
Codice: Seleziona tutto
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description. Line
# up the first '|' above the ':' following the base package name, and the '|' on
# the right side marks the last column you can put a character in. You must make
# exactly 11 lines for the formatting to be correct. It's also customary to
# leave one space after the ':'.
|-----handy-ruler-------------------------------------------------------|
OOo: OpenOffice.org
OOo:
OOo: E' una suite per ufficio completa, rilasciata con una licenza libera
OOo: e Open Source che ne consente la distribuzione gratuita. Legge e
OOo: scrive file nei formati utilizzati dai prodotti più diffusi sul
OOo: mercato e, a garanzia della futura accessibilità dei dati, nel formato
OOo: OpenDocument, standard ISO. Consente inoltre l'esportazione in formato
OOo: PDF.
OOo:
OOo: http://www.openoffice.org/
OOo: Packager: diego @ slacky.it
Diego


