From cecb9fe3e3777a82a005a196011b516609641b44 Mon Sep 17 00:00:00 2001
From: Britney Fransen <brfransen@gmail.com>
Date: Wed, 14 Aug 2013 11:33:01 -0500
Subject: shellinabox: add lighttpd conf

---
 abs/extra/shellinabox/PKGBUILD                      | 21 +++++++++++++++------
 abs/extra/shellinabox/__changelog                   |  4 ++++
 abs/extra/shellinabox/shellinaboxd.gen_light_conf.d |  1 +
 abs/extra/shellinabox/shellinaboxd.include          | 10 ++++++++++
 abs/extra/shellinabox/shellinaboxd.install          |  7 +++++++
 5 files changed, 37 insertions(+), 6 deletions(-)
 create mode 100644 abs/extra/shellinabox/shellinaboxd.gen_light_conf.d
 create mode 100644 abs/extra/shellinabox/shellinaboxd.include

diff --git a/abs/extra/shellinabox/PKGBUILD b/abs/extra/shellinabox/PKGBUILD
index 6032aff..680de85 100644
--- a/abs/extra/shellinabox/PKGBUILD
+++ b/abs/extra/shellinabox/PKGBUILD
@@ -1,7 +1,7 @@
 # Contributor: Brian Moore <archlinux@cptl.org>
 pkgname=shellinabox
 pkgver=2.14
-pkgrel=3
+pkgrel=4
 pkgdesc="A web-based ssh client."
 arch=('i686' 'x86_64')
 url="http://shellinabox.com/"
@@ -11,11 +11,8 @@ optdepends=('openssh: SSL support')
 makedepends=(openssh)
 install=shellinaboxd.install
 backup=('etc/conf.d/shellinaboxd')
-source=("http://shellinabox.googlecode.com/files/$pkgname-$pkgver.tar.gz" "shellinaboxd.rc.d" "shellinaboxd.conf.d" "shellinaboxd.service")
-md5sums=('6c63b52edcebc56ee73a108e7211d174'
-         'feea22575089cc7eb4925b1daff88b8c'
-         '77e487f36da2abe51251500f4a1e024f'
-	 'be649866d06ba497d88bb14f3e58f862')
+source=("http://shellinabox.googlecode.com/files/$pkgname-$pkgver.tar.gz" "shellinaboxd.rc.d" "shellinaboxd.conf.d" "shellinaboxd.service"
+        "shellinaboxd.include" "shellinaboxd.gen_light_conf.d")
 
 prepare() {
 	cd "$srcdir/$pkgname-$pkgver"
@@ -37,4 +34,16 @@ package() {
   install -D -m644 $srcdir/shellinaboxd.service $pkgdir/usr/lib/systemd/system/shellinaboxd.service
   install -Dm644 $srcdir/shellinaboxd.conf.d $pkgdir/etc/conf.d/shellinaboxd
   install -dm700 -o nobody $pkgdir/var/lib/shellinabox
+
+  #install conf files for lighttpd
+  mkdir -p ${pkgdir}/etc/lighttpd
+  install -D -m 644 ${srcdir}/shellinaboxd.include ${pkgdir}/etc/lighttpd/
+  #gen_light_conf
+  install -D -m 744 ${srcdir}/shellinaboxd.gen_light_conf.d ${pkgdir}/etc/gen_light_conf.d/shellinaboxd.conf
 }
+md5sums=('6c63b52edcebc56ee73a108e7211d174'
+         'feea22575089cc7eb4925b1daff88b8c'
+         '77e487f36da2abe51251500f4a1e024f'
+         'be649866d06ba497d88bb14f3e58f862'
+         '06b131e47522d8028aa245c1b8884e00'
+         'aadd1edf4110aca2d16d806791e90019')
diff --git a/abs/extra/shellinabox/__changelog b/abs/extra/shellinabox/__changelog
index edbcbff..efedcc7 100644
--- a/abs/extra/shellinabox/__changelog
+++ b/abs/extra/shellinabox/__changelog
@@ -2,3 +2,7 @@
 initial inclusion from AUR v2.14-3
 add dep of runit-scripts to PKGBUILD
 add shellinaboxd.install
+
+# 8/14/2013
+add proxy config to PKGBUILD & .install
+add shellinaboxd.include and shellinaboxd.gen_light_conf.d
diff --git a/abs/extra/shellinabox/shellinaboxd.gen_light_conf.d b/abs/extra/shellinabox/shellinaboxd.gen_light_conf.d
new file mode 100644
index 0000000..5512216
--- /dev/null
+++ b/abs/extra/shellinabox/shellinaboxd.gen_light_conf.d
@@ -0,0 +1 @@
+include "/etc/lighttpd/shellinaboxd.include"
diff --git a/abs/extra/shellinabox/shellinaboxd.include b/abs/extra/shellinabox/shellinaboxd.include
new file mode 100644
index 0000000..c4c11bd
--- /dev/null
+++ b/abs/extra/shellinabox/shellinaboxd.include
@@ -0,0 +1,10 @@
+#proxy for shellinaboxd
+proxy.server = ( "/shell/" =>
+    ( "localhost" =>
+        (
+            "host" => "127.0.0.1",
+            "port" => 4200
+        )
+    )
+)
+
diff --git a/abs/extra/shellinabox/shellinaboxd.install b/abs/extra/shellinabox/shellinaboxd.install
index 466ba3c..1fb3a79 100644
--- a/abs/extra/shellinabox/shellinaboxd.install
+++ b/abs/extra/shellinabox/shellinaboxd.install
@@ -1,8 +1,11 @@
 post_install() {
+    echo "Generate lighttpd include..."
+    gen_light_include.py
     echo "Create link to linhes.pem..."
     ln -s /etc/lighttpd/linhes.pem /etc/lighttpd/certificate.pem
     echo "Start runit service for shellinaboxd..."
     add_service.sh shellinaboxd
+    /sbin/sv restart shellinaboxd
 }
 
 post_upgrade() {
@@ -10,6 +13,10 @@ post_upgrade() {
 }
 
 post_remove() {
+    echo "Generate lighttpd include..."
+    gen_light_include.py
+    echo "Forcing a re-read of lighttpd's configuration file..."
+    /sbin/sv hup /service/lighttpd
     echo "Remove link to linhes.pem..."
     rm /etc/lighttpd/certificate.pem
     echo "Remove runit service for shellinaboxd..."
-- 
cgit v0.12

