#!/bin/sh # Slackware build script for openoffice.org # Originally written by Niki Kovacs /dev/null | head -n 1 | tr -d \/) # If the above operation failed for some reason, unset SOURCEDIR so that # the "set -eu" below will cause us to bail out with an error # Normally SOURCEDIR=en-US [ -z $SOURCEDIR ] && unset SOURCEDIR rm -rf $PKG mkdir -p $TMP $PKG $OUTPUT rm -rf $TMP/$SOURCEDIR # Extract tarball tar xvf $CWD/$TARNAME -C $TMP cd $TMP/$SOURCEDIR/RPMS # We only need the freedesktop integration, so we move it to the current location mv desktop-integration/openoffice$SRCSHORT-freedesktop-menus-$SRCSHORT-*.noarch.rpm . # We don't want this, so we delete the *onlineupdate*.rpm rm -f *onlineupdate*.rpm # Extract the files from the *.rpm for FILE in *.rpm ; do rpm2cpio < $FILE | cpio -imdv ; done rm -rf desktop-integration *.rpm mv opt usr $PKG cd $PKG # Fix broken symlinks cd $PKG/usr/bin rm -f soffice ln -s ../../opt/openoffice4/program/soffice . cd - cd $PKG/usr/share/applications for FILE in \ base calc draw impress javafilter math printeradmin startcenter writer ; do rm -f openoffice4-$FILE.desktop ln -sf ../../../opt/openoffice4/share/xdg/$FILE.desktop $FILE.desktop ; done cd - # Remove DejaVu fonts - these are included in other packages rm -f $PKG/opt/openoffice4/share/fonts/truetype/DejaVu*.ttf # Move docs to their expected locations mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION cd $PKG/opt/openoffice4 mv README* share/readme/* $PKG/usr/doc/$PRGNAM-$VERSION rmdir share/readme cd - cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc cat $CWD/doinst.sh > $PKG/install/doinst.sh # Fix ownership and permissions and make the package chown -R root:root . find . -type d -exec chmod 755 {} \; chmod -R u+rw,go+r-w,a-s . /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-${VERSION}_${PKG_LANG}-$PKGARCH-$BUILD$TAG.${PKGTYPE:-tgz} # Cleanup cd $TMP rm -rf $OOLANG $PKG