rlh   img   mp3   nfo   pro  
./nfo/linux/slackware/slackbuilds/ola/ola.slackbuild
#!/bin/sh -e
#
# SlackBuild by RLH [www.rlh.no] 20110510

# OLA (Open Lighting Architecture) is a framework that allows 
# applications to send and receive DMX512, using various hardware 
# devices and DMX over IP protocols. It enables software controllers 
# talk to DMX hardware.

# OLA allows DMX sent using various DMX over IP protocols to be 
# converted from one format to another. This enables devices from 
# different manufacturers to talk to each another (for example a Strand
# Console can send DMX to an Enttec EtherGate). When combined with a 
# physical DMX interface such as the DMX USB Pro, OLA can send and
# receive data from traditional wired DMX networks.
#
# http://www.opendmx.net/index.php/OLA

# NEWS: For more recent versions, use http://slackbuilds.org/result/?search=ola&sv=

CWD=$(pwd)
if [ "$TMP" = "" ]; then
  TMP=/tmp/slackbuild
fi

VERSION=0.8.18
PKG_VERSION=$VERSION
ARCH=${ARCH:-x86_64}
BUILD=${BUILD:-RLH}
APP=ola
PKG=$TMP/package-$APP

if [ "$ARCH" = "i486" ]; then
  SLKCFLAGS="-O2 -march=i486 -mtune=i686"
  LIBDIRSUFFIX=""
 elif [ "$ARCH" = "x86_64" ]; then
  SLKCFLAGS="-O2 -fPIC"
  LIBDIRSUFFIX="64"
fi

rm -rf $PKG 
mkdir -p $TMP $PKG
rm -rf $TMP/$APP-$VERSION
cd $TMP || exit 1
tar -zxvf $CWD/$APP-$VERSION.tar.gz || exit 1
cd $APP-$VERSION || exit 1
chown -R root:root .
chmod -R u+w,go+r-w,a-s .

# CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
./configure \
  --prefix=/usr \
  --libdir=/usr/lib$LIBDIRSUFFIX \
  --sysconfdir=/etc \
  --localstatedir=/var \
  --docdir=/usr/doc/$APP-$VERSION \
  --mandir=/usr/man \
  --sharedstatedir=/var/lib/$APP \
  --build=$ARCH-slackware-linux \
  --host=$ARCH-slackware-linux 

make || exit
make install DESTDIR=$PKG || exit

mkdir -p $PKG/usr/doc/$APP-$VERSION
cp -a ChangeLog AUTHORS NEWS INSTALL COPYING README TODO $PKG/usr/doc/$APP-$VERSION
find $PKG/usr/doc/$APP-$VERSION -type f -exec chmod 644 {} \;
cat $CWD/$APP.SlackBuild > $PKG/usr/doc/$APP-$VERSION/$APP.SlackBuild

mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
if [ -e $CWD/doinst.sh.gz ]; then
  zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh
fi

( 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
)
if [ -d $PKG/usr/man ]; then
  ( cd $PKG/usr/man
  find . -type f -exec gzip -9 {} \;
  for i in $(find . -type l) ; do ln -s $(readlink $i).gz $i.gz ; rm $i ; done
  ) 
fi
if [ -d $PKG/usr/info ]; then
  gzip -9 $PKG/usr/info/*.info
  rm -f $PKG/usr/info/dir
fi

cd $PKG
/sbin/makepkg -l y -c n $TMP/$APP-$PKG_VERSION-$ARCH-$BUILD.tgz