Skip to content

Commit

Permalink
cookbook for installing/configuring 7-zip file archiver
Browse files Browse the repository at this point in the history
  • Loading branch information
schisamo committed Sep 27, 2011
1 parent 1b25633 commit 3bf1c8c
Show file tree
Hide file tree
Showing 4 changed files with 132 additions and 0 deletions.
61 changes: 61 additions & 0 deletions 7-zip/README.md
Original file line number Diff line number Diff line change
@@ -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 (<[email protected]>)

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.

31 changes: 31 additions & 0 deletions 7-zip/attributes/default.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#
# Author:: Seth Chisamore (<[email protected]>)
# 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"
9 changes: 9 additions & 0 deletions 7-zip/metadata.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
maintainer "Opscode, Inc."
maintainer_email "[email protected]"
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"
31 changes: 31 additions & 0 deletions 7-zip/recipes/default.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#
# Author:: Seth Chisamore (<[email protected]>)
# 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.