All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH rest-dbus] Add supporting files
@ 2015-10-08  0:04 OpenBMC Patches
  2015-10-08  0:04 ` OpenBMC Patches
  2015-10-08  0:45 ` Patrick Williams
  0 siblings, 2 replies; 4+ messages in thread
From: OpenBMC Patches @ 2015-10-08  0:04 UTC (permalink / raw)
  To: openbmc

Add makefile, systemd service file.
Hardcode resources dir filesystem path.

https://github.com/openbmc/rest-dbus/pull/1

Brad Bishop (1):
  Add supporting files

 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

-- 
2.6.0

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH rest-dbus] Add supporting files
  2015-10-08  0:04 [PATCH rest-dbus] Add supporting files OpenBMC Patches
@ 2015-10-08  0:04 ` OpenBMC Patches
  2015-10-08  5:52   ` Jeremy Kerr
  2015-10-08  0:45 ` Patrick Williams
  1 sibling, 1 reply; 4+ messages in thread
From: OpenBMC Patches @ 2015-10-08  0:04 UTC (permalink / raw)
  To: openbmc

From: Brad Bishop <bradleyb@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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH rest-dbus] Add supporting files
  2015-10-08  0:04 [PATCH rest-dbus] Add supporting files OpenBMC Patches
  2015-10-08  0:04 ` OpenBMC Patches
@ 2015-10-08  0:45 ` Patrick Williams
  1 sibling, 0 replies; 4+ messages in thread
From: Patrick Williams @ 2015-10-08  0:45 UTC (permalink / raw)
  To: OpenBMC Patches; +Cc: openbmc

[-- Attachment #1: Type: text/plain, Size: 591 bytes --]

On Wed, Oct 07, 2015 at 07:04:38PM -0500, OpenBMC Patches wrote:
> Add makefile, systemd service file.
> Hardcode resources dir filesystem path.
> 
> https://github.com/openbmc/rest-dbus/pull/1
> 
> Brad Bishop (1):
>   Add supporting files
> 
>  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

Any issues with this being merged?  It has been out there for a while.
-- 
Patrick Williams

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH rest-dbus] Add supporting files
  2015-10-08  0:04 ` OpenBMC Patches
@ 2015-10-08  5:52   ` Jeremy Kerr
  0 siblings, 0 replies; 4+ messages in thread
From: Jeremy Kerr @ 2015-10-08  5:52 UTC (permalink / raw)
  To: openbmc

Hi Brad,

> +PACKAGE=rest-dbus
> +
> +prefix?=/usr/local
> +bin=$(prefix)/usr/bin
> +share=$(prefix)/usr/share/$(PACKAGE)
> +srv=$(prefix)/lib/systemd/system/

We have /usr/ duplicated there in $(bin) and $(share).

You probably want this to work with

  make prefix=/usr libdir=/lib

and so using standard path names, this would be

  prefix ?= /usr/local
  bindir ?= $(prefix)/bin
  libdir ?= $(prefix)/lib
  datarootdir ?= $(prefix)/share
  pkgdatarootdir ?= $(prefix)/share/$(PACKAGE)
  servicedir ?= $(libdir)/systemd/system/

> -    resource_base = 'resources'
> +    resource_base = '/usr/share/rest-dbus/resources'

.. but this breaks if we use a different prefix. How about:

resource_base = os.path.join(os.path.dirname(__file__),
         os.pardir, 'share', 'resources')

- which still depends on pkgdatarootdir & bindir, but they're much less 
likely to be altered than prefix.

Also: generally, the systemd service definitions are part of the 
distribution, rather than upstream. Should we be putting that in the 
recipe instead?

Cheers,


Jeremy

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-10-08  5:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-08  0:04 [PATCH rest-dbus] Add supporting files OpenBMC Patches
2015-10-08  0:04 ` OpenBMC Patches
2015-10-08  5:52   ` Jeremy Kerr
2015-10-08  0:45 ` Patrick Williams

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.