]> git.friedersdorff.com Git - max/slackbuilds.git/blobdiff - office/mailcheck/mailcheck.SlackBuild
Add slackbuild for mailcheck
[max/slackbuilds.git] / office / mailcheck / mailcheck.SlackBuild
diff --git a/office/mailcheck/mailcheck.SlackBuild b/office/mailcheck/mailcheck.SlackBuild
new file mode 100644 (file)
index 0000000..b612487
--- /dev/null
@@ -0,0 +1,104 @@
+#!/bin/sh -e
+
+# Slackware build script for mailcheck
+
+# Copyright 2017 Maximilian Friederdorff
+
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+
+# set up some variables for the build process
+CWD=$(pwd)
+if [ "$TMP" = "" ]; then
+  TMP=/tmp
+fi
+
+APP="mailcheck"
+VERSION=${VERSION:-1.91.2}
+PKG_VERSION=$VERSION
+
+# Detect the architecture
+if [ -z "$ARCH" ]; then
+  case "$( uname -m )" in
+    i?86) export ARCH=i586 ;;
+    arm*) export ARCH=arm ;;
+    # Unless $ARCH is already set, use uname -m for all other archs:
+    *) export ARCH=$( uname -m ) ;;
+  esac
+fi
+
+if [ "$ARCH" = "i486" ]; then
+  SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+elif [ "$ARCH" = "x86_64" ]; then
+  SLKCFLAGS="-O2 -fPIC"
+fi
+
+NUMJOBS=${NUMJOBS:-" -j4 "}
+
+BUILD=${BUILD:-1_maf}
+PKG=$TMP/package-$APP
+
+# Clean build location in case of previous build attempts
+rm -rf $PKG
+mkdir -p $TMP $PKG
+rm -rf $TMP/$APP-$VERSION
+
+cd $TMP || exit 1
+
+# Extract sources
+tar -zxvf $CWD/${APP}_${VERSION}.tar.gz || exit 1
+cd $APP-$VERSION || exit 1
+
+# Ensure ownership and permissions are consistant 
+chown -R root:root .
+chmod -R u+w,go+r-w,a-s .
+
+# Build and install
+make $NUMJOBS || exit
+mkdir -p $PKG/usr/bin
+make install prefix=$PKG || exit
+
+# Install documentation
+mkdir -p $PKG/usr/doc/$APP-$VERSION
+cp -a COPYING mailcheckrc mailcheck.1 $PKG/usr/doc/$APP-$VERSION
+find $PKG/usr/doc/$APP-$VERSION -type f -exec chmod 644 {} \;
+cat $CWD/$APP.SlackBuild > $PKG/usr/doc/$APP-$VERSION/$APP.SlackBuild
+
+# Install slack-desc file
+mkdir -p $PKG/install
+cat $CWD/slack-desc > $PKG/install/slack-desc
+
+# Strip some libraries and binaries
+( 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
+)
+
+# Compress man pages if they exist
+if [ -d $PKG/usr/man ]; then
+  ( cd $PKG/usr/man
+  find . -type f -exec gzip -9 {} \;
+  for i in $(find . -type l) ; do ln -s $(readlink $i).gz $i.gz ; rm $i ; done
+  ) 
+fi
+
+# Compress info pages if they exist (and remove the dir file)
+if [ -d $PKG/usr/info ]; then
+  gzip -9 $PKG/usr/info/*.info
+  rm -f $PKG/usr/info/dir
+fi
+
+# Make the package
+cd $PKG
+/sbin/makepkg -l y -c n $TMP/$APP-$PKG_VERSION-$ARCH-$BUILD.tgz