#!/bin/sh # Heavily based on the Slackware 13.1 SlackBuild # Written by Michelino # Last build from jimmy_page_89 ( jimmy_page_89@hotmail.it ) # Slackware build script for emesene # Official Site: http://www.emesene.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. set -e PKGNAME=emesene VERSION=svn BUILD=${BUILD:-1sl} ARCH=${ARCH:-x86_64} SOURCE="https://emesene.svn.sourceforge.net/svnroot/emesene/trunk/emesene" CWD=$(pwd) TMP=${TMP:-/tmp/buildpkgs/$PKGNAME} PKG=$TMP/package-$PKGNAME OUTPUT=${OUTPUT:-$CWD} if [ "$ARCH" = "i486" ]; then SLKCFLAGS="-O2 -march=i486 -mtune=i686" LIBDIRSUFFIX="" elif [ "$ARCH" = "i586" ]; then SLKCFLAGS="-O2 -march=i586 -mtune=i686" LIBDIRSUFFIX="" elif [ "$ARCH" = "i686" ]; then SLKCFLAGS="-O2 -march=i686 -mtune=i686" LIBDIRSUFFIX="" elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2 -fPIC" LIBDIRSUFFIX="64" fi rm -rf $TMP mkdir -p $TMP $PKG $OUTPUT cd $TMP svn co $SOURCE $PKGNAME-$VERSION || exit 1 cd $PKGNAME-$VERSION REVISION=$(svn info | grep Revision: | cut -d: -f2 | cut -d" " -f2) ### installazione patch (se presenti) # patch -p1 < $CWD/some_patch.diff # gzip -cd $CWD/compressed_patch.diff.gz |patch -p1 chown -R root:root . chmod -R u+w,go+r-w,a-s . ### In this section you may remove some not needed files or move that file in other path mkdir -p $PKG/usr/share/emesene cp -R * $PKG/usr/share/emesene/ mkdir -p $PKG/usr/share/applications cat $CWD/emesene.desktop > $PKG/usr/share/applications/emesene.desktop mkdir -p $PKG/usr/bin cat $CWD/emesene > $PKG/usr/bin/emesene chmod 755 $PKG/usr/bin/emesene mkdir -p $PKG/usr/share/pixmaps cp $TMP/$PKGNAME-$VERSION/misc/emesene.png $PKG/usr/share/pixmaps/emesene.png cp $TMP/$PKGNAME-$VERSION/misc/emesene-big.png $PKG/usr/share/pixmaps/emesene-big.png ### copy some documentation files mkdir -p $PKG/usr/doc/$PKGNAME-$VERSION cp -a \ COPYING docs/INSTALL \ $PKG/usr/doc/$PKGNAME-$VERSION cat $CWD/$PKGNAME.SlackBuild > $PKG/usr/doc/$PKGNAME-$VERSION/$PKGNAME.SlackBuild cat $CWD/slack-desc > $PKG/usr/doc/$PKGNAME-$VERSION/slack-desc ### compress man pages mkdir -p $PKG/usr/man/man1/ gzip -9 -c $TMP/$PKGNAME-$VERSION/misc/emesene.1 > $PKG/usr/man/man1/emesene.1.gz ### now you must do 'strip' all binary files ( cd $PKG find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs -r strip --strip-unneeded 2> /dev/null || true find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs -r strip --strip-unneeded 2> /dev/null || true find . | xargs file | grep "current ar archive" | cut -f 1 -d : | xargs -r strip --strip-unneeded 2> /dev/null || true ) ### popolate the install/ directory mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc cat $CWD/doinst.sh > $PKG/install/doinst.sh ## some adds to doinst.sh #echo "( cd usr/lib$LIBDIRSUFFIX/$PKGNAME ; ./postinstall.sh )" >> $PKG/install/doinst.sh ### reset owner and create slack-required file. cd $PKG chown -R root:root $PKG if [ -x "$(which requiredbuilder 2>/dev/null)" ];then requiredbuilder -y -v -s $CWD $PKG # aggiungi -c -b se hai binari in /usr/share fi ### finally make the package. /sbin/makepkg -l y -c n $OUTPUT/$PKGNAME-r$REVISION-$ARCH-$BUILD$TAG.${PKGTYPE:-txz} if [ "$1" = "--cleanup" ]; then rm -rf $TMP fi