wok view phpvirtualbox/receipt @ rev 25037

Up glza (0.11.4)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat May 21 21:38:29 2022 +0000 (23 months ago)
parents 4cf10037f0f9
children 5db546345599
line source
1 # SliTaz package receipt.
3 PACKAGE="phpvirtualbox"
4 VERSION="5.2.1"
5 CATEGORY="network"
6 SHORT_DESC="Virtualbox AJAX interface."
7 MAINTAINER="pascal.bellard@slitaz.org"
8 LICENSE="GPL3"
9 WEB_SITE="https://github.com/phpvirtualbox/phpvirtualbox"
11 TARBALL="$PACKAGE-$VERSION.tar.gz"
12 WGET_URL="$WEB_SITE/archive/${VERSION%.*}-${VERSION##*.}.tar.gz"
14 DEPENDS="php-soap virtualbox"
16 current_version()
17 {
18 wget -O - ${WGET_URL%/arch*}/releases 2>/dev/null | \
19 sed '/archive.*tar/!d;s|.*/\(.*\).tar.*|\1|;s|-|.|;q'
20 }
22 # Rules to gen a SliTaz package suitable for Tazpkg.
23 genpkg_rules()
24 {
25 mkdir -p $fs/usr/share
26 mkdir -p $fs/etc
28 cp -a $src $fs/usr/share/phpvirtualbox
29 cp -a $fs/usr/share/phpvirtualbox/config.php-example \
30 $fs/etc/phpvirtualbox.php
31 dos2unix $fs/etc/phpvirtualbox.php
32 ln -s /etc/phpvirtualbox.php $fs/usr/share/phpvirtualbox/config.php
33 cp -a stuff/* $fs
34 }
36 post_install()
37 {
38 # Virtualbox OSE needs to disable authenication for vboxwebsrv
39 [ -d "$1/var/lib/tazpkg/installed/virtualbox" ] ||
40 chroot "$1/" VBoxManage setproperty websrvauthlibrary null
42 # Configure lighttpd server
43 if [ -f "$1/etc/lighttpd/lighttpd.conf" ]
44 then
45 if ! grep -q /usr/share/phpvirtualbox/ "$1/etc/lighttpd/lighttpd.conf"
46 then
47 sed -e 's|.*"/examples/" => "/usr/share/examples/",| "/examples/" => "/usr/share/examples/",\n "/phpvirtualbox/" => "/usr/share/phpvirtualbox/",|g' -i "$1/etc/lighttpd/lighttpd.conf"
48 if [ -z "$1" ]
49 then
50 # Start Web server.
51 /etc/init.d/lighttpd stop
52 /etc/init.d/lighttpd start
53 fi
54 fi
55 fi
57 # Configure apache server
58 if [ -f "$1/etc/apache/httpd.conf" ]
59 then
60 if [ ! -f "$1/etc/apache/conf.d/phpvirtualbox" ]
61 then
62 cat > "$1/etc/apache/conf.d/phpvirtualbox" <<EOT
63 <IfModule mod_alias.c>
64 Alias /phpvirtualbox /usr/share/phpvirtualbox
65 </IfModule>
66 <DirectoryMatch /usr/share/phpvirtualbox/>
67 DirectoryIndex index.php
68 Options +FollowSymLinks
69 AllowOverride None
70 Order allow,deny
71 Allow from all
72 </DirectoryMatch>
73 EOT
74 if [ -z "$1" ]
75 then
76 # Start Web server.
77 /etc/init.d/apache stop
78 /etc/init.d/apache start
79 fi
80 fi
81 fi
82 [ -z "$1" ] && /etc/init.d/vboxwebsrv start
83 cat <<EOT
84 Please configure /etc/phpvirtualbox.php now.
85 EOT
86 }
88 pre_remove()
89 {
90 /etc/init.d/vboxwebsrv stop
91 }