diff --git a/subversion/README.md b/subversion/README.md index 558f90a84..ffcff5855 100644 --- a/subversion/README.md +++ b/subversion/README.md @@ -3,13 +3,6 @@ Description Installs subversion for clients or sets up a server under Apache HTTPD. -Changes -======= - -## v0.8.3: - -* Current public release - Requirements ============ @@ -18,10 +11,12 @@ Requirements * Debian/Ubuntu * RHEL/CentOS * Fedora +* Windows ## Cookbooks: * apache2 +* windows Attributes ========== @@ -68,6 +63,13 @@ you would like a subversion server, use `recipe[subversion::server]`. You should override `node['subversion']['password']` in the role that applies the server recipe. +Changes +======= + +## v0.8.3: + +* Current public release + License and Author ================== diff --git a/subversion/attributes/default.rb b/subversion/attributes/default.rb index 7e1c91a71..e3edb2812 100644 --- a/subversion/attributes/default.rb +++ b/subversion/attributes/default.rb @@ -22,3 +22,7 @@ default['subversion']['server_name'] = 'svn' default['subversion']['user'] = 'subversion' default['subversion']['password'] = 'subversion' + +# For Windows +default['subversion']['msi_source'] = "http://downloads.sourceforge.net/project/win32svn/1.7.0/Setup-Subversion-1.7.0.msi" +default['subversion']['msi_checksum'] = "2ee93a3a2c1f9b720917263295466f92cac6058c6cd8af65592186235cf0ed71" diff --git a/subversion/metadata.rb b/subversion/metadata.rb index bc045f94d..6b3b0b00f 100644 --- a/subversion/metadata.rb +++ b/subversion/metadata.rb @@ -9,6 +9,7 @@ end depends "apache2" +depends "windows" recipe "subversion", "Includes the client recipe." recipe "subversion::client", "Subversion Client installs subversion and some extra svn libs" diff --git a/subversion/recipes/client.rb b/subversion/recipes/client.rb index 2c0d5eeda..02563f238 100644 --- a/subversion/recipes/client.rb +++ b/subversion/recipes/client.rb @@ -2,14 +2,14 @@ # Cookbook Name:: subversion # Recipe:: default # -# Copyright 2008, Opscode, Inc. +# Copyright 2008-2012, Opscode, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at -# +# # http://www.apache.org/licenses/LICENSE-2.0c -# +# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -17,25 +17,42 @@ # limitations under the License. # -package "subversion" do - action :install -end +case node['platform'] +when "windows" -extra_packages = case node[:platform] - when "ubuntu" - if node[:platform_version].to_f < 8.04 - %w{subversion-tools libsvn-core-perl} - else - %w{subversion-tools libsvn-perl} - end - when "centos","redhat","fedora" - %w{subversion-devel subversion-perl} - else - %w{subversion-tools libsvn-perl} + windows_package "Subversion" do + source node['subversion']['msi_source'] + checksum node['subversion']['msi_checksum'] + action :install + end + + windows_path 'C:\Program Files (x86)\Subversion\bin' do + action :add end -extra_packages.each do |pkg| - package pkg do +else + + package "subversion" do action :install end + + extra_packages = case node[:platform] + when "ubuntu" + if node[:platform_version].to_f < 8.04 + %w{subversion-tools libsvn-core-perl} + else + %w{subversion-tools libsvn-perl} + end + when "centos","redhat","fedora" + %w{subversion-devel subversion-perl} + else + %w{subversion-tools libsvn-perl} + end + + extra_packages.each do |pkg| + package pkg do + action :install + end + end + end