wok-next annotate transmission-web/receipt @ rev 1842
transmission-web: configure lighttpd & apache
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Thu Dec 11 19:45:59 2008 +0000 (2008-12-11) |
parents | f4d16010477f |
children | fe3b7cbf1a7f |
rev | line source |
---|---|
pankso@1840 | 1 # SliTaz package receipt. |
pankso@1840 | 2 |
pankso@1840 | 3 PACKAGE="transmission-web" |
pankso@1840 | 4 VERSION="1.40" |
pankso@1840 | 5 CATEGORY="network" |
pankso@1840 | 6 SHORT_DESC="Transmission web interface." |
pankso@1840 | 7 MAINTAINER="pankso@slitaz.org" |
pascal@1842 | 8 DEPENDS="transmission lighttpd" |
pankso@1840 | 9 WANTED="transmission" |
pankso@1840 | 10 WEB_SITE="http://www.transmissionbt.com/" |
pankso@1840 | 11 |
pankso@1840 | 12 # Rules to gen a SliTaz package suitable for Tazpkg. |
pankso@1840 | 13 genpkg_rules() |
pankso@1840 | 14 { |
pankso@1840 | 15 mkdir -p $fs/usr/share |
pankso@1840 | 16 cp -a $_pkg/usr/share/transmission $fs/usr/share |
pankso@1840 | 17 rm $fs/usr/share/transmission/web/LICENSE |
pankso@1840 | 18 } |
pascal@1842 | 19 |
pascal@1842 | 20 post_install() |
pascal@1842 | 21 { |
pascal@1842 | 22 # Configure lighttpd server |
pascal@1842 | 23 if [ -f $1/etc/lighttpd/lighttpd.conf ]; then |
pascal@1842 | 24 if ! grep -q /usr/share/transmission/web/ $1/etc/lighttpd/lighttpd.conf; then |
pascal@1842 | 25 sed -e 's|.*"/examples/" => "/usr/share/examples/",| "/examples/" => "/usr/share/examples/",\n "/transmission/" => "/usr/share/transmission/web/",|g' -i $1/etc/lighttpd/lighttpd.conf |
pascal@1842 | 26 if [ -z "$1" ]; then |
pascal@1842 | 27 # Start Web server. |
pascal@1842 | 28 /etc/init.d/lighttpd stop |
pascal@1842 | 29 /etc/init.d/lighttpd start |
pascal@1842 | 30 fi |
pascal@1842 | 31 fi |
pascal@1842 | 32 fi |
pascal@1842 | 33 # Configure apache server |
pascal@1842 | 34 if [ -f $1/etc/apache/httpd.conf ]; then |
pascal@1842 | 35 if [ ! -f $1/etc/apache/conf.d/transmission ]; then |
pascal@1842 | 36 cat > $1/etc/apache/conf.d/transmission <<EOT |
pascal@1842 | 37 <IfModule mod_alias.c> |
pascal@1842 | 38 Alias /transmission /usr/share/transmission/web |
pascal@1842 | 39 </IfModule> |
pascal@1842 | 40 <DirectoryMatch /usr/share/transmission/web> |
pascal@1842 | 41 DirectoryIndex index.html |
pascal@1842 | 42 Options +FollowSymLinks |
pascal@1842 | 43 AllowOverride None |
pascal@1842 | 44 Order allow,deny |
pascal@1842 | 45 Allow from all |
pascal@1842 | 46 </DirectoryMatch> |
pascal@1842 | 47 EOT |
pascal@1842 | 48 if [ -z "$1" ]; then |
pascal@1842 | 49 # Start Web server. |
pascal@1842 | 50 /etc/init.d/apache stop |
pascal@1842 | 51 /etc/init.d/apache start |
pascal@1842 | 52 fi |
pascal@1842 | 53 fi |
pascal@1842 | 54 fi |
pascal@1842 | 55 } |