#!/bin/sh CWD=`pwd` if [ "$TMP" = "" ]; then TMP=/tmp fi VERSION=${VERSION:-2.0.6} DOCV=${DOCV:-2.0.4} ARCH=${ARCH:-x86_64} BUILD=${BUILD:-2} 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 PKG=$TMP/package-slang rm -rf $PKG mkdir -p $PKG cd $TMP rm -rf slang-$VERSION tar xjvf $CWD/slang-$VERSION.tar.bz2 cd slang-$VERSION chown -R root:root . CFLAGS="$SLKCFLAGS" \ ./configure \ --prefix=/usr \ --libdir=/usr/lib64 \ --includedir=/usr/include \ --disable-static \ $ARCH-slackware-linux make -j4 || exit 1 make install DESTDIR=$PKG make -j4 elf || exit 1 make install-elf DESTDIR=$PKG chmod 755 $PKG/usr/lib64/libslang.so.$VERSION # --disable-static doesn't always work, but this is guaranteed: rm -f $PKG/usr/lib64/*.a ( 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 ) # Compress and if needed symlink the man pages: if [ -d $PKG/usr/man ]; then ( cd $PKG/usr/man for manpagedir in $(find . -type d -name "man*") ; do ( cd $manpagedir for eachpage in $( find . -type l -maxdepth 1) ; do ln -s $( readlink $eachpage ).gz $eachpage.gz rm $eachpage done gzip -9 *.? ) done ) fi # Prepare the documentation: rm -r $PKG/usr/share/doc/slang rm -r $PKG/usr/share/doc rmdir $PKG/usr/share/doc mkdir -p $PKG/usr/doc/slang-$VERSION cp -a \ COPYING INSTALL.pc INSTALL.unx INSTALL.vms NEWS README UPGRADE.txt \ $PKG/usr/doc/slang-$VERSION # Add some additional documentation: tar xjvf $CWD/slangdoc-$DOCV.tar.bz2 chown -R root:root doc cp -a doc/html $PKG/usr/doc/slang-$VERSION mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc cd $PKG makepkg -l y -c n $TMP/slang-$VERSION-$ARCH-$BUILD.tgz