blob: 1fc4772f94973fd28399189e5ce06c7af0798b91 [file] [log] [blame]
LuK133752a81d52025-07-08 18:07:20 -04001#! /bin/sh
2# this script is generated by the configure-script CF_MAN_PAGES macro.
3
4prefix="/usr"
5datarootdir="${prefix}/share"
6datadir="${datarootdir}"
7
8NCURSES_MAJOR="6"
9NCURSES_MINOR="5"
10NCURSES_PATCH="20240427"
11
12NCURSES_OSPEED="short"
13TERMINFO="/system_ext/etc/terminfo"
14TERMINFO_DIRS="/system_ext/etc/terminfo"
15
16INSTALL="/usr/bin/install -c"
17INSTALL_DATA="${INSTALL} -m 644"
18
19transform="s,x,x,"
20
21TMP=${TMPDIR:=/tmp}/man$$
22trap "rm -f $TMP; exit 1" 1 2 3 15
23trap "rm -f $TMP" 0
24
25form=$1
26shift || exit 1
27
28verb=$1
29shift || exit 1
30
31mandir=$1
32shift || exit 1
33
34srcdir=$1
35top_srcdir=$srcdir/..
36shift || exit 1
37
38if test "$form" = normal ; then
39 if test "no" = yes ; then
40 if test "no" = no ; then
41 /bin/sh "$0" format "$verb" "$mandir" "$srcdir" "$@"
42 exit 0
43 fi
44 fi
45 cf_subdir=$mandir/man
46 cf_tables=no
47else
48 cf_subdir=$mandir/cat
49 cf_tables=yes
50fi
51
52# process the list of source-files
53for i in "$@" ; do
54case $i in
55(*.orig|*.rej) ;;
56(*.[0-9]*)
57 section=`expr "$i" : '.*\.\([0-9]\)[xm]*'`;
58 if test "$verb" = installing ; then
59 if test ! -d "$cf_subdir${section}" ; then
60 mkdir -p "$cf_subdir$section"
61 fi
62 fi
63
64 # replace variables in man page
65 if test ! -f "/home/micky387/Omni/external/libncurses/man_alias.sed" ; then
66cat >>/home/micky387/Omni/external/libncurses/man_alias.sed <<-CF_EOF2
67 s,@DATADIR@,$datadir,g
68 s,@TERMINFO@,${TERMINFO:="no default value"},g
69 s,@TERMINFO_DIRS@,${TERMINFO_DIRS:="no default value"},g
70 s,@NCURSES_MAJOR@,${NCURSES_MAJOR:="no default value"},g
71 s,@NCURSES_MINOR@,${NCURSES_MINOR:="no default value"},g
72 s,@NCURSES_PATCH@,${NCURSES_PATCH:="no default value"},g
73 s,@NCURSES_OSPEED@,${NCURSES_OSPEED:="no default value"},g
74s,@CAPTOINFO@,captoinfo,g
75s,@CLEAR@,clear,g
76s,@INFOCMP@,infocmp,g
77s,@INFOTOCAP@,infotocap,g
78s,@RESET@,reset,g
79s,@TABS@,tabs,g
80s,@TIC@,tic,g
81s,@TOE@,toe,g
82s,@TPUT@,tput,g
83s,@TSET@,tset,g
84CF_EOF2
85 echo "...made /home/micky387/Omni/external/libncurses/man_alias.sed"
86 fi
87
88 aliases=
89 cf_source=`basename "$i"`
90 cf_full_alias=$cf_source
91 test ! -f "$cf_full_alias" && cf_full_alias="$srcdir/$cf_full_alias"
92 if test ! -f "$cf_full_alias" ; then
93 echo ".. skipped $cf_source"
94 continue
95 fi
96 nCurses=ignore.3x
97 cf_part_alias=`echo $cf_full_alias| sed -e 's,^.*/,,'`
98 test "yes" = yes && nCurses=ncurses.3x
99 aliases=`sed -f "$top_srcdir/man/manlinks.sed" "$cf_full_alias" |sed -f "/home/micky387/Omni/external/libncurses/man_alias.sed" | sort -u; test "$cf_part_alias" = "$nCurses" && echo curses`
100 cf_target=`grep "^$cf_source" /home/micky387/Omni/external/libncurses/man/man_db.renames | mawk '{print $2}'`
101 if test -z "$cf_target" ; then
102 echo "? missing rename for $cf_source"
103 cf_target="$cf_source"
104 fi
105 cf_target="$cf_subdir${section}/${cf_target}"
106
107 sed -f "/home/micky387/Omni/external/libncurses/man_alias.sed" \
108 < "$i" | sed -f /home/micky387/Omni/external/libncurses/edit_man.sed >$TMP
109if test $cf_tables = yes ; then
110 tbl $TMP >$TMP.out
111 mv $TMP.out $TMP
112fi
113 if test "$form" = format ; then
114 nroff -man $TMP >$TMP.out
115 mv $TMP.out $TMP
116 fi
117 if test "$verb" = installing ; then
118 if ( "gzip" -f $TMP )
119 then
120 mv $TMP.gz $TMP
121 fi
122 fi
123 cf_target="$cf_target.gz"
124 suffix=`basename "$cf_target" | sed -e 's%^[^.]*%%'`
125 extra_suffix=
126 if test -n "" ; then
127 case $cf_target in
128 (*$suffix)
129 extra_suffix=""
130 ;;
131 esac
132 fi
133 if test "$verb" = installing ; then
134 echo "$verb $cf_target"
135 $INSTALL_DATA $TMP "$cf_target"
136 test -d "$cf_subdir${section}" &&
137 test -n "$aliases" && (
138 cd "$cf_subdir${section}" && (
139 cf_source=`echo "$cf_target" |sed -e 's%^.*/\([^/][^/]*/[^/][^/]*$\)%\1%'`
140 test -n "gz" && cf_source=`echo "$cf_source" |sed -e 's%\.gz$%%'`
141 cf_target=`basename "$cf_target"`
142 for cf_alias in $aliases
143 do
144 if test "$section" = 1 ; then
145 cf_alias=`echo "$cf_alias" |sed "${transform}"`
146 fi
147 cf_alias="${cf_alias}${extra_suffix}"
148
149 if test "yes" = yes ; then
150 if test -f "$cf_alias${suffix}" ; then
151 if ( cmp -s "$cf_target" "$cf_alias${suffix}" )
152 then
153 continue
154 fi
155 fi
156 echo ".. $verb alias $cf_alias${suffix}"
157 ln -s -f "$cf_target" "$cf_alias${suffix}"
158 elif test "$cf_target" != "$cf_alias${suffix}" ; then
159 echo ".so $cf_source" >$TMP
160 if test -n "gz" ; then
161 "gzip" -n -f $TMP
162 mv $TMP.gz $TMP
163 fi
164 echo ".. $verb alias $cf_alias${suffix}"
165 rm -f "$cf_alias${suffix}"
166 $INSTALL_DATA $TMP "$cf_alias${suffix}"
167 fi
168 done
169 )
170 )
171 elif test "$verb" = removing ; then
172 test -f "$cf_target" && (
173 echo "$verb $cf_target"
174 rm -f "$cf_target"
175 )
176 test -d "$cf_subdir${section}" &&
177 test -n "$aliases" && (
178 cd "$cf_subdir${section}" && (
179 for cf_alias in $aliases
180 do
181 if test "$section" = 1 ; then
182 cf_alias=`echo "$cf_alias" |sed "${transform}"`
183 fi
184 cf_alias="${cf_alias}${extra_suffix}"
185
186 echo ".. $verb alias $cf_alias${suffix}"
187 rm -f "$cf_alias${suffix}"
188 done
189 )
190 )
191 else
192# echo ".hy 0"
193 cat $TMP
194 fi
195 ;;
196esac
197done
198
199if test "no" = yes ; then
200if test "$form" != format ; then
201 /bin/sh "$0" format "$verb" "$mandir" "$srcdir" "$@"
202fi
203fi
204
205exit 0