Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix postgis2 installs, add release_version helper to main cookbook #136

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions cookbooks/main/libraries/release_version.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
class Chef
class Recipe
def release_version
release = File.read('/etc/engineyard/release')
return "v4" if release.to_i > 2009
"v2"
end
end
end
17 changes: 14 additions & 3 deletions cookbooks/postgresql9_extensions/recipes/ext_postgis2_install.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@
postgis_version = "2.0.2"
proj_version = "4.6.1"
geos_version = "3.2.2"
gdal_version = "1.8.1"

if release_version == "v2"
gdal_version = "1.8.1-r1"
else
gdal_version = "1.8.1-r2"
end

package_use "sci-libs/geos" do
flags "-ruby"
Expand All @@ -23,8 +28,14 @@
version postgis_version
end

package "dev-db/postgis" do
version postgis_version
# install gdal first so it gets installed via binary package instead of built
# from source with postgis below
package "sci-libs/gdal" do
version gdal_version
action :install
end

execute "setting emerge options" do
command "emerge --ignore-default-opts dev-db/postgis"
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,13 @@
version postgis_version
action :install
end
elsif ["9.1","9.2"].include?(@node[:postgres_version])
elsif ["9.1","9.2"].include?(@node[:postgres_version])
if @node[:postgres_version] == "9.1"
postgis_version = "1.5.3-r1"
else
postgis_version = "1.5.8"
end

proj_version = "4.6.1"
geos_version = "3.2.2"

package_use "sci-libs/geos" do
flags "-ruby"
end
Expand Down