libnfsidmap: updated to 0.25
[tomato.git] / release / src / router / libncurses / edit_man.sh
blob192c3437b6cd74c19f7b6002e1d1eaf24bd29971
1 #! /bin/sh
2 # this script is generated by the configure-script CF_MAN_PAGES macro.
4 prefix="/usr"
5 datadir="${prefix}/share"
7 NCURSES_MAJOR="5"
8 NCURSES_MINOR="9"
9 NCURSES_PATCH="20110404"
11 NCURSES_OSPEED="short"
12 TERMINFO="/usr/share/terminfo"
14 INSTALL="/usr/bin/install -c"
15 INSTALL_DATA="${INSTALL} -m 644"
17 transform="s,x,x,"
19 TMP=${TMPDIR:=/tmp}/man$$
20 trap "rm -f $TMP" 0 1 2 5 15
22 form=$1
23 shift || exit 1
25 verb=$1
26 shift || exit 1
28 mandir=$1
29 shift || exit 1
31 srcdir=$1
32 top_srcdir=$srcdir/..
33 shift || exit 1
35 if test "$form" = normal ; then
36 if test "no" = yes ; then
37 if test "no" = no ; then
38 sh $0 format $verb $mandir $srcdir $*
39 exit 0
42 cf_subdir=$mandir/man
43 cf_tables=no
44 else
45 cf_subdir=$mandir/cat
46 cf_tables=yes
49 # process the list of source-files
50 for i in $* ; do
51 case $i in #(vi
52 *.orig|*.rej) ;; #(vi
53 *.[0-9]*)
54 section=`expr "$i" : '.*\.\([0-9]\)[xm]*'`;
55 if test $verb = installing ; then
56 if test ! -d $cf_subdir${section} ; then
57 mkdir -p $cf_subdir$section
61 # replace variables in man page
62 if test ! -f /raid1/tomato/tomato.git.121AC/release.ar.wp/src/router/libncurses/man_alias.sed ; then
63 cat >>/raid1/tomato/tomato.git.121AC/release.ar.wp/src/router/libncurses/man_alias.sed <<-CF_EOF2
64 s,@DATADIR@,$datadir,g
65 s,@TERMINFO@,$TERMINFO,g
66 s,@NCURSES_MAJOR@,$NCURSES_MAJOR,g
67 s,@NCURSES_MINOR@,$NCURSES_MINOR,g
68 s,@NCURSES_PATCH@,$NCURSES_PATCH,g
69 s,@NCURSES_OSPEED@,$NCURSES_OSPEED,g
70 s,@CAPTOINFO@,captoinfo,g
71 s,@CLEAR@,clear,g
72 s,@INFOCMP@,infocmp,g
73 s,@INFOTOCAP@,infotocap,g
74 s,@TABS@,tabs,g
75 s,@TIC@,tic,g
76 s,@TOE@,toe,g
77 s,@TPUT@,tput,g
78 s,@TSET@,tset,g
79 CF_EOF2
80 echo "...made /raid1/tomato/tomato.git.121AC/release.ar.wp/src/router/libncurses/man_alias.sed"
83 aliases=
84 cf_source=`basename $i`
85 inalias=$cf_source
86 test ! -f $inalias && inalias="$srcdir/$inalias"
87 if test ! -f $inalias ; then
88 echo .. skipped $cf_source
89 continue
91 aliases=`sed -f $top_srcdir/man/manlinks.sed $inalias |sed -f /raid1/tomato/tomato.git.121AC/release.ar.wp/src/router/libncurses/man_alias.sed | sort -u`
92 cf_target=`grep "^$cf_source" /raid1/tomato/tomato.git.121AC/release.ar.wp/src/router/libncurses/man/man_db.renames | mawk '{print $2}'`
93 if test -z "$cf_target" ; then
94 echo '? missing rename for '$cf_source
95 cf_target="$cf_source"
97 cf_target="$cf_subdir${section}/${cf_target}"
99 sed -f /raid1/tomato/tomato.git.121AC/release.ar.wp/src/router/libncurses/man_alias.sed \
100 < $i | sed -f /raid1/tomato/tomato.git.121AC/release.ar.wp/src/router/libncurses/edit_man.sed >$TMP
101 if test $cf_tables = yes ; then
102 tbl $TMP >$TMP.out
103 mv $TMP.out $TMP
105 if test $form = format ; then
106 nroff -man $TMP >$TMP.out
107 mv $TMP.out $TMP
109 if test $verb = installing ; then
110 if ( gzip -f $TMP )
111 then
112 mv $TMP.gz $TMP
115 cf_target="$cf_target.gz"
116 suffix=`basename $cf_target | sed -e 's%^[^.]*%%'`
117 if test $verb = installing ; then
118 echo $verb $cf_target
119 $INSTALL_DATA $TMP $cf_target
120 test -d $cf_subdir${section} &&
121 test -n "$aliases" && (
122 cd $cf_subdir${section} && (
123 cf_source=`echo $cf_target |sed -e 's%^.*/\([^/][^/]*/[^/][^/]*$\)%\1%'`
124 test -n "gz" && cf_source=`echo $cf_source |sed -e 's%\.gz$%%'`
125 cf_target=`basename $cf_target`
126 for cf_alias in $aliases
128 if test $section = 1 ; then
129 cf_alias=`echo $cf_alias|sed "${transform}"`
132 if test "yes" = yes ; then
133 if test -f $cf_alias${suffix} ; then
134 if ( cmp -s $cf_target $cf_alias${suffix} )
135 then
136 continue
139 echo .. $verb alias $cf_alias${suffix}
140 ln -s -f $cf_target $cf_alias${suffix}
141 elif test "$cf_target" != "$cf_alias${suffix}" ; then
142 echo ".so $cf_source" >$TMP
143 if test -n "gz" ; then
144 gzip -f $TMP
145 mv $TMP.gz $TMP
147 echo .. $verb alias $cf_alias${suffix}
148 rm -f $cf_alias${suffix}
149 $INSTALL_DATA $TMP $cf_alias${suffix}
151 done
154 elif test $verb = removing ; then
155 test -f $cf_target && (
156 echo $verb $cf_target
157 rm -f $cf_target
159 test -d $cf_subdir${section} &&
160 test -n "$aliases" && (
161 cd $cf_subdir${section} && (
162 for cf_alias in $aliases
164 if test $section = 1 ; then
165 cf_alias=`echo $cf_alias|sed "${transform}"`
168 echo .. $verb alias $cf_alias${suffix}
169 rm -f $cf_alias${suffix}
170 done
173 else
174 # echo ".hy 0"
175 cat $TMP
178 esac
179 done
181 if test no = yes ; then
182 if test $form != format ; then
183 sh $0 format $verb $mandir $srcdir $*
187 exit 0