wok-4.x view phpvirtualbox/receipt @ rev 12461
fix symlinks (again)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Fri Apr 28 10:39:50 2017 +0200 (2017-04-28) |
parents | 5b1450e90bf6 |
children |
line source
1 # SliTaz package receipt.
3 PACKAGE="phpvirtualbox"
4 VERSION="4.0-3"
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 gen a SliTaz package suitable for Tazpkg.
14 genpkg_rules()
15 {
16 mkdir -p $fs/usr/share $fs/etc
17 cp -a $src $fs/usr/share/phpvirtualbox
18 cp -a $fs/usr/share/phpvirtualbox/config.php-example $fs/etc/phpvirtualbox.php
19 dos2unix $fs/etc/phpvirtualbox.php
20 ln -s /etc/phpvirtualbox.php $fs/usr/share/phpvirtualbox/config.php
21 cp -a stuff/* $fs/
22 }
24 post_install()
25 {
26 # Virtualbox OSE needs to disable authenication for vboxwebsrv
27 [ -d $1/var/lib/tazpkg/installed/virtualbox ] ||
28 chroot $1 VBoxManage setproperty websrvauthlibrary null
30 # Configure lighttpd server
31 if [ -f $1/etc/lighttpd/lighttpd.conf ]; then
32 if ! grep -q /usr/share/phpvirtualbox/ $1/etc/lighttpd/lighttpd.conf; then
33 sed -e 's|.*"/examples/" => "/usr/share/examples/",| "/examples/" => "/usr/share/examples/",\n "/phpvirtualbox/" => "/usr/share/phpvirtualbox/",|g' -i $1/etc/lighttpd/lighttpd.conf
34 if [ -z "$1" ]; then
35 # Start Web server.
36 /etc/init.d/lighttpd stop
37 /etc/init.d/lighttpd start
38 fi
39 fi
40 fi
41 # Configure apache server
42 if [ -f $1/etc/apache/httpd.conf ]; then
43 if [ ! -f $1/etc/apache/conf.d/phpvirtualbox ]; then
44 cat > $1/etc/apache/conf.d/phpvirtualbox <<EOT
45 <IfModule mod_alias.c>
46 Alias /phpvirtualbox /usr/share/phpvirtualbox
47 </IfModule>
48 <DirectoryMatch /usr/share/phpvirtualbox/>
49 DirectoryIndex index.php
50 Options +FollowSymLinks
51 AllowOverride None
52 Order allow,deny
53 Allow from all
54 </DirectoryMatch>
55 EOT
56 if [ -z "$1" ]; then
57 # Start Web server.
58 /etc/init.d/apache stop
59 /etc/init.d/apache start
60 fi
61 fi
62 fi
63 [ -z "$1" ] && /etc/init.d/vboxwebsrv start
64 cat <<EOT
65 Please configure /etc/phpvirtualbox.php now.
66 EOT
67 }
69 pre_remove()
70 {
71 /etc/init.d/vboxwebsrv stop
72 }