Add missing changes for mediawiki upgrades
This commit is contained in:
@@ -18,20 +18,41 @@
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
configure_options = node['php']['configure_options'].join(' ')
|
||||
if platform?('debian') && node['platform_version'].to_i == 9
|
||||
Chef::Log.fatal 'Debian 9 is not supported when building from source'
|
||||
end
|
||||
|
||||
build_essential 'install compilation tools'
|
||||
include_recipe 'yum-epel' if node['platform_family'] == 'rhel'
|
||||
version = node['php']['version']
|
||||
configure_options = node['php']['configure_options'].join(' ')
|
||||
ext_dir_prefix = node['php']['ext_dir'] ? "EXTENSION_DIR=#{node['php']['ext_dir']}" : ''
|
||||
|
||||
php_exists = if node['php']['src_recompile']
|
||||
false
|
||||
else
|
||||
"$(which #{node['php']['bin']}) --version | grep #{version}"
|
||||
end
|
||||
|
||||
build_essential
|
||||
|
||||
include_recipe 'yum-epel' if platform_family?('rhel', 'amazon')
|
||||
|
||||
package node['php']['src_deps']
|
||||
|
||||
version = node['php']['version']
|
||||
log "php_exists == #{php_exists}"
|
||||
|
||||
remote_file "#{Chef::Config[:file_cache_path]}/php-#{version}.tar.gz" do
|
||||
source "#{node['php']['url']}/php-#{version}.tar.gz/from/this/mirror"
|
||||
source "#{node['php']['url']}/php-#{version}.tar.gz"
|
||||
checksum node['php']['checksum']
|
||||
mode '0644'
|
||||
not_if "$(which #{node['php']['bin']}) --version | grep #{version}"
|
||||
action :create_if_missing
|
||||
not_if php_exists
|
||||
notifies :run, 'execute[un-pack php]', :immediately
|
||||
end
|
||||
|
||||
execute 'un-pack php' do
|
||||
cwd Chef::Config[:file_cache_path]
|
||||
command "tar -zxf php-#{version}.tar.gz"
|
||||
creates "#{Chef::Config[:file_cache_path]}/php-#{version}"
|
||||
action :nothing
|
||||
end
|
||||
|
||||
if node['php']['ext_dir']
|
||||
@@ -41,26 +62,31 @@ if node['php']['ext_dir']
|
||||
mode '0755'
|
||||
recursive true
|
||||
end
|
||||
ext_dir_prefix = "EXTENSION_DIR=#{node['php']['ext_dir']}"
|
||||
else
|
||||
ext_dir_prefix = ''
|
||||
end
|
||||
|
||||
# PHP is unable to find the GMP library in 16.04. The symlink brings the file
|
||||
# inside of the include libraries.
|
||||
# PHP is unable to find the GMP library on Ubuntu 16.04
|
||||
# This symlink brings the file inside of the included libraries
|
||||
link '/usr/include/gmp.h' do
|
||||
to '/usr/include/x86_64-linux-gnu/gmp.h'
|
||||
only_if { node['platform_family'] == 'debian' && node['platform_version'].to_f >= 14.04 }
|
||||
only_if { platform?('ubuntu') && node['platform_version'].to_f == 16.04 }
|
||||
end
|
||||
|
||||
bash 'build php' do
|
||||
cwd Chef::Config[:file_cache_path]
|
||||
code <<-EOF
|
||||
tar -zxf php-#{version}.tar.gz
|
||||
(cd php-#{version} && #{ext_dir_prefix} ./configure #{configure_options})
|
||||
(cd php-#{version} && make -j #{node['cpu']['total']} && make install)
|
||||
EOF
|
||||
not_if "$(which #{node['php']['bin']}) --version | grep #{version}"
|
||||
execute 'clean build' do
|
||||
cwd "#{Chef::Config[:file_cache_path]}/php-#{version}"
|
||||
command 'make clean'
|
||||
only_if { node['php']['src_recompile'] }
|
||||
end
|
||||
|
||||
execute 'configure php' do
|
||||
cwd "#{Chef::Config[:file_cache_path]}/php-#{version}"
|
||||
command "#{ext_dir_prefix} ./configure #{configure_options}"
|
||||
not_if php_exists
|
||||
end
|
||||
|
||||
execute 'build and install php' do
|
||||
cwd "#{Chef::Config[:file_cache_path]}/php-#{version}"
|
||||
command "make -j #{node['cpu']['total']} && make install"
|
||||
not_if php_exists
|
||||
end
|
||||
|
||||
directory node['php']['conf_dir'] do
|
||||
|
||||
Reference in New Issue
Block a user