5 # Copyright:: 2013, 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.
20 include_recipe "accounts"
32 libboost-program-options-dev
33 libboost-date-time-dev
34 libboost-filesystem-dev
36 libboost-iostreams-dev
47 directory "/opt/planet-dump-ng" do
53 git "/opt/planet-dump-ng" do
55 repository "https://github.com/zerebubuth/planet-dump-ng.git"
62 execute "/opt/planet-dump-ng/autogen.sh" do
64 command "./autogen.sh"
65 cwd "/opt/planet-dump-ng"
68 subscribes :run, "git[/opt/planet-dump-ng]"
71 execute "/opt/planet-dump-ng/configure" do
74 cwd "/opt/planet-dump-ng"
77 subscribes :run, "execute[/opt/planet-dump-ng/autogen.sh]"
80 execute "/opt/planet-dump-ng/Makefile" do
83 cwd "/opt/planet-dump-ng"
86 subscribes :run, "execute[/opt/planet-dump-ng/configure]"
89 directory "/store/planetdump" do
96 %w[planetdump planetdump-trigger].each do |program|
97 template "/usr/local/bin/#{program}" do
98 source "#{program}.erb"
105 systemd_service "planetdump@" do
106 description "Planet dump for %i"
108 exec_start "/usr/local/bin/planetdump %i"
112 bind_paths "/home/planet"
116 "/store/planet/planet",
122 systemd_service "planetdump-trigger" do
123 description "Planet dump trigger"
125 exec_start "/usr/local/bin/planetdump-trigger"
127 restrict_address_families "AF_UNIX"
130 service "planetdump-trigger" do
131 action [:enable, :start]
132 subscribes :restart, "template[/usr/local/bin/planetdump-trigger]"
135 systemd_service "planet-dump-mirror" do
139 service "planet-dump-mirror.timer" do
140 action [:disable, :stop]
143 systemd_timer "planet-dump-mirror" do