| 1 | #!/bin/sh |
|---|
| 2 | #slackbuild van http://slackware.cs.utah.edu/slackware_source/n/fetchmail/fetchmail.SlackBuild aangepast. |
|---|
| 3 | #DEP:openssl |
|---|
| 4 | |
|---|
| 5 | # Set initial variables: |
|---|
| 6 | CWD=`pwd` |
|---|
| 7 | if [ "$TMP" = "" ]; then |
|---|
| 8 | TMP=/tmp |
|---|
| 9 | fi |
|---|
| 10 | PKG=$TMP/package-fetchmail |
|---|
| 11 | |
|---|
| 12 | NAME=fetchmail |
|---|
| 13 | VERSION=6.3.26 |
|---|
| 14 | ARCH=i486 |
|---|
| 15 | BUILD=1 |
|---|
| 16 | |
|---|
| 17 | if [ ! -d $TMP ]; then |
|---|
| 18 | mkdir -p $TMP # location to build the source |
|---|
| 19 | fi |
|---|
| 20 | rm -rf $PKG |
|---|
| 21 | mkdir -p $PKG |
|---|
| 22 | |
|---|
| 23 | cd $TMP |
|---|
| 24 | rm -rf fetchmail-$VERSION |
|---|
| 25 | tar xjvf $CWD/fetchmail-$VERSION.tar.bz2 || exit 1 |
|---|
| 26 | cd fetchmail-$VERSION |
|---|
| 27 | |
|---|
| 28 | # this is the sloppiest source tarball ever |
|---|
| 29 | chown -R root.root . |
|---|
| 30 | find . -perm 664 -exec chmod 644 {} \; |
|---|
| 31 | find . -perm 600 -exec chmod 644 {} \; |
|---|
| 32 | find . -perm 444 -exec chmod 644 {} \; |
|---|
| 33 | find . -perm 400 -exec chmod 644 {} \; |
|---|
| 34 | find . -perm 440 -exec chmod 644 {} \; |
|---|
| 35 | find . -perm 777 -exec chmod 755 {} \; |
|---|
| 36 | find . -perm 775 -exec chmod 755 {} \; |
|---|
| 37 | find . -perm 511 -exec chmod 755 {} \; |
|---|
| 38 | find . -perm 711 -exec chmod 755 {} \; |
|---|
| 39 | find . -perm 555 -exec chmod 755 {} \; |
|---|
| 40 | |
|---|
| 41 | CFLAGS="-O2 -march=i486 -mcpu=i686" LDFLAGS=-s ./configure \ |
|---|
| 42 | --prefix=/usr \ |
|---|
| 43 | --enable-nls \ |
|---|
| 44 | --with-ssl || exit 1 |
|---|
| 45 | make || exit 1 |
|---|
| 46 | make install DESTDIR=$PKG || exit 1 |
|---|
| 47 | ( cd $PKG |
|---|
| 48 | find . | xargs file | grep "ELF 32-bit LSB executable" | grep 80386 | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null |
|---|
| 49 | find . | xargs file | grep "ELF 32-bit LSB shared object" | grep 80386 | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null |
|---|
| 50 | ) |
|---|
| 51 | chown -R root.bin $PKG/usr/bin |
|---|
| 52 | ( cd $PKG/usr/man/man1 |
|---|
| 53 | rm fetchmailconf.1 |
|---|
| 54 | gzip -9 * |
|---|
| 55 | ln -sf fetchmail.1.gz fetchmailconf.1.gz |
|---|
| 56 | ) |
|---|
| 57 | mkdir -p $PKG/usr/doc/fetchmail-$VERSION |
|---|
| 58 | cp -a \ |
|---|
| 59 | ABOUT-NLS COPYING FAQ FEATURES INSTALL MANIFEST NEWS NOTES README README.NTLM README.SSL TODO \ |
|---|
| 60 | *.html contrib *.lsm \ |
|---|
| 61 | $PKG/usr/doc/fetchmail-$VERSION |
|---|
| 62 | rm -rf $PKG/usr/doc/fetchmail-$VERSION/RCS $PKG/usr/doc/fetchmail-$VERSION/contrib/RCS |
|---|
| 63 | mkdir -p $PKG/install |
|---|
| 64 | cat $CWD/slack-desc > $PKG/install/slack-desc |
|---|
| 65 | |
|---|
| 66 | #makepkg -l y -c n $TMP/fetchmail-$VERSION-$ARCH-$BUILD.tgz |
|---|
| 67 | |
|---|
| 68 | cd $PKG |
|---|
| 69 | makepkg -l y -c n $CWD/$NAME.pkg > /dev/null && |
|---|
| 70 | echo $VERSION > $CWD/$NAME.version && |
|---|
| 71 | arch > $CWD/$NAME.arch |
|---|