ioncube-loader.SlackBuild 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. #!/bin/bash
  2. # Slackware build script for "ioncube-loader".
  3. # Copyright 2015-2018 Eugene Wissner, Germany, Dachau
  4. # All rights reserved.
  5. #
  6. # Redistribution and use in source and binary forms, with or without
  7. # modification, are permitted provided that the following conditions are
  8. # met:
  9. #
  10. # * Redistributions of source code must retain the above copyright
  11. # notice, this list of conditions and the following disclaimer.
  12. #
  13. # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  14. # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  15. # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  16. # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  17. # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  18. # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  19. # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  20. # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  21. # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  22. # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  23. # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  24. cd $(dirname $0) ; CWD=$(pwd)
  25. PRGNAM=ioncube-loader
  26. SRCNAM=ioncube
  27. VERSION=${VERSION:-11.0.1}
  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=$TMP/package-$PRGNAM
  47. OUTPUT=${OUTPUT:-/tmp}
  48. if [ "$ARCH" = "i586" ]; then
  49. TARGET="x86"
  50. LIBDIRSUFFIX=""
  51. elif [ "$ARCH" = "i686" ]; then
  52. TARGET="x86"
  53. LIBDIRSUFFIX=""
  54. elif [ "$ARCH" = "x86_64" ]; then
  55. TARGET="x86-64"
  56. LIBDIRSUFFIX="64"
  57. fi
  58. set -e
  59. rm -rf $PKG
  60. rm -rf $TMP/$SRCNAM
  61. mkdir -p $TMP $PKG $OUTPUT
  62. cd $TMP
  63. tar xvf $CWD/ioncube_loaders_lin_${TARGET}_${VERSION}.tar.gz
  64. cd $SRCNAM
  65. chown -R root:root .
  66. mkdir -p $PKG/usr/lib${LIBDIRSUFFIX}/php/extensions
  67. install -m 0755 ioncube_loader_lin_7.4_ts.so $PKG/usr/lib${LIBDIRSUFFIX}/php/extensions
  68. mkdir -p $PKG/etc/php.d
  69. cat $CWD/ioncube${LIBDIRSUFFIX}.ini > $PKG/etc/php.d/20ioncube.ini.new
  70. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  71. cp -a LICENSE.txt README.txt USER-GUIDE.txt $PKG/usr/doc/$PRGNAM-$VERSION
  72. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  73. mkdir -p $PKG/install
  74. cat $CWD/slack-desc > $PKG/install/slack-desc
  75. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  76. cd $PKG
  77. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE