# SliTaz package receipt.

PACKED_SIZE="136.0K"
UNPACKED_SIZE="732.0K"
PACKAGE="tazpanel"
VERSION="622"
CATEGORY="system-tools"
SHORT_DESC="SliTaz administration and configuration panel."
MAINTAINER="pankso@slitaz.org"
LICENSE="BSD"
TARBALL="$PACKAGE-$VERSION.tar.gz"
WEB_SITE="http://www.slitaz.org/"
WGET_URL="http://hg.slitaz.org/tazpanel/archive/$VERSION.tar.gz"
CONFIG_FILES="/etc/slitaz/tazpanel.conf /etc/slitaz/httpd.conf"
HOST_ARCH="i486 arm"

SUGGESTED="tazinst-gui tazinst"
DEPENDS="busybox gettext-base sundown"
BUILD_DEPENDS="gettext jsmin tidy-html5"
SIBLINGS="tazpanel-extra"

# Rules to configure and make the package.
compile_rules()
{
	make && make DESTDIR=$DESTDIR VERSION=$VERSION install
}

# Rules to gen a SliTaz package suitable for Tazpkg.
genpkg_rules()
{
	mkdir -p $fs/etc/init.d
	cp -a $install/* $fs
	# Init script use tazpanel cmdline
	cd $fs/etc/init.d && ln -s ../../usr/bin/tazpanel .
}

# Pre and post install commands for Tazpkg.
post_install()
{
	rm -f "$1"/var/cache/tazpanel/* 2> /dev/null
	grep -qs tazpanel "$1"/etc/hosts ||
		sed -i 's/^127.0.0.1.*/& tazpanel/' "$1"/etc/hosts

	# Do we need TazPanel restart? It freezes when updating using web interface.
	#[ -z "$1" ] && tazpanel restart
}
