gimp-gap.SlackBuild 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. #!/bin/bash
  2. # Slackware build script for gimp-gap
  3. # Copyright 2010-2012 Willy Sudiarto Raharjo <willysr@slackware-id.org>
  4. # All rights reserved.
  5. #
  6. # Permission to use, copy, modify, and distribute this software for any purpose
  7. # with or without fee is hereby granted, provided that the above copyright
  8. # notice and this permission notice appear in all copies.
  9. #
  10. # THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
  11. # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  12. # FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  13. # AUTHORS AND COPYRIGHT HOLDERS AND THEIR CONTRIBUTORS BE LIABLE FOR ANY
  14. # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  15. # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  16. # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  17. # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  18. # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  19. # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  20. cd $(dirname $0) ; CWD=$(pwd)
  21. PRGNAM=gimp-gap
  22. VERSION=${VERSION:-2.6.0}
  23. BUILD=${BUILD:-1}
  24. TAG=${TAG:-_SBo}
  25. PKGTYPE=${PKGTYPE:-tgz}
  26. if [ -z "$ARCH" ]; then
  27. case "$( uname -m )" in
  28. i?86) ARCH=i586 ;;
  29. arm*) ARCH=arm ;;
  30. *) ARCH=$( uname -m ) ;;
  31. esac
  32. fi
  33. # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
  34. # the name of the created package would be, and then exit. This information
  35. # could be useful to other scripts.
  36. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  37. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  38. exit 0
  39. fi
  40. TMP=${TMP:-/tmp/SBo}
  41. PKG=$TMP/package-$PRGNAM
  42. OUTPUT=${OUTPUT:-/tmp}
  43. if [ "$ARCH" = "i586" ]; then
  44. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  45. LIBDIRSUFFIX=""
  46. elif [ "$ARCH" = "i686" ]; then
  47. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  48. LIBDIRSUFFIX=""
  49. elif [ "$ARCH" = "x86_64" ]; then
  50. SLKCFLAGS="-O2 -fPIC"
  51. LIBDIRSUFFIX="64"
  52. else
  53. SLKCFLAGS="-O2"
  54. LIBDIRSUFFIX=""
  55. fi
  56. DOCS="AUTHORS COPYING ChangeLog INSTALL NEWS README \
  57. docs/howto/txt/HOWTO-do-lossless-MPEG-cut.txt \
  58. docs/howto/txt/HOWTO-write-animated-plug-ins.txt"
  59. libfaac="" ; [ "${FAAC:-yes}" != "yes" ] && libfaac="--disable-ff-libfaac"
  60. libfaad="" ; [ "${FAAD:-yes}" != "yes" ] && libfaad="--disable-ff-libfaad"
  61. libx264="" ; [ "${X264:-yes}" != "yes" ] && libx264="--disable-ff-libx264"
  62. libmpeg="" ; [ "${MPEG:-yes}" != "yes" ] && libmpeg="--disable-libmpeg3"
  63. libxvid="" ; [ "${XVID:-yes}" != "yes" ] && libxvid="--disable-libxvidcore"
  64. set -e
  65. rm -rf $PKG
  66. mkdir -p $TMP $PKG $OUTPUT
  67. cd $TMP
  68. rm -rf $PRGNAM-$VERSION
  69. tar xvf $CWD/${PRGNAM}-${VERSION}.tar.bz2
  70. cd $PRGNAM-$VERSION
  71. chown -R root:root .
  72. find -L . \
  73. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  74. -o -perm 511 \) -exec chmod 755 {} \; -o \
  75. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  76. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
  77. CFLAGS="$SLKCFLAGS" \
  78. CXXFLAGS="$SLKCFLAGS" \
  79. ./configure \
  80. --prefix=/usr \
  81. --libdir=/usr/lib${LIBDIRSUFFIX} \
  82. --sysconfdir=/etc \
  83. --localstatedir=/var \
  84. --mandir=/usr/man \
  85. --docdir=/usr/doc/$PRGNAM-$VERSION \
  86. --disable-audio-support \
  87. $libfaac \
  88. $libfaad \
  89. $libx264 \
  90. $libmpeg \
  91. $libxvid \
  92. --build=$ARCH-slackware-linux \
  93. LIBS="-lm"
  94. # Thanks to Heinz Wiesinger for the patch
  95. # This patch should fix compilation if internal ffmpeg is used
  96. #patch -p0 -i $CWD/patch-ffmpeg-Makefile.diff
  97. # Parallel building seems broken
  98. make -j1
  99. make install DESTDIR=$PKG
  100. find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
  101. | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  102. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  103. cp -a $DOCS $PKG/usr/doc/$PRGNAM-$VERSION
  104. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  105. mkdir -p $PKG/install
  106. cat $CWD/slack-desc > $PKG/install/slack-desc
  107. cd $PKG
  108. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE