Split strip function into system specific subfunctions.
After the rewrite of add_files in the Irix function library permissions where not assigned correctly. This has been fixed.
This commit is contained in:
parent
5def702b56
commit
2ff1b5e084
@ -61,7 +61,7 @@ BASENAME=/bin/basename
|
|||||||
DIRNAME=/bin/dirname
|
DIRNAME=/bin/dirname
|
||||||
TR=/bin/tr
|
TR=/bin/tr
|
||||||
DIFF=/usr/local/bin/diff # *Must* support -u (like GNU Diff)
|
DIFF=/usr/local/bin/diff # *Must* support -u (like GNU Diff)
|
||||||
FILE=/usr/bin/file # Used by strip()
|
FILE=/usr/bin/file # Used by do_strip()
|
||||||
|
|
||||||
# Groff stuff for manpages
|
# Groff stuff for manpages
|
||||||
NEQN=/usr/local/bin/neqn
|
NEQN=/usr/local/bin/neqn
|
||||||
@ -96,6 +96,7 @@ _sharedir=share
|
|||||||
_mandir=man
|
_mandir=man
|
||||||
_infodir=info
|
_infodir=info
|
||||||
_includedir=include
|
_includedir=include
|
||||||
|
_sysconfdir=etc
|
||||||
|
|
||||||
tmpdir=/tmp
|
tmpdir=/tmp
|
||||||
|
|
||||||
@ -321,42 +322,23 @@ clean()
|
|||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
# strip(): strip binaries in stagedir
|
# do_strip(): strip binaries in stagedir
|
||||||
# params: none
|
# params: none
|
||||||
# Automatically switches to $stagedir
|
# Automatically switches to $stagedir
|
||||||
# On exit cwd is $stagedir
|
# On exit cwd is $stagedir
|
||||||
strip()
|
do_strip()
|
||||||
{
|
{
|
||||||
local f
|
local f
|
||||||
setdir stage
|
setdir stage
|
||||||
# Strip ELF binaries (see brp-strip from RPM)
|
# Strip ELF binaries (see brp-strip from RPM)
|
||||||
if [ $dostrip_elf -eq 1 ]; then
|
if [ $dostrip_elf -eq 1 ]; then
|
||||||
echo "Stripping ELF binaries..."
|
do_strip_bin
|
||||||
for f in `$FIND . -type f \( -perm -0100 -o -perm -0010 -o -perm -0001 \) -exec $FILE {} \; | \
|
|
||||||
$GREP -v ' dynamic lib ' | \
|
|
||||||
$SED -n -e 's/^\(.*\):[ ]*ELF.*, not stripped/\1/p'`; do
|
|
||||||
$STRIP $strip_elf_args $f || :
|
|
||||||
done
|
|
||||||
fi
|
fi
|
||||||
if [ $dostrip_shared -eq 1 ]; then
|
if [ $dostrip_shared -eq 1 ]; then
|
||||||
echo "Stripping ELF shared objects..."
|
do_strip_shared
|
||||||
# Strip ELF shared objects (see brp-strip-shared from RPM)
|
|
||||||
# Please note we don't restrict our search to executable files because
|
|
||||||
# our libraries are not (should not be, at least) +x.
|
|
||||||
for f in `$FIND . -type f -a -exec $FILE {} \; | \
|
|
||||||
grep ' dynamic lib ' | \
|
|
||||||
$SED -n -e 's/^\(.*\):[ ]*ELF.*, not stripped/\1/p'`; do
|
|
||||||
$STRIP $strip_shared_args $f
|
|
||||||
done
|
|
||||||
fi
|
fi
|
||||||
if [ $dostrip_static -eq 1 ]; then
|
if [ $dostrip_static -eq 1 ]; then
|
||||||
echo "Stripping static archives..."
|
do_strip_static
|
||||||
# Strip static libraries. (see brp-strip-static-archive from RPM)
|
|
||||||
for f in `$FIND . -type f -a -exec $FILE {} \; | \
|
|
||||||
$GREP 'current ar archive' | \
|
|
||||||
$SED -n -e 's/^\(.*\):[ ]*current ar archive,.*/\1/p'`; do
|
|
||||||
$STRIP $strip_static_args $f
|
|
||||||
done
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -533,7 +515,7 @@ generic_install()
|
|||||||
error $E_BAD_MAKE generic_install
|
error $E_BAD_MAKE generic_install
|
||||||
fi
|
fi
|
||||||
if [ $dostrip -eq 1 ]; then
|
if [ $dostrip -eq 1 ]; then
|
||||||
strip
|
do_strip
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,7 +9,6 @@ GENDIST="/usr/sbin/gendist"
|
|||||||
|
|
||||||
GZIP=/usr/people/tgc/bin/gzip
|
GZIP=/usr/people/tgc/bin/gzip
|
||||||
BZIP2=/usr/local/bin/bzip2
|
BZIP2=/usr/local/bin/bzip2
|
||||||
STRIP=/bin/true
|
|
||||||
|
|
||||||
# This is the hostname command we'll want on Irix
|
# This is the hostname command we'll want on Irix
|
||||||
HOSTNAME=/usr/bsd/hostname
|
HOSTNAME=/usr/bsd/hostname
|
||||||
@ -27,11 +26,17 @@ hidefile=$metadir/hide
|
|||||||
catman=1
|
catman=1
|
||||||
|
|
||||||
# strip?
|
# strip?
|
||||||
dostrip=0
|
dostrip=1
|
||||||
|
|
||||||
|
# Setup default args for strip. They match /usr/bin/strip in Irix 6.2
|
||||||
|
# Change these if you're using strip from GNU Binutils (recommended)
|
||||||
|
strip_elf_args="" # GNU default is -g
|
||||||
|
strip_shared_args="-f" # GNU default is --strip-unneeded
|
||||||
|
strip_static_args="" # GNU default is -g
|
||||||
|
|
||||||
# Other
|
# Other
|
||||||
usedepend=0 # Don't use depend file even if it's available
|
usedepend=1 # Don't use depend file even if it's available
|
||||||
usescripts=0 # Don't add ops even if they're available
|
usescripts=1 # Don't add ops even if they're available
|
||||||
ignore_unpackaged_files=0 # default to check for unpackaged files in the stage area
|
ignore_unpackaged_files=0 # default to check for unpackaged files in the stage area
|
||||||
|
|
||||||
# Comment these declarations to get it to run with ksh
|
# Comment these declarations to get it to run with ksh
|
||||||
@ -194,22 +199,24 @@ add_files()
|
|||||||
"
|
"
|
||||||
for i in $FILES
|
for i in $FILES
|
||||||
do
|
do
|
||||||
IFS=$OIFS
|
IFS=$OIFS
|
||||||
if [ "$defperm" == "-" ]; then
|
if [ "$defperm" == "-" ]; then
|
||||||
permlist=`$LS -l "$i" | $CUT -d " " -f 1`
|
permlist=`$LS -l "$i" | $CUT -d " " -f 1`
|
||||||
perm=$(compute_octal $permlist)
|
perm=$(compute_octal $permlist)
|
||||||
fi
|
else
|
||||||
doop=$(check_ops "$i")
|
perm=$defperm
|
||||||
fname=$(fix_fname "$i")
|
fi
|
||||||
if [ ! -z "$specattr" ]; then
|
doop=$(check_ops "$i")
|
||||||
echo "f $perm $owner $group ${topinstalldir:1}/$fname $i ${pkgname}.${prodcat} $specattr" >>$idbfile
|
fname=$(fix_fname "$i")
|
||||||
|
if [ ! -z "$specattr" ]; then
|
||||||
|
echo "f $perm $owner $group ${topinstalldir:1}/$fname $i ${pkgname}.${prodcat} $specattr" >>$idbfile
|
||||||
|
else
|
||||||
|
if [ ! -z "$doop" ]; then
|
||||||
|
echo "f $perm $owner $group ${topinstalldir:1}/$fname $i ${pkgname}.${prodcat} $doop" >>$idbfile
|
||||||
else
|
else
|
||||||
if [ ! -z "$doop" ]; then
|
echo "f $perm $owner $group ${topinstalldir:1}/$fname $i ${pkgname}.${prodcat}" >>$idbfile
|
||||||
echo "f $perm $owner $group ${topinstalldir:1}/$fname $i ${pkgname}.${prodcat} $doop" >>$idbfile
|
|
||||||
else
|
|
||||||
echo "f $perm $owner $group ${topinstalldir:1}/$fname $i ${pkgname}.${prodcat}" >>$idbfile
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
done
|
done
|
||||||
IFS=$OIFS
|
IFS=$OIFS
|
||||||
@ -220,15 +227,17 @@ add_files()
|
|||||||
"
|
"
|
||||||
for i in $FILES
|
for i in $FILES
|
||||||
do
|
do
|
||||||
IFS=$OIFS
|
IFS=$OIFS
|
||||||
if [ "$defperm" == "-" ]; then
|
if [ "$defperm" == "-" ]; then
|
||||||
permlist=`$LS -l "$i" | $CUT -d " " -f 1`
|
permlist=`$LS -l "$i" | $CUT -d " " -f 1`
|
||||||
perm=`compute_octal $permlist`
|
perm=$(compute_octal $permlist)
|
||||||
fi
|
else
|
||||||
local temp=`$LS -l "$i"|$CUT -d '>' -f 2`
|
perm=$defperm
|
||||||
local symval=${temp# }
|
fi
|
||||||
fname=$(fix_fname "$i")
|
local temp=`$LS -l "$i"|$CUT -d '>' -f 2`
|
||||||
echo "l $perm $owner $group ${topinstalldir:1}/$fname $i ${pkgname}.${prodcat} symval($symval)" >>$idbfile
|
local symval=${temp# }
|
||||||
|
fname=$(fix_fname "$i")
|
||||||
|
echo "l $perm $owner $group ${topinstalldir:1}/$fname $i ${pkgname}.${prodcat} symval($symval)" >>$idbfile
|
||||||
done
|
done
|
||||||
IFS=$OIFS
|
IFS=$OIFS
|
||||||
}
|
}
|
||||||
@ -311,6 +320,46 @@ fetch_ops()
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# do_strip_bin(): Strip binaries
|
||||||
|
# params: none
|
||||||
|
do_strip_bin()
|
||||||
|
{
|
||||||
|
echo "Stripping ELF binaries..."
|
||||||
|
for f in `$FIND . -type f \( -perm -0100 -o -perm -0010 -o -perm -0001 \) -exec $FILE {} \; | \
|
||||||
|
$GREP -v ' dynamic lib ' | \
|
||||||
|
$SED -n -e 's/^\(.*\):[ ]*ELF.*\(not stripped\).*/\1/p'`; do
|
||||||
|
$STRIP $strip_elf_args $f || :
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
# do_strip_shared(): Strip shared libraries
|
||||||
|
# params: none
|
||||||
|
do_strip_shared()
|
||||||
|
{
|
||||||
|
echo "Stripping ELF shared objects..."
|
||||||
|
# Strip ELF shared objects (see brp-strip-shared from RPM)
|
||||||
|
# Please note we don't restrict our search to executable files because
|
||||||
|
# our libraries are not (should not be, at least) +x.
|
||||||
|
for f in `$FIND . -type f -a -exec $FILE {} \; | \
|
||||||
|
grep ' dynamic lib ' | \
|
||||||
|
$SED -n -e 's/^\(.*\):[ ]*ELF.*\(not stripped\).*/\1/p'`; do
|
||||||
|
$STRIP $strip_shared_args $f
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
# do_strip_static(): Strip static archives
|
||||||
|
# params: none
|
||||||
|
do_strip_static()
|
||||||
|
{
|
||||||
|
echo "Stripping static archives..."
|
||||||
|
# Strip static libraries. (see brp-strip-static-archive from RPM)
|
||||||
|
for f in `$FIND . -type f -a -exec $FILE {} \; | \
|
||||||
|
$GREP 'current ar archive' | \
|
||||||
|
$SED -n -e 's/^\(.*\):[ ]*current ar archive .*/\1/p'`; do
|
||||||
|
$STRIP $strip_static_args $f
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
##################################
|
##################################
|
||||||
# "external" functions
|
# "external" functions
|
||||||
##################################
|
##################################
|
||||||
|
@ -411,6 +411,46 @@ get_pkgrev()
|
|||||||
local secver=$(_upls ${pstamp##PSTAMP=})
|
local secver=$(_upls ${pstamp##PSTAMP=})
|
||||||
echo $secver
|
echo $secver
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# do_strip_bin(): Strip binaries
|
||||||
|
# params: none
|
||||||
|
do_strip_binaries()
|
||||||
|
{
|
||||||
|
echo "Stripping ELF binaries..."
|
||||||
|
for f in `$FIND . -type f \( -perm -0100 -o -perm -0010 -o -perm -0001 \) -exec $FILE {} \; | \
|
||||||
|
$GREP -v ' dynamic lib ' | \
|
||||||
|
$SED -n -e 's/^\(.*\):[ ]*ELF.*, not stripped/\1/p'`; do
|
||||||
|
$STRIP $strip_elf_args $f || :
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
# do_strip_shared(): Strip shared libraries
|
||||||
|
# params: none
|
||||||
|
do_strip_shared()
|
||||||
|
{
|
||||||
|
echo "Stripping ELF shared objects..."
|
||||||
|
# Strip ELF shared objects (see brp-strip-shared from RPM)
|
||||||
|
# Please note we don't restrict our search to executable files because
|
||||||
|
# our libraries are not (should not be, at least) +x.
|
||||||
|
for f in `$FIND . -type f -a -exec $FILE {} \; | \
|
||||||
|
grep ' dynamic lib ' | \
|
||||||
|
$SED -n -e 's/^\(.*\):[ ]*ELF.*, not stripped/\1/p'`; do
|
||||||
|
$STRIP $strip_shared_args $f
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
# do_strip_static(): Strip static archives
|
||||||
|
# params: none
|
||||||
|
do_strip_static()
|
||||||
|
{
|
||||||
|
echo "Stripping static archives..."
|
||||||
|
# Strip static libraries. (see brp-strip-static-archive from RPM)
|
||||||
|
for f in `$FIND . -type f -a -exec $FILE {} \; | \
|
||||||
|
$GREP 'current ar archive' | \
|
||||||
|
$SED -n -e 's/^\(.*\):[ ]*current ar archive,.*/\1/p'`; do
|
||||||
|
$STRIP $strip_static_args $f
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
#####################################################
|
#####################################################
|
||||||
# Define generic functions for different build stages
|
# Define generic functions for different build stages
|
||||||
|
Loading…
x
Reference in New Issue
Block a user