Commit | Line | Data |
---|---|---|
959f3c4c JH |
1 | ?RCS: $Id: scriptdir.U,v 3.1 1999/07/09 18:20:13 doughera Exp doughera $ |
2 | ?RCS: | |
3 | ?RCS: Copyright (c) 1991-1993, Raphael Manfredi | |
bbf326f0 | 4 | ?RCS: |
959f3c4c JH |
5 | ?RCS: You may redistribute only under the terms of the Artistic Licence, |
6 | ?RCS: as specified in the README file that comes with the distribution. | |
7 | ?RCS: You may reuse parts of this distribution only within the terms of | |
8 | ?RCS: that same Artistic Licence; a copy of which may be found at the root | |
9 | ?RCS: of the source tree for dist 3.0. | |
10 | ?RCS: | |
11 | ?RCS: $Log: scriptdir.U,v $ | |
12 | ?RCS: Revision 3.1 1999/07/09 18:20:13 doughera | |
13 | ?RCS: Updated for installprefix | |
14 | ?RCS: | |
15 | ?RCS: Revision 3.0.1.3 1995/09/25 09:17:15 ram | |
16 | ?RCS: patch59: unit is now forced to the top of Configure, if possible | |
17 | ?RCS: | |
18 | ?RCS: Revision 3.0.1.2 1995/01/30 14:46:13 ram | |
19 | ?RCS: patch49: can now handle installation prefix changes (from WED) | |
20 | ?RCS: | |
21 | ?RCS: Revision 3.0.1.1 1994/08/29 16:32:04 ram | |
22 | ?RCS: patch32: now uses installation prefix | |
23 | ?RCS: | |
24 | ?RCS: Revision 3.0 1993/08/18 12:09:45 ram | |
25 | ?RCS: Baseline for dist 3.0 netwide release. | |
26 | ?RCS: | |
27 | ?MAKE:scriptdir scriptdirexp installscript: cat test Getfile Loc \ | |
bbf326f0 | 28 | Oldconfig +bin sed Prefixit Setprefixvar prefixexp Prefixup |
959f3c4c | 29 | ?MAKE: -pick add $@ %< |
bbf326f0 | 30 | ?LINT:change prefixvar |
959f3c4c | 31 | ?Y:TOP |
bbf326f0 | 32 | ?D:scriptdir='' |
959f3c4c JH |
33 | ?S:scriptdir: |
34 | ?S: This variable holds the name of the directory in which the user wants | |
35 | ?S: to put publicly scripts for the package in question. It is either | |
36 | ?S: the same directory as for binaries, or a special one that can be | |
37 | ?S: mounted across different architectures, like /usr/share. Programs | |
38 | ?S: must be prepared to deal with ~name expansion. | |
39 | ?S:. | |
bbf326f0 | 40 | ?D:scriptdirexp='' |
959f3c4c JH |
41 | ?S:scriptdirexp: |
42 | ?S: This variable is the same as scriptdir, but is filename expanded | |
43 | ?S: at configuration time, for programs not wanting to bother with it. | |
44 | ?S:. | |
45 | ?S:installscript: | |
46 | ?S: This variable is usually the same as scriptdirexp, unless you are on | |
47 | ?S: a system running AFS, in which case they may differ slightly. You | |
48 | ?S: should always use this variable within your makefiles for portability. | |
49 | ?S:. | |
50 | ?C:SCRIPTDIR: | |
51 | ?C: This symbol holds the name of the directory in which the user wants | |
52 | ?C: to put publicly executable scripts for the package in question. It | |
53 | ?C: is often a directory that is mounted across diverse architectures. | |
54 | ?C: Programs must be prepared to deal with ~name expansion. | |
55 | ?C:. | |
56 | ?C:SCRIPTDIR_EXP: | |
57 | ?C: This is the same as SCRIPTDIR, but is filename expanded at | |
58 | ?C: configuration time, for use in programs not prepared to do | |
59 | ?C: ~name substitutions at run-time. | |
60 | ?C:. | |
61 | ?H:#define SCRIPTDIR "$scriptdir" /**/ | |
62 | ?H:#define SCRIPTDIR_EXP "$scriptdirexp" /**/ | |
63 | ?H:. | |
9f98f5fb | 64 | ?T:installscriptdir |
959f3c4c JH |
65 | : determine where public executable scripts go |
66 | set scriptdir scriptdir | |
67 | eval $prefixit | |
68 | case "$scriptdir" in | |
69 | '') | |
70 | dflt="$bin" | |
71 | : guess some guesses | |
72 | $test -d /usr/share/scripts && dflt=/usr/share/scripts | |
73 | $test -d /usr/share/bin && dflt=/usr/share/bin | |
74 | $test -d /usr/local/script && dflt=/usr/local/script | |
75 | $test -d /usr/local/scripts && dflt=/usr/local/scripts | |
76 | $test -d $prefixexp/script && dflt=$prefixexp/script | |
77 | set dflt | |
78 | eval $prefixup | |
79 | ;; | |
80 | *) dflt="$scriptdir" | |
81 | ;; | |
82 | esac | |
83 | $cat <<EOM | |
bbf326f0 | 84 | |
959f3c4c JH |
85 | Some installations have a separate directory just for executable scripts so |
86 | that they can mount it across multiple architectures but keep the scripts in | |
87 | one spot. You might, for example, have a subdirectory of /usr/share for this. | |
88 | Or you might just lump your scripts in with all your other executables. | |
bbf326f0 | 89 | |
959f3c4c JH |
90 | EOM |
91 | fn=d~ | |
92 | rp='Where do you keep publicly executable scripts?' | |
93 | . ./getfile | |
94 | if $test "X$ansexp" != "X$scriptdirexp"; then | |
95 | installscript='' | |
96 | fi | |
9f98f5fb | 97 | installscriptdir='' |
bbf326f0 MB |
98 | prefixvar=scriptdir |
99 | . ./setprefixvar | |
9f98f5fb MB |
100 | : A little fix up for an irregularly named variable. |
101 | installscript="$installscriptdir" | |
959f3c4c | 102 |