Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Provision PyPy 1.9 from the official tarball, 11.10 and 12.04 compatible

  • Loading branch information...
commit 563cb60dfc6dcac8797d8bb93bc33eedfdbf835b 1 parent e64543f
Michael Klishin michaelklishin authored
21 ci_environment/pypy/attributes/default.rb
View
@@ -0,0 +1,21 @@
+version = "1.9"
+arch = kernel['machine'] =~ /x86_64/ ? "amd64" : "i386"
+
+default[:pypy] = {
+ :tarball => {
+ :version => version,
+ :arch => arch,
+ :url => if arch == "i386"
+ "https://bitbucket.org/pypy/pypy/downloads/pypy-#{version}-linux.tar.bz2"
+ else
+ "https://bitbucket.org/pypy/pypy/downloads/pypy-#{version}-linux64.tar.bz2"
+ end,
+ :filename => if arch == "i386"
+ "pypy-#{version}-linux.tar.bz2"
+ else
+ "pypy-#{version}-linux64.tar.bz2"
+ end,
+ :dirname => "pypy-#{version}",
+ :installation_dir => "/usr/local/pypy"
+ }
+}
1  ci_environment/pypy/files/default/etc/profile.d/pypy.sh
View
@@ -0,0 +1 @@
+PATH=/usr/local/pypy/bin:$PATH
54 ci_environment/pypy/recipes/tarball.rb
View
@@ -0,0 +1,54 @@
+#
+# Cookbook Name:: pypy
+# Recipe:: tarball
+#
+# Copyright 2012, Michael S Klishin & Travis CI Development Team
+#
+# 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.
+#
+
+# 1. Download the tarball to /tmp
+require "tmpdir"
+
+td = Dir.tmpdir
+tmp = File.join(td, node.pypy.tarball.filename)
+tarball_dir = File.join(td, node.pypy.tarball.dirname)
+
+
+remote_file(tmp) do
+ source node.pypy.tarball.url
+
+ not_if "which pypy"
+end
+
+bash "extract #{tmp}, move it to #{node.pypy.tarball.installation_dir}" do
+ user "root"
+ cwd "/tmp"
+
+ code <<-EOS
+ tar xjfp #{tmp}
+ rm -rf #{node.pypy.tarball.installation_dir}
+ mv --force #{tarball_dir} #{node.pypy.tarball.installation_dir}
+ EOS
+
+ creates "#{node.pypy.tarball.installation_dir}/bin/pypy"
+end
+
+
+cookbook_file "/etc/profile.d/pypy.sh" do
+ owner "root"
+ group "root"
+ mode 0644
+
+ source "etc/profile.d/pypy.sh"
+end
Please sign in to comment.
Something went wrong with that request. Please try again.