Reorganize directory structure

Moving to directory per-application layout.  This facilitates
building single applications which is useful in the Yocto build
environment since different applications satisfy different OpenBMC
build requirements.

A number of issues are also addressed:
 - All applications were pulling in libsystemd and the gdbus libs
    irrespective of whether or not they were needed.
 - gpio.o duplicated in every application - moved to libopenbmc_intf
 - Added install target

Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/pysensormgr/Makefile b/pysensormgr/Makefile
new file mode 120000
index 0000000..76a90fc
--- /dev/null
+++ b/pysensormgr/Makefile
@@ -0,0 +1 @@
+../Makefile.python
\ No newline at end of file
diff --git a/pysensormgr/sensor_manager2.py b/pysensormgr/sensor_manager2.py
new file mode 100644
index 0000000..fa3638a
--- /dev/null
+++ b/pysensormgr/sensor_manager2.py
@@ -0,0 +1,66 @@
+#!/usr/bin/python -u
+
+import sys
+import os
+import gobject
+import dbus
+import dbus.service
+import dbus.mainloop.glib
+import obmc.sensors
+from obmc.dbuslib.bindings import DbusProperties, DbusObjectManager, get_dbus
+
+System = __import__(sys.argv[1])
+
+DBUS_NAME = 'org.openbmc.Sensors'
+OBJ_PATH = '/org/openbmc/sensors'
+
+
+class SensorManager(DbusProperties,DbusObjectManager):
+	def __init__(self,bus,name):
+		DbusProperties.__init__(self)
+		DbusObjectManager.__init__(self)
+		dbus.service.Object.__init__(self,bus,name)
+		self.InterfacesAdded(name,self.properties)
+
+	@dbus.service.method(DBUS_NAME,
+		in_signature='ss', out_signature='')
+	def register(self,object_name,obj_path):
+		if (self.objects.has_key(obj_path) == False):
+			print "Register: "+object_name+" : "+obj_path
+			sensor = eval('obmc.sensors.'+object_name+'(bus,obj_path)')
+			self.add(obj_path,sensor)
+
+	@dbus.service.method(DBUS_NAME,
+		in_signature='s', out_signature='')
+	def delete(self,obj_path):
+		if (self.objects.has_key(obj_path) == True):
+			print "Delete: "+obj_path
+			self.remove(obj_path)
+	
+	def SensorChange(self,value,path=None):
+		if (self.objects.has_key(path)):
+			self.objects[path].setValue(value)
+		else:
+			print "ERROR: Sensor not found: "+path
+			
+if __name__ == '__main__':
+	dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
+	bus = get_dbus()
+	name = dbus.service.BusName(DBUS_NAME,bus)
+	root_sensor = SensorManager(bus,OBJ_PATH)
+
+
+	## instantiate non-polling sensors
+	## these don't need to be in seperate process
+	for (id, the_sensor) in System.MISC_SENSORS.items():
+		sensor_class = the_sensor['class']
+		obj_path = System.ID_LOOKUP['SENSOR'][id]
+		sensor_obj = getattr(obmc.sensors, sensor_class)(bus, obj_path)
+		if 'os_path' in the_sensor:
+			sensor_obj.sysfs_attr = the_sensor['os_path']
+		root_sensor.add(obj_path, sensor_obj)
+
+	mainloop = gobject.MainLoop()
+	print "Starting sensor manager"
+	mainloop.run()
+
diff --git a/pysensormgr/setup.cfg b/pysensormgr/setup.cfg
new file mode 120000
index 0000000..29939b5
--- /dev/null
+++ b/pysensormgr/setup.cfg
@@ -0,0 +1 @@
+../setup.cfg
\ No newline at end of file
diff --git a/pysensormgr/setup.py b/pysensormgr/setup.py
new file mode 100644
index 0000000..7944841
--- /dev/null
+++ b/pysensormgr/setup.py
@@ -0,0 +1,6 @@
+from distutils.core import setup
+
+setup(name='pysensormgr',
+      version='1.0',
+      scripts=['sensor_manager2.py'],
+      )