sbotools2

Maintenance fork of the original sbotools version 2
git clone git://git.server.ky/slackcoder/sbotools2
Log | Files | Refs | README

ifuse.SlackBuild (3071B)


      1 #!/bin/sh
      2 
      3 # Slackware build script for ifuse
      4 
      5 # Written by David Somero <dsomero@hotmail.com>
      6 # Derived from Slackware's Slackbuilds.
      7 #
      8 # Copyright 2008, 2009  Patrick J. Volkerding, Sebeka, Minnesota, USA
      9 # Copyright 2010-2011  David Somero (dsomero@hotmail.com) Athens, TN, USA
     10 # All rights reserved.
     11 #
     12 # Redistribution and use of this script, with or without modification, is
     13 # permitted provided that the following conditions are met:
     14 #
     15 # 1. Redistributions of this script must retain the above copyright
     16 #    notice, this list of conditions and the following disclaimer.
     17 #
     18 #  THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
     19 #  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
     20 #  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO
     21 #  EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
     22 #  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
     23 #  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
     24 #  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
     25 #  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
     26 #  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
     27 #  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     28 
     29 PRGNAM=ifuse
     30 VERSION=${VERSION:-1.1.1}
     31 BUILD=${BUILD:-1}
     32 TAG=${TAG:-_SBo}
     33 
     34 if [ -z "$ARCH" ]; then
     35   case "$( uname -m )" in
     36     i?86) ARCH=i486 ;;
     37     arm*) ARCH=arm ;;
     38        *) ARCH=$( uname -m ) ;;
     39   esac
     40 fi
     41 
     42 CWD=$(pwd)
     43 TMP=${TMP:-/tmp/SBo}
     44 PKG=$TMP/package-$PRGNAM
     45 OUTPUT=${OUTPUT:-/tmp}
     46 
     47 if [ "$ARCH" = "i486" ]; then
     48   SLKCFLAGS="-O2 -march=i486 -mtune=i686"
     49   LIBDIRSUFFIX=""
     50 elif [ "$ARCH" = "i686" ]; then
     51   SLKCFLAGS="-O2 -march=i686 -mtune=i686"
     52   LIBDIRSUFFIX=""
     53 elif [ "$ARCH" = "x86_64" ]; then
     54   SLKCFLAGS="-O2 -fPIC"
     55   LIBDIRSUFFIX="64"
     56 else
     57   SLKCFLAGS="-O2"
     58   LIBDIRSUFFIX=""
     59 fi
     60 
     61 set -e
     62 
     63 rm -rf $PKG
     64 mkdir -p $TMP $PKG $OUTPUT
     65 cd $TMP
     66 rm -rf $PRGNAM-$VERSION
     67 tar xvf $CWD/$PRGNAM-$VERSION.tar.bz2
     68 cd $PRGNAM-$VERSION
     69 chown -R root:root .
     70 find . \
     71  \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
     72  -exec chmod 755 {} \; -o \
     73  \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
     74  -exec chmod 644 {} \;
     75 
     76 CFLAGS="$SLKCFLAGS" \
     77 CXXFLAGS="$SLKCFLAGS" \
     78 ./configure \
     79   --prefix=/usr \
     80   --libdir=/usr/lib${LIBDIRSUFFIX} \
     81   --sysconfdir=/etc \
     82   --localstatedir=/var \
     83   --mandir=/usr/man \
     84   --docdir=/usr/doc/$PRGNAM-$VERSION \
     85   --build=$ARCH-slackware-linux
     86 
     87 make
     88 make install DESTDIR=$PKG
     89 
     90 find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
     91   | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
     92 
     93 mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
     94 cp -a \
     95   COPYING* README AUTHORS \
     96   $PKG/usr/doc/$PRGNAM-$VERSION
     97 cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
     98 
     99 mkdir -p $PKG/install
    100 cat $CWD/slack-desc > $PKG/install/slack-desc
    101 
    102 cd $PKG
    103 /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}