Annotation of src/usr.bin/xinstall/install.1, Revision 1.4
1.4 ! millert 1: .\" $OpenBSD: install.1,v 1.3 1996/08/05 01:18:42 millert Exp $
1.1 deraadt 2: .\" $NetBSD: install.1,v 1.4 1994/11/14 04:57:17 jtc Exp $
3: .\"
4: .\" Copyright (c) 1987, 1990, 1993
5: .\" The Regents of the University of California. All rights reserved.
6: .\"
7: .\" Redistribution and use in source and binary forms, with or without
8: .\" modification, are permitted provided that the following conditions
9: .\" are met:
10: .\" 1. Redistributions of source code must retain the above copyright
11: .\" notice, this list of conditions and the following disclaimer.
12: .\" 2. Redistributions in binary form must reproduce the above copyright
13: .\" notice, this list of conditions and the following disclaimer in the
14: .\" documentation and/or other materials provided with the distribution.
15: .\" 3. All advertising materials mentioning features or use of this software
16: .\" must display the following acknowledgement:
17: .\" This product includes software developed by the University of
18: .\" California, Berkeley and its contributors.
19: .\" 4. Neither the name of the University nor the names of its contributors
20: .\" may be used to endorse or promote products derived from this software
21: .\" without specific prior written permission.
22: .\"
23: .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24: .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25: .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26: .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27: .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28: .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29: .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30: .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31: .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32: .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33: .\" SUCH DAMAGE.
34: .\"
35: .\" @(#)install.1 8.1 (Berkeley) 6/6/93
36: .\"
37: .Dd June 6, 1993
38: .Dt INSTALL 1
39: .Os BSD 4.2
40: .Sh NAME
41: .Nm install
42: .Nd install binaries
43: .Sh SYNOPSIS
44: .Nm install
1.3 millert 45: .Op Fl CcpSs
1.1 deraadt 46: .Op Fl f Ar flags
47: .Op Fl g Ar group
48: .Op Fl m Ar mode
49: .Op Fl o Ar owner
50: .Ar file1 file2
51: .Nm install
1.3 millert 52: .Op Fl CcpSs
1.1 deraadt 53: .Op Fl f Ar flags
54: .Op Fl g Ar group
55: .Op Fl m Ar mode
56: .Op Fl o Ar owner
57: .Ar file1
58: \&...
59: .Ar fileN directory
60: .Nm install
61: .Fl d
1.4 ! millert 62: .Op Fl g Ar group
1.1 deraadt 63: .Op Fl m Ar mode
64: .Op Fl o Ar owner
65: .Ar directory
66: \&...
67: .Sh DESCRIPTION
68: The file(s) are moved (or copied if the
69: .Fl c
70: option is specified) to the target file or directory.
71: If the destination is a directory, then the
72: .Ar file
73: is moved into
74: .Ar directory
75: with its original filename.
76: If the target file already exists, it is overwritten if permissions
77: allow.
78: .Pp
79: .Bl -tag -width Ds
1.3 millert 80: .It Fl C
81: Copy the file.
82: If the target file already exists and the files are the same,
83: then don't change the modification time of the target.
1.1 deraadt 84: .It Fl c
1.3 millert 85: Copy the file. This is actually the default. The
86: .Fl c
87: option is only included for backwards compatibility.
88: .It Fl d
89: Create directories.
90: Missing parent directories are created as required.
1.1 deraadt 91: .It Fl f
92: Specify the target's file flags.
93: (See
94: .Xr chflags 1
95: for a list of possible flags and their meanings.)
96: .It Fl g
1.3 millert 97: Specify a group. A numeric GID is allowed.
1.1 deraadt 98: .It Fl m
99: Specify an alternate mode.
100: The default mode is set to rwxr-xr-x (0755).
101: The specified mode may be either an octal or symbolic value; see
102: .Xr chmod 1
103: for a description of possible mode values.
104: .It Fl o
1.3 millert 105: Specify an owner. A numeric UID is allowed.
106: .It Fl p
107: Preserve the modification time.
108: Copy the file, as if the
109: .Fl C
110: (Compare and copy) option is specified,
111: except if the target file doesn't already exist or is different,
112: then preserve the modification time of the file.
113: .It Fl S
114: Safe copy. Normally,
115: .Nm install
116: unlinks an existing target before installing the new file. With the
117: .Fl S
118: flag a temporary file is used and then renamed to be
119: the target. The reason this is safer is that if the copy or
120: rename fails, the existing target is left untouched.
1.1 deraadt 121: .It Fl s
122: .Nm Install
123: exec's the command
124: .Xr strip 1
125: to strip binaries so that install can be portable over a large
126: number of systems and binary types.
127: .El
128: .Pp
129: By default,
130: .Nm install
131: preserves all file flags, with the exception of the ``nodump'' flag.
132: .Pp
133: The
134: .Nm install
135: utility attempts to prevent moving a file onto itself.
136: .Pp
137: Installing
138: .Pa /dev/null
139: creates an empty file.
140: .Pp
141: Upon successful completion a value of 0 is returned.
142: Otherwise, a value of 1 is returned.
1.3 millert 143: .Sh FILES
144: .Bl -tag -width INS@XXXXXX -compact
145: .It Pa INS@XXXXXX
146: If either
147: .Fl S
148: option is specified, or the
149: .Fl C
150: or
151: .Fl p
152: option is used in conjuction with the
153: .Fl s
154: option, temporary files named INS@XXXXXX,
155: where XXXXXX is decided by
156: .Xr mkstemp 3 ,
157: are created in the target directory.
1.1 deraadt 158: .Sh SEE ALSO
159: .Xr chflags 1 ,
160: .Xr chgrp 1 ,
161: .Xr chmod 1 ,
162: .Xr cp 1 ,
163: .Xr mv 1 ,
164: .Xr strip 1 ,
165: .Xr chown 8
166: .Sh HISTORY
167: The
168: .Nm install
169: utility appeared in
170: .Bx 4.2 .
1.3 millert 171: .Sh CAVEATS
172: The
173: .Fl C ,
174: .Fl p ,
175: and
176: .Fl S
177: flags are non-standard and should not relied upon for portability.
178: .br
179: Temporary files may be left in the target directory if
180: .Nm install
181: exits abnormally.