wok-stable diff phpvirtualbox/receipt @ rev 7809

Up slitaz-tools (3.9.3)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Dec 24 19:01:39 2010 +0100 (2010-12-24)
parents
children 52c31d10f766
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/phpvirtualbox/receipt	Fri Dec 24 19:01:39 2010 +0100
     1.3 @@ -0,0 +1,78 @@
     1.4 +# SliTaz package receipt.
     1.5 +
     1.6 +PACKAGE="phpvirtualbox"
     1.7 +VERSION="0.5"
     1.8 +CATEGORY="network"
     1.9 +SHORT_DESC="Virtualbox AJAX interface."
    1.10 +MAINTAINER="pascal.bellard@slitaz.org"
    1.11 +TARBALL="$PACKAGE-$VERSION.zip"
    1.12 +WEB_SITE="http://code.google.com/$PACKAGE/"
    1.13 +WGET_URL="http://$PACKAGE.googlecode.com/files/$TARBALL"
    1.14 +DEPENDS="php-soap virtualbox"
    1.15 +
    1.16 +# Rules to configure and make the package.
    1.17 +compile_rules()
    1.18 +{
    1.19 +	cd $src
    1.20 +}
    1.21 +
    1.22 +# Rules to gen a SliTaz package suitable for Tazpkg.
    1.23 +genpkg_rules()
    1.24 +{
    1.25 +	mkdir -p $fs/usr/share $fs/etc
    1.26 +	cp -a $src $fs/usr/share/phpvirtualbox
    1.27 +	mv $fs/usr/share/phpvirtualbox/config.php $fs/etc/phpvirtualbox.php
    1.28 +	dos2unix $fs/etc/phpvirtualbox.php
    1.29 +	ln -s /etc/phpvirtualbox.php $fs/usr/share/phpvirtualbox/config.php
    1.30 +	cp -a stuff/* $fs/
    1.31 +}
    1.32 +
    1.33 +post_install()
    1.34 +{
    1.35 +	# Virtualbox OSE needs to disable authenication for vboxwebsrv
    1.36 +	[ -d $1/var/lib/tazpkg/installed/virtualbox ] ||
    1.37 +	chroot $1 VBoxManage setproperty websrvauthlibrary null 
    1.38 +
    1.39 +	# Configure lighttpd server
    1.40 +	if [ -f $1/etc/lighttpd/lighttpd.conf ]; then
    1.41 +		if ! grep -q /usr/share/phpvirtualbox/ $1/etc/lighttpd/lighttpd.conf; then
    1.42 +	    		sed -e 's|.*"/examples/" => "/usr/share/examples/",|    "/examples/" => "/usr/share/examples/",\n    "/phpvirtualbox/" => "/usr/share/phpvirtualbox/",|g' -i $1/etc/lighttpd/lighttpd.conf
    1.43 +			if [ -z "$1" ]; then
    1.44 +				# Start Web server.
    1.45 +				/etc/init.d/lighttpd stop
    1.46 +				/etc/init.d/lighttpd start
    1.47 +			fi
    1.48 +		fi
    1.49 +	fi
    1.50 +	# Configure apache server
    1.51 +	if [ -f $1/etc/apache/httpd.conf ]; then
    1.52 +		if [ ! -f $1/etc/apache/conf.d/phpvirtualbox ]; then
    1.53 +			cat > $1/etc/apache/conf.d/phpvirtualbox <<EOT
    1.54 +<IfModule mod_alias.c>
    1.55 +    Alias /phpvirtualbox /usr/share/phpvirtualbox
    1.56 +</IfModule>
    1.57 +<DirectoryMatch /usr/share/phpvirtualbox/>
    1.58 +    DirectoryIndex index.php
    1.59 +    Options +FollowSymLinks
    1.60 +    AllowOverride None
    1.61 +    Order allow,deny
    1.62 +    Allow from all
    1.63 +</DirectoryMatch>
    1.64 +EOT
    1.65 +			if [ -z "$1" ]; then
    1.66 +				# Start Web server.
    1.67 +				/etc/init.d/apache stop
    1.68 +				/etc/init.d/apache start
    1.69 +			fi
    1.70 +		fi
    1.71 +	fi
    1.72 +	[ -z "$1" ] && /etc/init.d/vboxwebsrv start
    1.73 +	cat <<EOT
    1.74 +Please configure /etc/phpvirtualbox.php now.
    1.75 +EOT
    1.76 +}
    1.77 +
    1.78 +pre_remove()
    1.79 +{
    1.80 +	/etc/init.d/vboxwebsrv stop
    1.81 +}