wok view phpvirtualbox/receipt @ rev 25603

Update some current_version
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Jul 18 11:43:32 2023 +0000 (10 months ago)
parents 5ea0ce1cecc0
children
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 # What is the latest version available today?
17 current_version()
18 {
19 wget -O - ${WGET_URL%/arch*}/releases 2>/dev/null | \
20 sed '/tag\//!d;s|.*tag/v*||;s|".*||;s|-|.|;q'
21 }
23 # Rules to gen a SliTaz package suitable for Tazpkg.
24 genpkg_rules()
25 {
26 mkdir -p $fs/usr/share
27 mkdir -p $fs/etc
29 cp -a $src $fs/usr/share/phpvirtualbox
30 cp -a $fs/usr/share/phpvirtualbox/config.php-example \
31 $fs/etc/phpvirtualbox.php
32 dos2unix $fs/etc/phpvirtualbox.php
33 ln -s /etc/phpvirtualbox.php $fs/usr/share/phpvirtualbox/config.php
34 cp -a stuff/* $fs
35 }
37 post_install()
38 {
39 # Virtualbox OSE needs to disable authenication for vboxwebsrv
40 [ -d "$1/var/lib/tazpkg/installed/virtualbox" ] ||
41 chroot "$1/" VBoxManage setproperty websrvauthlibrary null
43 # Configure lighttpd server
44 if [ -f "$1/etc/lighttpd/lighttpd.conf" ]
45 then
46 if ! grep -q /usr/share/phpvirtualbox/ "$1/etc/lighttpd/lighttpd.conf"
47 then
48 sed -e 's|.*"/examples/" => "/usr/share/examples/",| "/examples/" => "/usr/share/examples/",\n "/phpvirtualbox/" => "/usr/share/phpvirtualbox/",|g' -i "$1/etc/lighttpd/lighttpd.conf"
49 if [ -z "$1" ]
50 then
51 # Start Web server.
52 /etc/init.d/lighttpd stop
53 /etc/init.d/lighttpd start
54 fi
55 fi
56 fi
58 # Configure apache server
59 if [ -f "$1/etc/apache/httpd.conf" ]
60 then
61 if [ ! -f "$1/etc/apache/conf.d/phpvirtualbox" ]
62 then
63 cat > "$1/etc/apache/conf.d/phpvirtualbox" <<EOT
64 <IfModule mod_alias.c>
65 Alias /phpvirtualbox /usr/share/phpvirtualbox
66 </IfModule>
67 <DirectoryMatch /usr/share/phpvirtualbox/>
68 DirectoryIndex index.php
69 Options +FollowSymLinks
70 AllowOverride None
71 Order allow,deny
72 Allow from all
73 </DirectoryMatch>
74 EOT
75 if [ -z "$1" ]
76 then
77 # Start Web server.
78 /etc/init.d/apache stop
79 /etc/init.d/apache start
80 fi
81 fi
82 fi
83 [ -z "$1" ] && /etc/init.d/vboxwebsrv start
84 cat <<EOT
85 Please configure /etc/phpvirtualbox.php now.
86 EOT
87 }
89 pre_remove()
90 {
91 /etc/init.d/vboxwebsrv stop
92 }