Permalink
Browse files

compiled postgresql for legacy upgrades

  • Loading branch information...
dje committed Feb 19, 2010
1 parent 89a9306 commit e950882235da24f7715ca31b5a595d53be635167
Showing with 55 additions and 0 deletions.
  1. +3 −0 postgresql/attributes/postgresql.rb
  2. +52 −0 postgresql/recipes/compiled.rb
@@ -1,3 +1,6 @@
+set_unless[:postgresql][:compiled_version] = "8.4.2"
+set_unless[:postgresql][:compiled_checksum] = "adb3c5c9"
+
# set_unless[:postgresql][:db_name] = 'app'
# set_unless[:postgresql][:username] = 'app'
# set_unless[:postgresql][:password] = 'app'
@@ -0,0 +1,52 @@
+version = node[:postgresql][:compiled_version]
+
+user "postgres" do
+ action :create
+end
+
+remote_file "/usr/src/postgresql-#{version}.tar.bz2" do
+ source "http://wwwmaster.postgresql.org/redir/198/h/source/v#{version}/postgresql-#{version}.tar.bz2"
+ checksum node[:postgresql][:compiled_checksum]
+end
+
+execute "untar postgresql" do
+ command "tar xjf postgresql-#{version}.tar.bz2"
+ cwd "/usr/src"
+ user "root"
+ group "src"
+ creates "/usr/src/postgresql-#{version}/README"
+end
+
+execute "configure postgresql" do
+ command "./configure"
+ cwd "/usr/src/postgresql-#{version}"
+ user "root"
+ creates "/usr/src/postgresql-#{version}/config.status"
+end
+
+execute "build postgresql" do
+ command "make"
+ cwd "/usr/src/postgresql-#{version}"
+ user "root"
+ creates "/usr/src/postgresql-#{version}/src/backend/postgres"
+end
+
+execute "install postgresql" do
+ command "make install"
+ cwd "/usr/src/postgresql-#{version}"
+ user "root"
+ creates "/usr/src/postgresql-#{version}/src/backend/postgres"
+end
+
+directory "/var/pgsql" do
+ owner "postgres"
+ group "postgres"
+ mode "0755"
+ action :create
+end
+
+execute "initialize database cluster" do
+ command "/usr/local/pgsql/bin/initdb -D /var/pgsql/data"
+ user "postgres"
+ not_if "test -d /var/pgsql/data"
+end

0 comments on commit e950882

Please sign in to comment.