diff --git a/.kitchen.yml b/.kitchen.yml index e0f6b93..27c9668 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -4,19 +4,27 @@ driver_config: require_chef_omnibus: true platforms: -# - name: ubuntu-12.04 -# driver_config: -# box: opscode-ubuntu-12.04 -# box_url: https://opscode-vm-bento.s3.amazonaws.com/vagrant/opscode_ubuntu-12.04_provisionerless.box - - name: ubuntu-13.04 - driver_config: - box: opscode-ubuntu-13.04 - box_url: https://opscode-vm-bento.s3.amazonaws.com/vagrant/opscode_ubuntu-13.04_provisionerless.box + - name: ubuntu-14.04 suites: - name: default run_list: - recipe[pdepend::default] + - name: pear + run_list: + - recipe[pdepend::default] + attributes: + pdepend: + install_method: pear + - name: composer + run_list: + - recipe[pdepend::default] attributes: pdepend: install_method: composer + - name: phar + run_list: + - recipe[pdepend::default] + attributes: + pdepend: + install_method: phar diff --git a/libraries/helpers.rb b/libraries/helpers.rb new file mode 100644 index 0000000..8d221de --- /dev/null +++ b/libraries/helpers.rb @@ -0,0 +1,28 @@ +# +# Cookbook Name:: pdepend +# Library:: helpers +# +# Copyright 2013-2015, Escape Studios +# + +# PDEPEND module +module PDEPEND + # helpers module + module Helpers + # Returns an array of package names that will install pdepend on a node. + # Package names returned are determined by the platform running this recipe. + def pdepend_prerequisite_packages + value_for_platform( + 'default' => ['libmagickwand-dev', 'libmagickcore-dev'] + ) + end + end +end + +# Chef class +class Chef + # Recipe class + class Recipe + include PDEPEND::Helpers + end +end diff --git a/recipes/pear.rb b/recipes/pear.rb index e745ca3..1389ac1 100644 --- a/recipes/pear.rb +++ b/recipes/pear.rb @@ -7,6 +7,12 @@ include_recipe 'php' +pdepend_prerequisite_packages.each do |pkg| + package pkg do + action :install + end +end + # PHP Extension and Application Repository PEAR channel php_pear_channel 'pear.php.net' do action :update