wok view phpvirtualbox/receipt @ rev 7937

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