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

VERSION=0.2.34
PROGNAME="Enlightemnent Sound Daemon"
DESC="\
esound (Enlightened Sound Daemon)                                    \n\
                                                                     \n\
EsounD, the Enlightened Sound Daemon, is a server process that mixes \n\
several audio streams for playback by a single audio device. For     \n\
example, if you're listening to music on a CD and you receive a      \n\
sound-related event from ICQ, the two applications won't have to     \n\
jockey for the use of your sound card.  Install esound if you'd like \n\
to let sound applications share your audio device."

BUILD=1
MAINTAINER="Mark Post <mark.post@eds.com>"
SOURCE=ftp://ftp.gnome.org/pub/GNOME/stable/sources/
PKGNAME=esound-$VERSION-s390-$BUILD
TAG=ADD

compile() {
   tar -yxvf $CWD/esound-$VERSION.tar.bz2
   cd esound-$VERSION/
   chown -R root.root .
   find . -perm 664 -exec chmod 644 {} \;

   # For whatever reason, the ltmain.sh that comes with esound is creating a libtool
   # script that really messes up badly.
#  cp -vp /usr/share/libtool/ltmain.sh ./

   CFLAGS=-O2 \
   ./configure --prefix=/usr \
               --sysconfdir=/etc \
               --build=s390-slackware-linux \
               --host=s390-slackware-linux \
               --target=s390-slackware-linux
   make
}

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

   mkdir -p /package-esound/usr/doc/esound-$VERSION
   cp -a AUTHORS COPYING COPYING.LIB ChangeLog INSTALL NEWS README TIPS TODO \
       /package-esound/usr/doc/esound-$VERSION

   ( cd /package-esound/usr/man/man1
     rm -f *.gz
     gzip -9 *.1
   )
}

attributes() {
   chown -R root.bin $PKG/package-esound/usr/bin/
}

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

   cd $CTL
   cat $CWD/slack-desc > slack-desc

   sed -e 's%package-esound/%%g' doinst.sh > doinst.sh.new
   cat doinst.sh.new > doinst.sh
   rm doinst.sh.new
}

