-ruby_block "#{civicrm_directory}/civicrm.settings.php" do
- block do
- out = File.new("#{civicrm_directory}/civicrm.settings.php", "w")
-
- File.foreach("#{civicrm_directory}/templates/CRM/common/civicrm.settings.php.tpl") do |line|
- line.gsub!(/%%cms%%/, "Drupal")
- line.gsub!(/%%CMSdbUser%%/, "civicrm")
- line.gsub!(/%%CMSdbPass%%/, database_password)
- line.gsub!(/%%CMSdbHost%%/, "localhost")
- line.gsub!(/%%CMSdbName%%/, "civicrm")
- line.gsub!(/%%dbUser%%/, "civicrm")
- line.gsub!(/%%dbPass%%/, database_password)
- line.gsub!(/%%dbHost%%/, "localhost")
- line.gsub!(/%%dbName%%/, "civicrm")
- line.gsub!(/%%crmRoot%%/, "/usr/share/drupal7/sites/all/modules/civicrm")
- line.gsub!(/%%templateCompileDir%%/, "/data/crm.osmfoundation.org/civicrm")
- line.gsub!(/%%baseURL%%/, "http://crm.osmfoundation.org/")
- line.gsub!(/%%siteKey%%/, site_key)
-
- out.print(line)
- end
-
- out.close
- end
-
- not_if do
- File.exist?("#{civicrm_directory}/civicrm.settings.php") and
- File.mtime("#{civicrm_directory}/civicrm.settings.php") >= File.mtime("#{civicrm_directory}/templates/CRM/common/civicrm.settings.php.tpl")
- end
-end
-
-link "/etc/drupal/7/sites/crm.osmfoundation.org/civicrm.settings.php" do
- to "#{civicrm_directory}/civicrm.settings.php"
-end
-
-template "#{civicrm_directory}/settings_location.php" do
- source "settings_location.php.erb"
- owner "root"
- group "root"
- mode "0644"
+execute "/var/cache/chef/civicrm-#{civicrm_version}-wordpress.zip" do
+ action :nothing
+ command "unzip -qq /var/cache/chef/civicrm-#{civicrm_version}-wordpress.zip"
+ cwd "/opt/civicrm-#{civicrm_version}"
+ user "wordpress"
+ group "wordpress"
+ subscribes :run, "remote_file[/var/cache/chef/civicrm-#{civicrm_version}-wordpress.zip]", :immediately