wok annotate phpvirtualbox/receipt @ rev 7738

Add phpvirtualbox
author Pascal Bellard <pascal.bellard@slitaz.org>
date Mon Dec 20 14:58:13 2010 +0100 (2010-12-20)
parents
children 52c31d10f766
rev   line source
pascal@7738 1 # SliTaz package receipt.
pascal@7738 2
pascal@7738 3 PACKAGE="phpvirtualbox"
pascal@7738 4 VERSION="0.5"
pascal@7738 5 CATEGORY="network"
pascal@7738 6 SHORT_DESC="Virtualbox AJAX interface."
pascal@7738 7 MAINTAINER="pascal.bellard@slitaz.org"
pascal@7738 8 TARBALL="$PACKAGE-$VERSION.zip"
pascal@7738 9 WEB_SITE="http://code.google.com/$PACKAGE/"
pascal@7738 10 WGET_URL="http://$PACKAGE.googlecode.com/files/$TARBALL"
pascal@7738 11 DEPENDS="php-soap virtualbox"
pascal@7738 12
pascal@7738 13 # Rules to configure and make the package.
pascal@7738 14 compile_rules()
pascal@7738 15 {
pascal@7738 16 cd $src
pascal@7738 17 }
pascal@7738 18
pascal@7738 19 # Rules to gen a SliTaz package suitable for Tazpkg.
pascal@7738 20 genpkg_rules()
pascal@7738 21 {
pascal@7738 22 mkdir -p $fs/usr/share $fs/etc
pascal@7738 23 cp -a $src $fs/usr/share/phpvirtualbox
pascal@7738 24 mv $fs/usr/share/phpvirtualbox/config.php $fs/etc/phpvirtualbox.php
pascal@7738 25 dos2unix $fs/etc/phpvirtualbox.php
pascal@7738 26 ln -s /etc/phpvirtualbox.php $fs/usr/share/phpvirtualbox/config.php
pascal@7738 27 cp -a stuff/* $fs/
pascal@7738 28 }
pascal@7738 29
pascal@7738 30 post_install()
pascal@7738 31 {
pascal@7738 32 # Virtualbox OSE needs to disable authenication for vboxwebsrv
pascal@7738 33 [ -d $1/var/lib/tazpkg/installed/virtualbox ] ||
pascal@7738 34 chroot $1 VBoxManage setproperty websrvauthlibrary null
pascal@7738 35
pascal@7738 36 # Configure lighttpd server
pascal@7738 37 if [ -f $1/etc/lighttpd/lighttpd.conf ]; then
pascal@7738 38 if ! grep -q /usr/share/phpvirtualbox/ $1/etc/lighttpd/lighttpd.conf; then
pascal@7738 39 sed -e 's|.*"/examples/" => "/usr/share/examples/",| "/examples/" => "/usr/share/examples/",\n "/phpvirtualbox/" => "/usr/share/phpvirtualbox/",|g' -i $1/etc/lighttpd/lighttpd.conf
pascal@7738 40 if [ -z "$1" ]; then
pascal@7738 41 # Start Web server.
pascal@7738 42 /etc/init.d/lighttpd stop
pascal@7738 43 /etc/init.d/lighttpd start
pascal@7738 44 fi
pascal@7738 45 fi
pascal@7738 46 fi
pascal@7738 47 # Configure apache server
pascal@7738 48 if [ -f $1/etc/apache/httpd.conf ]; then
pascal@7738 49 if [ ! -f $1/etc/apache/conf.d/phpvirtualbox ]; then
pascal@7738 50 cat > $1/etc/apache/conf.d/phpvirtualbox <<EOT
pascal@7738 51 <IfModule mod_alias.c>
pascal@7738 52 Alias /phpvirtualbox /usr/share/phpvirtualbox
pascal@7738 53 </IfModule>
pascal@7738 54 <DirectoryMatch /usr/share/phpvirtualbox/>
pascal@7738 55 DirectoryIndex index.php
pascal@7738 56 Options +FollowSymLinks
pascal@7738 57 AllowOverride None
pascal@7738 58 Order allow,deny
pascal@7738 59 Allow from all
pascal@7738 60 </DirectoryMatch>
pascal@7738 61 EOT
pascal@7738 62 if [ -z "$1" ]; then
pascal@7738 63 # Start Web server.
pascal@7738 64 /etc/init.d/apache stop
pascal@7738 65 /etc/init.d/apache start
pascal@7738 66 fi
pascal@7738 67 fi
pascal@7738 68 fi
pascal@7738 69 [ -z "$1" ] && /etc/init.d/vboxwebsrv start
pascal@7738 70 cat <<EOT
pascal@7738 71 Please configure /etc/phpvirtualbox.php now.
pascal@7738 72 EOT
pascal@7738 73 }
pascal@7738 74
pascal@7738 75 pre_remove()
pascal@7738 76 {
pascal@7738 77 /etc/init.d/vboxwebsrv stop
pascal@7738 78 }