[PATCH rest-dbus] Add supporting files

OpenBMC Patches patches at stwcx.xyz
Thu Oct 8 11:04:39 AEDT 2015


From: Brad Bishop <bradleyb at us.ibm.com>

Add makefile, systemd service file.
Hardcode resources dir filesystem path.
---
 Makefile          | 21 +++++++++++++++++++++
 rest-dbus         |  2 +-
 rest-dbus.service |  8 ++++++++
 3 files changed, 30 insertions(+), 1 deletion(-)
 create mode 100644 Makefile
 create mode 100644 rest-dbus.service

diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..3d79547
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,21 @@
+PACKAGE=rest-dbus
+
+prefix?=/usr/local
+bin=$(prefix)/usr/bin
+share=$(prefix)/usr/share/$(PACKAGE)
+srv=$(prefix)/lib/systemd/system/
+
+build clean all:
+
+install:
+	@install -d $(bin) $(share)/resources $(srv)
+	@install -m 755 $(PACKAGE) $(bin)
+	@for f in resources/*; do \
+		install -m644 $$f $(share)/resources; \
+	done
+	@install $(PACKAGE).service $(srv)
+
+uninstall:
+	@rm -f $(bin)/$(PACKAGE)
+	@rm -rf $(share)
+	@rm -f $(srv)/$(PACKAGE).service
diff --git a/rest-dbus b/rest-dbus
index 56ec1f9..078b1cf 100755
--- a/rest-dbus
+++ b/rest-dbus
@@ -40,7 +40,7 @@ class DBusRestResourceResponse(DBusRestResponse):
         'png': 'image/png',
         'gif': 'image/gif',
     }
-    resource_base = 'resources'
+    resource_base = '/usr/share/rest-dbus/resources'
 
     def __init__(self, name):
         (_, ext) = os.path.splitext(name)
diff --git a/rest-dbus.service b/rest-dbus.service
new file mode 100644
index 0000000..686cf69
--- /dev/null
+++ b/rest-dbus.service
@@ -0,0 +1,8 @@
+[Unit]
+Description=DBUS introspecting REST server.
+
+[Service]
+ExecStart=/usr/bin/rest-dbus
+
+[Install]
+WantedBy=multi-user.target
-- 
2.6.0




More information about the openbmc mailing list