This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Populate metaconfig branch.
[metaconfig.git] / U / installdirs / man3dir.U
1 ?RCS: $Id: man3dir.U,v 3.1 1999/07/08 20:52:19 doughera Exp doughera $
2 ?RCS:
3 ?RCS: Copyright (c) 1996-1999, Andy Dougherty
4 ?RCS: Copyright (c) 1991-1993, Raphael Manfredi
5 ?RCS: 
6 ?RCS: You may redistribute only under the terms of the Artistic Licence,
7 ?RCS: as specified in the README file that comes with the distribution.
8 ?RCS: You may reuse parts of this distribution only within the terms of
9 ?RCS: that same Artistic Licence; a copy of which may be found at the root
10 ?RCS: of the source tree for dist 3.0.
11 ?RCS:
12 ?RCS: $Log: man3dir.U,v $
13 ?RCS: Revision 3.1  1999/07/08 20:52:19  doughera
14 ?RCS: Updated for perl5.005_5x
15 ?RCS:
16 ?RCS: Revision 3.0.1.1  1997/02/28  16:10:34  ram
17 ?RCS: patch61: created
18 ?RCS:
19 ?X:
20 ?X:     This was originally specific to perl5.  Since perl5 has man pages that
21 ?X:     go in both man1/ and man3/ directories, we need both man1dir
22 ?X:     and man3dir.  This unit is basically dist's mansrc.U with 
23 ?X:     man3 used instead of man everywhere.
24 ?X:     I then added various tests because perl5 has *lots* of man3 
25 ?X:     pages with long file names. -- ADO
26 ?X:
27 ?MAKE:man3dir man3direxp man3ext installman3dir: cat nroff Loc Oldconfig \
28         sed man1dir spackage package Getfile prefix Prefixit Prefixup \
29         installprefix d_flexfnam privlib Myread test
30 ?MAKE:  -pick add $@ %<
31 ?Y:TOP
32 ?S:man3dir:
33 ?S:     This variable contains the name of the directory in which manual
34 ?S:     source pages are to be put.  It is the responsibility of the
35 ?S:     Makefile.SH to get the value of this into the proper command.
36 ?S:     You must be prepared to do the ~name expansion yourself.
37 ?S:.
38 ?S:man3direxp:
39 ?S:     This variable is the same as the man3dir variable, but is filename
40 ?S:     expanded at configuration time, for convenient use in makefiles.
41 ?S:.
42 ?S:installman3dir:
43 ?S:     This variable is really the same as man3direxp, unless you are using
44 ?S:     AFS in which case it points to the read/write location whereas
45 ?S:     man3direxp only points to the read-only access location. For extra
46 ?S:     portability, you should only use this variable within your makefiles.
47 ?S:.
48 ?S:man3ext:
49 ?S:     This variable contains the extension that the manual page should
50 ?S:     have: one of 'n', 'l', or '3'.  The Makefile must supply the '.'.
51 ?S:     See man3dir.
52 ?S:.
53 ?T:prog tdflt
54 : determine where library module manual pages go
55 set man3dir man3dir none
56 eval $prefixit
57 $cat <<EOM
58
59 $spackage has manual pages for many of the library modules.
60 EOM
61
62 case "$nroff" in
63 nroff)
64         $cat <<'EOM'
65 However, you don't have nroff, so they're probably useless to you.
66 EOM
67         case "$man3dir" in
68         '') man3dir="none";;
69         esac;;
70 esac
71
72 case "$d_flexfnam" in
73 undef)
74         $cat <<'EOM'
75 However, your system can't handle the long file names like File::Basename.3. 
76 EOM
77         case "$man3dir" in
78         '') man3dir="none";;
79         esac;;
80 esac
81
82 echo "If you don't want the manual sources installed, answer 'none'."
83 ?X: In 5.005_57 and earlier, I had the following notes:
84 ?X: We dont use /usr/local/man/man3 because some man programs will
85 ?X: only show the /usr/local/man/man3 contents, and not the system ones,
86 ?X: thus man less will show the perl module less.pm, but not the system
87 ?X: less command.  We might also conflict with TCL man pages.
88 ?X: However, something like /opt/perl/man/man3 is fine.
89 ?X:
90 ?X: However, opinion seems to be shifting such that 'man POSIX' ought
91 ?X: to just work.  -- Andy Dougherty  July 8, 1999
92 ?X:
93 ?X: remove any trailing -3.0 or other version indification from $package
94 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
95 case "$man3dir" in
96 '')     dflt=`echo $man1dir | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
97         if $test -d "$privlib/man/man3"; then
98                 cat <<EOM >&4
99
100 WARNING:  Previous versions of perl installed man3 pages into
101 $privlib/man/man3.  This version will suggest a 
102 new default of $dflt.  
103 EOM
104                 tdflt=$dflt
105                 dflt='n'
106                 rp='Do you wish to preserve the old behavior?(y/n)'
107                 . ./myread
108                 case "$ans" in
109                 y*) dflt="$privlib/man/man3" ;;
110                 *)  dflt=$tdflt ;;
111                 esac
112     fi
113         ;;
114 ' ') dflt=none;;
115 *)      dflt="$man3dir" ;;
116 esac
117 echo " "
118 fn=dn+~
119 rp="Where do the $package library man pages (source) go?"
120 . ./getfile
121 man3dir="$ans"
122 man3direxp="$ansexp"
123 case "$man1dir" in
124 '')     man3dir=' '
125         installman3dir='';;
126 esac
127
128 : Change installation prefix, if necessary.
129 if $test X"$prefix" != X"$installprefix"; then
130         installman3dir=`echo $man3direxp | $sed 's#^$prefix#$installprefix#'`
131 else
132         installman3dir="$man3direxp"
133 fi
134
135 : What suffix to use on installed man pages
136 case "$man3dir" in
137 ' ')
138         man3ext='0'
139         ;;
140 *)
141         rp="What suffix should be used for the $package library man pages?"
142         case "$man3ext" in
143         '')     case "$man3dir" in
144                 *3)  dflt=3 ;;
145                 *3p) dflt=3p ;;
146                 *3pm) dflt=3pm ;;
147                 *l) dflt=l;;
148                 *n) dflt=n;;
149                 *o) dflt=o;;
150                 *p) dflt=p;;
151                 *C) dflt=C;;
152                 *L) dflt=L;;
153                 *L3) dflt=L3;;
154                 *) dflt=3;;
155                 esac
156                 ;;
157         *)      dflt="$man3ext";;
158         esac
159         . ./myread
160         man3ext="$ans"
161         ;;
162 esac
163