#!/bin/sh CWD=`pwd` if [ "$TMP" = "" ]; then TMP=/tmp fi VERSION=${VERSION:-2.1.3} #DOCV=${DOCV:-2.0.4} ARCH=${ARCH:-i486} BUILD=${BUILD:-1} 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" fi PKG=$TMP/package-slang rm -rf $PKG mkdir -p $PKG cd $TMP rm -rf slang-$VERSION tar xjvf $CWD/slang-$VERSION.tar.bz2 || exit 1 cd slang-$VERSION chown -R root:root . CFLAGS="$SLKCFLAGS" \ ./configure \ --prefix=/usr \ --mandir=/usr/man \ --sysconfdir=/etc \ --includedir=/usr/include \ --disable-static \ --build=$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/lib/libslang.so.$VERSION # --disable-static doesn't always work, but this is guaranteed: rm -f $PKG/usr/lib/*.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