Submitted By: Pablo E. Saquilán (mankeletor) David B. Cortarello (Nomius) Date: 04-03-2006 Initial Package Version: 2.1 Description: The patch was created from the original makepkg program This patch provides the following features: * -s (--strip) Strip binaries and libraries in the package * -z (--zip-man) Compress with gzip the manpages in the package --- makepkg.old 2006-03-04 22:40:05.000000000 -0300 +++ makepkg 2006-03-05 00:18:13.000000000 -0300 @@ -74,6 +74,8 @@ programs in the doinst.sh script) -c, --chown y|n (resets all permissions to root:root 755 - not generally recommended) + -z, --zip-man (compress with gzip the manpages in the package) + -s, --strip (strip binaries and libraries in the package) If these options are not set, makepkg will prompt as appropriate. EOF @@ -107,6 +109,12 @@ elif [ "$1" = "-p" -o "$1" = "--prepend" ]; then PREPEND=y shift 1 + elif [ "$1" = "-z" -o "$1" = " --zip-man" ]; then + ZIP_MAN=y + shift 1 + elif [ "$1" = "-s" -o "$1" = " --strip" ]; then + STRIP=y + shift 1 elif [ "$1" = "-h" -o "$1" = "-H" -o "$1" = "--help" -o $# = 0 ]; then usage exit 0 @@ -208,7 +216,25 @@ if [ "$CHOWN" = "y" ]; then find . -type d -exec chmod -v 755 {} \; find . -type d -exec chown -v root.root {} \; + for x in usr/bin usr/sbin sbin usr/X11R6/bin; do + chown -R root.bin ${x} 1> /dev/null 2> /dev/null + done +fi + +if [ "$MAN_ZIP" = "y" ]; then + for x in usr/man usr/X11R6/man var/man /share/man local/man; do + if [ -d ${x} ]; then + gzip -9 ${x}/man?/* + fi + done +fi + +if [ "$STRIP" = "y" ]; then + find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null + find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null + find . | xargs file | grep "current ar archive" | cut -f 1 -d : | xargs strip --strip-debug 2> /dev/null fi + echo echo "Creating tar file $TAR_NAME.tar..." echo