mp3splt.SlackBuild 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. #!/bin/bash
  2. # Slackware build script for mp3splt
  3. # Copyright 2008-2013 Roberto Neri, Palermo, Italy
  4. #
  5. # All rights reserved.
  6. #
  7. # Redistribution and use of this script, with or without modification, is
  8. # permitted provided that the following conditions are met:
  9. #
  10. # 1. Redistributions of this script must retain the above copyright
  11. # notice, this list of conditions and the following disclaimer.
  12. #
  13. # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED
  14. # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  15. # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  16. # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  17. # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  18. # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  19. # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  20. # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  21. # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  22. # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  23. # 20140819 bkw:
  24. # - Updated for v2.6.1a
  25. # - Get rid of empty TODO and redundant INSTALL from /usr/doc.
  26. # - Use make install-strip instead of find/xargs/strip
  27. # 20150107 bkw:
  28. # - Updated for v2.6.2
  29. cd $(dirname $0) ; CWD=$(pwd)
  30. PRGNAM=mp3splt
  31. VERSION=${VERSION:-2.6.2}
  32. BUILD=${BUILD:-1}
  33. TAG=${TAG:-_SBo}
  34. PKGTYPE=${PKGTYPE:-tgz}
  35. if [ -z "$ARCH" ]; then
  36. case "$( uname -m )" in
  37. i?86) ARCH=i586 ;;
  38. arm*) ARCH=arm ;;
  39. *) ARCH=$( uname -m ) ;;
  40. esac
  41. fi
  42. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  43. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  44. exit 0
  45. fi
  46. TMP=${TMP:-/tmp/SBo}
  47. PKG=$TMP/package-$PRGNAM
  48. OUTPUT=${OUTPUT:-/tmp}
  49. if [ "$ARCH" = "i586" ]; then
  50. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  51. LIBDIRSUFFIX=""
  52. elif [ "$ARCH" = "i686" ]; then
  53. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  54. LIBDIRSUFFIX=""
  55. elif [ "$ARCH" = "x86_64" ]; then
  56. SLKCFLAGS="-O2 -fPIC"
  57. LIBDIRSUFFIX="64"
  58. else
  59. SLKCFLAGS="-O2"
  60. LIBDIRSUFFIX=""
  61. fi
  62. set -e
  63. rm -rf $PKG
  64. mkdir -p $TMP $PKG $OUTPUT
  65. cd $TMP
  66. rm -rf $PRGNAM-$VERSION
  67. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
  68. cd $PRGNAM-$VERSION
  69. chown -R root:root .
  70. find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
  71. \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
  72. CFLAGS="$SLKCFLAGS" \
  73. CXXFLAGS="$SLKCFLAGS" \
  74. ./configure \
  75. --prefix=/usr \
  76. --libdir=/usr/lib${LIBDIRSUFFIX} \
  77. --mandir=/usr/man \
  78. --enable-oggsplt_symlink \
  79. --enable-flacsplt_symlink \
  80. --build=$ARCH-slackware-linux
  81. make
  82. make install-strip DESTDIR=$PKG
  83. find $PKG/usr/man -type f -exec gzip -9 {} \;
  84. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  85. cp -a AUTHORS ChangeLog COPYING NEWS README $PKG/usr/doc/$PRGNAM-$VERSION
  86. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  87. mkdir -p $PKG/install
  88. cat $CWD/slack-desc > $PKG/install/slack-desc
  89. cd $PKG
  90. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE