oggconvert.SlackBuild 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. #!/bin/bash
  2. # Slackware build script for <appname>
  3. # Written by Branden branden5th@gmail.com
  4. #Copyright (c) 2012, Branden
  5. #All rights reserved.
  6. #
  7. # Redistribution and use in source and binary forms, with or without
  8. # modification, are permitted provided that the following conditions are met:
  9. # * Redistributions of source code must retain the above copyright
  10. # notice, this list of conditions and the following disclaimer.
  11. # * Redistributions in binary form must reproduce the above copyright
  12. # notice, this list of conditions and the following disclaimer in the
  13. # documentation and/or other materials provided with the distribution.
  14. #
  15. #THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
  16. #CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
  17. #BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  18. #FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  19. #COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  20. #INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  21. # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  22. #USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  23. #ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  24. #(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  25. # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  26. cd $(dirname $0) ; CWD=$(pwd)
  27. PRGNAM=oggconvert
  28. VERSION=${VERSION:-0.3.3}
  29. BUILD=${BUILD:-1}
  30. TAG=${TAG:-_SBo}
  31. PKGTYPE=${PKGTYPE:-tgz}
  32. if [ -z "$ARCH" ]; then
  33. case "$( uname -m )" in
  34. i?86) ARCH=i486 ;;
  35. arm*) ARCH=arm ;;
  36. *) ARCH=$( uname -m ) ;;
  37. esac
  38. fi
  39. # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
  40. # the name of the created package would be, and then exit. This information
  41. # could be useful to other scripts.
  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. set -e
  50. rm -rf $PKG
  51. mkdir -p $TMP $PKG $OUTPUT
  52. cd $TMP
  53. rm -rf $PRGNAM-$VERSION
  54. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
  55. cd $PRGNAM-$VERSION
  56. chown -R root:root .
  57. find -L . \
  58. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \
  59. -exec chmod 755 {} \; -o \
  60. \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
  61. -exec chmod 644 {} \;
  62. python setup.py install --root=$PKG
  63. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  64. cp -a \
  65. PKG-INFO COPYING AUTHORS ChangeLog README TODO \
  66. $PKG/usr/doc/$PRGNAM-$VERSION
  67. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  68. mkdir -p $PKG/install
  69. cat $CWD/slack-desc > $PKG/install/slack-desc
  70. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  71. cd $PKG
  72. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE