sfnt2woff.SlackBuild 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. #!/bin/bash
  2. # Slackware build script for sfnt2woff
  3. # Copyright 2016 Ryan S. Northrup <northrup@yellowapple.us>
  4. # All rights reserved.
  5. #
  6. # Redistribution and use of this script, with or without modification,
  7. # is permitted provided that the following conditions are met:
  8. #
  9. # 1. Redistributions of this script must retain the above copyright
  10. # notice, this list of conditions and the following disclaimer.
  11. #
  12. # THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR
  13. # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  14. # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  15. # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
  16. # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  17. # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
  18. # GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  19. # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  20. # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  21. # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  22. # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  23. cd $(dirname $0) ; CWD=$(pwd)
  24. PRGNAM=sfnt2woff
  25. VERSION=${VERSION:-2009.10.03}
  26. SRCVER=20091003
  27. BUILD=${BUILD:-1}
  28. TAG=${TAG:-_SBo}
  29. PKGTYPE=${PKGTYPE:-tgz}
  30. if [ -z "$ARCH" ]; then
  31. case "$( uname -m )" in
  32. i?86) ARCH=i586 ;;
  33. arm*) ARCH=arm ;;
  34. *) ARCH=$( uname -m ) ;;
  35. esac
  36. fi
  37. # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
  38. # the name of the created package would be, and then exit. This information
  39. # could be useful to other scripts.
  40. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  41. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  42. exit 0
  43. fi
  44. TMP=${TMP:-/tmp/SBo}
  45. PKG=$TMP/package-$PRGNAM
  46. OUTPUT=${OUTPUT:-/tmp}
  47. if [ "$ARCH" = "i586" ]; then
  48. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  49. elif [ "$ARCH" = "i686" ]; then
  50. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  51. elif [ "$ARCH" = "x86_64" ]; then
  52. SLKCFLAGS="-O2 -fPIC"
  53. else
  54. SLKCFLAGS="-O2"
  55. fi
  56. set -e
  57. rm -rf $PKG
  58. mkdir -p $TMP $PKG $OUTPUT
  59. cd $TMP
  60. rm -rf $PRGNAM-$SRCVER
  61. tar xvf $CWD/$PRGNAM-$SRCVER.tar.gz
  62. cd $PRGNAM-$SRCVER
  63. chown -R root:root .
  64. find -L . \
  65. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  66. -o -perm 511 \) -exec chmod 755 {} \; -o \
  67. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  68. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
  69. # Ain't really much to the build process
  70. CC="cc $SLCKFLAGS" make
  71. find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
  72. | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  73. # There's no "make install", but we can do that ourselves.
  74. mkdir -p $PKG/usr/bin
  75. cp -a sfnt2woff woff2sfnt $PKG/usr/bin
  76. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  77. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  78. mkdir -p $PKG/install
  79. cat $CWD/slack-desc > $PKG/install/slack-desc
  80. cd $PKG
  81. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE