#!/bin/sh # Set initial variables: CWD=`pwd` if [ "$TMP" = "" ]; then TMP=/tmp fi PKG=$TMP/package-ftchmail if [ ! -d $TMP ]; then mkdir -p $TMP # location to build the source fi if [ ! -d $PKG ]; then mkdir -p $PKG # place for the package to be built fi # Explode the package framework: cd $PKG explodepkg $CWD/_ftchmail.tar.gz # Find the size of a file: filesize() { SIZE=`ls -l -d -G $1 | cut -b23-32` echo -n $SIZE } echo "+=================+" echo "| fetchmail-5.4.0 |" echo "+=================+" cd $TMP tar xzvf $CWD/fetchmail-5.4.0.tar.gz cd fetchmail-5.4.0 ./configure --prefix=/usr --enable-nls i386-slackware-linux make CFLAGS=-O2 LDFLAGS=-s strip fetchmail cat fetchmail > $PKG/usr/bin/fetchmail cat fetchmailconf > $PKG/usr/bin/fetchmailconf cat fetchmail.man | gzip -9c > $PKG/usr/man/man1/fetchmail.1.gz echo '.so man1/fetchmail.1' | gzip -9c > $PKG/usr/man/man1/fetchmailconf.1.gz mkdir -p $PKG/usr/doc/fetchmail-5.4.0 cp -a ABOUT-NLS COPYING FAQ FEATURES INSTALL MANIFEST NEWS NOTES README \ *.html contrib fetchmail.lsm \ sample.rcfile $PKG/usr/doc/fetchmail-5.4.0 chown -R root.root $PKG/usr/doc/fetchmail-5.4.0 find $PKG/usr/doc/fetchmail-5.4.0 -type d -exec chmod 755 {} \; find $PKG/usr/doc/fetchmail-5.4.0 -type f -exec chmod 644 {} \; cd po for locale in cs es fr gl pl pt_BR ; do mkdir -p $PKG/usr/share/locale/$locale/LC_MESSAGES cat $locale.gmo > $PKG/usr/share/locale/$locale/LC_MESSAGES/fetchmail.mo done # Build the package: cd $PKG tar czvf $TMP/ftchmail.tgz . # Warn of zero-length files: for file in `find . -type f -print` ; do if [ "`filesize $file`" = "0" ]; then echo "WARNING: zero length file $file" fi if [ "`filesize $file`" = "20" ]; then echo "WARNING: possible empty gzipped file $file" fi done # Clean up the extra stuff: if [ "$1" = "--cleanup" ]; then rm -rf $TMP/fetchmail-5.4.0 rm -rf $PKG fi