#!/bin/sh # Heavily based on the Slackware 12.1 SlackBuild # http://dri.freedesktop.org/wiki/DriConf # Packager submax (Massimo Cavalleri) NAME=driconf VERSION=0.9.1 BUILD=2sm TMP=${TMP:-/tmp/tgz} PKG=$TMP/package-$NAME ARCH=${ARCH:-noarch} CWD=`pwd` # download if source not exist on current directory if [ ! -e $CWD/$NAME-$VERSION.tar.gz ]; then wget -c http://people.freedesktop.org/~fxkuehl/driconf/$NAME-$VERSION.tar.gz fi # cleaning rm -rf $PKG mkdir -p $PKG # extract source cd $TMP tar -xvzf $CWD/$NAME-$VERSION.tar.gz # build directory's package cd $NAME-$VERSION # By default driconf will be installed into various sub-directories under # /usr/local. You can change this behaviour in setup.cfg. # (like --prefix=$PKG) sed -i -e "s:/usr/local/lib/driconf:$PKG/usr/lib/driconf:g" -e "s:/usr/local:$PKG/usr:g" setup.cfg # In that case you may also have to adjust the driconf start-up script accordingly. sed -i -e "s:local/::" driconf sed -i -e "s:/usr/local:/usr:g" setup.py sed -i -e "s:/usr/local:/usr:g" driconf_commonui.py python setup.py install # install and fix desktop entry mkdir -p $PKG/usr/share/applications sed -i -e "s:/usr/local/share/driconf/driconf-icon.png:/usr/share/pixmaps/driconf-icon.png:g" $NAME.desktop cp $NAME.desktop $PKG/usr/share/applications mkdir -p $PKG/usr/share/pixmaps cp driconf-icon.png $PKG/usr/share/pixmaps # add documentation mkdir -p $PKG/usr/doc/$NAME-$VERSION cp TODO README CHANGELOG COPYING simplemode.txt $PKG/usr/doc/$NAME-$VERSION cat $CWD/slack-desc > $PKG/usr/doc/$NAME-$VERSION/slack-desc cat $CWD/$NAME.SlackBuild > $PKG/usr/doc/$NAME-$VERSION/$NAME.SlackBuild # slack-desc mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc # build tgz's package cd $PKG requiredbuilder -v -y -s $CWD $PKG makepkg -l y -c n $CWD/../$NAME-$VERSION-$ARCH-$BUILD.tgz (cd $CWD/.. md5sum $NAME-$VERSION-$ARCH-$BUILD.tgz > $NAME-$VERSION-$ARCH-$BUILD.tgz.md5 cat $PKG/install/slack-desc | grep "^$NAME" > $NAME-$VERSION-$ARCH-$BUILD.txt ) if [ "$1" = "--cleanup" ]; then rm -rf $TMP fi