abcde.SlackBuild 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. #!/bin/sh
  2. # Slackware build script for abcde
  3. # abcde has a dependency of cd-discid, see the README
  4. # Copyright 2007 Jim Capozzoli <saltmiser@gmail.com>
  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. # Modified by the SlackBuilds.org project
  24. # Modified by Andrew Strong
  25. PRGNAM=abcde
  26. VERSION=2.3.99.6
  27. BUILD=${BUILD:-2}
  28. TAG=${TAG:-_SBo}
  29. # Automatically determine the architecture we're building on:
  30. if [ -z "$ARCH" ]; then
  31. case "$( uname -m )" in
  32. i?86) ARCH=i486 ;;
  33. arm*) ARCH=arm ;;
  34. # Unless $ARCH is already set, use uname -m for all other archs:
  35. *) ARCH=$( uname -m ) ;;
  36. esac
  37. fi
  38. CWD=$(pwd)
  39. TMP=${TMP:-/tmp/SBo}
  40. PKG=$TMP/package-$PRGNAM
  41. OUTPUT=${OUTPUT:-/tmp}
  42. set -e
  43. rm -rf $PKG
  44. mkdir -p $TMP $PKG $OUTPUT
  45. rm -rf $TMP/$PRGNAM-$VERSION
  46. cd $TMP
  47. tar xvf $CWD/$PRGNAM\_$VERSION.orig.tar.gz
  48. cd $PRGNAM-$VERSION
  49. chown -R root:root .
  50. chmod -R u+w,go+r-w,a-s .
  51. # Fix mandir and remove setting of ownership during install
  52. # The mandir can easily be changed by passing a 'mandir' variable to the
  53. # 'make install' process, but the setting of ownership isn't so easy to
  54. # work around without a patch. This isn't an issue if the SlackBuild
  55. # script is run as root, but I'm guessing that I'm not the only person who
  56. # likes to test a script as normal user before running it as root, and the
  57. # ownership setting in the Makefile will break installs as a normal user.
  58. # --rworkman
  59. patch -p1 < $CWD/Makefile.diff
  60. # An amalgamated patch from Ubuntu and Fedora which allows automatic tagging
  61. # of both m4a/aac and speex files, broken in this version of abcde. Normally
  62. # this should be submitted upstream rather than placed in a SlackBuild script
  63. # but unfortunately there is no upstream at the moment :-).
  64. # For what its worth I have also submitted to the final resting place of abcde:
  65. # http://code.google.com/p/abcde/issues/detail?id=7
  66. patch -p1 < $CWD/aac_speex_tagging.diff
  67. make
  68. make install DESTDIR=$PKG
  69. # Let's not overwrite the config file if it already exists
  70. mv $PKG/etc/$PRGNAM.conf $PKG/etc/$PRGNAM.conf.new
  71. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  72. cp -a COPYING FAQ README TODO changelog examples $PKG/usr/doc/$PRGNAM-$VERSION
  73. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  74. find $PKG/usr/doc/$PRGNAM-$VERSION -type f -exec chmod 644 {} \;
  75. ( cd $PKG/usr/man || exit
  76. find . -type f -exec gzip -9 {} \;
  77. for i in $( find . -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
  78. )
  79. mkdir -p $PKG/install
  80. cat $CWD/slack-desc > $PKG/install/slack-desc
  81. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  82. cd $PKG
  83. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}