2 # Cookbook Name:: planet
 
   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 #     http://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 => "/usr/local/bin/planetdump $#"
 
  28 include_recipe "incron"
 
  35 package "libboost-dev"
 
  36 package "libboost-program-options-dev"
 
  37 package "libboost-date-time-dev"
 
  38 package "libboost-filesystem-dev"
 
  39 package "libboost-thread-dev"
 
  40 package "libboost-iostreams-dev"
 
  41 package "libosmpbf-dev"
 
  42 package "libprotobuf-dev"
 
  45 # Add planet-mirror-redirect-update dependencies
 
  49 directory "/opt/planet-dump-ng" do
 
  55 git "/opt/planet-dump-ng" do
 
  57   repository "git://github.com/zerebubuth/planet-dump-ng.git"
 
  63 execute "/opt/planet-dump-ng/autogen.sh" do
 
  65   command "./autogen.sh"
 
  66   cwd "/opt/planet-dump-ng"
 
  69   subscribes :run, "git[/opt/planet-dump-ng]"
 
  72 execute "/opt/planet-dump-ng/configure" do
 
  75   cwd "/opt/planet-dump-ng"
 
  78   subscribes :run, "execute[/opt/planet-dump-ng/autogen.sh]"
 
  81 execute "/opt/planet-dump-ng/Makefile" do
 
  84   cwd "/opt/planet-dump-ng"
 
  87   subscribes :run, "execute[/opt/planet-dump-ng/configure]"
 
  90 directory "/store/planetdump" do
 
  96 ["planetdump", "planet-mirror-redirect-update", "apache-latest-planet-filename"].each do |program|
 
  97   template "/usr/local/bin/#{program}" do
 
  98     source "#{program}.erb"