summaryrefslogblamecommitdiffstats
path: root/system/smart/smart.SlackBuild
blob: 9803c676eef7f28857dd520e0d5d0d3316b05b07 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
           



                                              

                             



                         
                       


                         
                      




                               







                                                                              



                        
                             














































                                                                                        
                                                                          
#!/bin/bash

# Slackware build script for smart
# Written by Marcin Slodkiewicz <slociu@wp.pl>

cd $(dirname $0) ; CWD=$(pwd)

PRGNAM=smart
VERSION=${VERSION:-1.4.1}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}

if [ -z "$ARCH" ]; then
  case "$( uname -m )" in
    i?86) ARCH=i586 ;;
    arm*) ARCH=arm ;;
       *) ARCH=$( uname -m ) ;;
  esac
fi

# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
# the name of the created package would be, and then exit. This information
# could be useful to other scripts.
if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  exit 0
fi

TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}

if [ "$ARCH" = "i586" ]; then
  LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
  LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
  LIBDIRSUFFIX="64"
else
  LIBDIRSUFFIX=""
fi

set -e

rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
tar xvf $CWD/$PRGNAM-$VERSION.tar.bz2
cd $PRGNAM-$VERSION
chown -R root:root .

python setup.py build
python setup.py install \
--root=/$PKG \
--prefix=/usr

find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
  | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true

mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a README TODO LICENSE $PKG/usr/doc/$PRGNAM-$VERSION

mkdir -p $PKG/etc/smart/channels
cat $CWD/channels > $PKG/etc/smart/channels/channels.new

mkdir -p $PKG/usr/share/{applications,pixmaps}
cat $CWD/smart.desktop > $PKG/usr/share/applications/smart.desktop
cp $CWD/smart.png $PKG/usr/share/pixmaps/

cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild

mv $PKG/usr/share/man $PKG/usr/man
find $PKG/usr/man -type f -exec gzip -9 {} \;

mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/doinst.sh > $PKG/install/doinst.sh

cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE