#!/bin/sh # Build ncurses for Slackware # by Patrick Volkerding , 11/2000. # Updated for ncurses-5.3, 2003-01. # v5.4, 2004-02. # v5.5, 2006-02. # Set initial variables: CWD=$(pwd) TMP=${TMP:-/tmp} PKG=$TMP/package-ncurses VERSION=5.6 ARCH=${ARCH:-x86_64} BUILD=${BUILD:-1} DISTRO=${DISTRO:-slamd64} if [ $DISTRO = slackware ]; then PKGARCH=$ARCH else PKGARCH=${ARCH}_${DISTRO} fi if [ $DISTRO = slamd64 ]; then LIBSUFFIX=64 else LIBSUFFIX= fi if [ "$ARCH" = "i386" ]; then SLKCFLAGS="-O2 -march=i386 -mcpu=i686" elif [ "$ARCH" = "i486" ]; then SLKCFLAGS="-O2 -march=i486 -mtune=i686" elif [ "$ARCH" = "s390" ]; then SLKCFLAGS="-O2" elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2 -fPIC" fi ncurses_configure() { CFLAGS="$SLKCFLAGS" \ ./configure \ --prefix=/usr \ --libdir=/usr/lib$LIBSUFFIX \ --with-gpm \ --disable-termcap \ --with-normal \ --with-shared \ --enable-symlinks \ --without-debug \ --without-profile \ --without-ada \ --program-suffix="" \ --program-prefix="" \ $WIDEC \ $ARCH-$DISTRO-linux } rm -rf $PKG mkdir -p $PKG cd $TMP rm -rf ncurses-$VERSION tar xzvf $CWD/ncurses-$VERSION.tar.gz || exit 1 cd ncurses-$VERSION chown -R root:root . for file in $CWD/ncurses-$VERSION-2*.patch.gz ; do zcat $file | patch -p1 --verbose || exit 1 done zcat $CWD/ncurses.mkhashsize.diff.gz | patch -p1 --verbose || exit 1 ncurses_configure make -j9 || exit 1 # Spamming the partition. Sorry, but it's about the only way to get a good 'tic'. make install || exit 1 # Install the package: make install DESTDIR=$PKG || exit 1 # Build/install again with wide character support: make clean WIDEC=--enable-widec ncurses_configure make -j9 || exit 1 make install make install DESTDIR=$PKG # Strip stuff: ( cd $PKG find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null ) # Move the include files from /usr/include into # /usr/include/ncurses, then make symlinks back # into /usr/include. ( cd $PKG/usr/include rm -rf ncurses mkdir ncurses mv *.h ncurses for file in ncurses/* ; do ln -sf $file . done # This shouldn't clobber the real one: mv termcap.h termcap-ncurses.h ) # Move the ncurses libraries into /lib, since they're important: mkdir -p $PKG/lib$LIBSUFFIX ( cd $PKG/usr/lib$LIBSUFFIX chmod 755 *.so chmod 644 *.a mv libncurses.so.5* $PKG/lib$LIBSUFFIX mv libncursesw.so.5* $PKG/lib$LIBSUFFIX rm -f libncurses.so ln -sf /lib$LIBSUFFIX/libncurses.so.5 libncurses.so rm -f libncursesw.so ln -sf /lib$LIBSUFFIX/libncursesw.so.5 libncursesw.so # Olde obsolete names, just in case rm -f libcurses.so ln -sf libncurses.so libcurses.so rm -f libcursesw.so ln -sf libncursesw.so libcursesw.so ) # Set TERMINFO to point to the package: export TERMINFO=$PKG/usr/share/terminfo # Fix the xterm, screen, rxvt, and Eterm entries: for tfile in $CWD/xterm.terminfo $CWD/screeninfo.src $CWD/rxvt.terminfo $CWD/Eterm.ti ; do if [ -r $tfile ]; then progs/tic -v $tfile fi done unset TERMINFO # Then, add /usr/doc/ncurses-xxxxx with appropriate files. mkdir -p $PKG/usr/doc/ncurses-$VERSION cp -a \ ANNOUNCE INSTALL MANIFEST NEWS README* TO-DO \ $PKG/usr/doc/ncurses-$VERSION mkdir -p $PKG/usr/doc/ncurses-$VERSION/c++ cp -a \ c++/NEWS c++/PROBLEMS c++/README-first \ $PKG/usr/doc/ncurses-$VERSION/c++ if [ -r $PKG/usr/man/man1/tack.1 ]; then gzip -9 --force $PKG/usr/man/man1/tack.1 fi # desc file: mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc cd $PKG makepkg -l y -c n ../ncurses-$VERSION-$PKGARCH-$BUILD.tgz