Skip to content

Commit

Permalink
[COOK-810] - add windows support
Browse files Browse the repository at this point in the history
  • Loading branch information
jtimberman committed Jan 19, 2012
1 parent 471b87a commit 515039b
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 26 deletions.
16 changes: 9 additions & 7 deletions subversion/README.md
Expand Up @@ -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
============

Expand All @@ -18,10 +11,12 @@ Requirements
* Debian/Ubuntu
* RHEL/CentOS
* Fedora
* Windows

## Cookbooks:

* apache2
* windows

Attributes
==========
Expand Down Expand Up @@ -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
==================

Expand Down
4 changes: 4 additions & 0 deletions subversion/attributes/default.rb
Expand Up @@ -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"
1 change: 1 addition & 0 deletions subversion/metadata.rb
Expand Up @@ -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"
Expand Down
55 changes: 36 additions & 19 deletions subversion/recipes/client.rb
Expand Up @@ -2,40 +2,57 @@
# 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.
# See the License for the specific language governing permissions and
# 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

0 comments on commit 515039b

Please sign in to comment.