Add support for global LDFLAGS
[platform/upstream/rpm.git] / packaging / find-docs.sh
1 #!/bin/sh
2
3 usage () {
4 cat << EOF
5 Usage: $0 TOP_DIR
6
7 EOF
8 exit 1
9 }
10
11 if [ -z "$1" ] ; then usage
12 elif [ $1 = / ] ; then echo $0: expects non-/ argument for '$1' 1>&2
13 elif [ ! -d $1 ] ; then
14  echo $0: $1: no such directory
15  exit 1
16 else TOP_DIR="`echo $1|sed -e 's:/$::'`"
17 fi
18 shift
19
20 DOC_NAME=documentation.list
21 touch $DOC_NAME
22
23 find $TOP_DIR -type f -o -type l | sed '
24 s:'"$TOP_DIR"'::
25 s:\(.*/man/man./.*\.[0-9]\):%doc \1:
26 s:\(.*/man/*/man./.*\.[0-9]\):%doc \1:
27 s:\(.*/gtk-doc/html/.*\):%doc \1:
28 s:\(.*/info/.*\info.*\):%doc \1:
29 s:^\([^%].*\)::
30 /^$/d' >> $DOC_NAME
31
32
33 exit 0