#!/bin/bash ulimit -s unlimited shopt -s extglob # 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: slackset_var_cwds # Temporary build locations: export TMPBUILD=$TMP/build-$PKGNAM export PKG=$TMP/package-$PKGNAM mkpkgdirs # Delete & re-create temporary directories then cd into $TMPBUILD # Extract source: tar xvvf $CWD/$PKGNAM-$VERSION.tar.!(*sign|*asc|*sig) 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 # Fix misnamed man page: mv -fv man/mmencode.1 man/mimencode.1 # Refresh to support latest architectures: slackupdatelibtool # Configure: chmod 755 configure CFLAGS="$SLKCFLAGS" \ ./configure \ --prefix=/usr \ --libdir=/usr/lib${LIBDIRSUFFIX} \ --disable-static \ --program-prefix="" \ --program-suffix="" \ --build=${SLK_ARCH_BUILD} || 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 || make || 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 # Apply generic Slackware packaging policies: cd $PKG slackstripall # strip all .a archives and all ELFs slack_delete_lafiles # delete usr/lib{,64}/*.la #slackstriprpaths # strip rpaths 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