changeset 480:ad196be66ad1

wip, packaging fixes for openwrt/homebrew
author Louis Opter <kalessin@kalessin.fr>
date Sun, 26 Jun 2016 18:16:37 -0700
parents cac17a050953
children 20f25ba1dd1e
files docker_images.patch fix_openwrt_docs_examples_installation.patch homebrew_fixes.patch series
diffstat 4 files changed, 87 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/docker_images.patch	Sun Jun 26 18:16:37 2016 -0700
@@ -0,0 +1,24 @@
+# HG changeset patch
+# Parent  598584f3f664456ec33a7a8baac2d1dc3be3b1b0
+Add a release command to generate Docker images
+
+diff --git a/dist/docker/Dockerfile b/dist/docker/Dockerfile
+new file mode 100644
+--- /dev/null
++++ b/dist/docker/Dockerfile
+@@ -0,0 +1,15 @@
++FROM lopter/openwrt_designated_driver_{{ isa }}
++MAINTAINER Louis Opter <louis@opter.org>
++
++ADD https://downloads.lightsd.io/openwrt/designated_driver_trunk/{{ isa }}/lightsd_{{ version }}_{{ isa }}.ipk /tmp/
++
++RUN opkg update \
++    && opkg install \
++        libevent2-core \
++        /tmp/lightsd_{{ version }}_{{ isa }}.ipk \
++    && rm -rf /tmp/*
++
++# TODO: figure out user creation and networking
++
++USER lightsd
++ENTRYPOINT /usr/bin/lightsd -v warning -t -s /var/run/lightsd/socket -c /var/run/lightsd/pipe
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fix_openwrt_docs_examples_installation.patch	Sun Jun 26 18:16:37 2016 -0700
@@ -0,0 +1,23 @@
+# HG changeset patch
+# Parent  0a5e483609801e059956bbba248916b56f2392de
+Install docs and examples at the correct place in OpenWRT
+
+They were installed one level too dee.
+
+diff --git a/dist/openwrt/utils/lightsd/Makefile b/dist/openwrt/utils/lightsd/Makefile
+--- a/dist/openwrt/utils/lightsd/Makefile
++++ b/dist/openwrt/utils/lightsd/Makefile
+@@ -51,11 +51,11 @@
+ 
+ 	$(CP) \
+ 		$(PKG_INSTALL_DIR)/usr/share/lightsd \
+-		$(1)/usr/share/lightsd
++		$(1)/usr/share
+ 
+ 	$(CP) \
+ 		$(PKG_INSTALL_DIR)/usr/share/doc/lightsd \
+-		$(1)/usr/share/doc/lightsd
++		$(1)/usr/share/doc
+ endef
+ 
+ $(eval $(call BuildPackage,lightsd))
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/homebrew_fixes.patch	Sun Jun 26 18:16:37 2016 -0700
@@ -0,0 +1,37 @@
+# HG changeset patch
+# Parent  5ab3699200d68360a9398e63f2beb88afd3d84b2
+Fix version detection and improve hardening flags in the Hombrew formulae
+
+diff --git a/dist/homebrew/lightsd.rb b/dist/homebrew/lightsd.rb
+--- a/dist/homebrew/lightsd.rb
++++ b/dist/homebrew/lightsd.rb
+@@ -5,6 +5,8 @@
+   homepage "https://github.com/lopter/lightsd/"
+   url "{{ archive_url  }}"
+   sha256 "{{ archive_sha256 }}"
++  # This will have ~ instead of - for rc versions:
++  version "{{ version|replace("-", "~") }}
+   revision {{ build_number }}
+ 
+   depends_on "cmake" => :build
+@@ -22,7 +24,7 @@
+     # proper release flags:
+     cflags = %W[
+       -fstack-protector-strong
+-      --param=ssp-buffer-size=4
++      -D_FORTIFY_SOURCE=2
+       -O3
+       -DNDEBUG
+     ]
+@@ -69,8 +71,9 @@
+   end
+ 
+   def caveats; <<-EOS.undent
+-    Once you've started lightsd with launchctl load (see below), you can start
+-    poking around with lightsc.py:
++    Once you've started lightsd (see the brew services command below, if you're
++    using tmux, remember that you will need to run it outside tmux), you can
++    start poking around with lightsc.py:
+ 
+       `lightsd --prefix`/share/lightsd/examples/lightsc.py
+     EOS
--- a/series	Sun Jun 26 10:39:15 2016 -0700
+++ b/series	Sun Jun 26 18:16:37 2016 -0700
@@ -1,3 +1,6 @@
+homebrew_fixes.patch
+fix_openwrt_docs_examples_installation.patch
+docker_images.patch
 add_power_transition.patch
 open_gateway_on_any_bulb_response.patch #+future
 make_gateway_write_callbacks_low_priority.patch #+future