From b60014d974723a8e52331000a74bb4885881ee25 Mon Sep 17 00:00:00 2001
From: ale <ale@incal.net>
Date: Sun, 10 Nov 2013 15:10:34 +0000
Subject: [PATCH] install static content

---
 debian/rules | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/debian/rules b/debian/rules
index 528eedfa..56d20c0d 100755
--- a/debian/rules
+++ b/debian/rules
@@ -25,6 +25,7 @@ SVCDIR = $(DESTDIR)/etc/svc
 	dh $@ 
 
 override_dh_install:
+	# Build the binary
 	install -m 755 -o root -g root -d $(DESTDIR)/usr/bin
 	(tmpdir=$$(mktemp -d) ; \
 	 export GOPATH=$$tmpdir ; unset GOBIN ; \
@@ -37,14 +38,25 @@ override_dh_install:
 	 done ; \
 	 rm -fr $$tmpdir)
 
-	install -d -m 755 -o root -g root $(SVCDIR)
+	# Install the static files and templates for the HTTP dashboard.
 	install -d -m 755 -o root -g root $(DESTDIR)/usr/share/radioai
-	install -m 644 -o root -g root debian/services/lib.sh \
+	install -d -m 755 -o root -g root $(DESTDIR)/usr/share/radioai/htdocs/static
+	(for f in $(CURDIR)/fe/static/* ; do \
+	  install -o root -g root -m 644 $$f $(DESTDIR)/usr/share/radioai/htdocs/static/ ; \
+	 done)
+	install -d -m 755 -o root -g root $(DESTDIR)/usr/share/radioai/htdocs/templates
+	(for f in $(CURDIR)/fe/templates/*.html ; do \
+	  install -o root -g root -m 644 $$f $(DESTDIR)/usr/share/radioai/htdocs/templates/ ; \
+	 done)
+
+	# Install runit service runners.
+	install -d -m 755 -o root -g root $(SVCDIR)
+	install -m 644 -o root -g root $(CURDIR)/debian/services/lib.sh \
 		$(DESTDIR)/usr/share/radioai/lib.sh
 	(for f in radiod redirectord ; do \
 	  install -d -o root -g root $(SVCDIR)/$$f ; \
 	  install -d -o root -g root $(SVCDIR)/$$f/log ; \
-	  install -m 755 -o root -g root debian/services/$$f \
+	  install -m 755 -o root -g root $(CURDIR)/debian/services/$$f \
 		$(SVCDIR)/$$f/run ; \
 	  echo -e '#!/bin/sh\nexec chpst -u log svlogd -tt /var/log/radioai/'$$f > \
 		$(SVCDIR)/$$f/log/run ; \
-- 
GitLab