5 # Copyright:: 2011, OpenStreetMap Foundation
7 # Licensed under the Apache License, Version 2.0 (the "License");
8 # you may not use this file except in compliance with the License.
9 # You may obtain a copy of the License at
11 # https://www.apache.org/licenses/LICENSE-2.0
13 # Unless required by applicable law or agreed to in writing, software
14 # distributed under the License is distributed on an "AS IS" BASIS,
15 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 # See the License for the specific language governing permissions and
17 # limitations under the License.
21 include_recipe "postgresql"
22 include_recipe "python"
25 aws_credentials = data_bag_item("db", "aws")
30 libboost-filesystem-dev
31 libboost-program-options-dev
44 repository "https://github.com/openstreetmap/osmdbt.git"
51 node[:postgresql][:versions].each do |db_version|
52 directory "/opt/osmdbt/build-#{db_version}" do
58 execute "/opt/osmdbt/build-#{db_version}" do
60 command "cmake -DPG_CONFIG=/usr/lib/postgresql/#{db_version}/bin/pg_config .."
61 cwd "/opt/osmdbt/build-#{db_version}"
64 subscribes :run, "directory[/opt/osmdbt/build-#{db_version}]"
65 subscribes :run, "git[/opt/osmdbt]"
68 execute "/opt/osmdbt/build-#{db_version}/postgresql-plugin/Makefile" do
71 cwd "/opt/osmdbt/build-#{db_version}/postgresql-plugin"
74 subscribes :run, "execute[/opt/osmdbt/build-#{db_version}]"
77 link "/usr/lib/postgresql/#{db_version}/lib/osm-logical.so" do
78 to "/opt/osmdbt/build-#{db_version}/postgresql-plugin/osm-logical.so"
86 remote_file "/usr/local/bin/wal-g" do
88 source "https://github.com/wal-g/wal-g/releases/download/v2.0.1/wal-g-pg-ubuntu-20.04-amd64"
94 template "/usr/local/bin/openstreetmap-wal-g" do
99 variables :aws_credentials => aws_credentials