2 # Cookbook Name:: taginfo
5 # Copyright 2014, 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 include_recipe "apache::ssl"
23 package "libsqlite3-dev"
25 package "libosmpbf-dev"
26 package "libprotobuf-dev"
27 package "libboost-dev"
28 package "libexpat1-dev"
29 package "libsparsehash-dev"
30 package "libgd2-xpm-dev"
41 gem_package "sinatra-r18n"
42 gem_package "rack-contrib"
44 apache_module "passenger"
46 munin_plugin "passenger_memory"
47 munin_plugin "passenger_processes"
48 munin_plugin "passenger_queues"
49 munin_plugin "passenger_requests"
51 node[:taginfo][:sites].each do |site|
53 directory = site[:directory] || "/srv/#{name}"
55 directory directory do
61 git "#{directory}/osmium" do
63 repository "git://github.com/joto/osmium.git"
69 git "#{directory}/taginfo" do
71 repository "git://github.com/joto/taginfo.git"
77 settings = edit_file "#{directory}/taginfo/taginfo-config-example.json" do |line|
78 line.gsub!(/^( *)"cxxflags": ".*",/, "\\1\"cxxflags\": \"-I../../osmium/include\",")
83 file "#{directory}/taginfo-config.json" do
90 execute "#{directory}/taginfo/tagstats/Makefile" do
93 cwd "#{directory}/taginfo/tagstats"
96 subscribes :run, "git[#{directory}/osmium]"
97 subscribes :run, "git[#{directory}/taginfo]"
98 notifies :restart, "service[apache2]"
101 directory "#{directory}/data" do
108 template "apache.erb"
109 directory "#{directory}/taginfo/web/public"