sync with rpm4 branch: removed obsolete files
This commit is contained in:
parent
c15b8e601d
commit
b1f0386809
@ -1,61 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# This script reads filenames from STDIN and outputs any relevant provides
|
||||
# information that needs to be included in the package.
|
||||
|
||||
filelist=`sed "s/['\"]/\\\&/g"`
|
||||
|
||||
solist=$(echo $filelist | grep "\\.so" | grep -v "^/lib/ld.so" | \
|
||||
xargs file -L 2>/dev/null | grep "ELF.*shared object" | cut -d: -f1)
|
||||
pythonlist=
|
||||
tcllist=
|
||||
|
||||
#
|
||||
# --- Alpha does not mark 64bit dependencies
|
||||
case `uname -m` in
|
||||
alpha*) mark64="" ;;
|
||||
*) mark64="()(64bit)" ;;
|
||||
esac
|
||||
|
||||
#
|
||||
# --- Library sonames and weak symbol versions (from glibc).
|
||||
for f in $solist; do
|
||||
soname=$(objdump -p $f | awk '/SONAME/ {print $2}')
|
||||
|
||||
lib64=`if file -L $f 2>/dev/null | \
|
||||
grep "ELF 64-bit" >/dev/null; then echo "$mark64"; fi`
|
||||
if [ "$soname" != "" ]; then
|
||||
if [ ! -L $f ]; then
|
||||
echo $soname$lib64
|
||||
objdump -p $f | awk '
|
||||
BEGIN { START=0 ; }
|
||||
/Version definitions:/ { START=1; }
|
||||
/^[0-9]/ && (START==1) { print $4; }
|
||||
/^$/ { START=0; }
|
||||
' | \
|
||||
grep -v $soname | \
|
||||
while read symbol ; do
|
||||
echo "$soname($symbol)`echo $lib64 | sed 's/()//'`"
|
||||
done
|
||||
fi
|
||||
else
|
||||
echo ${f##*/}$lib64
|
||||
fi
|
||||
done | sort -u
|
||||
|
||||
#
|
||||
# --- Perl modules.
|
||||
[ -x /usr/lib/rpm/perl.prov ] &&
|
||||
echo $filelist | tr '[:blank:]' \\n | grep '\.pm$' | /usr/lib/rpm/perl.prov | sort -u
|
||||
|
||||
#
|
||||
# --- Python modules.
|
||||
[ -x /usr/lib/rpm/python.prov -a -n "$pythonlist" ] &&
|
||||
echo $pythonlist | tr '[:blank:]' \\n | /usr/lib/rpm/python.prov | sort -u
|
||||
|
||||
#
|
||||
# --- Tcl modules.
|
||||
[ -x /usr/lib/rpm/tcl.prov -a -n "$tcllist" ] &&
|
||||
echo $tcllist | tr '[:blank:]' \\n | /usr/lib/rpm/tcl.prov | sort -u
|
||||
|
||||
exit 0
|
@ -1,112 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
#
|
||||
# Auto-generate requirements for executables (both ELF and a.out) and library
|
||||
# sonames, script interpreters, and perl modules.
|
||||
#
|
||||
|
||||
ulimit -c 0
|
||||
|
||||
filelist=`sed "s/['\"]/\\\&/g"`
|
||||
exelist=`echo $filelist | xargs -r file | egrep -v ":.* (commands|script) " | \
|
||||
grep ":.*executable" | cut -d: -f1`
|
||||
scriptlist=`echo $filelist | xargs -r file | \
|
||||
egrep ":.* (commands|script) " | cut -d: -f1`
|
||||
liblist=`echo $filelist | xargs -r file | \
|
||||
grep ":.*shared object" | cut -d : -f1`
|
||||
|
||||
interplist=
|
||||
perllist=
|
||||
pythonlist=
|
||||
tcllist=
|
||||
|
||||
#
|
||||
# --- Alpha does not mark 64bit dependencies
|
||||
case `uname -m` in
|
||||
alpha*) mark64="" ;;
|
||||
*) mark64="()(64bit)" ;;
|
||||
esac
|
||||
|
||||
#
|
||||
# --- Executable sonames.
|
||||
for f in $exelist; do
|
||||
[ -r $f -a -x $f ] || continue
|
||||
lib64=`if file -L $f 2>/dev/null | \
|
||||
grep "ELF 64-bit" >/dev/null; then echo "$mark64"; fi`
|
||||
ldd $f | awk '/=>/ {
|
||||
if ($1 !~ /libNoVersion.so/ && $1 !~ /4[um]lib.so/) {
|
||||
gsub(/'\''"/,"\\&",$1);
|
||||
printf "%s'$lib64'\n", $1
|
||||
}
|
||||
}'
|
||||
done | xargs -r -n 1 basename | sort -u
|
||||
|
||||
#
|
||||
# --- Library sonames.
|
||||
for f in $liblist; do
|
||||
[ -r $f ] || continue
|
||||
lib64=`if file -L $f 2>/dev/null | \
|
||||
grep "ELF 64-bit" >/dev/null; then echo "$mark64"; fi`
|
||||
ldd $f | awk '/=>/ {
|
||||
if ($1 !~ /libNoVersion.so/ && $1 !~ /4[um]lib.so/) {
|
||||
gsub(/'\''"/,"\\&",$1);
|
||||
printf "%s'$lib64'\n", $1
|
||||
}
|
||||
}'
|
||||
done | xargs -r -n 1 basename | sort -u
|
||||
|
||||
#
|
||||
# --- Script interpreters.
|
||||
for f in $scriptlist; do
|
||||
[ -r $f -a -x $f ] || continue
|
||||
interp=`head -1 $f | sed -e 's/^\#\![ ]*//' | cut -d" " -f1`
|
||||
interplist="$interplist $interp"
|
||||
case $interp in
|
||||
*/perl) perllist="$perllist $f" ;;
|
||||
esac
|
||||
done
|
||||
[ -n "$interplist" ] && { echo "$interplist" | tr '[:blank:]' \\n | sort -u ; }
|
||||
|
||||
#
|
||||
# --- Find perl module files.
|
||||
for f in $filelist; do
|
||||
[ -r $f -a "${f%.pm}" != "${f}" ] && perllist="$perllist $f"
|
||||
done
|
||||
|
||||
#
|
||||
# --- Weak symbol versions (from glibc).
|
||||
[ -n "$mark64" ] && mark64="(64bit)"
|
||||
for f in $liblist $exelist ; do
|
||||
[ -r $f ] || continue
|
||||
lib64=`if file -L $f 2>/dev/null | \
|
||||
grep "ELF 64-bit" >/dev/null; then echo "$mark64"; fi`
|
||||
objdump -p $f | awk '
|
||||
BEGIN { START=0; LIBNAME=""; }
|
||||
/Version References:/ { START=1; }
|
||||
/required from/ && (START==1) {
|
||||
sub(/:/, "", $3);
|
||||
LIBNAME=$3;
|
||||
}
|
||||
(START==1) && (LIBNAME!="") && ($4!="") && (($4~/^GLIBC_*/) || ($4~/^GCC_*/)) {
|
||||
print LIBNAME "(" $4 ")'$lib64'";
|
||||
}
|
||||
/^$/ { START=0; }
|
||||
'
|
||||
done | sort -u
|
||||
|
||||
#
|
||||
# --- Perl modules.
|
||||
[ -x /usr/lib/rpm/perl.req -a -n "$perllist" ] && \
|
||||
echo $perllist | tr '[:blank:]' \\n | /usr/lib/rpm/perl.req | sort -u
|
||||
|
||||
#
|
||||
# --- Python modules.
|
||||
[ -x /usr/lib/rpm/python.req -a -n "$pythonlist" ] && \
|
||||
echo $pythonlist | tr '[:blank:]' \\n | /usr/lib/rpm/python.req | sort -u
|
||||
|
||||
#
|
||||
# --- Tcl modules.
|
||||
[ -x /usr/lib/rpm/tcl.req -a -n "$tcllist" ] && \
|
||||
echo $tcllist | tr '[:blank:]' \\n | /usr/lib/rpm/tcl.req | sort -u
|
||||
|
||||
exit 0
|
@ -1,56 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# If using normal root, avoid changing anything.
|
||||
if [ -z "$RPM_BUILD_ROOT" -o "$RPM_BUILD_ROOT" = "/" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
cd $RPM_BUILD_ROOT
|
||||
|
||||
# Compress man pages
|
||||
COMPRESS="gzip -9"
|
||||
COMPRESS_EXT=.gz
|
||||
|
||||
for d in ./usr/man/man* ./usr/man/*/man* ./usr/info \
|
||||
./usr/share/man/man* ./usr/share/man/*/man* ./usr/share/info \
|
||||
./usr/kerberos/man ./usr/X11R6/man/man* ./usr/lib/perl5/man/man* \
|
||||
./usr/share/doc/*/man/man* ./usr/lib/*/man/man*
|
||||
do
|
||||
[ -d $d ] || continue
|
||||
for f in `find $d -type f`
|
||||
do
|
||||
[ -f "$f" ] || continue
|
||||
[ "`basename $f`" = "dir" ] && continue
|
||||
|
||||
case "$f" in
|
||||
*.Z) gunzip $f; b=`echo $f | sed -e 's/\.Z$//'`;;
|
||||
*.gz) gunzip $f; b=`echo $f | sed -e 's/\.gz$//'`;;
|
||||
*.bz2) bunzip2 $f; b=`echo $f | sed -e 's/\.bz2$//'`;;
|
||||
*) b=$f;;
|
||||
esac
|
||||
|
||||
$COMPRESS $b </dev/null 2>/dev/null || {
|
||||
inode=`ls -i $b | awk '{ print $1 }'`
|
||||
others=`find $d -type f -inum $inode`
|
||||
if [ -n "$others" ]; then
|
||||
for afile in $others ; do
|
||||
[ "$afile" != "$b" ] && rm -f $afile
|
||||
done
|
||||
$COMPRESS -f $b
|
||||
for afile in $others ; do
|
||||
[ "$afile" != "$b" ] && ln $b$COMPRESS_EXT $afile$COMPRESS_EXT
|
||||
done
|
||||
else
|
||||
$COMPRESS -f $b
|
||||
fi
|
||||
}
|
||||
done
|
||||
|
||||
for f in `find $d -type l`
|
||||
do
|
||||
l=`ls -l $f | awk '{ print $11 }' | sed -e 's/\.gz$//' -e 's/\.bz2$//' -e 's/\.Z$//'`
|
||||
rm -f $f
|
||||
b=`echo $f | sed -e 's/\.gz$//' -e 's/\.bz2$//' -e 's/\.Z$//'`
|
||||
ln -sf $l$COMPRESS_EXT $b$COMPRESS_EXT
|
||||
done
|
||||
done
|
@ -1,12 +0,0 @@
|
||||
#!/bin/sh
|
||||
# If using normal root, avoid changing anything.
|
||||
if [ -z "$RPM_BUILD_ROOT" -o "$RPM_BUILD_ROOT" = "/" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Strip ELF binaries
|
||||
for f in `find $RPM_BUILD_ROOT -type f \( -perm -0100 -or -perm -0010 -or -perm -0001 \) -exec file {} \; | \
|
||||
grep -v ' shared object,' | \
|
||||
sed -n -e 's/^\(.*\):[ ]*ELF.*, not stripped/\1/p'`; do
|
||||
strip -g $f || :
|
||||
done
|
Loading…
Reference in New Issue
Block a user