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

VERSION=0.6.3
PROGNAME="gst-plugins $VERSION"
DESC="\
gst-plugins                                                            \n\
                                                                       \n\
This is gst-plugins, a set of multimedia plugins for GStreamer."

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

compile() {
   # Sometimes this gets built before the rest of KDE, but arts is already there
   export PATH=$PATH:/opt/kde/bin/

   tar -yxvf $CWD/gst-plugins-$VERSION.tar.bz2
   cd gst-plugins-$VERSION/
   chown -R root.root .
   find . -perm 666 -exec chmod 644 {} \;
   find . -perm 664 -exec chmod 644 {} \;
   CFLAGS=-O2 \
   ./configure --prefix=/usr \
               --sysconfdir=/etc \
               --localstatedir=/var/lib \
               --program-prefix="" \
               --program-suffix="" \
               --disable-static \
               --build=s390-slackware-linux \
               --host=s390-slackware-linux \
               --target=s390-slackware-linux
   cat $CWD/makefile.diff | patch -p1 --backup --suffix=.orig
   make -i
}

install() {
cd $TMP/gst-plugins-$VERSION/
   mkdir -p /package-gst-plugins/etc/gconf/gconf.xml.defaults
   make -i install DESTDIR=/package-gst-plugins

   mkdir -p /package-gst-plugins/usr/doc/gst-plugins-$VERSION
   cp -a AUTHORS COPYING INSTALL NEWS README RELEASE REQUIREMENTS TODO \
       /package-gst-plugins/usr/doc/gst-plugins-$VERSION

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

   rm -f /package-gst-plugins/etc/gconf/gconf.xml.defaults/%gconf.xml \
         /package-gst-plugins/etc/gconf/gconf.xml.defaults/schemas/%gconf.xml \
         /package-gst-plugins/etc/gconf/gconf.xml.defaults/schemas/system/%gconf.xml \
         /package-gst-plugins/etc/gconf/gconf.xml.defaults/system/%gconf.xml
}

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

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

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

   zcat $CWD/doinst.sh.gz >> doinst.sh
   sed -e 's%package-gst-plugins/%%g' doinst.sh > doinst.sh.new
   cat doinst.sh.new > doinst.sh
   rm doinst.sh.new
}

