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 => [ "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 directory "/opt/planet-dump-ng" do
 
  51 git "/opt/planet-dump-ng" do
 
  53   repository "git://github.com/zerebubuth/planet-dump-ng.git"
 
  59 execute "/opt/planet-dump-ng/autogen.sh" do
 
  61   command "./autogen.sh"
 
  62   cwd "/opt/planet-dump-ng"
 
  65   subscribes :run, "git[/opt/planet-dump-ng]"
 
  68 execute "/opt/planet-dump-ng/configure" do
 
  71   cwd "/opt/planet-dump-ng"
 
  74   subscribes :run, "execute[/opt/planet-dump-ng/autogen.sh]"
 
  77 execute "/opt/planet-dump-ng/Makefile" do
 
  80   cwd "/opt/planet-dump-ng"
 
  83   subscribes :run, "execute[/opt/planet-dump-ng/configure]"
 
  86 directory "/store/planetdump" do
 
  92 ["planetdump", "planet-mirror-redirect-update", "apache-latest-planet-filename"].each do |program|
 
  93   template "/usr/local/bin/#{program}" do
 
  94     source "#{program}.erb"