mpgtx.SlackBuild 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. #!/bin/bash
  2. # Slackware build script for mpgtx
  3. # Written by Matteo Bernardini <ponce@slackbuilds.org>
  4. # Modified by Erik Hanson <erik@slackbuilds.org>
  5. cd $(dirname $0) ; CWD=$(pwd)
  6. PRGNAM=mpgtx
  7. VERSION=${VERSION:-1.3.1}
  8. BUILD=${BUILD:-2}
  9. TAG=${TAG:-_SBo}
  10. PKGTYPE=${PKGTYPE:-tgz}
  11. if [ -z "$ARCH" ]; then
  12. case "$( uname -m )" in
  13. i?86) ARCH=i486 ;;
  14. arm*) ARCH=arm ;;
  15. *) ARCH=$( uname -m ) ;;
  16. esac
  17. fi
  18. # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
  19. # the name of the created package would be, and then exit. This information
  20. # could be useful to other scripts.
  21. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  22. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  23. exit 0
  24. fi
  25. TMP=${TMP:-/tmp/SBo}
  26. PKG=$TMP/package-$PRGNAM
  27. OUTPUT=${OUTPUT:-/tmp}
  28. if [ "$ARCH" = "i486" ]; then
  29. SLKCFLAGS="-O2 -march=i486 -mtune=i686"
  30. elif [ "$ARCH" = "i686" ]; then
  31. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  32. elif [ "$ARCH" = "x86_64" ]; then
  33. SLKCFLAGS="-O2 -fPIC"
  34. else
  35. SLKCFLAGS="-O2"
  36. fi
  37. set -e
  38. rm -rf $PKG
  39. mkdir -p $TMP $PKG $OUTPUT
  40. cd $TMP
  41. rm -rf $PRGNAM-$VERSION
  42. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
  43. cd $PRGNAM-$VERSION
  44. chown -R root:root .
  45. find -L . \
  46. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \
  47. -exec chmod 755 {} \; -o \
  48. \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
  49. -exec chmod 644 {} \;
  50. # Various fixes from Timothy Redaelli <drizzt@gentoo.org>
  51. patch -p0 < $CWD/patches/mpgtx-1.3.1-configure.patch
  52. patch -p1 < $CWD/patches/mpgtx-1.3.1-dont-ignore-cxx-flags.patch
  53. CXXFLAGS=$SLKCFLAGS ./configure --prefix=/usr
  54. make
  55. cd man
  56. make
  57. cd de
  58. make
  59. cd ../..
  60. mkdir -p $PKG/usr/bin
  61. install -s -m 755 mpgtx $PKG/usr/bin
  62. for l in mpgjoin mpgsplit mpgcat mpginfo mpgdemux tagmp3 ; do
  63. ln -s /usr/bin/mpgtx $PKG/usr/bin/$l
  64. done
  65. mkdir -p $PKG/usr/man/man1
  66. mkdir -p $PKG/usr/man/de/man1
  67. cp -a man/*.1 $PKG/usr/man/man1
  68. cp -a man/de/*.1 $PKG/usr/man/de/man1
  69. find $PKG/usr/man -type f -exec gzip -9 {} \;
  70. for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
  71. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  72. cp -a AUTHORS COPYING README TODO $PKG/usr/doc/$PRGNAM-$VERSION
  73. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  74. mkdir -p $PKG/install
  75. cat $CWD/slack-desc > $PKG/install/slack-desc
  76. cd $PKG
  77. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE