# HG changeset patch # User Pascal Bellard # Date 1292853493 -3600 # Node ID 5b1450e90bf6b4b9a3fb2ca65b1fa40f742265ee # Parent 48880e2d195bbd1eefa5162370c658a72443e9fd Add phpvirtualbox diff -r 48880e2d195b -r 5b1450e90bf6 phpvirtualbox/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phpvirtualbox/receipt Mon Dec 20 14:58:13 2010 +0100 @@ -0,0 +1,78 @@ +# SliTaz package receipt. + +PACKAGE="phpvirtualbox" +VERSION="0.5" +CATEGORY="network" +SHORT_DESC="Virtualbox AJAX interface." +MAINTAINER="pascal.bellard@slitaz.org" +TARBALL="$PACKAGE-$VERSION.zip" +WEB_SITE="http://code.google.com/$PACKAGE/" +WGET_URL="http://$PACKAGE.googlecode.com/files/$TARBALL" +DEPENDS="php-soap virtualbox" + +# Rules to configure and make the package. +compile_rules() +{ + cd $src +} + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + mkdir -p $fs/usr/share $fs/etc + cp -a $src $fs/usr/share/phpvirtualbox + mv $fs/usr/share/phpvirtualbox/config.php $fs/etc/phpvirtualbox.php + dos2unix $fs/etc/phpvirtualbox.php + ln -s /etc/phpvirtualbox.php $fs/usr/share/phpvirtualbox/config.php + cp -a stuff/* $fs/ +} + +post_install() +{ + # Virtualbox OSE needs to disable authenication for vboxwebsrv + [ -d $1/var/lib/tazpkg/installed/virtualbox ] || + chroot $1 VBoxManage setproperty websrvauthlibrary null + + # Configure lighttpd server + if [ -f $1/etc/lighttpd/lighttpd.conf ]; then + if ! grep -q /usr/share/phpvirtualbox/ $1/etc/lighttpd/lighttpd.conf; then + sed -e 's|.*"/examples/" => "/usr/share/examples/",| "/examples/" => "/usr/share/examples/",\n "/phpvirtualbox/" => "/usr/share/phpvirtualbox/",|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/phpvirtualbox ]; then + cat > $1/etc/apache/conf.d/phpvirtualbox < + Alias /phpvirtualbox /usr/share/phpvirtualbox + + + DirectoryIndex index.php + 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 + [ -z "$1" ] && /etc/init.d/vboxwebsrv start + cat < /dev/null 2>&1 + [ -f $PIDFILE ] || pidof $NAME | awk '{ print $1 }' > $PIDFILE + active_pidfile $PIDFILE $NAME + status + ;; + stop) + if ! active_pidfile $PIDFILE $NAME ; then + echo "$NAME is not running." + exit 1 + fi + echo -n "Stopping $DESC: $NAME... " + kill `cat $PIDFILE` + status + ;; + restart) + if ! active_pidfile $PIDFILE $NAME ; then + echo "$NAME is not running." + exit 1 + fi + echo -n "Restarting $DESC: $NAME... " + kill `cat $PIDFILE` + sleep 2 + $DAEMON $OPTIONS > /dev/null 2>&1 + [ -f $PIDFILE ] || pidof $NAME | awk '{ print $1 }' > $PIDFILE + active_pidfile $PIDFILE $NAME + status + ;; +*) + echo "" + echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]" + echo "" + exit 1 + ;; +esac + +exit 0