--- ncurses.SlackBuild	2006-04-03 20:43:02.000000000 -0400
+++ ncurses.SlackBuild.s390x	2006-09-16 21:07:19.000000000 -0400
@@ -13,7 +13,7 @@
   SLKCFLAGS="-O2 -march=i386 -mcpu=i686"
 elif [ "$ARCH" = "i486" ]; then
   SLKCFLAGS="-O2 -march=i486 -mtune=i686"
-elif [ "$ARCH" = "s390" ]; then
+elif [ "$ARCH" = "s390x" ]; then
   SLKCFLAGS="-O2"
 elif [ "$ARCH" = "x86_64" ]; then
   SLKCFLAGS="-O2"
@@ -23,7 +23,8 @@
 CFLAGS="$SLKCFLAGS" \
 ./configure \
   --prefix=/usr \
-  --with-gpm \
+  --libdir='${exec_prefix}/lib64' \
+  --without-gpm \
   --disable-termcap \
   --with-normal \
   --with-shared \
@@ -49,17 +50,19 @@
 ncurses_configure
 make
 # Spamming the partition.  Sorry, but it's about the only way to get a good 'tic'.
-make install
+#make install
 # Install the package:
-make install DESTDIR=$PKG
+LD_LIBRARY_PATH=/tmp/ncurses-$VERSION/lib make install DESTDIR=$PKG
 
 # Build/install again with wide character support:
 make clean
 WIDEC=--enable-widec
 ncurses_configure
 make
-make install
+#make install
+export LD_LIBRARY_PATH=/tmp/ncurses-$VERSION/lib
 make install DESTDIR=$PKG
+chown -R root:bin $PKG/usr/bin
 
 # Strip stuff:
 ( cd $PKG
@@ -81,17 +84,17 @@
   mv termcap.h termcap-ncurses.h
 )
 
-# Move the ncurses libraries into /lib, since they're important:
-mkdir -p $PKG/lib
-( cd $PKG/usr/lib
+# Move the ncurses libraries into /lib64, since they're important:
+mkdir -p $PKG/lib64
+( cd $PKG/usr/lib64
   chmod 755 *.so
   chmod 644 *.a
-  mv libncurses.so.5* $PKG/lib
-  mv libncursesw.so.5* $PKG/lib
+  mv libncurses.so.5* $PKG/lib64
+  mv libncursesw.so.5* $PKG/lib64
   rm -f libncurses.so
-  ln -sf /lib/libncurses.so.5 libncurses.so
+  ln -sf /lib64/libncurses.so.5 libncurses.so
   rm -f libncursesw.so
-  ln -sf /lib/libncursesw.so.5 libncursesw.so
+  ln -sf /lib64/libncursesw.so.5 libncursesw.so
   # Olde obsolete names, just in case
   rm -f libcurses.so
   ln -sf libncurses.so libcurses.so
@@ -134,6 +137,12 @@
   gzip -9 --force $PKG/usr/man/man1/tack.1
 fi
 
+# Not sure why I have to do this when Pat does not...
+mkdir $PKG/usr/lib
+( cd $PKG/usr/lib
+  ln -s ../share/terminfo terminfo
+)
+
 # desc file:
 mkdir -p $PKG/install
 cat $CWD/slack-desc > $PKG/install/slack-desc
