This is an automated email from the git hooks/post-receive script. tille pushed a commit to branch master in repository osrm.
commit 2b2e882ab74b91664847b2775f775ec834e70c5f Author: Andreas Tille <ti...@debian.org> Date: Thu Jul 10 16:35:27 2014 +0200 Inject debian/ dir as created by Christopher Baines <cbain...@gmail.com> Thu, 04 Jul 2013 15:03:15 +0100 --- debian/README.source | 9 + debian/changelog | 5 + debian/compat | 1 + debian/conffiles/access.lua | 13 ++ debian/conffiles/bicycle.lua | 353 +++++++++++++++++++++++++++++++++++++++ debian/conffiles/car.lua | 219 ++++++++++++++++++++++++ debian/conffiles/contractor.ini | 1 + debian/conffiles/extractor.ini | 2 + debian/conffiles/foot.lua | 193 +++++++++++++++++++++ debian/conffiles/server.ini | 10 ++ debian/conffiles/testbot.lua | 107 ++++++++++++ debian/conffiles/turnbot.lua | 8 + debian/control | 35 ++++ debian/copyright | 65 +++++++ debian/docs | 2 + debian/osrm-components.1 | 14 ++ debian/osrm-extract.1 | 22 +++ debian/osrm-prepare.1 | 14 ++ debian/osrm-routed.1 | 56 +++++++ debian/osrm-tools.install | 1 + debian/osrm-tools.manpages | 1 + debian/osrm.7 | 67 ++++++++ debian/osrm.default | 2 + debian/osrm.init | 98 +++++++++++ debian/osrm.install | 12 ++ debian/osrm.manpages | 4 + debian/osrm.postinst | 50 ++++++ debian/osrm.postrm | 50 ++++++ debian/patches/add-cmake-install | 38 +++++ debian/patches/series | 1 + debian/rules | 9 + debian/source/format | 1 + debian/source/include-binaries | 22 +++ 33 files changed, 1485 insertions(+) diff --git a/debian/README.source b/debian/README.source new file mode 100644 index 0000000..fa1a5a0 --- /dev/null +++ b/debian/README.source @@ -0,0 +1,9 @@ +osrm for Debian +--------------- + +<this file describes information about the source package, see Debian policy +manual section 4.14. You WILL either need to modify or delete this file> + + + + diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..1c0430a --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +osrm (0.3.4-1) unstable; urgency=low + + * Initial release (Closes: #701506) + + -- Christopher Baines <cbain...@gmail.com> Thu, 04 Jul 2013 15:03:15 +0100 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +9 diff --git a/debian/conffiles/access.lua b/debian/conffiles/access.lua new file mode 100644 index 0000000..094db62 --- /dev/null +++ b/debian/conffiles/access.lua @@ -0,0 +1,13 @@ +local ipairs = ipairs + +module "Access" + +function find_access_tag(source,access_tags_hierachy) + for i,v in ipairs(access_tags_hierachy) do + local tag = source.tags:Find(v) + if tag ~= '' then + return tag + end + end + return nil +end \ No newline at end of file diff --git a/debian/conffiles/bicycle.lua b/debian/conffiles/bicycle.lua new file mode 100644 index 0000000..98d03c8 --- /dev/null +++ b/debian/conffiles/bicycle.lua @@ -0,0 +1,353 @@ +require("lib/access") + +-- Begin of globals +barrier_whitelist = { [""] = true, ["cycle_barrier"] = true, ["bollard"] = true, ["entrance"] = true, ["cattle_grid"] = true, ["border_control"] = true, ["toll_booth"] = true, ["sally_port"] = true, ["gate"] = true, ["no"] = true} +access_tag_whitelist = { ["yes"] = true, ["permissive"] = true, ["designated"] = true } +access_tag_blacklist = { ["no"] = true, ["private"] = true, ["agricultural"] = true, ["forestery"] = true } +access_tag_restricted = { ["destination"] = true, ["delivery"] = true } +access_tags_hierachy = { "bicycle", "vehicle", "access" } +cycleway_tags = {["track"]=true,["lane"]=true,["opposite"]=true,["opposite_lane"]=true,["opposite_track"]=true,["share_busway"]=true,["sharrow"]=true,["shared"]=true } +service_tag_restricted = { ["parking_aisle"] = true } +restriction_exception_tags = { "bicycle", "vehicle", "access" } + +default_speed = 15 + +walking_speed = 6 + +bicycle_speeds = { + ["cycleway"] = default_speed, + ["primary"] = default_speed, + ["primary_link"] = default_speed, + ["secondary"] = default_speed, + ["secondary_link"] = default_speed, + ["tertiary"] = default_speed, + ["tertiary_link"] = default_speed, + ["residential"] = default_speed, + ["unclassified"] = default_speed, + ["living_street"] = default_speed, + ["road"] = default_speed, + ["service"] = default_speed, + ["track"] = 12, + ["path"] = 12 + --["footway"] = 12, + --["pedestrian"] = 12, +} + +pedestrian_speeds = { + ["footway"] = walking_speed, + ["pedestrian"] = walking_speed, + ["steps"] = 2 +} + +railway_speeds = { + ["train"] = 10, + ["railway"] = 10, + ["subway"] = 10, + ["light_rail"] = 10, + ["monorail"] = 10, + ["tram"] = 10 +} + +platform_speeds = { + ["platform"] = walking_speed +} + +amenity_speeds = { + ["parking"] = 10, + ["parking_entrance"] = 10 +} + +man_made_speeds = { + ["pier"] = walking_speed +} + +route_speeds = { + ["ferry"] = 5 +} + +surface_speeds = { + ["cobblestone:flattened"] = 10, + ["paving_stones"] = 10, + ["compacted"] = 10, + ["cobblestone"] = 6, + ["unpaved"] = 6, + ["fine_gravel"] = 6, + ["gravel"] = 6, + ["fine_gravel"] = 6, + ["pebbelstone"] = 6, + ["ground"] = 6, + ["dirt"] = 6, + ["earth"] = 6, + ["grass"] = 6, + ["mud"] = 3, + ["sand"] = 3 +} + +take_minimum_of_speeds = true +obey_oneway = true +obey_bollards = false +use_restrictions = true +ignore_areas = true -- future feature +traffic_signal_penalty = 5 +u_turn_penalty = 20 +use_turn_restrictions = false +turn_penalty = 60 +turn_bias = 1.4 +-- End of globals + +function get_exceptions(vector) + for i,v in ipairs(restriction_exception_tags) do + vector:Add(v) + end +end + +function node_function (node) + local barrier = node.tags:Find ("barrier") + local access = Access.find_access_tag(node, access_tags_hierachy) + local traffic_signal = node.tags:Find("highway") + + -- flag node if it carries a traffic light + if traffic_signal == "traffic_signals" then + node.traffic_light = true + end + + -- parse access and barrier tags + if access and access ~= "" then + if access_tag_blacklist[access] then + node.bollard = true + else + node.bollard = false + end + elseif barrier and barrier ~= "" then + if barrier_whitelist[barrier] then + node.bollard = false + else + node.bollard = true + end + end + + return 1 +end + +function way_function (way) + -- initial routability check, filters out buildings, boundaries, etc + local highway = way.tags:Find("highway") + local route = way.tags:Find("route") + local man_made = way.tags:Find("man_made") + local railway = way.tags:Find("railway") + local amenity = way.tags:Find("amenity") + local public_transport = way.tags:Find("public_transport") + if (not highway or highway == '') and + (not route or route == '') and + (not railway or railway=='') and + (not amenity or amenity=='') and + (not man_made or man_made=='') and + (not public_transport or public_transport=='') + then + return 0 + end + + -- don't route on ways or railways that are still under construction + if highway=='construction' or railway=='construction' then + return 0 + end + + -- access + local access = Access.find_access_tag(way, access_tags_hierachy) + if access_tag_blacklist[access] then + return 0 + end + + + -- other tags + local name = way.tags:Find("name") + local ref = way.tags:Find("ref") + local junction = way.tags:Find("junction") + local maxspeed = parseMaxspeed(way.tags:Find ( "maxspeed") ) + local maxspeed_forward = parseMaxspeed(way.tags:Find( "maxspeed:forward")) + local maxspeed_backward = parseMaxspeed(way.tags:Find( "maxspeed:backward")) + local barrier = way.tags:Find("barrier") + local oneway = way.tags:Find("oneway") + local onewayClass = way.tags:Find("oneway:bicycle") + local cycleway = way.tags:Find("cycleway") + local cycleway_left = way.tags:Find("cycleway:left") + local cycleway_right = way.tags:Find("cycleway:right") + local duration = way.tags:Find("duration") + local service = way.tags:Find("service") + local area = way.tags:Find("area") + local foot = way.tags:Find("foot") + local surface = way.tags:Find("surface") + + -- name + if "" ~= ref and "" ~= name then + way.name = name .. ' / ' .. ref + elseif "" ~= ref then + way.name = ref + elseif "" ~= name then + way.name = name + else + way.name = "{highway:"..highway.."}" -- if no name exists, use way type + -- this encoding scheme is excepted to be a temporary solution + end + + -- speed + if route_speeds[route] then + -- ferries (doesn't cover routes tagged using relations) + way.direction = Way.bidirectional + way.ignore_in_grid = true + if durationIsValid(duration) then + way.duration = math.max( 1, parseDuration(duration) ) + else + way.speed = route_speeds[route] + end + elseif railway and platform_speeds[railway] then + -- railway platforms (old tagging scheme) + way.speed = platform_speeds[railway] + elseif platform_speeds[public_transport] then + -- public_transport platforms (new tagging platform) + way.speed = platform_speeds[public_transport] + elseif railway and railway_speeds[railway] then + -- railways + if access and access_tag_whitelist[access] then + way.speed = railway_speeds[railway] + way.direction = Way.bidirectional + end + elseif amenity and amenity_speeds[amenity] then + -- parking areas + way.speed = amenity_speeds[amenity] + elseif bicycle_speeds[highway] then + -- regular ways + way.speed = bicycle_speeds[highway] + elseif access and access_tag_whitelist[access] then + -- unknown way, but valid access tag + way.speed = default_speed + else + -- biking not allowed, maybe we can push our bike? + -- essentially requires pedestrian profiling, for example foot=no mean we can't push a bike + -- TODO: if we can push, the way should be marked as pedestrion mode, but there's no way to do it yet from lua.. + if foot ~= 'no' then + if pedestrian_speeds[highway] then + -- pedestrian-only ways and areas + way.speed = pedestrian_speeds[highway] + elseif man_made and man_made_speeds[man_made] then + -- man made structures + way.speed = man_made_speeds[man_made] + elseif foot == 'yes' then + way.speed = walking_speed + end + end + end + + -- direction + way.direction = Way.bidirectional + local impliedOneway = false + if junction == "roundabout" or highway == "motorway_link" or highway == "motorway" then + way.direction = Way.oneway + impliedOneway = true + end + + if onewayClass == "yes" or onewayClass == "1" or onewayClass == "true" then + way.direction = Way.oneway + elseif onewayClass == "no" or onewayClass == "0" or onewayClass == "false" then + way.direction = Way.bidirectional + elseif onewayClass == "-1" then + way.direction = Way.opposite + elseif oneway == "no" or oneway == "0" or oneway == "false" then + way.direction = Way.bidirectional + elseif cycleway and string.find(cycleway, "opposite") == 1 then + if impliedOneway then + way.direction = Way.opposite + else + way.direction = Way.bidirectional + end + elseif cycleway_left and cycleway_tags[cycleway_left] and cycleway_right and cycleway_tags[cycleway_right] then + way.direction = Way.bidirectional + elseif cycleway_left and cycleway_tags[cycleway_left] then + if impliedOneway then + way.direction = Way.opposite + else + way.direction = Way.bidirectional + end + elseif cycleway_right and cycleway_tags[cycleway_right] then + if impliedOneway then + way.direction = Way.oneway + else + way.direction = Way.bidirectional + end + elseif oneway == "-1" then + way.direction = Way.opposite + elseif oneway == "yes" or oneway == "1" or oneway == "true" then + way.direction = Way.oneway + end + + -- pushing bikes + if bicycle_speeds[highway] or pedestrian_speeds[highway] then + if foot ~= 'no' then + if junction ~= "roundabout" then + if way.direction == Way.oneway then + way.backward_speed = walking_speed + elseif way.direction == Way.opposite then + way.backward_speed = walking_speed + way.speed = way.speed + end + end + end + if way.backward_speed == way.speed then + -- TODO: no way yet to mark a way as pedestrian mode if forward/backward speeds are equal + way.direction = Way.bidirectional + end + end + + + -- cycleways + if cycleway and cycleway_tags[cycleway] then + way.speed = bicycle_speeds["cycleway"] + elseif cycleway_left and cycleway_tags[cycleway_left] then + way.speed = bicycle_speeds["cycleway"] + elseif cycleway_right and cycleway_tags[cycleway_right] then + way.speed = bicycle_speeds["cycleway"] + end + + -- surfaces + if surface then + surface_speed = surface_speeds[surface] + if surface_speed then + way.speed = math.min(way.speed, surface_speed) + way.backward_speed = math.min(way.backward_speed, surface_speed) + end + end + + -- maxspeed + -- TODO: maxspeed of backward direction + if take_minimum_of_speeds then + if maxspeed and maxspeed>0 then + way.speed = math.min(way.speed, maxspeed) + end + end + + -- Override speed settings if explicit forward/backward maxspeeds are given + if maxspeed_forward ~= nil and maxspeed_forward > 0 then + if Way.bidirectional == way.direction then + way.backward_speed = way.speed + end + way.speed = maxspeed_forward + end + if maxspeed_backward ~= nil and maxspeed_backward > 0 then + way.backward_speed = maxspeed_backward + end + + + + way.type = 1 + return 1 +end + +function turn_function (angle) + -- compute turn penalty as angle^2, with a left/right bias + k = turn_penalty/(90.0*90.0) + if angle>=0 then + return angle*angle*k/turn_bias + else + return angle*angle*k*turn_bias + end +end diff --git a/debian/conffiles/car.lua b/debian/conffiles/car.lua new file mode 100644 index 0000000..ff7c379 --- /dev/null +++ b/debian/conffiles/car.lua @@ -0,0 +1,219 @@ +-- Begin of globals +require("lib/access") + +barrier_whitelist = { ["cattle_grid"] = true, ["border_control"] = true, ["toll_booth"] = true, ["sally_port"] = true, ["gate"] = true, ["no"] = true} +access_tag_whitelist = { ["yes"] = true, ["motorcar"] = true, ["motor_vehicle"] = true, ["vehicle"] = true, ["permissive"] = true, ["designated"] = true } +access_tag_blacklist = { ["no"] = true, ["private"] = true, ["agricultural"] = true, ["forestry"] = true } +access_tag_restricted = { ["destination"] = true, ["delivery"] = true } +access_tags = { "motorcar", "motor_vehicle", "vehicle" } +access_tags_hierachy = { "motorcar", "motor_vehicle", "vehicle", "access" } +service_tag_restricted = { ["parking_aisle"] = true } +ignore_in_grid = { ["ferry"] = true } +restriction_exception_tags = { "motorcar", "motor_vehicle", "vehicle" } + +speed_profile = { + ["motorway"] = 90, + ["motorway_link"] = 75, + ["trunk"] = 85, + ["trunk_link"] = 70, + ["primary"] = 65, + ["primary_link"] = 60, + ["secondary"] = 55, + ["secondary_link"] = 50, + ["tertiary"] = 40, + ["tertiary_link"] = 30, + ["unclassified"] = 25, + ["residential"] = 25, + ["living_street"] = 10, + ["service"] = 15, +-- ["track"] = 5, + ["ferry"] = 5, + ["shuttle_train"] = 10, + ["default"] = 50 +} + +take_minimum_of_speeds = false +obey_oneway = true +obey_bollards = true +use_restrictions = true +ignore_areas = true -- future feature +traffic_signal_penalty = 2 +u_turn_penalty = 20 + +-- End of globals + +function get_exceptions(vector) + for i,v in ipairs(restriction_exception_tags) do + vector:Add(v) + end +end + +local function parse_maxspeed(source) + if source == nil then + return 0 + end + local n = tonumber(source:match("%d*")) + if n == nil then + n = 0 + end + if string.match(source, "mph") or string.match(source, "mp/h") then + n = (n*1609)/1000; + end + return math.abs(n) +end + +function node_function (node) + local barrier = node.tags:Find ("barrier") + local access = Access.find_access_tag(node, access_tags_hierachy) + local traffic_signal = node.tags:Find("highway") + + --flag node if it carries a traffic light + + if traffic_signal == "traffic_signals" then + node.traffic_light = true; + end + + -- parse access and barrier tags + if access and access ~= "" then + if access_tag_blacklist[access] then + node.bollard = true + end + elseif barrier and barrier ~= "" then + if barrier_whitelist[barrier] then + return + else + node.bollard = true + end + end + return 1 +end + + +function way_function (way) + -- we dont route over areas + local area = way.tags:Find("area") + if ignore_areas and ("yes" == area) then + return 0 + end + + -- check if oneway tag is unsupported + local oneway = way.tags:Find("oneway") + if "reversible" == oneway then + return 0 + end + + -- Check if we are allowed to access the way + local access = Access.find_access_tag(way, access_tags_hierachy) + if access_tag_blacklist[access] then + return 0 + end + + -- Second, parse the way according to these properties + local highway = way.tags:Find("highway") + local name = way.tags:Find("name") + local ref = way.tags:Find("ref") + local junction = way.tags:Find("junction") + local route = way.tags:Find("route") + local maxspeed = parse_maxspeed(way.tags:Find ( "maxspeed") ) + local maxspeed_forward = parse_maxspeed(way.tags:Find( "maxspeed:forward")) + local maxspeed_backward = parse_maxspeed(way.tags:Find( "maxspeed:backward")) + local barrier = way.tags:Find("barrier") + local cycleway = way.tags:Find("cycleway") + local duration = way.tags:Find("duration") + local service = way.tags:Find("service") + + + -- Set the name that will be used for instructions + if "" ~= ref then + way.name = ref + elseif "" ~= name then + way.name = name +-- else +-- way.name = highway -- if no name exists, use way type + end + + if "roundabout" == junction then + way.roundabout = true; + end + + -- Handling ferries and piers + if (speed_profile[route] ~= nil and speed_profile[route] > 0) then + if durationIsValid(duration) then + way.duration = math.max( parseDuration(duration), 1 ); + end + way.direction = Way.bidirectional + if speed_profile[route] ~= nil then + highway = route; + end + if tonumber(way.duration) < 0 then + way.speed = speed_profile[highway] + end + end + + -- Set the avg speed on the way if it is accessible by road class + if (speed_profile[highway] ~= nil and way.speed == -1 ) then + if maxspeed > speed_profile[highway] then + way.speed = maxspeed + else + if 0 == maxspeed then + maxspeed = math.huge + end + way.speed = math.min(speed_profile[highway], maxspeed) + end + end + + -- Set the avg speed on ways that are marked accessible + if "" ~= highway and access_tag_whitelist[access] and way.speed == -1 then + if 0 == maxspeed then + maxspeed = math.huge + end + way.speed = math.min(speed_profile["default"], maxspeed) + end + + -- Set access restriction flag if access is allowed under certain restrictions only + if access ~= "" and access_tag_restricted[access] then + way.is_access_restricted = true + end + + -- Set access restriction flag if service is allowed under certain restrictions only + if service ~= "" and service_tag_restricted[service] then + way.is_access_restricted = true + end + + -- Set direction according to tags on way + way.direction = Way.bidirectional + if obey_oneway then + if oneway == "-1" then + way.direction = Way.opposite + elseif oneway == "yes" or oneway == "1" or oneway == "true" or junction == "roundabout" or highway == "motorway_link" or highway == "motorway" then + way.direction = Way.oneway + end + end + + -- Override speed settings if explicit forward/backward maxspeeds are given + if maxspeed_forward ~= nil and maxspeed_forward > 0 then + if Way.bidirectional == way.direction then + way.backward_speed = way.speed + end + way.speed = maxspeed_forward + end + if maxspeed_backward ~= nil and maxspeed_backward > 0 then + way.backward_speed = maxspeed_backward + end + + -- Override general direction settings of there is a specific one for our mode of travel + if ignore_in_grid[highway] ~= nil and ignore_in_grid[highway] then + way.ignore_in_grid = true + end + + way.type = 1 + return 1 +end + +-- These are wrappers to parse vectors of nodes and ways and thus to speed up any tracing JIT + +function node_vector_function(vector) + for v in vector.nodes do + node_function(v) + end +end diff --git a/debian/conffiles/contractor.ini b/debian/conffiles/contractor.ini new file mode 100644 index 0000000..4da33c7 --- /dev/null +++ b/debian/conffiles/contractor.ini @@ -0,0 +1 @@ +Threads = 4 diff --git a/debian/conffiles/extractor.ini b/debian/conffiles/extractor.ini new file mode 100644 index 0000000..8dd11de --- /dev/null +++ b/debian/conffiles/extractor.ini @@ -0,0 +1,2 @@ +Memory = 2 +Threads = 10 diff --git a/debian/conffiles/foot.lua b/debian/conffiles/foot.lua new file mode 100644 index 0000000..6a15fb2 --- /dev/null +++ b/debian/conffiles/foot.lua @@ -0,0 +1,193 @@ +-- Foot profile + +-- Begin of globals + +bollards_whitelist = { [""] = true, ["cattle_grid"] = true, ["border_control"] = true, ["toll_booth"] = true, ["sally_port"] = true, ["gate"] = true} +access_tag_whitelist = { ["yes"] = true, ["foot"] = true, ["permissive"] = true, ["designated"] = true } +access_tag_blacklist = { ["no"] = true, ["private"] = true, ["agricultural"] = true, ["forestery"] = true } +access_tag_restricted = { ["destination"] = true, ["delivery"] = true } +access_tags = { "foot" } +service_tag_restricted = { ["parking_aisle"] = true } +ignore_in_grid = { ["ferry"] = true } +restriction_exception_tags = { "foot" } + +speed_profile = { + ["primary"] = 5, + ["primary_link"] = 5, + ["secondary"] = 5, + ["secondary_link"] = 5, + ["tertiary"] = 5, + ["tertiary_link"] = 5, + ["unclassified"] = 5, + ["residential"] = 5, + ["road"] = 5, + ["living_street"] = 5, + ["service"] = 5, + ["track"] = 5, + ["path"] = 5, + ["steps"] = 5, + ["ferry"] = 5, + ["pedestrian"] = 5, + ["footway"] = 5, + ["pier"] = 5, + ["default"] = 5 +} + + +take_minimum_of_speeds = true +obey_oneway = true +obey_bollards = false +use_restrictions = false +ignore_areas = true -- future feature +traffic_signal_penalty = 2 +u_turn_penalty = 2 +use_turn_restrictions = false +-- End of globals + +function get_exceptions(vector) + for i,v in ipairs(restriction_exception_tags) do + vector:Add(v) + end +end + +function node_function (node) + local barrier = node.tags:Find ("barrier") + local access = node.tags:Find ("access") + local traffic_signal = node.tags:Find("highway") + + --flag node if it carries a traffic light + + if traffic_signal == "traffic_signals" then + node.traffic_light = true; + end + + if obey_bollards then + --flag node as unpassable if it black listed as unpassable + if access_tag_blacklist[barrier] then + node.bollard = true; + end + + --reverse the previous flag if there is an access tag specifying entrance + if node.bollard and not bollards_whitelist[barrier] and not access_tag_whitelist[barrier] then + node.bollard = false; + end + end + return 1 +end + +function way_function (way) + + -- First, get the properties of each way that we come across + local highway = way.tags:Find("highway") + local name = way.tags:Find("name") + local ref = way.tags:Find("ref") + local junction = way.tags:Find("junction") + local route = way.tags:Find("route") + local maxspeed = parseMaxspeed(way.tags:Find ( "maxspeed") ) + local man_made = way.tags:Find("man_made") + local barrier = way.tags:Find("barrier") + local oneway = way.tags:Find("oneway") + local onewayClass = way.tags:Find("oneway:foot") + local duration = way.tags:Find("duration") + local service = way.tags:Find("service") + local area = way.tags:Find("area") + local access = way.tags:Find("access") + + -- Second parse the way according to these properties + + if ignore_areas and ("yes" == area) then + return 0 + end + + -- Check if we are allowed to access the way + if access_tag_blacklist[access] ~=nil and access_tag_blacklist[access] then + return 0; + end + + -- Check if our vehicle types are forbidden + for i,v in ipairs(access_tags) do + local mode_value = way.tags:Find(v) + if nil ~= mode_value and "no" == mode_value then + return 0; + end + end + + + -- Set the name that will be used for instructions + if "" ~= ref then + way.name = ref + elseif "" ~= name then + way.name = name + end + + if "roundabout" == junction then + way.roundabout = true; + end + + -- Handling ferries and piers + + if (speed_profile[route] ~= nil and speed_profile[route] > 0) or + (speed_profile[man_made] ~= nil and speed_profile[man_made] > 0) + then + if durationIsValid(duration) then + way.speed = parseDuration(duration) / math.max(1, numberOfNodesInWay-1); + way.is_duration_set = true; + end + way.direction = Way.bidirectional; + if speed_profile[route] ~= nil then + highway = route; + elseif speed_profile[man_made] ~= nil then + highway = man_made; + end + if not way.is_duration_set then + way.speed = speed_profile[highway] + end + + end + + -- Set the avg speed on the way if it is accessible by road class + if (speed_profile[highway] ~= nil and way.speed == -1 ) then + way.speed = speed_profile[highway] + end + + -- Set the avg speed on ways that are marked accessible + if access_tag_whitelist[access] and way.speed == -1 then + if (0 < maxspeed and not take_minimum_of_speeds) or maxspeed == 0 then + maxspeed = math.huge + end + way.speed = math.min(speed_profile["default"], maxspeed) + end + + -- Set access restriction flag if access is allowed under certain restrictions only + if access ~= "" and access_tag_restricted[access] then + way.is_access_restricted = true + end + + -- Set access restriction flag if service is allowed under certain restrictions only + if service ~= "" and service_tag_restricted[service] then + way.is_access_restricted = true + end + + -- Set direction according to tags on way + if obey_oneway then + if onewayClass == "yes" or onewayClass == "1" or onewayClass == "true" then + way.direction = Way.oneway + elseif onewayClass == "no" or onewayClass == "0" or onewayClass == "false" then + way.direction = Way.bidirectional + elseif onewayClass == "-1" then + way.direction = Way.opposite + else + way.direction = Way.bidirectional + end + else + way.direction = Way.bidirectional + end + + -- Override general direction settings of there is a specific one for our mode of travel + + if ignore_in_grid[highway] ~= nil and ignore_in_grid[highway] then + way.ignore_in_grid = true + end + way.type = 1 + return 1 +end diff --git a/debian/conffiles/server.ini b/debian/conffiles/server.ini new file mode 100644 index 0000000..9920460 --- /dev/null +++ b/debian/conffiles/server.ini @@ -0,0 +1,10 @@ +Threads = 8 +IP = 0.0.0.0 +Port = 5000 + +hsgrData=/var/lib/osrm/planet-latest.osrm.hsgr +nodesData=/var/lib/osrm/planet-latest.osrm.nodes +edgesData=/var/lib/osrm/planet-latest.osrm.edges +ramIndex=/var/lib/osrm/planet-latest.osrm.ramIndex +fileIndex=/var/lib/osrm/planet-latest.osrm.fileIndex +namesData=/var/lib/osrm/planet-latest.osrm.names diff --git a/debian/conffiles/testbot.lua b/debian/conffiles/testbot.lua new file mode 100644 index 0000000..f934fea --- /dev/null +++ b/debian/conffiles/testbot.lua @@ -0,0 +1,107 @@ +-- Testbot profile + +-- Moves at fixed, well-known speeds, practical for testing speed and travel times: + +-- Primary road: 36km/h = 36000m/3600s = 100m/10s +-- Secondary road: 18km/h = 18000m/3600s = 100m/20s +-- Tertiary road: 12km/h = 12000m/3600s = 100m/30s + +speed_profile = { + ["primary"] = 36, + ["secondary"] = 18, + ["tertiary"] = 12, + ["default"] = 24 +} + +-- these settings are read directly by osrm + +take_minimum_of_speeds = true +obey_oneway = true +obey_bollards = true +use_restrictions = true +ignore_areas = true -- future feature +traffic_signal_penalty = 7 -- seconds +u_turn_penalty = 20 + +function limit_speed(speed, limits) + -- don't use ipairs(), since it stops at the first nil value + for i=1, #limits do + limit = limits[i] + if limit ~= nil and limit > 0 then + if limit < speed then + return limit -- stop at first speedlimit that's smaller than speed + end + end + end + return speed +end + +function node_function (node) + local traffic_signal = node.tags:Find("highway") + + if traffic_signal == "traffic_signals" then + node.traffic_light = true; + -- TODO: a way to set the penalty value + end + return 1 +end + +function way_function (way) + local highway = way.tags:Find("highway") + local name = way.tags:Find("name") + local oneway = way.tags:Find("oneway") + local route = way.tags:Find("route") + local duration = way.tags:Find("duration") + local maxspeed = tonumber(way.tags:Find ( "maxspeed")) + local maxspeed_forward = tonumber(way.tags:Find( "maxspeed:forward")) + local maxspeed_backward = tonumber(way.tags:Find( "maxspeed:backward")) + + way.name = name + + if route ~= nil and durationIsValid(duration) then + way.duration = math.max( 1, parseDuration(duration) ) + else + local speed_forw = speed_profile[highway] or speed_profile['default'] + local speed_back = speed_forw + + if highway == "river" then + local temp_speed = speed_forw; + speed_forw = temp_speed*1.5 + speed_back = temp_speed/1.5 + end + + if maxspeed_forward ~= nil and maxspeed_forward > 0 then + speed_forw = maxspeed_forward + else + if maxspeed ~= nil and maxspeed > 0 and speed_forw > maxspeed then + speed_forw = maxspeed + end + end + + if maxspeed_backward ~= nil and maxspeed_backward > 0 then + speed_back = maxspeed_backward + else + if maxspeed ~=nil and maxspeed > 0 and speed_back > maxspeed then + speed_back = maxspeed + end + end + + way.speed = speed_forw + if speed_back ~= way_forw then + way.backward_speed = speed_back + end + end + + if oneway == "no" or oneway == "0" or oneway == "false" then + way.direction = Way.bidirectional + elseif oneway == "-1" then + way.direction = Way.opposite + elseif oneway == "yes" or oneway == "1" or oneway == "true" then + way.direction = Way.oneway + else + way.direction = Way.bidirectional + end + + way.type = 1 + return 1 +end diff --git a/debian/conffiles/turnbot.lua b/debian/conffiles/turnbot.lua new file mode 100644 index 0000000..1a96966 --- /dev/null +++ b/debian/conffiles/turnbot.lua @@ -0,0 +1,8 @@ +-- Testbot, with turn penalty +-- Used for testing turn penalties + +require 'testbot' + +function turn_function (angle) + return 200*math.abs(angle)/180 -- penalty +end diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..515c81c --- /dev/null +++ b/debian/control @@ -0,0 +1,35 @@ +Source: osrm +Section: misc +Priority: extra +Maintainer: Debian GIS Project <pkg-grass-devel@lists.alioth.debian.org> +Uploaders: Debian OpenStreetMap Team <pkg-osm-ma...@lists.alioth.debian.org>, + Christopher Baines <cbain...@gmail.com> +Build-Depends: debhelper (>= 9.0.0), cmake, libboost-dev, libboost-filesystem-dev, libboost-thread-dev, libboost-system-dev, libboost-regex-dev, libstxxl-dev, libxml2-dev, libsparsehash-dev, libbz2-dev, zlib1g-dev, libzip-dev, libgomp1, libpng-dev, libprotoc7, libprotobuf-dev, protobuf-compiler, liblua5.1-0-dev, libluabind-dev, pkg-config, libosmpbf-dev, libgdal-dev +Standards-Version: 3.9.4 +Homepage: http://project-osrm.org/ +Vcs-Git: git://git.debian.org/pkg-grass/osrm.git +Vcs-Browser: http://git.debian.org/?p=pkg-grass/osrm.git + +Package: osrm +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Suggests: osrm-tools +Pre-Depends: adduser +Description: high performance routing engine for shortest paths in road networks + The Open Source Routing Machine (OSRM) is a C++ implementation of a + high-performance routing engine for shortest paths in road networks. + . + OSRM is able to compute and output a shortest path between any origin + and destination within a few miliseconds. + +Package: osrm-tools +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Enhances: osrm +Description: tools for use with osrm + The Open Source Routing Machine (OSRM) is a C++ implementation of a + high-performance routing engine for shortest paths in road networks. + . + This package contains the component analisis (osrm-components) tool + which generates statistics and a shapefile for unroutable roads in the OSM + data. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..efa741b --- /dev/null +++ b/debian/copyright @@ -0,0 +1,65 @@ +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: osrm +Source: http://project-osrm.org/ + +Files: * +Copyright: Christian Vetter + Dennis Luxen + Ruslan Krenzler + Frederik Ramm + Bharath Vissapragada + Pascal Neis + Sasa Ivetic + Emil Tin + Henning Moll +License: GPL-3 + This package is free software; you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation. + . + This package is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/> + +Files: win/getopt.c win/getopt.h +Copyright: 1987,88,89,90,91,92,93,94,95,96,98,99,2000,2001 Free Software Foundation, Inc. +License: LGPL-2.1+ + This file is part of the GNU C Library. + . + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + . + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + . + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + . + On Debian systems, the full text of the GNU Lesser General Public + License version 2.1 can be found in the file + `/usr/share/common-licenses/LGPL-2.1'. + +Files: debian/* +Copyright: 2013 Christopher Baines <cbain...@gmail.com> +License: AGPL-3 + This package is free software; you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation. + . + This package is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/> diff --git a/debian/docs b/debian/docs new file mode 100644 index 0000000..a5a61e8 --- /dev/null +++ b/debian/docs @@ -0,0 +1,2 @@ +AUTHORS.TXT +README.TXT diff --git a/debian/osrm-components.1 b/debian/osrm-components.1 new file mode 100644 index 0000000..039d505 --- /dev/null +++ b/debian/osrm-components.1 @@ -0,0 +1,14 @@ +.TH OSRM-COMPONENTS 1 "July 4, 2013" osrm-components "Open Source Rouing Machine" +.SH NAME +osrm-components \- gives information about unroutable roads in the data +.SH SYNOPSIS +.B osrm-components +.I data.osrm +.I data.osrm.restrictions +.SH DESCRIPTION +Produces some statistics, and a shapefile (with associated data) regarding the input data. +.SH SEE ALSO +.BR osrm (7), +.BR osrm-extract (1), +.BR osrm-prepare (1), +.BR osrm-routed (1) diff --git a/debian/osrm-extract.1 b/debian/osrm-extract.1 new file mode 100644 index 0000000..d39a3b0 --- /dev/null +++ b/debian/osrm-extract.1 @@ -0,0 +1,22 @@ +.TH OSRM-EXTRACT 1 "July 4, 2013" osrm-extract "Open Source Routing Machine" +.SH NAME +osrm-extract \- generate OSRM routing data from OSM data +.SH SYNOPSIS +.B osrm-extract +.I data +[profile.lua] +.SH DESCRIPTION +\fBosrm-extract\fP takes OSM data, ether in a xml file, a bzipped xml or a pbf encoded file. Along with a profile (written in lua). It then creates three files, .osrm which contains the routing data, osrm.restrictions which contains turn restrictions, and .osrm.names which contains the names of the road. +.SH PROFILES +Profiles are written in lua, and describe how the osm data can be routed across. Several profiles are available in /etc/osrm/profiles +.SH EXAMPLES +Using the data file planet-latest.osm.pbf, and the profile /etc/osrm/profiles/car.lua, you would run: + + osrm-extract planet-latest.osm.pbf /etc/osrm/profiles/car.lua + +This should then generate: planet-latest.osrm planet-latest.osrm.restrictions planet-latest.osrm.names +The next step is to run the osrm-prepare tool. +.SH SEE ALSO +.BR osrm (7), +.BR osrm-prepare (1), +.BR osrm-routed (1) diff --git a/debian/osrm-prepare.1 b/debian/osrm-prepare.1 new file mode 100644 index 0000000..4afd368 --- /dev/null +++ b/debian/osrm-prepare.1 @@ -0,0 +1,14 @@ +.TH OSRM-PREPARE 1 "July 4, 2013" osrm-prepare "Open Source Routing Machine" +.SH NAME +osrm-prepare \- generate the hierarchy from OSRM data +.SH SYNOPSIS +.B osrm-prepare +.I file.osrm +.I file.osrm.resctictions +.I profile.lua +.SH DESCRIPTION +The \fBosrm-prepare\fP tool takes the data generated by \fBosrm-extract\fP and creates, .osrm.hsgr, .osrm.nodes, .osrm.ramIndex, .osrm.fileIndex . After these have been generated, the osrm service can be started, or the \fBosrm-routed\fP command can be run. +.SH SEE ALSO +.BR osrm (7), +.BR osrm-extract (1), +.BR osrm-routed (1) diff --git a/debian/osrm-routed.1 b/debian/osrm-routed.1 new file mode 100644 index 0000000..13ee086 --- /dev/null +++ b/debian/osrm-routed.1 @@ -0,0 +1,56 @@ +.\" (C) Copyright 2013 Christopher Baines <ch...@chris-desktop.home>, +.TH OSRM-ROUTED 1 "July 4, 2013" osrm-routed "Open Source Routing Machine" +.SH NAME +osrm-routed \- the OSRM routing service +.SH SYNOPSIS +.B osrm +.I server.ini +.SH DESCRIPTION +The Open Source Routing Machine (OSRM) is a high performance routing enigine for finding shortest paths in road networks. +.PP +\fBosrm-routed\fP starts the router, it uses then config file given, defaulting to server.ini in the current directory. Note that on Debian, this command is executed by the init file, so for a standard setup, it should not be nessacery to run it directly. +.SH CONFIGURATION FILE +Uses a key = value syntax. The table below gives the keys that can be used. + +.TS +tab (@); +l lx. +Threads@T{ +Number of threads OSRM will use (default 8) +T} +IP@T{ +IP address that OSRM will use (default 0.0.0.0) +T} +Port@T{ +Port that OSRM will use (default 5000) +T} +hsgrData@T{ +OSRM Hierarchy (default suffix: osrm.hsgr) +T} +nodesData@T{ +Node map (default suffix: osrm.nodes) +T} +edgesData@T{ +Edge map (default suffix: osrm.edges) +T} +ramIndex@T{ +Stage 1 index (default suffix: osrm.ramIndex) +e.g. \fBman\fR(7), \fBgroff\fR(7) +T} +fileIndex@T{ +Stage 2 index (default suffix: osrm.fileIndex) +T} +namesData@T{ +Road names (default suffix: osrm.names) +T} +.TE + +.SH FILES +.TP +.I /etc/osrm/server.ini +The server configuration file used by the OSRM service + +.SH "SEE ALSO" +.BR osrm (7), +.BR osrm-extract (1), +.BR osrm-prepare (1) diff --git a/debian/osrm-tools.install b/debian/osrm-tools.install new file mode 100644 index 0000000..4781507 --- /dev/null +++ b/debian/osrm-tools.install @@ -0,0 +1 @@ +debian/tmp/usr/bin/osrm-components /usr/bin/ diff --git a/debian/osrm-tools.manpages b/debian/osrm-tools.manpages new file mode 100644 index 0000000..b630af7 --- /dev/null +++ b/debian/osrm-tools.manpages @@ -0,0 +1 @@ +debian/osrm-components.1 diff --git a/debian/osrm.7 b/debian/osrm.7 new file mode 100644 index 0000000..c59da78 --- /dev/null +++ b/debian/osrm.7 @@ -0,0 +1,67 @@ +.TH OSRM 7 "July 4, 2013" osrm "Open Source Routing Machine" +.SH NAME +osrm \- high performance routing engine +.SH SYNOPSIS +.B osrm-extract +.I data +[profile.lua] +.br +.B osrm-prepare +.I file.osrm +.I file.osrm.resctictions +.I profile.lua +.br +.B osrm-routed +.I server.ini +.br +.B osrm-components +.I data.osrm +.I data.osrm.restrictions +.SH DESCRIPTION +The Open Source Routing Machine (OSRM) is a high performance routing engine for road networks. + +Firstly, you must take OSM data, and create the files that OSM uses. This is done through the use of the osrm-extract and osrm-prepare commands. +.SH EXAMPLE +The following example uses an osm file called planet-latest.osm.pbf, however this will work with raw osm data, or pbf data. The prefix for the osrm files will be planet-latest, this is taken from the name of the osm file, if you use a differently named file, you must change the prefix in the below commands. The files used will be placed in /var/cache/osrm, as this is the default location, as set in /etc/osrm/server.ini, the configuration file used by the osrm service. + +The latest planet file can be downloaded from the planet.openstreetmap.org site by using the following command (run in the /var/cache/osrm directory): + + wget http://planet.openstreetmap.org/pbf/planet-latest.osm.pbf + +The following commands assume that the osm data is in the /var/lib/osrm directory. + +For this example, the profile /etc/osrm/profiles/car.lua will be used, but this can either be changed, or a different profile can be used. There are additional sample profiles available in /etc/osrm/profiles. To run the extraction, run: + + osrm-extract planet-latest.osm.pbf /etc/osrm/profiles/car.lua + +Once finished, you should have the files planet-latest.osrm, planet-latest.osrm.names, planet-latest.osrm.restrictions present. You will also have some stxxl related files, but these are not directly related to osrm. + +To proceed, use osrm-prepare to generate the higherarchi: + + osrm-prepare planet-latest.osrm planet-latest.osrm.restrictions /etc/osrm/profiles/car.lua + +In the working directory, you should now have in addition to the above files planet-latest.osrm.hsgr, planet-latest.osrm.edges, planet-latest.osrm.nodes, planet-latest.osrm.ramindex and planet-latest.osrm.fileIndex. You can then start the service. + + service osrm restart + +If the service starts successfully, you should be able to use the API, if not, check the log file at /var/log.osrm/routed.log, and if nessacery, report a bug against the osrm package. +.SH SERVER API +The service api is similar to query strings for HTTP. Three types of query are possible: +.TS +tab (@); +l lx. +locate@T{ +Takes latitude and longitude and returns the nearest node in the data to that point. +T} +nearest@T{ +Takes lattitude and longitude and returns the nearest point on a street segment to that point. +T} +viaroute@T{ +Takes multiple latitude, longitude points, and returns a route from the first, through to the last. +T} +.TE +.SH SEE ALSO +.BR osrm-extract (1), +.BR osrm-prepare (1), +.BR osrm-routed (1), +.BR osrm-components (1) diff --git a/debian/osrm.default b/debian/osrm.default new file mode 100644 index 0000000..f69417e --- /dev/null +++ b/debian/osrm.default @@ -0,0 +1,2 @@ +# Location of the configuration file +DAEMON_OPTS="/etc/osrm/server.ini" diff --git a/debian/osrm.init b/debian/osrm.init new file mode 100644 index 0000000..748c889 --- /dev/null +++ b/debian/osrm.init @@ -0,0 +1,98 @@ +#!/bin/sh +### BEGIN INIT INFO +# Provides: osrm +# Required-Start: $network $local_fs $remote_fs +# Required-Stop: $remote_fs +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: OSRM routing service +# Description: high performance routing engine +### END INIT INFO + +# Author: Christopher Baines <cbain...@gmail.com> + +PATH=/sbin:/usr/sbin:/bin:/usr/bin +DESC="high performance routing engine" +NAME=osrm +USER=osrm +DAEMON=/usr/bin/osrm-routed +SERVER_INI=/etc/osrm/server.ini +DAEMON_ARGS="$SERVER_INI >>/var/log/osrm/routed.log 2>&1" +PIDFILE=/var/run/$NAME.pid +SCRIPTNAME=/etc/init.d/$NAME + +# Exit if the package is not installed +[ -x $DAEMON ] || exit 0 + +# Define LSB log_* functions. +# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. +. /lib/lsb/init-functions + +# +# Function that starts the daemon/service +# +do_start() +{ + start-stop-daemon --start --quiet --pidfile $PIDFILE --background --user $USER --chuid $USER --exec $DAEMON --test > /dev/null || return 1 + start-stop-daemon --start --quiet --pidfile $PIDFILE --background --user $USER --chuid $USER --exec $DAEMON -- $DAEMON_ARGS || return 2 +} + +# +# Function that stops the daemon/service +# +do_stop() +{ + start-stop-daemon --stop --quiet --user $USER --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME + RETVAL="$?" + [ "$RETVAL" = 2 ] && return 2 + start-stop-daemon --stop --quiet --user $USER --oknodo --retry=0/30/KILL/5 --exec $DAEMON + [ "$?" = 2 ] && return 2 + rm -f $PIDFILE + return "$RETVAL" +} + +case "$1" in + start) + [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC " "$NAME" + do_start + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + stop) + [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" + do_stop + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + status) + status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $? + ;; + restart|force-reload) + log_daemon_msg "Restarting $DESC" "$NAME" + do_stop + case "$?" in + 0|1) + do_start + case "$?" in + 0) log_end_msg 0 ;; + 1) log_end_msg 1 ;; # Old process is still running + *) log_end_msg 1 ;; # Failed to start + esac + ;; + *) + # Failed to stop + log_end_msg 1 + ;; + esac + ;; + *) + echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2 + exit 3 + ;; +esac + +: diff --git a/debian/osrm.install b/debian/osrm.install new file mode 100644 index 0000000..fefbabc --- /dev/null +++ b/debian/osrm.install @@ -0,0 +1,12 @@ +debian/tmp/usr/bin/osrm-routed /usr/bin/ +debian/tmp/usr/bin/osrm-prepare /usr/bin/ +debian/tmp/usr/bin/osrm-extract /usr/bin/ +debian/conffiles/server.ini /etc/osrm/ +debian/conffiles/extractor.ini /etc/osrm/ +debian/conffiles/contractor.ini /etc/osrm/ +debian/conffiles/car.lua /etc/osrm/profiles/ +debian/conffiles/foot.lua /etc/osrm/profiles/ +debian/conffiles/bicycle.lua /etc/osrm/profiles/ +debian/conffiles/testbot.lua /etc/osrm/profiles/ +debian/conffiles/turnbot.lua /etc/osrm/profiles/ +debian/conffiles/access.lua /etc/osrm/profiles/lib/ diff --git a/debian/osrm.manpages b/debian/osrm.manpages new file mode 100644 index 0000000..3b07499 --- /dev/null +++ b/debian/osrm.manpages @@ -0,0 +1,4 @@ +debian/osrm.7 +debian/osrm-routed.1 +debian/osrm-extract.1 +debian/osrm-prepare.1 diff --git a/debian/osrm.postinst b/debian/osrm.postinst new file mode 100644 index 0000000..2408ba3 --- /dev/null +++ b/debian/osrm.postinst @@ -0,0 +1,50 @@ +#!/bin/sh +# postinst script for osrm + +set -e + +# summary of how this script can be called: +# * <postinst> `configure' <most-recently-configured-version> +# * <old-postinst> `abort-upgrade' <new version> +# * <conflictor's-postinst> `abort-remove' `in-favour' <package> +# <new-version> +# * <postinst> `abort-remove' +# * <deconfigured's-postinst> `abort-deconfigure' `in-favour' +# <failed-install-package> <version> `removing' +# <conflicting-package> <version> +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + +case "$1" in + configure) + # Create osrm group if it doesn't already exist. + if ! getent group osrm >/dev/null; then + addgroup --quiet --system osrm + fi + + # Create osrm user if it doesn't already exist. + if ! getent passwd osrm >/dev/null; then + adduser --quiet --system --ingroup osrm --home /var/lib/osrm \ + --gecos "OSRM" osrm + fi + + mkdir -p /var/log/osrm + chown osrm:osrm /var/log/osrm + mkdir -p /var/lib/osrm + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/debian/osrm.postrm b/debian/osrm.postrm new file mode 100644 index 0000000..a888153 --- /dev/null +++ b/debian/osrm.postrm @@ -0,0 +1,50 @@ +#!/bin/sh +# postrm script for osrm + +set -e + +# summary of how this script can be called: +# * <postrm> `remove' +# * <postrm> `purge' +# * <old-postrm> `upgrade' <new-version> +# * <new-postrm> `failed-upgrade' <old-version> +# * <new-postrm> `abort-install' +# * <new-postrm> `abort-install' <old-version> +# * <new-postrm> `abort-upgrade' <old-version> +# * <disappearer's-postrm> `disappear' <overwriter> +# <overwriter-version> +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + +case "$1" in + purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + if getent passwd osrm >/dev/null; then + if [ -x "`which deluser 2>/dev/null`" ]; then + deluser --system osrm + else + echo >&2 "Not removing \`osrm' system account" \ + "because deluser command was not found." + fi + fi + if getent group osrm >/dev/null; then + if [ -x "`which delgroup 2>/dev/null`" ]; then + delgroup --system osrm + else + echo >&2 "Not removing \`osrm' system group" \ + "because delgroup command was not found." + fi + fi + ;; + + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/debian/patches/add-cmake-install b/debian/patches/add-cmake-install new file mode 100644 index 0000000..148e34f --- /dev/null +++ b/debian/patches/add-cmake-install @@ -0,0 +1,38 @@ +Description: <short summary of the patch> + TODO: Put a short summary on the line above and replace this paragraph + with a longer explanation of this change. Complete the meta-information + with other relevant fields (see below for details). To make it easier, the + information below has been extracted from the changelog. Adjust it or drop + it. + . + osrm (0.3.4-1) unstable; urgency=low + . + * Initial release (Closes: #nnnn) <nnnn is the bug number of your ITP> +Author: Christopher Baines <cbain...@gmail.com> + +--- +The information above should follow the Patch Tagging Guidelines, please +checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here +are templates for supplementary fields that you might want to add: + +Origin: <vendor|upstream|other>, <url of original patch> +Bug: <url in upstream bugtracker> +Bug-Debian: http://bugs.debian.org/<bugnumber> +Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber> +Forwarded: <no|not-needed|url proving that it has been forwarded> +Reviewed-By: <name and email of someone who approved the patch> +Last-Update: <YYYY-MM-DD> + +--- osrm-0.3.4.orig/CMakeLists.txt ++++ osrm-0.3.4/CMakeLists.txt +@@ -107,5 +107,10 @@ if(WITH_TOOLS) + include_directories(${GDAL_INCLUDE_DIR}) + target_link_libraries( osrm-components ${GDAL_LIBRARIES} ) + target_link_libraries( osrm-components ${Boost_LIBRARIES} ) ++ install(TARGETS osrm-components RUNTIME DESTINATION bin) + endif(GDAL_FOUND) + endif(WITH_TOOLS) ++ ++install(TARGETS osrm-extract RUNTIME DESTINATION bin) ++install(TARGETS osrm-prepare RUNTIME DESTINATION bin) ++install(TARGETS osrm-routed RUNTIME DESTINATION bin) diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 0000000..9c427cd --- /dev/null +++ b/debian/patches/series @@ -0,0 +1 @@ +add-cmake-install diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..13119bc --- /dev/null +++ b/debian/rules @@ -0,0 +1,9 @@ +#!/usr/bin/make -f + +export DEB_BUILD_HARDENING=1 + +%: + dh $@ --parallel + +override_dh_auto_configure: + dh_auto_configure -- -DWITH_TOOLS=1 diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/debian/source/include-binaries b/debian/source/include-binaries new file mode 100644 index 0000000..5282da9 --- /dev/null +++ b/debian/source/include-binaries @@ -0,0 +1,22 @@ +obj-x86_64-linux-gnu/CMakeFiles/2.8.11.1/CMakeDetermineCompilerABI_C.bin +obj-x86_64-linux-gnu/CMakeFiles/2.8.11.1/CMakeDetermineCompilerABI_CXX.bin +obj-x86_64-linux-gnu/CMakeFiles/2.8.11.1/CompilerIdC/a.out +obj-x86_64-linux-gnu/CMakeFiles/2.8.11.1/CompilerIdCXX/a.out +obj-x86_64-linux-gnu/CMakeFiles/osrm-extract.dir/Extractor/BaseParser.cpp.o +obj-x86_64-linux-gnu/CMakeFiles/osrm-extract.dir/Extractor/ExtractionContainers.cpp.o +obj-x86_64-linux-gnu/CMakeFiles/osrm-extract.dir/Extractor/ExtractorCallbacks.cpp.o +obj-x86_64-linux-gnu/CMakeFiles/osrm-extract.dir/Extractor/PBFParser.cpp.o +obj-x86_64-linux-gnu/CMakeFiles/osrm-extract.dir/Extractor/ScriptingEnvironment.cpp.o +obj-x86_64-linux-gnu/CMakeFiles/osrm-extract.dir/Extractor/XMLParser.cpp.o +obj-x86_64-linux-gnu/CMakeFiles/osrm-extract.dir/extractor.cpp.o +obj-x86_64-linux-gnu/CMakeFiles/osrm-prepare.dir/Contractor/EdgeBasedGraphFactory.cpp.o +obj-x86_64-linux-gnu/CMakeFiles/osrm-prepare.dir/Contractor/TemporaryStorage.cpp.o +obj-x86_64-linux-gnu/CMakeFiles/osrm-prepare.dir/createHierarchy.cpp.o +obj-x86_64-linux-gnu/CMakeFiles/osrm-routed.dir/DataStructures/SearchEngine.cpp.o +obj-x86_64-linux-gnu/CMakeFiles/osrm-routed.dir/DataStructures/SearchEngineData.cpp.o +obj-x86_64-linux-gnu/CMakeFiles/osrm-routed.dir/Descriptors/DescriptionFactory.cpp.o +obj-x86_64-linux-gnu/CMakeFiles/osrm-routed.dir/Server/DataStructures/QueryObjectsStorage.cpp.o +obj-x86_64-linux-gnu/CMakeFiles/osrm-routed.dir/routed.cpp.o +obj-x86_64-linux-gnu/osrm-extract +obj-x86_64-linux-gnu/osrm-prepare +obj-x86_64-linux-gnu/osrm-routed -- Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/osrm.git _______________________________________________ Pkg-grass-devel mailing list Pkg-grass-devel@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-grass-devel