From 6832d2240740edc102a0bc6b2e6ea8716b8f3e76 Mon Sep 17 00:00:00 2001 From: Berend de Boer Date: Tue, 4 Nov 2014 18:19:06 +1300 Subject: [PATCH 1/3] grep for content-disposition field should be case-insensitive, else you would get: tar: /tmp/pecl-build: Cannot open: No such file or directory tar: Error is not recoverable: exiting no Also fixed some typos and improved bash style a bit. --- bin/pecl-build | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/bin/pecl-build b/bin/pecl-build index 8b0623a..0138bce 100755 --- a/bin/pecl-build +++ b/bin/pecl-build @@ -17,7 +17,7 @@ usage() { echo " --dry dry run mode." echo " -d, --base-dir specified build directory. (default: /tmp/pecl-build)" echo " -p, --phpize absolute path for phpize. (default: environment dependent)" - echo " -i, --php-config aboslute path for php-config. (default: environment dependent)" + echo " -i, --php-config absolute path for php-config. (default: environment dependent)" echo " -c, --configure-options additional configure options. (default: nothing)" echo " -z, --zend-extension registerd zend_extensin at ini file generated." echo " --skip-test skip make test." @@ -57,13 +57,13 @@ main() { debug "install package: $(green $package)" # extension build base dir - if [ "x$base_dir" = "x" ];then + if [ -z $base_dir ];then base_dir=/tmp/pecl-build fi debug "base_dir: $(green $base_dir)" # phpize command path - if [ "x$phpize" = "x" ];then + if [ -z $phpize ];then phpize=phpize else phpize=$(echo $phpize) # path expantion @@ -75,12 +75,12 @@ main() { debug "phpize command: $(green $phpize)" # additional configure options - if [ "x$configure_options" = "x" ];then + if [ -z $configure_options ];then configure_options= fi # php-config command path - if [ "x$phpconfig" = "x" ];then + if [ -z $phpconfig ];then phpconfig=php-config else phpconfig=$(echo $phpconfig) #path expantion @@ -96,11 +96,11 @@ main() { ### main ### - # crete build base + # create build base pecl_url=http://pecl.php.net/get url=$pecl_url/$package - tarball=$(curl -I $url 2>/dev/null |grep Content-disposition |cut -d'=' -f2 |tr -d \") + tarball=$(curl -I $url 2>/dev/null |grep -i Content-disposition |cut -d'=' -f2 |tr -d \") package_name=${tarball%.*} extension=${package_name%-*} version=${package_name##*-} @@ -113,10 +113,10 @@ main() { debug "version: $(green $version)" debug "build_dir: $(green $build_dir)" - info "create build directory: $(green $build_dir)" + info "creating build directory: $(green $build_dir)" run mkdir -p $build_dir if [ -e "$build_dir/$package_name" ];then - warn "already exist old dir. remove it." + warn "removing exist old dir $build_dir/$package_name." run rm -rf $build_dir/$package_name fi @@ -208,4 +208,3 @@ debug() { # call main. main "$@" - From da21e8966373c4afd45a9ec9a3a4c0d02ac07f92 Mon Sep 17 00:00:00 2001 From: Berend de Boer Date: Tue, 4 Nov 2014 18:19:23 +1300 Subject: [PATCH 2/3] Typos + how to install from my repository. --- README.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index ece53b5..ebc51d5 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ If you want usage detail, type `--help`. ``` When standalone, build php version is system default. -If you want use other php version, you can change `phpize` and `php-config` command by parameter. +If you want to use another php version, you can change `phpize` and `php-config` command by parameter. ``` $ bin/pecl-build -p /path/to/phpize -i /path/to/php-config @@ -22,12 +22,12 @@ $ bin/pecl-build -p /path/to/phpize -i /path/to/php-config ### Use phpenv plugins ``` -% git clone https://github.com/crocos/pecl-build.git $PHPENV_ROOT/plugins/pecl-build +% git clone https://github.com/berenddeboer/pecl-build.git $PHPENV_ROOT/plugins/pecl-build % phpenv pecl ``` -phpenv plugin follow php version for phpenv specified. -If you want specify build php version, you can set parameter. +phpenv plugin follows the php version installed by phpenv. +If you want to build for a specific php version, you can specify a parameter. ``` % phpenv pecl -j @@ -53,4 +53,3 @@ so created `.ini` config set `zend_extension` * Initial Version AUTHOR:: Daichi Kamemoto - From b676d0d9c243582b348ff4d65e44bed176046c76 Mon Sep 17 00:00:00 2001 From: Berend de Boer Date: Tue, 4 Nov 2014 18:19:32 +1300 Subject: [PATCH 3/3] Skip tests by default. --- bin/phpenv-pecl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bin/phpenv-pecl b/bin/phpenv-pecl index 9574b70..8ad3e6b 100755 --- a/bin/phpenv-pecl +++ b/bin/phpenv-pecl @@ -89,7 +89,7 @@ _build_extension() { fi info "build $(green $package) on php-$(green $version)" - run pecl-build $package -p $php_dir/bin/phpize -i $php_dir/bin/php-config $options + run pecl-build $package -p $php_dir/bin/phpize -i $php_dir/bin/php-config --skip-test $options fi } @@ -145,4 +145,3 @@ debug() { # call main. main "$@" -