wok-next rev 13237

Move from undigest: phpsysinfo
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Aug 14 13:39:12 2012 +0200 (2012-08-14)
parents eb36f0d250b4
children 65bb24bf604e
files phpsysinfo/receipt
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/phpsysinfo/receipt	Tue Aug 14 13:39:12 2012 +0200
     1.3 @@ -0,0 +1,77 @@
     1.4 +# SliTaz package receipt.
     1.5 +
     1.6 +PACKAGE="phpsysinfo"
     1.7 +VERSION="3.0.18"
     1.8 +CATEGORY="misc"
     1.9 +SHORT_DESC="Displays information about your system nicely."
    1.10 +MAINTAINER="pascal.bellard@slitaz.org"
    1.11 +WEB_SITE="http://phpsysinfo.sourceforge.net/"
    1.12 +TARBALL="$PACKAGE-$VERSION.tar.gz"
    1.13 +WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL"
    1.14 +CONFIG_FILES="/etc/phpsysinfo.conf"
    1.15 +
    1.16 +DEPENDS="php pcre-dev"
    1.17 +BUILD_DEPENDS=""
    1.18 +
    1.19 +# Rules to configure and make the package.
    1.20 +compile_rules()
    1.21 +{
    1.22 +	cd $src
    1.23 +	# SliTazisation from http://enira.net/?p=61
    1.24 +	sed -i "s/'-q'/'-a | grep -i pts -c'/" includes/os/class.Linux.inc.php
    1.25 +	grep -i slitaz data/distros.ini || cat >> data/distros.ini <<EOT
    1.26 +[Slitaz]
    1.27 +Name = "Slitaz"
    1.28 +Image = "slitaz.png"
    1.29 +Files = "/etc/slitaz-release"
    1.30 +
    1.31 +EOT
    1.32 +}
    1.33 +
    1.34 +# Rules to gen a SliTaz package suitable for Tazpkg.
    1.35 +genpkg_rules()
    1.36 +{
    1.37 +	mkdir -p $fs/usr/share/phpsysinfo $fs/etc
    1.38 +	cp -a $src/* $fs/usr/share/phpsysinfo
    1.39 +	chown -R www.www $fs/usr/share/phpsysinfo
    1.40 +	mv $fs/usr/share/phpsysinfo/config.php.new $fs/etc/phpsysinfo.conf
    1.41 +	chmod 600 $fs/etc/phpsysinfo.conf
    1.42 +	ln -s /etc/phpsysinfo.conf $fs/usr/share/phpsysinfo/config.php
    1.43 +}
    1.44 +
    1.45 +post_install()
    1.46 +{
    1.47 +	# Configure lighttpd server
    1.48 +	if [ -f $1/etc/lighttpd/lighttpd.conf ]; then
    1.49 +		if ! grep -q /usr/share/phpsysinfo/ $1/etc/lighttpd/lighttpd.conf; then
    1.50 +	    		sed -e 's|.*"/examples/" => "/usr/share/examples/",|    "/examples/" => "/usr/share/examples/",\n    "/phpsysinfo/" => "/usr/share/phpsysinfo/",|g' -i $1/etc/lighttpd/lighttpd.conf
    1.51 +			if [ -z "$1" ]; then
    1.52 +				# Start Web server.
    1.53 +				/etc/init.d/lighttpd stop
    1.54 +				/etc/init.d/lighttpd start
    1.55 +			fi
    1.56 +		fi
    1.57 +	fi
    1.58 +	# Configure apache server
    1.59 +	if [ -f $1/etc/apache/httpd.conf ]; then
    1.60 +		if [ ! -f $1/etc/apache/conf.d/phpsysinfo ]; then
    1.61 +			cat > $1/etc/apache/conf.d/phpsysinfo <<EOT
    1.62 +<IfModule mod_alias.c>
    1.63 +    Alias /phpsysinfo /usr/share/phpsysinfo
    1.64 +</IfModule>
    1.65 +<DirectoryMatch /usr/share/phpsysinfo/>
    1.66 +    DirectoryIndex index.php
    1.67 +    Options +FollowSymLinks
    1.68 +    AllowOverride None
    1.69 +    Order allow,deny
    1.70 +    Allow from all
    1.71 +</DirectoryMatch>
    1.72 +EOT
    1.73 +			if [ -z "$1" ]; then
    1.74 +				# Start Web server.
    1.75 +				/etc/init.d/apache stop
    1.76 +				/etc/init.d/apache start
    1.77 +			fi
    1.78 +		fi
    1.79 +	fi
    1.80 +}