IGNOREPATH=/etc:/home:/var:/dev:/boot:/root:/tmp:/usr/local:/bin:/sbin:/mnt:/usr/src
STRIPLIB=y
STRIPBIN=y

VERSION=`grep VERSION= ../KDE.options | cut -f 2- -d =`
PROGNAME="arts $VERSION"
VERSION=1.1.4
DESC="\
arts (Analog Realtime Synthesizer)                                     \n\
                                                                       \n\
aRts is the core sound system for KDE, and is short for "analog        \n\
realtime synthesizer".  aRts is designed to create or process sound    \n\
using small specialized modules.  These may create a waveform, play    \n\
samples, filter data, add signals, perform effects (like delay,        \n\
flanger or chorus), or output the data to the soundcard."

BUILD=1
MAINTAINER="Mark Post <mark.post@eds.com>"
SOURCE=ftp://ftp.gnu.org/pub/gnu/arts
PKGNAME=arts-$VERSION-s390-$BUILD
TAG=OPT

compile() {
   # Avoid a version number in .la files:
   if [ -d /usr/lib/qt ]; then
     QTDIR=/usr/lib/qt
   fi

   tar -yxvf $CWD/arts-$VERSION.tar.bz2
   cd arts-$VERSION/

   chown -R root.root .
   CFLAGS=-O2 CXXFLAGS=-O2 \
   ./configure --prefix=/opt/kde \
               --with-xinerama \
               --disable-debug \
               --program-prefix="" \
               --program-suffix="" \
               --build=s390-slackware-linux \
               --host=s390-slackware-linux \
               --target=s390-slackware-linux

   make
}

install() {
   make install DESTDIR=/package-arts

   mkdir -p /package-arts/usr/doc/arts-$VERSION
   cp -a COPYING COPYING.LIB INSTALL doc/NEWS doc/README doc/TODO \
       /package-arts/usr/doc/arts-$VERSION
}

special() {
   cd $PKG
   mv package-arts/* ./
   rmdir package-arts

   cd $CTL
   cat $CWD/slack-desc > slack-desc
   sed -e 's%package-arts/%%g' doinst.sh > doinst.sh.new
   cat doinst.sh.new > doinst.sh
   rm doinst.sh.new

   # Pat says:
   # It's possible that arts might be installed without KDE (or kdelibs), since
   # other audio related libraries and apps outside of KDE depend on it.  So,
   # we shouldn't rely on kdelibs to make sure that /opt/kde/lib is added to
   # the ld.so.conf.  Do it here, too.
   # Also, I'd rather see arts in /usr at this point, but KDE doesn't seem to
   # pick it up correctly there, and I don't want all of KDE moved into /usr,
   # so it'll have to stay like this for now.
   cat << EOF >> $PKG/install/doinst.sh
# Add KDE library directory to /etc/ld.so.conf:
if fgrep /opt/kde/lib etc/ld.so.conf 1> /dev/null 2> /dev/null ; then
  true
else
  echo "/opt/kde/lib" >> etc/ld.so.conf
fi
EOF
}

