wok rev 1137

Fix post_install for subdir install
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu Jul 24 12:27:06 2008 +0000 (2008-07-24)
parents 8c8d1dfb63df
children 11021a6d576e
files clamav/receipt nail/receipt ntpclient/receipt openvpn/receipt partimage/receipt php/receipt rox-filer/receipt slitaz-boot-scripts/receipt sudo/receipt transmission/receipt xorg-server/receipt
line diff
     1.1 --- a/clamav/receipt	Thu Jul 24 09:52:02 2008 +0000
     1.2 +++ b/clamav/receipt	Thu Jul 24 12:27:06 2008 +0000
     1.3 @@ -47,23 +47,23 @@
     1.4  	
     1.5  	# Enable freshclam update
     1.6  	echo -n "Enabling freshclam update..."
     1.7 -	cd /etc/clamav
     1.8 +	cd $1/etc/clamav
     1.9  	sed 's/^Example/#Example/' < freshclam.conf > temp.file
    1.10  	mv temp.file freshclam.conf
    1.11  	status
    1.12  
    1.13  	# Enable clamd configuration
    1.14  	echo -n "Enabling clamd daemon..."
    1.15 -	cd /etc/clamav
    1.16 +	cd $1/etc/clamav
    1.17  	sed 's/^Example/#Example/; s/^#PidFile/PidFile/' < clamd.conf > temp.file
    1.18  	mv temp.file clamd.conf
    1.19  	status
    1.20  
    1.21  	
    1.22  	# adduser clamav if needed
    1.23 -	if ! grep -q clamav /etc/passwd; then
    1.24 +	if ! grep -q clamav $1/etc/passwd; then
    1.25  		echo "Adding user clamav..."
    1.26 -		adduser clamav -s /bin/false -H -D -S
    1.27 +		chroot $1/ adduser clamav -s /bin/false -H -D -S
    1.28  		status
    1.29  	fi
    1.30  }
     2.1 --- a/nail/receipt	Thu Jul 24 09:52:02 2008 +0000
     2.2 +++ b/nail/receipt	Thu Jul 24 12:27:06 2008 +0000
     2.3 @@ -42,9 +42,9 @@
     2.4  # Check mailx
     2.5  post_install()
     2.6  {
     2.7 -	. /etc/init.d/rc.functions
     2.8 +	. $1/etc/init.d/rc.functions
     2.9  
    2.10 -	if [ -e /usr/bin/mailx ]; then
    2.11 +	if [ -e $1/usr/bin/mailx ]; then
    2.12  		echo ""
    2.13  		echo "/usr/bin/mailx exists"
    2.14  		echo -n "Do you want /usr/bin/nail for /usr/bin/mailx (y/N) ? : "
    2.15 @@ -52,8 +52,8 @@
    2.16  		if [ "$anser" == "y" ]; then
    2.17  			echo ""
    2.18  			echo -n "linking /usr/bin/mailx to /usr/bin/nail"
    2.19 -			rm /usr/bin/mailx
    2.20 -			ln -s /usr/bin/nail /usr/bin/mailx
    2.21 +			rm $1/usr/bin/mailx
    2.22 +			ln -s /usr/bin/nail $1/usr/bin/mailx
    2.23  			status
    2.24  		else
    2.25  			echo ""
    2.26 @@ -62,7 +62,7 @@
    2.27  		fi
    2.28  	else
    2.29  		echo -n "linking /usr/bin/mailx to /usr/bin/nail"
    2.30 -		ln -s /usr/bin/nail /usr/bin/mailx
    2.31 +		ln -s /usr/bin/nail $1/usr/bin/mailx
    2.32  		status
    2.33  	fi
    2.34  }
     3.1 --- a/ntpclient/receipt	Thu Jul 24 09:52:02 2008 +0000
     3.2 +++ b/ntpclient/receipt	Thu Jul 24 12:27:06 2008 +0000
     3.3 @@ -35,7 +35,7 @@
     3.4  
     3.5  post_install()
     3.6  {
     3.7 -    local root
     3.8 +    [ -n "$1" ] && return
     3.9      echo ""
    3.10      echo -n "Do you want to run ntpclient in automatic mode (y/N): "; read anser
    3.11      	if [ "$anser" == "y" ]; then
     4.1 --- a/openvpn/receipt	Thu Jul 24 09:52:02 2008 +0000
     4.2 +++ b/openvpn/receipt	Thu Jul 24 12:27:06 2008 +0000
     4.3 @@ -31,7 +31,7 @@
     4.4  # Post install/remove commands for Tazpkg.
     4.5  post_install()
     4.6  {
     4.7 -	mkdir -p /etc/openvpn /var/run/openvpn
     4.8 +	mkdir -p $1/etc/openvpn $1/var/run/openvpn
     4.9  }
    4.10  
    4.11  post_remove()
     5.1 --- a/partimage/receipt	Thu Jul 24 09:52:02 2008 +0000
     5.2 +++ b/partimage/receipt	Thu Jul 24 12:27:06 2008 +0000
     5.3 @@ -38,14 +38,14 @@
     5.4  {
     5.5  	echo "Processing post install commands..."
     5.6  	echo "Adding user/group partimag..."
     5.7 -	adduser -S -H -D partimag
     5.8 +	chroot $1/ adduser -S -H -D partimag
     5.9  
    5.10  	echo "Setting permissions for config files"
    5.11 -	chmod 0600 /etc/partimaged/*
    5.12 -	chown partimag.partimag /etc/partimaged/*	
    5.13 +	chmod 0600 $1/etc/partimaged/*
    5.14 +	chown partimag.partimag $1/etc/partimaged/*	
    5.15  	
    5.16  	echo " Creating image files directory"
    5.17 -	install -g partimag -o partimag -m 0755 -d /var/lib/partimaged
    5.18 +	install -g partimag -o partimag -m 0755 -d $1/var/lib/partimaged
    5.19  	
    5.20  	echo ""
    5.21  	echo -e "\nTo starts $PACKAGE server you can run :\n"
     6.1 --- a/php/receipt	Thu Jul 24 09:52:02 2008 +0000
     6.2 +++ b/php/receipt	Thu Jul 24 12:27:06 2008 +0000
     6.3 @@ -59,8 +59,6 @@
     6.4  }
     6.5  post_install()
     6.6  {
     6.7 -	local root
     6.8 -	root=$1
     6.9  	# Restore original php.ini
    6.10  	if [ -f "$1/etc/php.ini.bak" ]; then
    6.11  		echo -n "Restoring php.ini backup..."
    6.12 @@ -68,7 +66,7 @@
    6.13  		status
    6.14  	fi
    6.15  	# Start Web server.
    6.16 -	if [ ! -f "/var/run/lighttpd.pid" ]; then
    6.17 +	if [ -z "$1" -a ! -f "/var/run/lighttpd.pid" ]; then
    6.18  		/etc/init.d/lighttpd start
    6.19  	fi
    6.20  }
     7.1 --- a/rox-filer/receipt	Thu Jul 24 09:52:02 2008 +0000
     7.2 +++ b/rox-filer/receipt	Thu Jul 24 12:27:06 2008 +0000
     7.3 @@ -63,16 +63,14 @@
     7.4  # Check /usr/share/icons/ROX
     7.5  post_install()
     7.6  { 
     7.7 -	. /etc/init.d/rc.functions
     7.8 -
     7.9 -	if [ -e /usr/share/icons/ROX ]; then
    7.10 +	if [ -e $1/usr/share/icons/ROX ]; then
    7.11  		echo ""
    7.12  		echo "/usr/share/icons/ROX exists"
    7.13  	else
    7.14  		echo ""
    7.15  		echo "/usr/share/icons/ROX doesn't exists"
    7.16  		echo -n "linking /usr/share/icons/ROX to /usr/share/icons/Tango"
    7.17 -		ln -s /usr/share/icons/Tango /usr/share/icons/ROX
    7.18 +		ln -s /usr/share/icons/Tango $1/usr/share/icons/ROX
    7.19  		status
    7.20  	fi
    7.21  }
     8.1 --- a/slitaz-boot-scripts/receipt	Thu Jul 24 09:52:02 2008 +0000
     8.2 +++ b/slitaz-boot-scripts/receipt	Thu Jul 24 12:27:06 2008 +0000
     8.3 @@ -69,7 +69,11 @@
     8.4  WIFI_ESSID="any"
     8.5  WIFI_MODE="managed"
     8.6  WIFI_KEY=""
     8.7 +WIFI_KEY_TYPE="none"
     8.8 +WPA_DRIVER=""
     8.9  WIFI_CHANNEL=""
    8.10 +WIFI_IWCONFIG_ARGS=""
    8.11 +NDISWRAPPER_DRIVERS=""
    8.12  
    8.13  EOT
    8.14  	fi
     9.1 --- a/sudo/receipt	Thu Jul 24 09:52:02 2008 +0000
     9.2 +++ b/sudo/receipt	Thu Jul 24 12:27:06 2008 +0000
     9.3 @@ -3,7 +3,7 @@
     9.4  PACKAGE="sudo"
     9.5  VERSION="1.6.9p12"
     9.6  CATEGORY="security"
     9.7 -SHORT_DESC="Sudo (su "do") allows a system administrator to delegate authority."
     9.8 +SHORT_DESC="Sudo (su \"do\") allows a system administrator to delegate authority."
     9.9  MAINTAINER="erjo@slitaz.org"
    9.10  DEPENDS=""
    9.11  TARBALL="$PACKAGE-$VERSION.tar.gz"
    10.1 --- a/transmission/receipt	Thu Jul 24 09:52:02 2008 +0000
    10.2 +++ b/transmission/receipt	Thu Jul 24 12:27:06 2008 +0000
    10.3 @@ -41,7 +41,7 @@
    10.4  # Remove old packages name
    10.5  post_install()
    10.6  {
    10.7 -	rm -f /usr/bin/transmission-gtk
    10.8 +	rm -f $1/usr/bin/transmission-gtk
    10.9  }
   10.10  
   10.11  # Fancy tarball...
    11.1 --- a/xorg-server/receipt	Thu Jul 24 09:52:02 2008 +0000
    11.2 +++ b/xorg-server/receipt	Thu Jul 24 12:27:06 2008 +0000
    11.3 @@ -82,9 +82,9 @@
    11.4  	root=$1
    11.5  	chmod 1777 $root/var/tmp
    11.6  	# Reinstall libX11 if needed...
    11.7 -	if [ ! -f /usr/share/X11/XKeysymDB ]; then
    11.8 +	if [ ! -f $1/usr/share/X11/XKeysymDB ]; then
    11.9  		echo "Missing file: /usr/share/X11/XKeysymDB"
   11.10 -		tazpkg get-install xorg-libX11 --forced
   11.11 +		tazpkg get-install xorg-libX11 --forced --root=$1
   11.12  	fi
   11.13  }
   11.14