tazwok rev 135

Add function check_fsh to avoid non-standard path
author Christophe Lincoln <pankso@slitaz.org>
date Mon Jun 22 01:36:57 2009 +0200 (2009-06-22)
parents eb3321e3c8ad
children 1f855947f165
files examples/tazwok.conf tazwok
line diff
     1.1 --- a/examples/tazwok.conf	Mon Jun 22 00:14:40 2009 +0200
     1.2 +++ b/examples/tazwok.conf	Mon Jun 22 01:36:57 2009 +0200
     1.3 @@ -27,11 +27,17 @@
     1.4  
     1.5  # Mirrors URLs. To downloads source next from your location.
     1.6  # GNU mirror :
     1.7 -#
     1.8  GNU_MIRROR="ftp://sunsite.cnlab-switch.ch/mirror/gnu"
     1.9  # SourceForge mirror :
    1.10 -#
    1.11  SF_MIRROR="http://switch.dl.sourceforge.net/sourceforge"
    1.12  # Xorg mirror :
    1.13 -#
    1.14  XORG_MIRROR="ftp://ftp.solnet.ch/mirror/x.org/pub/individual"
    1.15 +
    1.16 +# Favorite console editor.
    1.17 +EDITOR="nano"
    1.18 +
    1.19 +# FSH standards directories with init. Package generation will abort if
    1.20 +# a file is installed in a non-specified path. Note /vz is for OpenVZ.
    1.21 +FSH="bin boot dev etc home init lib media mnt proc root sbin share sys \
    1.22 +tmp usr var vz usr/bin usr/games usr/include usr/lib usr/local usr/sbin \
    1.23 +usr/share usr/src"
     2.1 --- a/tazwok	Mon Jun 22 00:14:40 2009 +0200
     2.2 +++ b/tazwok	Mon Jun 22 01:36:57 2009 +0200
     2.3 @@ -14,7 +14,11 @@
     2.4  # Tazwok variables #
     2.5  ####################
     2.6  
     2.7 -# Packages categories.
     2.8 +# Packages categories
     2.9 +#
    2.10 +# We may move this to a centralized config for Tazwok, Tazpkg and Tazbb.
    2.11 +# /var/lib/tazpkg/categories ?
    2.12 +#
    2.13  CATEGORIES="
    2.14  base-system
    2.15  x-window
    2.16 @@ -424,6 +428,42 @@
    2.17  	status
    2.18  }
    2.19  
    2.20 +# Check FSH in a slitaz package (Path: /:/usr)
    2.21 +check_fsh()
    2.22 +{
    2.23 +	cd $WOK/$PACKAGE/taz/*/fs
    2.24 +	for i in `ls -d * usr/* 2>/dev/null`
    2.25 +	do
    2.26 +		if ! echo $FSH | grep -q $i; then
    2.27 +			echo "Wrong path: /$i"
    2.28 +			error=1
    2.29 +		fi
    2.30 +	done
    2.31 +	if [ "$error" = "1" ]; then
    2.32 +		cat << _EOT_
    2.33 +
    2.34 +Package will install files in a non standard directory and want be generated.
    2.35 +You may have a wrong copy path in genpkg_rules or must add some options to
    2.36 +configure in compile_rules. Some valid options for SliTaz (Linux FSH):
    2.37 +
    2.38 + --prefix=/usr
    2.39 + --sysconfdir=/etc
    2.40 + --libexecdir=/usr/lib/(pkgname)
    2.41 + --localstatedir=/var
    2.42 + --mandir=/usr/share/man
    2.43 + --infodir=/usr/share/info
    2.44 +
    2.45 +For more information please read SliTaz doc and run: ./configure --help
    2.46 +================================================================================
    2.47 +$PACKAGE package generation aborted.
    2.48 +
    2.49 +_EOT_
    2.50 +		# Dont generate a corrupted package.
    2.51 +		exit 1
    2.52 +	fi
    2.53 +	echo ""
    2.54 +}
    2.55 +
    2.56  # Create a package tree and build the gziped cpio archive
    2.57  # to make a SliTaz (.tazpkg) package.
    2.58  gen_package()
    2.59 @@ -456,7 +496,8 @@
    2.60  		_pkg=$src/_pkg
    2.61  	fi
    2.62  	cd $WOK/$PACKAGE
    2.63 -	# Execute genpkg_rules and copy generic files to build the package.
    2.64 +	# Execute genpkg_rules, check package and copy generic files to build
    2.65 +	# the package.
    2.66  	echo ""
    2.67  	echo "Building $PACKAGE with the receipt..."
    2.68  	echo "================================================================================"
    2.69 @@ -464,6 +505,7 @@
    2.70  		# Log process.
    2.71  		echo "executing genpkg_rules" >> $LOG
    2.72  		genpkg_rules
    2.73 +		check_fsh
    2.74  		cd $WOK/$PACKAGE
    2.75  		# Skip generic files for packages with a WANTED variable
    2.76  		# (dev and splited pkgs).