#!/bin/sh # Heavily based on the Slackware 13.0 SlackBuild # http://slackpackpkgman.wordpress.com/ # Packager Vincenzi Loris - slacky@slacky.it CWD=`pwd` TMP=${TMP:-/tmp/txz} PKG=$TMP/package-slackpack NAME=slackpack VERSION=1.1.8 CHOST=i486 ARCH=${ARCH:-i486} BUILD=1sl SOURCE=http://downloads.sourceforge.net/slackpackpkgman/$NAME-$VERSION-source.tar.gz if [ ! -e $NAME-$VERSION-source.tar.gz ]; then wget -c $SOURCE fi [ -d $TMP/$NAME-$VERSION ]&&rm -r $TMP/$NAME-$VERSION mkdir -p $TMP/$NAME-$VERSION [ -d $PKG ]&&rm -r $PKG mkdir -p $PKG 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 cd $TMP/$NAME-$VERSION tar xzvf $CWD/$NAME-$VERSION-source.tar.gz || exit 1 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 . # this bug will solved in 1.1.9 version (see http://www.linuxquestions.org/questions/slackware-14/slackpack-package-manager-758501/page4.html#post3733962) cat $CWD/Slackpack.pro.diff|sed "s|VERSION|$VERSION|"|patch -p0 CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ qmake Slackpack.pro make -j4 || exit 1 make install INSTALL_ROOT=$PKG || exit 1 #sed -i "s|/root/kdev/Slackpack/src/hi90-app-slackpack.png|/usr/share/icons/hicolor/32x32/apps/slackpack.png|g" $PKG/usr/share/applnk/Utilities/slackpack.desktop cd $PKG mkdir -p usr/share/applnk/Utilities/ mkdir -p usr/share/icons/hicolor/16x16/apps mkdir -p usr/share/icons/hicolor/32x32/apps cp $CWD/slackpack.desktop usr/share/applnk/Utilities/ cp usr/share/slackpack/images/hi16-app-slackpack.png usr/share/icons/hicolor/16x16/apps/slackpack.png cp usr/share/slackpack/images/hi32-app-slackpack.png usr/share/icons/hicolor/32x32/apps/slackpack.png find . -type d -name .svn |xargs -I {} rm -r {} find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null mkdir -p $PKG/install 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.txz if [ "$1" = "--cleanup" ]; then rm -rf $TMP fi