Added all of the MH sources, including RCS files, in
[mmh] / docs / historical / mh-6.8.5 / support / general / RCS / bootmhn.sh,v
1 head    1.10;
2 access;
3 symbols;
4 locks; strict;
5 comment @# @;
6
7
8 1.10
9 date    96.02.09.01.29.45;      author jromine; state Exp;
10 branches;
11 next    1.8;
12
13 1.8
14 date    95.12.06.21.00.46;      author jromine; state Exp;
15 branches;
16 next    1.7;
17
18 1.7
19 date    95.12.06.20.57.55;      author jromine; state Exp;
20 branches;
21 next    1.6;
22
23 1.6
24 date    93.08.20.15.48.51;      author jromine; state Exp;
25 branches;
26 next    1.5;
27
28 1.5
29 date    92.11.16.22.32.36;      author jromine; state Exp;
30 branches;
31 next    1.4;
32
33 1.4
34 date    92.11.02.21.58.59;      author jromine; state Exp;
35 branches;
36 next    1.3;
37
38 1.3
39 date    92.10.26.16.58.14;      author jromine; state Exp;
40 branches;
41 next    1.2;
42
43 1.2
44 date    92.10.26.16.43.45;      author jromine; state Exp;
45 branches;
46 next    1.1;
47
48 1.1
49 date    92.10.26.16.42.30;      author jromine; state Exp;
50 branches;
51 next    ;
52
53
54 desc
55 @@
56
57
58 1.10
59 log
60 @fix id
61 @
62 text
63 @: run this script through /bin/sh
64 : '$Id:$'
65
66 if [ -z "$1" ]; then
67     echo "usage: bootmhn.sh MH-library-area" 1>&2
68     exit 1
69 fi
70 LIB="$1"
71 MHN="$LIB/mhn_defaults"
72
73 if [ -s $MHN ]; then
74     echo "%s: already exists." 1>&2
75     exit 1
76 fi
77 TMP=/tmp/mhn$$
78 trap "rm -f $TMP" 0 1 2 3 13 15
79
80 echo "mhn-store-text: %m%P.txt" >> $TMP
81 echo "mhn-store-text/richtext: %m%P.rt" >> $TMP
82 echo "mhn-store-video/mpeg: %m%P.mpg" >> $TMP
83 echo "mhn-store-application/PostScript: %m%P.ps" >> $TMP
84 echo "mhn-show-application/pgp: %ppgpshow -show '%F' %a" >> $TMP
85 echo "mhn-store-application/pgp: | pgpshow -store %m%P.pgp %a" >> $TMP
86 echo "mhn-show-text/pgp: %ppgpshow -show '%F' %a" >> $TMP
87 echo "mhn-store-text/pgp: | pgpshow -store %m%P.txt %a" >> $TMP
88
89 PGM="`./bootmhn.findit xwud $LIB`"
90 if [ ! -z "$PGM" ]; then
91     XWUD="$PGM" X11DIR="`echo $PGM | awk -F/ '{ for(i=2;i<NF;i++)printf "/%s", $i;}'`"/
92 else
93     XWUD= X11DIR=
94 fi
95
96 PGM="`./bootmhn.findit pbmtoxwd $LIB`"
97 if [ ! -z "$PGM" ]; then
98     PBM="$PGM" PBMDIR="`echo $PGM | awk -F/ '{ for(i=2;i<NF;i++)printf "/%s", $i;}'`"/
99 else
100     PBM= PBMDIR=
101 fi
102
103 PGM="`./bootmhn.findit xv $LIB`"
104 if [ ! -z "$PGM" ]; then
105     echo "\
106 mhn-show-image: %p$PGM -geometry =-0+0 '%f'" >> $TMP
107 elif [ ! -z $"PBM" -a ! -z "$XWUD" ]; then
108     echo "\
109 mhn-show-image/gif: %p${PBMDIR}giftoppm | ${PBMDIR}ppmtopgm | ${PBMDIR}pgmtopbm | ${PBMDIR}pbmtoxwd | $XWUD -geometry =-0+0
110 mhn-show-image/x-pbm: %p${PBMDIR}pbmtoxwd | $XWUD -geometry =-0+0
111 mhn-show-image/x-pgm: %p${PBMDIR}pgmtopbm | ${PBMDIR}pbmtoxwd | $XWUD -geometry =-0+0
112 mhn-show-image/x-ppm: %p${PBMDIR}ppmtopgm | ${PBMDIR}pgmtopbm | ${PBMDIR}pbmtoxwd | $XWUD -geometry =-0+0
113 mhn-show-image/x-xwd: %p$XWUD -geometry =-0+0" >> $TMP
114
115     PGM="`./bootmhn.findit djpeg $LIB`"
116     if [ ! -z "$PGM" ]; then
117         echo "\
118 mhn-show-image/jpeg: %p$PGM -Pg | ${PBMDIR}ppmtopgm | ${PBMDIR}pgmtopbm | ${PBMDIR}pbmtoxwd | $XWUD -geometry =-0+0" >> $TMP
119     fi
120 fi
121
122 if [ -f "/dev/audioIU" ]; then
123     PGM="`./bootmhn.findit recorder $LIB`"
124     if [ ! -z "$PGM" ]; then
125         echo "\
126 mhn-store-audio/basic: %m%P.au
127 mhn-compose-audio/basic: ${AUDIODIR}recorder '%f' -au -pause > /dev/tty
128 mhn-show-audio/basic: %p${AUDIODIR}splayer -au" >> $TMP
129     fi
130 elif [ -f "/dev/audio" ]; then
131     PGM="`./bootmhn.findit raw2audio $LIB`"
132     if [ ! -z "$PGM" ]; then
133         AUDIODIR="`echo $PGM | awk -F/ '{ for(i=2;i<NF;i++)printf "/%s", $i;}'`"/
134         echo "\
135 mhn-store-audio/basic: | ${AUDIODIR}raw2audio -e ulaw -s 8000 -c 1 > %m%P.au
136 mhn-store-audio/x-next: %m%P.au" >> $TMP
137         AUDIOTOOL="`./bootmhn.findit audiotool $LIB`"
138         if [ ! -z "$AUDIOTOOL" ]; then
139             echo "\
140 mhn-compose-audio/basic: $AUDIOTOOL %f && ${AUDIODIR}raw2audio -F < %f" >> $TMP
141         else
142             echo "\
143 mhn-compose-audio/basic: trap \"exit 0\" 2 && ${AUDIODIR}record | ${AUDIODIR}raw2audio -F" >> $TMP
144         fi
145         echo "\
146 mhn-show-audio/basic: %p${AUDIODIR}raw2audio 2>/dev/null | ${AUDIODIR}play" >> $TMP
147
148         PGM="`./bootmhn.findit adpcm_enc $LIB`"
149         if [ ! -z "$PGM" ]; then
150             DIR="`echo $PGM | awk -F/ '{ for(i=2;i<NF;i++)printf "/%s", $i;}'`"/
151             if [ ! -z "$AUDIOTOOL" ]; then
152                 echo "\
153 mhn-compose-audio/x-next: $AUDIOTOOL %f && ${DIR}adpcm_enc < %f" >> $TMP
154             else
155                 echo "\
156 mhn-compose-audio/x-next: ${AUDIODIR}record | ${DIR}adpcm_enc" >> $TMP
157             fi
158             echo "\
159 mhn-show-audio/x-next: %p${DIR}adpcm_dec | ${AUDIODIR}play" >> $TMP
160         else
161             if [ ! -z "$AUDIOTOOL" ]; then
162                 echo "\
163 mhn-compose-audio/x-next: $AUDIOTOOL %f" >> $TMP
164             else
165                 echo "\
166 mhn-compose-audio/x-next: ${AUDIODIR}record" >> $TMP
167             fi
168             echo "\
169 mhn-show-audio/x-next: %p${AUDIODIR}play" >> $TMP
170         fi
171     else
172         echo "\
173 mhn-compose-audio/basic: cat < /dev/audio
174 mhn-show-audio/basic: %pcat > /dev/audio" >> $TMP
175     fi
176 fi
177
178 PGM="`./bootmhn.findit mpeg_play $LIB`"
179 if [ ! -z "$PGM" ]; then
180         echo "\
181 mhn-show-video/mpeg: %p$PGM '%f'" >> $TMP
182 fi
183
184 PGM="`./bootmhn.findit lpr $LIB`"
185 if [ ! -z "$PGM" ]; then
186         echo "\
187 mhn-show-application/PostScript: %plpr -Pps" >> $TMP    
188 else
189     PGM="`./bootmhn.findit lp $LIB`"
190     if [ ! -z "$PGM" ]; then    
191         echo "\
192 mhn-show-application/PostScript: %plp -dps" >> $TMP    
193     fi
194 fi
195
196 PGM="`./bootmhn.findit ivs_replay $LIB`"
197 if [ ! -z "$PGM" ]; then
198         echo "\
199 mhn-show-application/x-ivs: %p$PGM -o '%F'" >> $TMP
200 fi
201
202 PGM="`./bootmhn.findit richtext $LIB`"
203 if [ ! -z "$PGM" ]; then
204         echo "\
205 mhn-show-text/richtext: %p$PGM -p '%F'" >> $TMP
206 else
207     PGM="`./bootmhn.findit rt2raw $LIB`"
208     if [ ! -z "$PGM" ]; then
209         echo "\
210 mhn-show-text/richtext: %p$PGM < '%f' | fmt -78 | more" >> $TMP
211     fi
212 fi
213
214 PGM="`./bootmhn.findit xterm $LIB`"
215 if [ ! -z "$PGM" ]; then
216         echo "\
217 mhn-charset-iso-8859-1: xterm -fn '-*-*-medium-r-normal-*-*-120-*-*-c-*-iso8859-*' -e %s" >> $TMP
218 fi
219
220 sort < $TMP > $MHN
221 chmod 644 $MHN
222
223 exit 0
224
225 : not until we get a "safe" postscript environment...
226
227 PGM="`./bootmhn.findit pageview $LIB`"
228 if [ "$DISPLAY" = "unix:0.0" -a ! -z "$PGM" ]; then
229     echo "mhn-show-application/PostScript: %p$PGM -" >> $TMP    
230 else
231     PGM="`./bootmhn.findit gs $LIB`"
232     if [ ! -z "$PGM" ]; then
233         echo "mhn-show-application/PostScript: %p$PGM -- '%F'" >> $TMP
234     fi
235 fi
236
237 : have to experiment more with this
238
239 PGM="`./bootmhn.findit ivs_record $LIB`"
240 if [ ! -z "$PGM" ]; then
241         echo "\
242 mhn-compose-application/x-ivs: $PGM -u localhost '%F'" >> $TMP
243 fi
244 @
245
246
247 1.8
248 log
249 @more pgp fixes from mtr
250 @
251 text
252 @d2 1
253 a2 1
254 : '$Id'
255 @
256
257
258 1.7
259 log
260 @pgp changes from mtr
261 @
262 text
263 @d24 2
264 @
265
266
267 1.6
268 log
269 @fixes from mtr:
270         mpeg support
271         better audio support
272 @
273 text
274 @d22 2
275 @
276
277
278 1.5
279 log
280 @fixes from mtr
281 @
282 text
283 @d19 2
284 d71 8
285 d80 1
286 a80 2
287 mhn-compose-audio/basic: ${AUDIODIR}record | ${AUDIODIR}raw2audio -F
288 mhn-show-audio/basic: %p${AUDIODIR}raw2audio 2>/dev/null | play" >> $TMP
289 d85 7
290 a92 1
291 mhn-compose-audio/x-next: ${AUDIODIR}record | ${DIR}adpcm_enc
292 d95 7
293 a102 1
294 mhn-compose-audio/x-next: ${AUDIODIR}record
295 d110 6
296 @
297
298
299 1.4
300 log
301 @use [ -f ...] instead of -x/-c since those options aren't present everywhere
302 @
303 text
304 @d103 6
305 d124 1
306 a124 1
307 mhn-charset-iso-8859-1: xterm -fn '-*-*-medium-r-normal-*-*-120-*-*-*-*-iso8859-*' -e %s" >> $TMP
308 d142 8
309 @
310
311
312 1.3
313 log
314 @add single quotes around %f
315 @
316 text
317 @d54 1
318 a54 1
319 if [ -c "/dev/audioIU" ]; then
320 d62 1
321 a62 1
322 elif [ -c "/dev/audio" ]; then
323 @
324
325
326 1.2
327 log
328 @new version from MTR
329 @
330 text
331 @d38 1
332 a38 1
333 mhn-show-image: %p$PGM -geometry =-0+0 %f" >> $TMP
334 d59 1
335 a59 1
336 mhn-compose-audio/basic: ${AUDIODIR}recorder %f -au -pause > /dev/tty
337 d106 1
338 a106 1
339 mhn-show-text/richtext: %p$PGM -p %F" >> $TMP
340 d111 1
341 a111 1
342 mhn-show-text/richtext: %p$PGM < %f | fmt -78 | more" >> $TMP
343 d134 1
344 a134 1
345         echo "mhn-show-application/PostScript: %p$PGM -- %F" >> $TMP
346 @
347
348
349 1.1
350 log
351 @Initial revision
352 @
353 text
354 @d2 1
355 a2 1
356 : '$Id$'
357 d54 9
358 a62 1
359 if [ -c "/dev/audio" ]; then
360 a87 8
361     fi
362 elif [ -c "/dev/audioIU" ]; then
363     PGM="`./bootmhn.findit recorder $LIB`"
364     if [ ! -z "$PGM" ]; then
365         echo "\
366 mhn-store-audio/basic: %m%P.au
367 mhn-compose-audio/basic: ${AUDIODIR}recorder %f -au -pause > /dev/tty
368 mhn-show-audio/basic: %p${AUDIODIR}splayer -au" >> $TMP
369 @