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

VERSION=0.9.5
PROGNAME="gnopernicus $VERSION"
DESC="\
gnopernicus                                                            \n\
                                                                       \n\
The Gnopernicus project enables users with limited vision (or no       \n\
vision) to use the Gnome desktop and applications effectively.  By     \n\
providing automated focus tracking and fullscreen magnification,       \n\
Gnopernicus will aid low-vision Gnome users, and its screen reader     \n\
features will allow low-vision and blind users access to standard      \n\
GTK+2 and Java-based GUI applications via speech and braille output."

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

compile() {
   tar -yxvf $CWD/gnopernicus-$VERSION.tar.bz2
   cd gnopernicus-$VERSION/
   chown -R root.root .
   find . -perm 664 -exec chmod 644 {} \;
   find . -perm 600 -exec chmod 644 {} \;
   find . -perm 444 -exec chmod 644 {} \;
   find . -perm 400 -exec chmod 644 {} \;
   find . -perm 440 -exec chmod 644 {} \;
   find . -perm 777 -exec chmod 755 {} \;
   find . -perm 775 -exec chmod 755 {} \;
   find . -perm 511 -exec chmod 755 {} \;
   find . -perm 711 -exec chmod 755 {} \;
   find . -perm 555 -exec chmod 755 {} \;
   find . -perm 666 -exec chmod 644 {} \;
   find . -perm 664 -exec chmod 644 {} \;
   ./configure --prefix=/usr \
               --sysconfdir=/etc \
               --localstatedir=/var/lib \
               --enable-static=no \
               --build=s390-slackware-linux \
               --host=s390-slackware-linux \
               --target=s390-slackware-linux

   cat $CWD/makefile.diff | patch -p1 --backup --suffix=.orig
   # Pat says
   # Expecting $SED to be set to 'sed' is one of the more
   # ridiculous assumptions I've seen lately.
   export SED=sed

   make
}

install() {
   mkdir -p /package-gnopernicus/etc/gconf/
   make install DESTDIR=/package-gnopernicus

   mkdir -p /package-gnopernicus/usr/doc/gnopernicus-$VERSION
   cp -a AUTHORS COPYING NEWS README TODO \
       /package-gnopernicus/usr/doc/gnopernicus-$VERSION

   rm -f /package-gnopernicus/usr/share/fonts/default/Type1/fonts.cache-1

   mkdir -p /package-gnopernicus/var/lib/scrollkeeper/ \
            /package-gnopernicus/usr/share/fonts/default/Type1

   rm -f /package-gnopernicus/etc/gconf/gconf.xml.defaults/%gconf.xml \
         /package-gnopernicus/etc/gconf/gconf.xml.defaults/apps/%gconf.xml \
         /package-gnopernicus/etc/gconf/gconf.xml.defaults/schemas/%gconf.xml \
         /package-gnopernicus/etc/gconf/gconf.xml.defaults/schemas/apps/%gconf.xml
}

attributes() {
   chown -R root.bin $PKG/package-gnopernicus/usr/bin
   find $PKG/package-gnopernicus/etc -name '%gconf.xml' | xargs chmod 644
}

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

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

   zcat $CWD/doinst.sh.gz >> doinst.sh
}

