1
0

GraphicsMagick.sh 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #!/bin/bash
  2. # Author: yeho <lj2007331 AT gmail.com>
  3. # BLOG: https://blog.linuxeye.cn
  4. #
  5. # Notes: OneinStack for CentOS/RadHat 6+ Debian 6+ and Ubuntu 12+
  6. #
  7. # Project home page:
  8. # https://oneinstack.com
  9. # https://github.com/lj2007331/oneinstack
  10. Install_GraphicsMagick() {
  11. pushd ${oneinstack_dir}/src > /dev/null
  12. tar xzf GraphicsMagick-${graphicsmagick_ver}.tar.gz
  13. pushd GraphicsMagick-${graphicsmagick_ver}
  14. ./configure --prefix=${gmagick_install_dir} --enable-shared --enable-static
  15. make -j ${THREAD} && make install
  16. popd
  17. rm -rf GraphicsMagick-${graphicsmagick_ver}
  18. popd
  19. }
  20. Install_php-gmagick() {
  21. pushd ${oneinstack_dir}/src > /dev/null
  22. if [ -e "${php_install_dir}/bin/phpize" ]; then
  23. phpExtensionDir=`${php_install_dir}/bin/php-config --extension-dir`
  24. if [ "`${php_install_dir}/bin/php -r 'echo PHP_VERSION;' | awk -F. '{print $1}'`" == '7' ]; then
  25. tar xzf gmagick-${gmagick_for_php7_ver}.tgz
  26. pushd gmagick-${gmagick_for_php7_ver}
  27. else
  28. tar xzf gmagick-${gmagick_ver}.tgz
  29. pushd gmagick-${gmagick_ver}
  30. fi
  31. export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
  32. ${php_install_dir}/bin/phpize
  33. ./configure --with-php-config=${php_install_dir}/bin/php-config --with-gmagick=${gmagick_install_dir}
  34. make -j ${THREAD} && make install
  35. popd
  36. if [ -f "${phpExtensionDir}/gmagick.so" ]; then
  37. echo 'extension=gmagick.so' > ${php_install_dir}/etc/php.d/03-gmagick.ini
  38. echo "${CSUCCESS}PHP gmagick module installed successfully! ${CEND}"
  39. rm -rf gmagick-${gmagick_for_php7_ver} gmagick-${gmagick_ver}
  40. else
  41. echo "${CFAILURE}PHP gmagick module install failed, Please contact the author! ${CEND}"
  42. fi
  43. fi
  44. popd
  45. }