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 node.default[:incron][:planetdump] = {
 
  22   :path => "/store/backup",
 
  23   :events => %w[IN_CREATE IN_MOVED_TO],
 
  24   :command => "/bin/systemctl start planetdump@$#"
 
  28 include_recipe "incron"
 
  39   libboost-program-options-dev
 
  40   libboost-date-time-dev
 
  41   libboost-filesystem-dev
 
  43   libboost-iostreams-dev
 
  52 directory "/opt/planet-dump-ng" do
 
  58 git "/opt/planet-dump-ng" do
 
  60   repository "https://github.com/zerebubuth/planet-dump-ng.git"
 
  67 execute "/opt/planet-dump-ng/autogen.sh" do
 
  69   command "./autogen.sh"
 
  70   cwd "/opt/planet-dump-ng"
 
  73   subscribes :run, "git[/opt/planet-dump-ng]"
 
  76 execute "/opt/planet-dump-ng/configure" do
 
  79   cwd "/opt/planet-dump-ng"
 
  82   subscribes :run, "execute[/opt/planet-dump-ng/autogen.sh]"
 
  85 execute "/opt/planet-dump-ng/Makefile" do
 
  88   cwd "/opt/planet-dump-ng"
 
  91   subscribes :run, "execute[/opt/planet-dump-ng/configure]"
 
  94 directory "/store/planetdump" do
 
 101 %w[planetdump planet-mirror-redirect-update].each do |program|
 
 102   template "/usr/local/bin/#{program}" do
 
 103     source "#{program}.erb"
 
 110 systemd_service "planetdump@" do
 
 111   description "Planet dump for %i"
 
 113   exec_start "/usr/local/bin/planetdump %i"
 
 118   protect_system "full"
 
 120   no_new_privileges true
 
 123 cron_d "planet-dump-mirror" do
 
 126   command "/usr/local/bin/planet-mirror-redirect-update"
 
 127   mailto "horntail-www-data-cron@firefishy.com"