summaryrefslogtreecommitdiff
path: root/packaging/find-docs.sh
blob: afe4e22b7e9a7f34f8d2a6fa85fac0c4d7a0110b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/sh

usage () {
cat << EOF
Usage: $0 TOP_DIR

EOF
exit 1
}

if [ -z "$1" ] ; then usage
elif [ $1 = / ] ; then echo $0: expects non-/ argument for '$1' 1>&2
elif [ ! -d $1 ] ; then
 echo $0: $1: no such directory
 exit 1
else TOP_DIR="`echo $1|sed -e 's:/$::'`"
fi
shift

DOC_NAME=documentation.list
touch $DOC_NAME

find $TOP_DIR -type f -o -type l | sed '
s:'"$TOP_DIR"'::
s:\(.*/man/man./.*\.[0-9]\):%doc \1:
s:\(.*/man/*/man./.*\.[0-9]\):%doc \1:
s:\(.*/gtk-doc/html/.*\):%doc \1:
s:\(.*/info/.*\info.*\):%doc \1:
s:^\([^%].*\)::
/^$/d' >> $DOC_NAME


exit 0