--- feeds/jlars/sound/shairport/Makefile.orig	2011-08-10 18:30:45.000000000 +0200
+++ feeds/jlars/sound/shairport/Makefile	2011-08-10 18:32:10.000000000 +0200
@@ -64,12 +64,20 @@
 define Package/shairport/install
 	$(INSTALL_DIR) $(1)/usr/bin
 	$(INSTALL_BIN) $(PKG_BUILD_DIR)/{hairtunes,shairport} $(1)/usr/bin/
+	$(INSTALL_DIR) $(1)/etc/config
+	$(INSTALL_DATA) ./files/$(PKG_NAME).config $(1)/etc/config/$(PKG_NAME)
+	$(INSTALL_DIR) $(1)/etc/init.d
+	$(INSTALL_BIN) ./files/$(PKG_NAME).init $(1)/etc/init.d/$(PKG_NAME)
 endef
 
 
 define Package/shairport-perl/install
 	$(INSTALL_DIR) $(1)/usr/bin
 	$(INSTALL_BIN) $(PKG_BUILD_DIR)/shairport.pl $(1)/usr/bin/
+	$(INSTALL_DIR) $(1)/etc/config
+	$(INSTALL_DATA) ./files/$(PKG_NAME).config $(1)/etc/config/$(PKG_NAME)
+	$(INSTALL_DIR) $(1)/etc/init.d
+	$(INSTALL_BIN) ./files/$(PKG_NAME).init $(1)/etc/init.d/$(PKG_NAME)
 endef
 
 
--- /dev/null	2011-07-03 02:34:29.163655238 +0200
+++ feeds/jlars/sound/shairport/files/shairport.config	2011-08-10 18:27:00.000000000 +0200
@@ -0,0 +1,3 @@
+config 'shairport'
+	option apname		'NSLU'
+	option enabled		'1'
--- /dev/null	2011-07-03 02:34:29.163655238 +0200
+++ feeds/jlars/sound/shairport/files/shairport-perl.config	2011-08-10 18:27:00.000000000 +0200
@@ -0,0 +1,3 @@
+config 'shairport'
+	option apname		'NSLU'
+	option enabled		'1'
--- /dev/null	2011-07-03 02:34:29.163655238 +0200
+++ feeds/jlars/sound/shairport/files/shairport.init	2011-08-10 18:29:21.000000000 +0200
@@ -0,0 +1,22 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2008 OpenWrt.org
+START=75
+
+NAME=shairport
+PROG=/usr/bin/$NAME
+
+start_service() {
+	local section="$1"
+	local apname
+	config_get apname "$section" apname
+	config_get_bool "enabled" "$section" "enabled" '1'
+	[ "$enabled" -gt 0 ] && $PROG -a $apname -d
+}
+start() {
+	config_load "shairport"
+	config_foreach start_service "shairport"
+}
+
+stop() {
+	killall avahi-publish-service
+	killall $NAME
+}
--- /dev/null	2011-07-03 02:34:29.163655238 +0200
+++ feeds/jlars/sound/shairport/files/shairport-perl.init	2011-08-10 18:33:10.000000000 +0200
@@ -0,0 +1,22 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2008 OpenWrt.org
+START=75
+
+NAME=shairport.pl
+PROG=/usr/bin/$NAME
+
+start_service() {
+	local section="$1"
+	local apname
+	config_get apname "$section" apname
+	config_get_bool "enabled" "$section" "enabled" '1'
+	[ "$enabled" -gt 0 ] && $PROG -a $apname -d
+}
+start() {
+	config_load "shairport"
+	config_foreach start_service "shairport"
+}
+
+stop() {
+	killall avahi-publish-service
+	killall $NAME
+}

