id3tool.SlackBuild 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. #!/bin/bash
  2. # Slackware build script for id3tool
  3. # Copyright 2012 Markus Hutmacher <email removed>
  4. # Copyright 2018 B. Watson <yalhcru@gmail.com>
  5. # All rights reserved.
  6. #
  7. # Permission to use, copy, modify, and distribute this software for any purpose
  8. # with or without fee is hereby granted, provided that the above copyright
  9. # notice and this permission notice appear in all copies.
  10. #
  11. # THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
  12. # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  13. # FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  14. # AUTHORS AND COPYRIGHT HOLDERS AND THEIR CONTRIBUTORS BE LIABLE FOR ANY
  15. # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  16. # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  17. # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  18. # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  19. # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  20. # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  21. # 20180729 bkw:
  22. # - Take over maintenance.
  23. # - i486 => i586.
  24. # - Reword README and slack-desc (less awkward now).
  25. # - Remove --enable-sudo and --infodir from configure (they did nothing).
  26. # - Don't install useless INSTALL doc.
  27. # - BUILD=2.
  28. # - Simplify script a bit.
  29. cd $(dirname $0) ; CWD=$(pwd)
  30. PRGNAM=id3tool
  31. VERSION=${VERSION:-1.2a}
  32. BUILD=${BUILD:-2}
  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. --mandir=/usr/man \
  77. --build=$ARCH-slackware-linux
  78. make
  79. make install-strip DESTDIR=$PKG
  80. gzip $PKG/usr/man/man1/$PRGNAM.1
  81. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  82. cp -a COPYING README CHANGELOG $PKG/usr/doc/$PRGNAM-$VERSION
  83. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  84. mkdir -p $PKG/install
  85. cat $CWD/slack-desc > $PKG/install/slack-desc
  86. cd $PKG
  87. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE