wok rev 8059

Add: ovz-web-panel
author Eric Joseph-Alexandre <erjo@slitaz.org>
date Fri Jan 21 01:02:30 2011 +0100 (2011-01-21)
parents 811617bdf56d
children 4af8ad8c803b
files ovz-web-panel/receipt ovz-web-panel/stuff/hardware_server.rb.u ovz-web-panel/stuff/owp-1.7.u
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/ovz-web-panel/receipt	Fri Jan 21 01:02:30 2011 +0100
     1.3 @@ -0,0 +1,63 @@
     1.4 +# SliTaz package receipt.
     1.5 +
     1.6 +PACKAGE="ovz-web-panel"
     1.7 +VERSION="1.7"
     1.8 +CATEGORY="networking"
     1.9 +SHORT_DESC="GUI web-based frontend for OpenVZ"
    1.10 +MAINTAINER="erjo@slitaz.org"
    1.11 +DEPENDS="ruby rubygems sqlite3-ruby"
    1.12 +TARBALL="${PACKAGE}-${VERSION}.tgz"
    1.13 +WEB_SITE="http://code.google.com/p/ovz-web-panel/"
    1.14 +WGET_URL="http://ovz-web-panel.googlecode.com/files/$TARBALL"
    1.15 +
    1.16 +
    1.17 +# Rules to configure and make the package.
    1.18 +compile_rules()
    1.19 +{
    1.20 +	cd $PACKAGE
    1.21 +	# Apply patches
    1.22 +	while read patch_file; do
    1.23 +		if [ -f done.$patch_file ]; then
    1.24 +			echo "Skipping $patch_file"
    1.25 +			continue
    1.26 +		fi
    1.27 +		echo "Apply $patch_file"
    1.28 +		patch -p1 < ../stuff/$patch_file || exit 1
    1.29 +		touch done.$patch_file
    1.30 +	done <<EOT
    1.31 +owp-${VERSION}.u
    1.32 +EOT
    1.33 +	
    1.34 +}
    1.35 +
    1.36 +# Rules to gen a SliTaz package suitable for Tazpkg.
    1.37 +genpkg_rules()
    1.38 +{
    1.39 +	mkdir -p $fs/usr/share \
    1.40 +		$fs/etc 
    1.41 +				
    1.42 +	cp -a $PACKAGE $fs/usr/share
    1.43 +	cp -a $fs/usr/share/$PACKAGE/config/owp.conf.sample $fs/etc/owp.conf
    1.44 +	cp -a $fs/usr/share//$PACKAGE/utils/hw-daemon/hw-daemon.ini.sample $fs/usr/share/$PACKAGE/utils/hw-daemon/hw-daemon.ini
    1.45 +	
    1.46 +	# Set secret key
    1.47 +	sed -i 's/secret/2918b7aafc1f5f753ee232a7e7f78175/' \
    1.48 +		$fs/usr/share/$PACKAGE/utils/hw-daemon/hw-daemon.ini
    1.49 +	
    1.50 +	# Set program homedir
    1.51 +	sed -i 's!/opt!/usr/share!' $fs/etc/owp.conf
    1.52 +	
    1.53 +	# Fix perms
    1.54 +	chmod 755 $fs/usr/share/$PACKAGE/script/owp
    1.55 +}
    1.56 +
    1.57 +post_install()
    1.58 +{
    1.59 +	echo "Processing post-install commands..."	
    1.60 +	chroot "$1/" ln -s /usr/share/$PACKAGE/script/owp /etc/init.d/owp
    1.61 +}
    1.62 +
    1.63 +clean_wok()
    1.64 +{
    1.65 +	[ -d $PACKAGE ] && rm -rf $PACKAGE
    1.66 +}
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/ovz-web-panel/stuff/hardware_server.rb.u	Fri Jan 21 01:02:30 2011 +0100
     2.3 @@ -0,0 +1,11 @@
     2.4 +--- ovz-web-panel-ori/app/models/hardware_server.rb	Fri Nov 19 18:54:08 2010
     2.5 ++++ ovz-web-panel/app/models/hardware_server.rb	Fri Dec 31 23:59:40 2010
     2.6 +@@ -174,7 +174,7 @@
     2.7 +   end
     2.8 +   
     2.9 +   def sync_backups
    2.10 +-    backups_list = rpc_client.exec('ls', "--block-size=M -s #{backups_dir}")['output']
    2.11 ++    backups_list = rpc_client.exec('ls', "-h -s #{backups_dir}")['output']
    2.12 +     backups_list = backups_list.split("\n")
    2.13 +     # remove totals line
    2.14 +     backups_list.shift
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/ovz-web-panel/stuff/owp-1.7.u	Fri Jan 21 01:02:30 2011 +0100
     3.3 @@ -0,0 +1,22 @@
     3.4 +--- ovz-web-panel-ori/app/models/hardware_server.rb	Fri Nov 19 18:54:08 2010
     3.5 ++++ ovz-web-panel/app/models/hardware_server.rb	Fri Dec 31 23:59:40 2010
     3.6 +@@ -174,7 +174,7 @@
     3.7 +   end
     3.8 +   
     3.9 +   def sync_backups
    3.10 +-    backups_list = rpc_client.exec('ls', "--block-size=M -s #{backups_dir}")['output']
    3.11 ++    backups_list = rpc_client.exec('ls', "-h -s #{backups_dir}")['output']
    3.12 +     backups_list = backups_list.split("\n")
    3.13 +     # remove totals line
    3.14 +     backups_list.shift
    3.15 +--- ovz-web-panel-ori/script/owp	Mon Oct 25 19:09:40 2010
    3.16 ++++ ovz-web-panel/script/owp	Sat Jan  1 01:08:42 2011
    3.17 +@@ -61,7 +61,7 @@
    3.18 + 
    3.19 + stop() {
    3.20 +   echo "Stopping OpenVZ Web Panel server"
    3.21 +-  PANEL_APP_PID=`ps auxww | grep ruby | grep script/server | awk '{ print $2 }'`
    3.22 ++  PANEL_APP_PID=`ps  | grep ruby | grep script/server | awk '{ print $1 }'`
    3.23 +   [ -n "$PANEL_APP_PID" ] && kill -2 $PANEL_APP_PID
    3.24 +   [ "$ENVIRONMENT" = "HW-NODE" ] && ruby $INSTALL_DIR/utils/hw-daemon/hw-daemon.rb stop
    3.25 +   ruby $INSTALL_DIR/utils/watchdog/watchdog.rb stop