From 0b639535ab88cc02e851d4036cf24d789c944c2a Mon Sep 17 00:00:00 2001 From: David Kinzer Date: Fri, 14 Nov 2014 15:42:24 -0500 Subject: [PATCH] Separate unpacking and building. In case PHP source has already been unpacked in a previous instance there is no need to unpack it again. --- recipes/recompile.rb | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/recipes/recompile.rb b/recipes/recompile.rb index bf3201979..1a090cd91 100644 --- a/recipes/recompile.rb +++ b/recipes/recompile.rb @@ -35,12 +35,17 @@ action 'create_if_missing' end -bash 're-build php' do +bash 'un-pack php' do cwd Chef::Config[:file_cache_path] + code "tar -zxf php-#{version}.tar.gz" + creates "#{node['php']['url']}/php-#{version}" +end + +bash 're-build php' do + cwd "#{Chef::Config[:file_cache_path]}/php-#{version}" code <<-EOF - tar -zxf php-#{version}.tar.gz - (cd php-#{version} && make clean) - (cd php-#{version} && #{ext_dir_prefix} ./configure #{configure_options}) - (cd php-#{version} && make && make install) + (make clean) + (#{ext_dir_prefix} ./configure #{configure_options}) + (make && make install) EOF end