gmtp.SlackBuild 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. #!/bin/bash
  2. # Generated by Alien's SlackBuild Toolkit: http://slackware.com/~alien/AST
  3. # Copyright 2009, 2010, 2011, 2012, 2013, 2014 Eric Hameleers, Eindhoven, Netherlands
  4. # Slackware build script for gmtp
  5. # Based on http://slackbuilds.org/template.SlackBuild
  6. # Copyright 2014 Thorn Inurcide United States
  7. # Copyright 2014-2017 Ryan P.C. McQuen | Everett, WA | ryanpcmcquen@member.fsf.org
  8. # Copyright 2017 Jeremy Hansen <jebrhansen+SBo -at- gmail.com>
  9. # All rights reserved.
  10. #
  11. # Redistribution and use of this script, with or without modification, is
  12. # permitted provided that the following conditions are met:
  13. #
  14. # 1. Redistributions of this script must retain the above copyright
  15. # notice, this list of conditions and the following disclaimer.
  16. #
  17. # THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
  18. # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  19. # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  20. # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  21. # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  22. # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  23. # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  24. # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  25. # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  26. # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  27. cd $(dirname $0) ; CWD=$(pwd)
  28. PRGNAM=gmtp
  29. VERSION=${VERSION:-1.3.11}
  30. BUILD=${BUILD:-1}
  31. TAG=${TAG:-_SBo}
  32. PKGTYPE=${PKGTYPE:-tgz}
  33. if [ -z "$ARCH" ]; then
  34. case "$( uname -m )" in
  35. i?86) export ARCH=i586 ;;
  36. arm*) export ARCH=arm ;;
  37. *) export ARCH=$( uname -m ) ;;
  38. esac
  39. fi
  40. # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
  41. # the name of the created package would be, and then exit. This information
  42. # could be useful to other scripts.
  43. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  44. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  45. exit 0
  46. fi
  47. TMP=${TMP:-/tmp/SBo}
  48. PKG=$TMP/package-$PRGNAM
  49. OUTPUT=${OUTPUT:-/tmp}
  50. if [ "$ARCH" = "i586" ]; then
  51. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  52. LIBDIRSUFFIX=""
  53. elif [ "$ARCH" = "i686" ]; then
  54. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  55. LIBDIRSUFFIX=""
  56. elif [ "$ARCH" = "x86_64" ]; then
  57. SLKCFLAGS="-O2 -fPIC"
  58. LIBDIRSUFFIX="64"
  59. else
  60. SLKCFLAGS="-O2"
  61. LIBDIRSUFFIX=""
  62. fi
  63. set -e
  64. rm -rf $PKG
  65. mkdir -p $TMP $PKG $OUTPUT
  66. cd $TMP
  67. rm -rf $PRGNAM-$VERSION
  68. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
  69. cd $PRGNAM-$VERSION
  70. chown -R root:root .
  71. find -L . \
  72. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  73. -o -perm 511 \) -exec chmod 755 {} \; -o \
  74. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  75. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
  76. SLKCFLAGS+=" -fcommon"
  77. CFLAGS="$SLKCFLAGS" \
  78. CXXFLAGS="$SLKCFLAGS" \
  79. ./configure \
  80. --prefix=/usr \
  81. --libdir=/usr/lib${LIBDIRSUFFIX} \
  82. --sysconfdir=/etc \
  83. --localstatedir=/var \
  84. --docdir=/usr/doc/$PRGNAM-$VERSION \
  85. --with-gtk2 \
  86. --disable-schemas-compile \
  87. --disable-schemas-install \
  88. --build=$ARCH-slackware-linux
  89. make
  90. make install DESTDIR=$PKG
  91. find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" \
  92. | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  93. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  94. cp -a ABOUT-NLS AUTHORS COPYING ChangeLog README $PKG/usr/doc/$PRGNAM-$VERSION
  95. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  96. mkdir -p $PKG/install
  97. cat $CWD/slack-desc > $PKG/install/slack-desc
  98. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  99. cd $PKG
  100. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE