Permalink
Browse files

cookbook for installing/configuring 7-zip file archiver

  • Loading branch information...
schisamo committed Sep 27, 2011
1 parent 1b25633 commit 3bf1c8cb7c291b6bd4cb68ab1b9ecfa1c56e7e27
Showing with 132 additions and 0 deletions.
  1. +61 −0 7-zip/README.md
  2. +31 −0 7-zip/attributes/default.rb
  3. +9 −0 7-zip/metadata.rb
  4. +31 −0 7-zip/recipes/default.rb
View
@@ -0,0 +1,61 @@
+Description
+===========
+
+[7-Zip](http://www.7-zip.org/) is a file archiver with a high compression ratio. This cookbook installs the full 7-zip suite of tools (GUI and CLI).
+
+Requirements
+============
+
+Platform
+--------
+
+* Windows XP
+* Windows Vista
+* Windows Server 2003 R2
+* Windows 7
+* Windows Server 2008 (R1, R2)
+
+Cookbooks
+---------
+
+* windows
+
+Attributes
+==========
+
+* `node['7-zip']['home']` - location to install 7-zip files to. default is `%SYSTEMDRIVE%\7-zip`
+
+Usage
+=====
+
+default
+-------
+
+Downloads and installs 7-zip to the location specified by `node['7-zip']['home']`. Also ensures `node['7-zip']['home']` is in the system path.
+
+Changes/Roadmap
+===============
+
+## 1.0.0:
+
+* initial release
+
+License and Author
+==================
+
+Author:: Seth Chisamore (<schisamo@opscode.com>)
+
+Copyright:: 2011, 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.0
+
+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.
+
@@ -0,0 +1,31 @@
+#
+# Author:: Seth Chisamore (<schisamo@opscode.com>)
+# Cookbook Name:: 7-zip
+# Attribute:: default
+#
+# Copyright:: Copyright (c) 2011 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.0
+#
+# 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.
+#
+
+if kernel['machine'] =~ /x86_64/
+ default['7-zip']['url'] = "http://downloads.sourceforge.net/sevenzip/7z920-x64.msi"
+ default['7-zip']['checksum'] = "62df458bc521001cd9a947643a84810ecbaa5a16b5c8e87d80df8e34c4a16fe2"
+ default['7-zip']['package_name'] = "7-Zip 9.20 (x64 edition)"
+else
+ default['7-zip']['url'] = "http://downloads.sourceforge.net/sevenzip/7z920.msi"
+ default['7-zip']['checksum'] = "fe4807b4698ec89f82de7d85d32deaa4c772fc871537e31fb0fccf4473455cb8"
+ default['7-zip']['package_name'] = "7-Zip 9.20"
+end
+
+default['7-zip']['home'] = "#{ENV['SYSTEMDRIVE']}\\7-zip"
View
@@ -0,0 +1,9 @@
+maintainer "Opscode, Inc."
+maintainer_email "cookbooks@opscode.com"
+license "Apache 2.0"
+description "Installs/Configures the 7-zip file archiver"
+long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
+version "1.0.0"
+supports "windows"
+
+depends "windows", ">= 1.2.2"
View
@@ -0,0 +1,31 @@
+#
+# Author:: Seth Chisamore (<schisamo@opscode.com>)
+# Cookbook Name:: 7-zip
+# Recipe:: default
+#
+# Copyright 2011, 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.0
+#
+# 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.
+#
+
+windows_package node['7-zip']['package_name'] do
+ source node['7-zip']['url']
+ checksum node['7-zip']['checksum']
+ options "INSTALLDIR=\"#{node['7-zip']['home']}\""
+ action :install
+end
+
+# update path
+windows_path node['7-zip']['home'] do
+ action :add
+end

0 comments on commit 3bf1c8c

Please sign in to comment.