tazwok rev 25

Strip generated packages automaticly
author Christophe Lincoln <pankso@slitaz.org>
date Tue Feb 05 00:27:57 2008 +0100 (2008-02-05)
parents 47584d26ad16
children f0821ee32fd3
files tazwok
line diff
     1.1 --- a/tazwok	Mon Feb 04 21:06:36 2008 +0100
     1.2 +++ b/tazwok	Tue Feb 05 00:27:57 2008 +0100
     1.3 @@ -15,7 +15,17 @@
     1.4  ####################
     1.5  
     1.6  # Packages categories.
     1.7 -CATEGORIES="base-system base-apps x-window devel extra"
     1.8 +CATEGORIES="
     1.9 +base-system
    1.10 +utilities
    1.11 +network
    1.12 +graphics
    1.13 +multimedia
    1.14 +office
    1.15 +development
    1.16 +system-tools
    1.17 +security
    1.18 +meta"
    1.19  
    1.20  # Use words rater than numbers in the code.
    1.21  COMMAND=$1
    1.22 @@ -277,7 +287,6 @@
    1.23  # This function is executed by gen_package when 'tazwok genpkg'.
    1.24  copy_generic_files()
    1.25  {
    1.26 -	cd $WOK/$PACKAGE
    1.27  	# In most case locale are in $_pkg/usr/share/locale so we copy files
    1.28  	# using generic variables and $LOCALE from Tazwok config file.
    1.29  	if [ ! "$LOCALE" = "" ]; then
    1.30 @@ -314,6 +323,23 @@
    1.31  	fi
    1.32  }
    1.33  
    1.34 +# Find and strip : --strip-all (-s) or --strip-debug on static libs.
    1.35 +strip_package()
    1.36 +{
    1.37 +	echo -n "Executing strip on all files..."
    1.38 +	# Binaries.
    1.39 +	for dir in $fs/bin $fs/sbin $fs/usr/bin $fs/usr/sbin $fs/usr/games
    1.40 +	do
    1.41 +		if [ -d "$dir" ]; then
    1.42 +			find $dir -type f -exec strip -s '{}' 2>/dev/null \;
    1.43 +		fi
    1.44 +	done
    1.45 +	# Libraries.
    1.46 +	find $fs -name "*.so*" -exec strip -s '{}' 2>/dev/null \;
    1.47 +	find $fs -name "*.a" -exec strip --strip-debug '{}' 2>/dev/null \;
    1.48 +	status
    1.49 +}
    1.50 +
    1.51  # Creat a package tree and build the gziped cpio archive
    1.52  # to make a SliTaz (.tazpkg) package.
    1.53  gen_package()
    1.54 @@ -350,6 +376,7 @@
    1.55  		# Log process.
    1.56  		echo "executing genpkg_rules" >> $LOG
    1.57  		genpkg_rules
    1.58 +		cd $WOK/$PACKAGE
    1.59  		# Skip generic files for packages with a WANTED variable 
    1.60  		# (dev and splited pkgs).
    1.61  		if [ ! "$WANTED" = "" ]; then
    1.62 @@ -357,6 +384,7 @@
    1.63  		else
    1.64  			copy_generic_files
    1.65  		fi
    1.66 +		strip_package
    1.67  	else
    1.68  		echo "No package rules to gen $PACKAGE..."
    1.69  		exit 1