#!/bin/sh # Set initial variables: CWD=`pwd` PKG=/tmp/package-metamail VERSION=2.7 ARCH=${ARCH:-x86_64} 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 -fPIC" SLKLDFLAGS="-L/usr/lib64" LIBSUFFIX=64 fi rm -rf $PKG mkdir -p $PKG cd /tmp rm -rf metamail-$VERSION tar xzvf $CWD/metamail-$VERSION.tar.gz cd metamail-$VERSION chown -R root.root . find . -perm 400 -exec chmod 644 {} \; find . -perm 600 -exec chmod 644 {} \; find . -perm 700 -exec chmod 755 {} \; zcat $CWD/metamail_2.7-43.diff.gz | patch -p1 zcat $CWD/metamail.fmtbuf.diff.gz | patch -p1 ( cd bin cat showexternal | perl -pi -e 's|sensible-pager|more|' > se chmod 755 se ; mv se showexternal cat sun-message | perl -pi -e 's|sensible-pager|more|' > sm chmod 755 sm ; mv sm sun-message ) ( cd src/metamail cat mailto.c | perl -pi -e 's|sensible-pager|more|' > m.c mv m.c mailto.c ) if [ ! -r configure ]; then sh autogen.sh fi chmod +x configure LDFLAGS="$SLKLDFLAGS" \ CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ ./configure \ --prefix=/usr \ --libdir=/usr/lib${LIBSUFFIX} \ --program-prefix="" \ --program-suffix="" \ $ARCH-slackware-linux make ( cd bin cat mailto-hebrew | perl -pi -e 's|/usr/lib/X11/fonts/misc|/usr/lib/metamail/fonts|' > mh chmod 755 mh ; mv mh mailto-hebrew ) make install DESTDIR=$PKG # Install man pages ( cd man mkdir -p $PKG/usr/man/man1 for file in *.1 ; do cat $file | gzip -9c > $PKG/usr/man/man1/$file.gz done #mkdir -p $PKG/usr/man/man4 #for file in *.4 ; do # cat $file | gzip -9c > /usr/man/man4/$file.gz #done mkdir -p $PKG/usr/man/man5 for file in *.5 ; do cat $file | gzip -9c > $PKG/usr/man/man5/$file.gz done ) # Install fonts ( cd fonts make mkdir -p $PKG/usr/lib$LIBSUFFIX/metamail/fonts for file in *.pcf ; do cat $file > $PKG/usr/lib$LIBSUFFIX/metamail/fonts/$file done cat fonts.alias > $PKG/usr/lib$LIBSUFFIX/metamail/fonts/fonts.alias cat fonts.dir > $PKG/usr/lib$LIBSUFFIX/metamail/fonts/fonts.dir ) (cd $PKG # These are obsolete, broken, and/or undocumented. # The Slackware build file is the definitive guide of whether Slamd64 includes them or not, so # if Slackware -current also doesn't ship it, complain to volkerdi@slackware.com if you miss any of them... for file in \ mailserver rcvAppSingle richtoatk sndAppSingle sun-audio-file sun-message sun-to-mime sun2mime \ rcvAppleSingle sndAppleSingle sun-message.csh \ ; do rm -f $PKG/usr/bin/$file rm -f $PKG/usr/man/man1/$file.1 done ) chown -R root.root $PKG/usr/bin ( 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/metamail-$VERSION cp -a \ CREDITS README mailcap \ $PKG/usr/doc/metamail-$VERSION chmod 644 $PKG/usr/doc/metamail-$VERSION/* gzip -9 $PKG/usr/man/man?/* mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc cd $PKG makepkg -l y -c n ../metamail-$VERSION-$ARCH-$BUILD.tgz # Clean up the extra stuff: if [ "$1" = "--cleanup" ]; then rm -rf /tmp/metamail-$VERSION rm -rf $PKG fi