source: projects/specs/trunk/t/texlive/find-provides-texlive.sh @ 5214

Revision 5214, 1.9 KB checked in by munepi, 12 years ago (diff)

updated texlive-vl.spec

  • Property svn:executable set to *
Line 
1#!/bin/bash
2# find-provides-texlive.sh
3# based on /usr/lib/rpm/find-provides
4
5# This script reads filenames from STDIN and outputs any relevant provides
6# information that needs to be included in the package.
7
8# VINE: newer objdump (in binutils) has translated messages,
9# so at a moment we need to set LANG to C
10
11LANG=C
12
13
14filelist=`sed "s/['\"]/\\\&/g"`
15
16solist=$(echo $filelist | grep "\\.so" | grep -v "^/lib/ld.so" | \
17        xargs file -L 2>/dev/null | grep "ELF.*shared object" | cut -d: -f1)
18pythonlist=
19tcllist=
20
21#
22# --- Alpha does not mark 64bit dependencies
23case `uname -m` in
24  alpha*)       mark64="" ;;
25  *)            mark64="()(64bit)" ;;
26esac
27
28#
29# --- Library sonames and weak symbol versions (from glibc).
30for f in $solist; do
31    soname=$(objdump -p $f | awk '/SONAME/ {print $2}')
32
33    lib64=`if file -L $f 2>/dev/null | \
34        grep "ELF 64-bit" >/dev/null; then echo "$mark64"; fi`
35    if [ "$soname" != "" ]; then
36        if [ ! -L $f ]; then
37            echo $soname$lib64
38            objdump -p $f | awk '
39                BEGIN { START=0 ; }
40                /Version definitions:/ { START=1; }
41                /^[0-9]/ && (START==1) { print $4; }
42                /^$/ { START=0; }
43            ' | \
44                grep -v $soname | \
45                while read symbol ; do
46                    echo "$soname($symbol)`echo $lib64 | sed 's/()//'`"
47                done
48        fi
49    else
50        echo ${f##*/}$lib64
51    fi
52done | sort -u
53
54# #
55# # --- Perl modules.
56# [ -x /usr/lib/rpm/perl.prov ] &&
57#     echo $filelist | tr '[:blank:]' \\n | grep '\.pm$' | /usr/lib/rpm/perl.prov | sort -u
58
59# #
60# # --- Python modules.
61# [ -x /usr/lib/rpm/python.prov -a -n "$pythonlist" ] &&
62#     echo $pythonlist | tr '[:blank:]' \\n | /usr/lib/rpm/python.prov | sort -u
63
64# #
65# # --- Tcl modules.
66# [ -x /usr/lib/rpm/tcl.prov -a -n "$tcllist" ] &&
67#     echo $tcllist | tr '[:blank:]' \\n | /usr/lib/rpm/tcl.prov | sort -u
68
69# #
70# # --- Mono modules.
71# [ -x /usr/lib/rpm/mono-find-provides -a -n "$filelist" ] &&
72#     echo $filelist | tr '[:blank:]' \\n | /usr/lib/rpm/mono-find-provides | sort -u
73
74exit 0
Note: See TracBrowser for help on using the repository browser.