#!/bin/bash # metamail.SlackBuild # Heavily based on the original Slackware build scripts, # Modified by Stuart Winter for ARMedslack. # Record toolchain & other info for the build log: slackbuildinfo # Paths to skeleton port's source & real Slackware source tree: export CWD=$SLACKSOURCE/$PKGSERIES/$PKGNAM export PORTCWD=$PWD # Temporary build locations: export TMPBUILD=$TMP/build-$PKGNAM export PKG=$TMP/package-$PKGNAM mkpkgdirs # Delete & re-create temporary directories then cd into $TMPBUILD # Determine the CFLAGS for the known architectures: case $ARCH in arm) export SLKCFLAGS="-O2 -march=armv5te" export LIBDIRSUFFIX="" ;; *) export SLKCFLAGS="-O2" ;; esac # Extract source: tar xvvf $CWD/$PKGNAM-$VERSION.tar.xz cd $PKGNAM-$VERSION || exit 1 slackhousekeeping # Apply patches: xz -dc $CWD/metamail_2.7-54.diff.xz | patch -p1 || exit 1 xz -dc $CWD/metamail.automake.diff.xz | patch -p1 || exit 1 zcat $CWD/metamail.uue.getline.diff.gz | patch -p1 || exit 1 # Configure: chmod 755 configure CFLAGS="$SLKCFLAGS" \ ./configure \ --prefix=/usr \ --libdir=/usr/lib${LIBDIRSUFFIX} \ --disable-static \ --program-prefix="" \ --program-suffix="" \ --build=$ARCH-slackware-linux-gnueabi || failconfig ( 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 ) # Build: make $NUMJOBS || failmake ( cd bin cat mailto-hebrew | perl -pi -e 's|/usr/lib/X11/fonts/misc|/usr/share/metamail/fonts|' > mh chmod 755 mh ; mv mh mailto-hebrew ) # Install into package framework: make install DESTDIR=$PKG || failinstall ( cd fonts make mkdir -p $PKG/usr/share/metamail/fonts for file in *.pcf ; do cat $file > $PKG/usr/share/metamail/fonts/$file done cat fonts.alias > $PKG/usr/share/metamail/fonts/fonts.alias cat fonts.dir > $PKG/usr/share/metamail/fonts/fonts.dir ) # These are obsolete, broken, and/or undocumented. # 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 $PKG/usr/man/man?/$file.* done mkdir -p $PKG/usr/doc/metamail-$VERSION cp -a \ COPYING CREDITS INSTALL README \ $PKG/usr/doc/metamail-$VERSION # If necessary, start the fakeroot server so we can set file/dir ownerships: start_fakeroot # Apply generic Slackware packaging policies: cd $PKG slackstripall # strip all .a archives and all ELFs slackgzpages -i # compress man & info pages and delete usr/info/dir slackslack # chown -R root:root, chmod -R og-w, slackchown, slack644docs slackdesc # install slack-desc and doinst.sh slackmp # run makepkg -l y -c n # Perform any final checks on the package: cd $PKG slackhlinks # search for any hard links