#!/bin/sh # Heavily based on the Slackware 13.0 SlackBuild # http://ufraw.sourceforge.net # http://www.slacky.eu # # Required: cfitsio ( Statically linked), gtkimageview, lensfun # # Exit on most errors set -e NAME=ufraw VERSION=0.16 EXT=tar.gz ARCH=${ARCH:-i486} BUILD=1lu SOURCE=http://switch.dl.sourceforge.net/sourceforge/ufraw/ufraw-$VERSION.tar.gz CWD=`pwd` if [ ! -e $NAME-$VERSION.tar.gz ]; then wget -c $SOURCE fi if ["$TMP" = ""]; then TMP=/tmp fi PKG=$TMP/package/$NAME if [ "$ARCH" = "i486" ]; then SLKCFLAGS="-O2 -march=i486 -mtune=i686" elif [ "$ARCH" = "i686" ]; then SLKCFLAGS="-O2" elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2" fi if [ "$EXT" = "tar.gz" ]; then TARCMD="tar xvzf" elif [ "$EXT" = "txz" ]; then TARCMD="tar xvzf" elif [ "$EXT" = "tar.bz2" ]; then TARCMD="tar xvjf" elif ["$EXT" = "gz" ]; then TARCMD="gunzip" elif ["$EXT" = "zip" ]; then TARCMD="gzip" fi if [ ! -d $TMP ]; then mkdir -p $TMP fi if [ ! -d $PKG ]; then mkdir -p $PKG fi mkdir -p $PKG/usr cd $TMP $TARCMD $CWD/$NAME-$VERSION.$EXT cd $NAME-$VERSION find . -perm 666 -exec chmod 644 {} \; find . -perm 664 -exec chmod 644 {} \; find . -perm 600 -exec chmod 644 {} \; find . -perm 444 -exec chmod 644 {} \; find . -perm 400 -exec chmod 644 {} \; find . -perm 440 -exec chmod 644 {} \; find . -perm 777 -exec chmod 755 {} \; find . -perm 775 -exec chmod 755 {} \; find . -perm 511 -exec chmod 755 {} \; find . -perm 711 -exec chmod 755 {} \; find . -perm 555 -exec chmod 755 {} \; chown -R root:root . LDFLAGS="$SLKLDFLAGS" \ CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ ./configure --prefix=/usr \ --sysconfdir=/etc \ --localstatedir=/var \ --libdir=/usr/lib${LIBDIRSUFFIX} \ --disable-static \ --mandir=/usr/man \ --enable-mime \ --enable-extras \ --with-lensfun \ --program-prefix= \ --program-suffix= \ --build=$ARCH-slackware-linux make make install DESTDIR=$PKG mkdir -p $PKG/usr/doc/$NAME-$VERSION cp -a COPYING MANIFEST README TODO $PKG/usr/doc/$NAME-$VERSION # Remove gconf crap rm -rf $PKG/usr/share/gconf mkdir -p $PKG/usr/share/applications cp ufraw.desktop $PKG/usr/share/applications gimptool=gimptool-2.0 gimpdir=`$gimptool --gimpplugindir` gimpplugindir=$gimpdir/plug-ins mkdir -p $PKG/$gimpplugindir cp $TMP/$NAME-$VERSION/ufraw-gimp $PKG/$gimpplugindir ( cd $PKG find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null find . | xargs file | grep "current ar archive" | cut -f 1 -d : | xargs strip -g 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 gzip -9 $PKG/usr/man/*/* chmod 755 $PKG/usr/bin/* cd $PKG requiredbuilder -v -y -s $CWD $PKG makepkg -l y -c n $CWD/$NAME-$VERSION-$ARCH-$BUILD.txz if [ "$1" = "--cleanup" ]; then rm -rf $TMP/$NAME-$VERSION rm -rf $PKG fi