python3-cycler.SlackBuild 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. #!/bin/bash
  2. # Slackware build script for cycler
  3. # Copyright 2016-2017 Serban Udrea <s.udrea@gsi.de>
  4. # Jeremy Hansen <jebrhansen+SBo -at- gmail.com>
  5. # All rights reserved.
  6. #
  7. # Redistribution and use of this script, with or without modification,
  8. # is 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
  14. # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  15. # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  16. # DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
  17. # INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  18. # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  19. # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  20. # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
  21. # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
  22. # IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  23. # POSSIBILITY OF SUCH DAMAGE.
  24. cd $(dirname $0) ; CWD=$(pwd)
  25. PRGNAM=python3-cycler
  26. SRCNAM=cycler
  27. VERSION=${VERSION:-0.11.0}
  28. BUILD=${BUILD:-1}
  29. TAG=${TAG:-_SBo}
  30. PKGTYPE=${PKGTYPE:-tgz}
  31. if [ -z "$ARCH" ]; then
  32. case "$( uname -m )" in
  33. i?86) ARCH=i586 ;;
  34. arm*) ARCH=arm ;;
  35. *) ARCH=$( uname -m ) ;;
  36. esac
  37. fi
  38. # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
  39. # the name of the created package would be, and then exit. This information
  40. # could be useful to other scripts.
  41. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  42. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  43. exit 0
  44. fi
  45. TMP=${TMP:-/tmp/SBo}
  46. PKG=${PKG:-$TMP/package-$PRGNAM}
  47. OUTPUT=${OUTPUT:-/tmp}
  48. set -e
  49. rm -rf $PKG
  50. mkdir -p $TMP $PKG $OUTPUT
  51. cd $TMP
  52. rm -rf $SRCNAM-$VERSION
  53. tar xvf $CWD/$SRCNAM-$VERSION.tar.gz
  54. cd $SRCNAM-$VERSION
  55. chown -R root:root .
  56. find -L . \
  57. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  58. -o -perm 511 \) -exec chmod 755 {} \; -o \
  59. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  60. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
  61. python3 setup.py install --root $PKG
  62. find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
  63. | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  64. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  65. cp -a LICENSE PKG-INFO README.rst $PKG/usr/doc/$PRGNAM-$VERSION
  66. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  67. mkdir -p $PKG/install
  68. cat $CWD/slack-desc > $PKG/install/slack-desc
  69. cd $PKG
  70. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE