Skip to content
This repository has been archived by the owner on Jan 23, 2019. It is now read-only.

Commit

Permalink
support for Debian 6
Browse files Browse the repository at this point in the history
  • Loading branch information
phlipper committed Dec 27, 2012
1 parent 754763e commit ebdb88b
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 7 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ The default version is `9.1`.
The following platforms are supported by this cookbook, meaning that the recipes run on these platforms without error:

* Ubuntu
* Debian 6


## Recipes
Expand Down
3 changes: 3 additions & 0 deletions files/default/pgdg.pref
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Package: *
Pin: release o=apt.postgresql.org
Pin-Priority: 500
6 changes: 5 additions & 1 deletion metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,8 @@
recipe "postgresql::libpq", "PostgreSQL C client library and header files for libpq5 (PostgreSQL library)"
recipe "postgresql::postgis", "Geographic objects support for PostgreSQL 9.x"

supports "ubuntu"
%w[ubuntu debian].each do |os|
supports os
end

depends "apt"
52 changes: 46 additions & 6 deletions recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,51 @@
# Recipe:: default
#

package "python-software-properties"
case node["lsb"]["id"]
when "Ubuntu"

execute "setup ppa apt repository" do
command "add-apt-repository ppa:pitti/postgresql && apt-get update"
not_if "test -f /etc/apt/sources.list.d/pitti-postgresql-#{node["lsb"]["codename"]}.list"
end
apt_repository "pitti-postgresql" do
uri "http://ppa.launchpad.net/pitti/postgresql/ubuntu"
distribution node["lsb"]["codename"]
components ["main"]
keyserver "keyserver.ubuntu.com"
key "8683D8A2"
action :add
notifies :run, "execute[apt-get update]", :immediately
end

# install common files
package "postgresql-common"

when "Debian"

# backports for initial support
apt_repository "debian-backports" do
uri "http://backports.debian.org/debian-backports"
distribution "#{node["lsb"]["codename"]}-backports"
components ["main"]
action :add
notifies :run, "execute[apt-get update]", :immediately
end

package "postgresql-common"
cookbook_file "/etc/apt/preferences.d/pgdg.pref" do
source "pgdg.pref"
end

# backports support for debian
%w[libpq5 postgresql-common].each do |pkg|
package pkg do
options "-t #{node["lsb"]["codename"]}-backports"
end
end

# use `apt.postgresql.org` for primary package installation support
apt_repository "apt.postgresql.org" do
uri "http://apt.postgresql.org/pub/repos/apt"
distribution "#{node["lsb"]["codename"]}-pgdg"
components ["main"]
key "http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc"
action :add
notifies :run, "execute[apt-get update]", :immediately
end
end

0 comments on commit ebdb88b

Please sign in to comment.