Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

emacs::source24 from https://gist.github.com/d3f67bb25145ac3bf395

  • Loading branch information...
commit 4c367450816839c0e2867b037cf775fb15a79fb4 1 parent 873983c
@dougm authored
Showing with 48 additions and 0 deletions.
  1. +48 −0 site-cookbooks/emacs/recipes/source24.rb
View
48 site-cookbooks/emacs/recipes/source24.rb
@@ -0,0 +1,48 @@
+#
+# Author:: Joshua Timberman <opensource@housepub.org>
+# Copyright:: Copyright (c) 2012, Joshua Timberman
+# License:: Apache License, Version 2.0
+#
+# 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 platform?("ubuntu","debian","linuxmint")
+ srcdir = "#{Chef::Config[:file_cache_path]}/emacs-source"
+
+ %w{ git-core build-essential texinfo autoconf libncurses-dev }.each {|prereq| package prereq}
+
+ git "#{Chef::Config[:file_cache_path]}/emacs-source" do
+ repository "git://git.savannah.gnu.org/emacs.git"
+ action :checkout
+ end
+
+ bash "build emacs24" do
+ cwd srcdir
+ creates "#{srcdir}/src/emacs"
+ code <<-EOH
+ ./autogen.sh && \
+ ./configure --without-x && \
+ make bootstrap && \
+ make 2>&1 >| make-#{node.name}-#{node['ohai_time']}
+ EOH
+ end
+
+ execute "install emacs24" do
+ cwd srcdir
+ command "make install 2>&1 >| make-#{node.name}-#{node['ohai_time']}"
+ creates "/usr/local/bin/emacs"
+ only_if "#{srcdir}/src/emacs --version"
+ end
+else
+ Chef::Log.warn("#{cookbook_name}::#{recipe_name} is not supported on #{node['platform']}")
+end
Please sign in to comment.
Something went wrong with that request. Please try again.