--- /opt/local/var/macports/sources/svn.macports.org/trunk/dports/science/sumo/Portfile	2014-06-21 17:18:53.000000000 -0700
+++ Portfile	2014-07-16 22:38:59.000000000 -0700
@@ -6,6 +6,7 @@
 name                sumo
 conflicts           sumo-devel
 version             0.21.0
+revision            1
 categories          science devel
 platforms           darwin
 maintainers         me.com:jens.fahnenbruck \
@@ -53,22 +54,23 @@
     reinplace -locale C "s#./PHEMlight/#${sharedir}/data/PHEMlight/#" src/tools/emissionsDrivingCycle_main.cpp
     reinplace -locale C "s#./PHEMlight/#${sharedir}/data/PHEMlight/#" src/tools/emissionsMap_main.cpp
     set python_bin ${frameworks_dir}/Python.framework/Versions/2.7/bin/python2.7
-    foreach f $python_scripts {
+    foreach f [list {*}$python_scripts {*}$python_libs {*}$python_tutorials] {
         reinplace "s#/usr/bin/env python#${python_bin}#" $f
         reinplace -E "s|^(sys.path.append)|# \\1|" $f
-        reinplace -E "s#^from (dijkstra|inputs)#from assign.\\1#" $f
+        reinplace -E "s#^ *from (assign|costMemory|dijkstra|duaIterate|elements|inputs|network|outputs|routeChoices|statisticsElements|tables)#from sumolib.assign.\\1#" $f
+        reinplace -E "s#^ *from (miscutils|OrderedMultiSet|output|testUtil)#from sumolib.\\1#" $f
         reinplace -E "s#^import (xsd|collectinghandler|connections|turndefinitions|rmsd)#from sumolib import \\1#" $f
         reinplace -E "s#^import (os,.*), helpers#import \\1, sumolib.helpers as helpers#" $f
     }
     foreach f $perl_scripts {
         reinplace "s#/usr/bin/perl#${perl_bin}#" $f
     }
+    reinplace -E "s#(removeTripsIfNotInInterval).pl#sumo-\\1#" tools/trip/splitTripsByHours.pl
 }
 
 # List of all python scripts. Used later to ensure usage of python27
 # (instead of the currently active python)
-set python_scripts [ list \
-    tools/bin/traceExporter.py \
+set python_scripts [list \
     tools/assign/Assignment.py \
     tools/assign/cadytsIterate.py \
     tools/assign/costFunctionChecker.py \
@@ -77,10 +79,11 @@
     tools/assign/matrixDailyToHourly.py \
     tools/assign/networkStatistics.py \
     tools/assign/one-shot.py \
-    tools/assign/run.py \
+    tools/bin/traceExporter.py \
     tools/detector/aggregateFlows.py \
     tools/detector/deleteUnusedDetectors.py \
     tools/detector/flowFromRoutes.py \
+    tools/detector/flowrouter.py \
     tools/net/0103to0110.py \
     tools/net/0123to0130.py \
     tools/net/batch0103to0110.py \
@@ -91,11 +94,9 @@
     tools/net/netextract.py \
     tools/net/netextract_subPart.py \
     tools/net/netmatch.py \
-    tools/net/netshiftadaptor.py \
     tools/net/netstats.py \
     tools/net/network_statistics.py \
     tools/net/odConnectionsCheck.py \
-    tools/net/OrderedMultiSet.py \
     tools/net/patchNetFiles.py \
     tools/net/prepareVISUM.py \
     tools/net/reprojectpolys.py \
@@ -115,6 +116,7 @@
     tools/output/netdumpmean.py \
     tools/output/timingStats.py \
     tools/output/vehLanes.py \
+    tools/output/vehroute2amitranOD.py \
     tools/output/vehrouteDiff.py \
     tools/route/cutRoutes.py \
     tools/route/extract_route_edges.py \
@@ -137,6 +139,10 @@
     tools/shapes/poi_alongRoads.py \
     tools/shapes/poi_atTLS.py \
     tools/shapes/pois2inductionLoops.py \
+    tools/tls/tls_check.py \
+    tools/tls/tls_csv2SUMO.py \
+    tools/traci/rebuildConstants.py \
+    tools/traci/traciToHex.py \
     tools/trigger/csv2vss.py \
     tools/trip/randomTrips.py \
     tools/trip/generateTripsXml.py \
@@ -163,12 +169,44 @@
     tools/xml/schemaCheck.py \
     tools/xml/xml2csv.py \
     tools/xml/xml2protobuf.py \
-    tools/xml/xsd.py ]
+]
+
+set python_libs [list \
+    tools/assign/assign.py \
+    tools/assign/costMemory.py \
+    tools/assign/dijkstra.py \
+    tools/assign/elements.py \
+    tools/assign/inputs.py \
+    tools/assign/network.py \
+    tools/assign/outputs.py \
+    tools/assign/run.py \
+    tools/assign/statisticsElements.py \
+    tools/assign/tables.py \
+    tools/net/netshiftadaptor.py \
+    tools/net/OrderedMultiSet.py \
+    tools/sumolib/geomhelper.py \
+    tools/trigger/csv2vss.py \
+    tools/turn-defs/connections.py \
+    tools/turn-defs/turndefinitions.py \
+    tools/xml/xml2csv.py \
+    tools/xml/xsd.py \
+]
 
-set perl_scripts [ list \
+set python_tutorials [list \
+    docs/tutorial/city_mobil/constants.py \
+    docs/tutorial/city_mobil/statistics.py \
+    docs/tutorial/hello/runner.py \
+    docs/tutorial/output_parsing/runner.py \
+    docs/tutorial/quickstart/runner.py \
+    docs/tutorial/san_pablo_dam/runner.py \
+    docs/tutorial/traci_tls/runner.py \
+]
+
+set perl_scripts [list \
     tools/trip/removeGeometryInTrips.pl \
     tools/trip/removeTripsIfNotInInterval.pl \
-    tools/trip/splitTripsByHours.pl ]
+    tools/trip/splitTripsByHours.pl \
+]
 
 # required for the gui to be enabled
 configure.args-append \
@@ -223,6 +261,10 @@
     xinstall -m 755 ${worksrcpath}/tools/lib/stop.png ${destroot}${python_lib}/sumolib/
     xinstall -m 755 ${worksrcpath}/tools/lib/testUtil.py ${destroot}${python_lib}/sumolib/
 
+    foreach f $python_libs {
+        xinstall -m 755 ${worksrcpath}/${f} ${destroot}${python_lib}/sumolib/
+    }
+
     foreach f [list {*}$python_scripts {*}$perl_scripts] {
         # convert file names to use dash rather than underscore and remove trailing .py or .pl
         set x [string map [list _ -] [file rootname [file tail ${f}]]]
