#!/bin/sh # Set initial variables: CWD=`pwd` if [ "$TMP" = "" ]; then TMP=/tmp fi PKG=$TMP/package-mt-st VERSION=${VERSION:-0.9b} ARCH=${ARCH:-x86_64} BUILD=${BUILD:-1} if [ ! -d $TMP ]; then mkdir -p $TMP # location to build the source fi rm -rf $PKG mkdir -p $PKG cd $TMP rm -rf mt-st-$VERSION tar xzvf $CWD/mt-st-$VERSION.tar.gz cd mt-st-$VERSION zcat $CWD/mt-st.config.diff.gz | patch -p1 --verbose || exit 1 zcat $CWD/mt-st.man.diff.gz | patch -p1 --verbose || exit 1 zcat $CWD/mt-st.sdlt.diff.gz | patch -p1 --verbose || exit 1 chown -R root:root . find . -perm 666 -exec chmod 644 {} \; 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 {} \; make || exit 1 strip mt stinit mkdir -p $PKG/bin cat mt > $PKG/bin/mt-st chmod 755 $PKG/bin/mt-st ( cd $PKG/bin ; ln -sf mt-st mt ) mkdir -p $PKG/sbin cat stinit > $PKG/sbin/stinit chmod 755 $PKG/sbin/stinit mkdir -p $PKG/usr/man/man{1,8} cat mt.1 | gzip -9c > $PKG/usr/man/man1/mt-st.1.gz cat stinit.8 | gzip -9c > $PKG/usr/man/man8/stinit.8.gz ( 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 ) mkdir -p $PKG/usr/doc/mt-st-$VERSION cp -a \ COPYING README* *.lsm stinit.def.examples \ $PKG/usr/doc/mt-st-$VERSION mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc # Build the package: cd $PKG makepkg -l y -c n $TMP/mt-st-$VERSION-$ARCH-$BUILD.tgz