#!/bin/sh [ -z $PREPKG ] && exit 1 SOURCE=LibreOffice PACKAGE=libreoffice VERSION4=4.4.2.2 VERSION3=${VERSION4%.*} VERSION2=${VERSION3%.*} FILES=$(cd $(dirname $0) ; pwd) tar xf $FILES/${SOURCE}_${VERSION3}_Linux_x86_rpm.tar.gz || exit 1 cd ${SOURCE}_${VERSION4}_Linux_x86_rpm/ # we don't want this rm -f \ RPMS/*onlineupdate*.rpm # extract everything useful for i in RPMS/*.rpm ; do rpm2cpio $i | cpio -dim --quiet done # tidy up in general chmod -R \ u+w,g-w . # and a few docs as well chmod \ a-x opt/$PACKAGE$VERSION2/[A-Z]* # move useful bits to packaging dir & continue from there # (omitting readmes/ because it's duplicated within the opt/ hierarchy) mv \ opt/ usr/ \ $PREPKG/ # already part of slackware. remove # experiment: keep for now, seems many glyphs are MUCH newer #rm -f \ # $PREPKG/opt/$PACKAGE$VERSION2/share/fonts/truetype/{DejaVu,Liberation}*.ttf # fix 'Exec=' commands. see http://bugzilla.xfce.org/show_bug.cgi?id=2430 #for i in base calc draw impress math writer ; do # sed -i "s,Exec=$PACKAGE$VERSION2 --,Exec=/opt/$PACKAGE$VERSION2/program/s," \ # $PREPKG/opt/$PACKAGE$VERSION2/share/xdg/$i.desktop #done # (re)create symlinks in /usr/bin to actual binaries for i in sbase scalc sdraw simpress smath soffice swriter unopkg ; do ln -sf \ ../../opt/$PACKAGE$VERSION2/program/$i \ $PREPKG/usr/bin/ done # new symlink: no longer need to call main binary with version number ln -sf \ $PACKAGE$VERSION2 \ $PREPKG/usr/bin/$PACKAGE mkdir -p \ $PREPKG/usr/doc/$PACKAGE-$VERSION4/ cd $PREPKG/opt/$PACKAGE$VERSION2/ mv \ readmes/ CREDITS* LICENSE* NOTICE \ $PREPKG/usr/doc/$PACKAGE-$VERSION4/ cd - mkdir -p \ $PREPKG/install/ cp \ $FILES/{doinst.sh,slack-desc} \ $PREPKG/install/