# HG changeset patch # User Pascal Bellard # Date 1229024759 0 # Node ID 6fde583951a339debf5f6860ae08810513246910 # Parent e2718e4cba26dd465836ec0b38d58026eae5b523 transmission-web: configure lighttpd & apache diff -r e2718e4cba26 -r 6fde583951a3 transmission-web/receipt --- a/transmission-web/receipt Thu Dec 11 15:40:01 2008 +0000 +++ b/transmission-web/receipt Thu Dec 11 19:45:59 2008 +0000 @@ -5,7 +5,7 @@ CATEGORY="network" SHORT_DESC="Transmission web interface." MAINTAINER="pankso@slitaz.org" -DEPENDS="transmission" +DEPENDS="transmission lighttpd" WANTED="transmission" WEB_SITE="http://www.transmissionbt.com/" @@ -16,3 +16,40 @@ cp -a $_pkg/usr/share/transmission $fs/usr/share rm $fs/usr/share/transmission/web/LICENSE } + +post_install() +{ + # Configure lighttpd server + if [ -f $1/etc/lighttpd/lighttpd.conf ]; then + if ! grep -q /usr/share/transmission/web/ $1/etc/lighttpd/lighttpd.conf; then + sed -e 's|.*"/examples/" => "/usr/share/examples/",| "/examples/" => "/usr/share/examples/",\n "/transmission/" => "/usr/share/transmission/web/",|g' -i $1/etc/lighttpd/lighttpd.conf + if [ -z "$1" ]; then + # Start Web server. + /etc/init.d/lighttpd stop + /etc/init.d/lighttpd start + fi + fi + fi + # Configure apache server + if [ -f $1/etc/apache/httpd.conf ]; then + if [ ! -f $1/etc/apache/conf.d/transmission ]; then + cat > $1/etc/apache/conf.d/transmission < + Alias /transmission /usr/share/transmission/web + + + DirectoryIndex index.html + Options +FollowSymLinks + AllowOverride None + Order allow,deny + Allow from all + +EOT + if [ -z "$1" ]; then + # Start Web server. + /etc/init.d/apache stop + /etc/init.d/apache start + fi + fi + fi +}