xref: /freebsd/usr.bin/xinstall/install.1 (revision 77a0943ded95b9e6438f7db70c4a28e4d93946d4)
1.\" Copyright (c) 1987, 1990, 1993
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\"    notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\"    notice, this list of conditions and the following disclaimer in the
11.\"    documentation and/or other materials provided with the distribution.
12.\" 3. All advertising materials mentioning features or use of this software
13.\"    must display the following acknowledgement:
14.\"	This product includes software developed by the University of
15.\"	California, Berkeley and its contributors.
16.\" 4. Neither the name of the University nor the names of its contributors
17.\"    may be used to endorse or promote products derived from this software
18.\"    without specific prior written permission.
19.\"
20.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE.
31.\"
32.\"	From: @(#)install.1	8.1 (Berkeley) 6/6/93
33.\" $FreeBSD$
34.\"
35.Dd September 22, 1996
36.Dt INSTALL 1
37.Os BSD 4.2
38.Sh NAME
39.Nm install
40.Nd install binaries
41.Sh SYNOPSIS
42.Nm
43.Op Fl CcDMpsv
44.Op Fl f Ar flags
45.Op Fl g Ar group
46.Op Fl m Ar mode
47.Op Fl o Ar owner
48.Ar file1 file2
49.Nm
50.Op Fl CcDMpsv
51.Op Fl f Ar flags
52.Op Fl g Ar group
53.Op Fl m Ar mode
54.Op Fl o Ar owner
55.Ar file1
56\&...
57.Ar fileN directory
58.Nm
59.Fl d
60.Op Fl v
61.Op Fl g Ar group
62.Op Fl m Ar mode
63.Op Fl o Ar owner
64.Ar directory
65\&...
66.Sh DESCRIPTION
67The file(s) are moved (or copied if the
68.Fl c
69option is specified) to the target file or directory.
70If the destination is a directory, then the
71.Ar file
72is moved into
73.Ar directory
74with its original filename.
75If the target file already exists, it is overwritten if permissions
76allow.
77.Pp
78.Bl -tag -width Ds
79.It Fl C
80Copy the file, as if the
81.Fl c
82option is specified,
83except if the target file already exists and the files are the same,
84then don't change the modification time of the target.
85.It Fl c
86Copy the file.
87This flag turns off the default behavior of
88.Nm
89where it deletes the original file after creating the target.
90.It Fl D
91Print debugging information.
92If
93.Fl D
94is specified one or more times,
95then print the renaming steps for
96.Fl C .
97If
98.Fl D
99is specified two or more times,
100then warn about files that aren't installed with
101.Fl C .
102.It Fl d
103Create directories.
104Missing parent directories are created as required.
105.It Fl f
106Specify the target's file flags; see
107.Xr chflags 1
108for a list of possible flags and their meanings.
109.It Fl g
110Specify a group.
111A numeric GID is allowed.
112.It Fl M
113Disable all use of
114.Xr mmap 2 .
115.It Fl m
116Specify an alternate mode.
117The default mode is set to rwxr-xr-x (0755).
118The specified mode may be either an octal or symbolic value; see
119.Xr chmod  1
120for a description of possible mode values.
121.It Fl o
122Specify an owner.
123A numeric UID is allowed.
124.It Fl p
125Preserve the modification time.
126Copy the file, as if the
127.Fl C
128(Compare and copy) option is specified,
129except if the target file doesn't already exist or is different,
130then preserve the modification time of the file.
131.It Fl s
132.Nm Install
133exec's the command
134.Xr strip  1
135to strip binaries so that install can be portable over a large
136number of systems and binary types.
137.It Fl v
138Causes
139.Nm
140to show when
141.Fl C
142acutally installs something.
143.El
144.Pp
145By default,
146.Nm
147preserves all file flags, with the exception of the ``nodump'' flag.
148.Pp
149The
150.Nm
151utility attempts to prevent moving a file onto itself.
152.Pp
153Installing
154.Pa /dev/null
155creates an empty file.
156.Sh DIAGNOSTICS
157The
158.Nm
159utility exits 0 on success, and 1 otherwise.
160.Sh FILES
161.Bl -tag -width INS@XXXX -compact
162.It Pa INS@XXXX
163If the
164.Fl C
165or
166.Fl p
167option is used, then temporary files named INS@XXXX,
168where XXXX is decided by
169.Xr mkstemp 3 ,
170are created in the target directory.
171.Sh SEE ALSO
172.Xr chflags 1 ,
173.Xr chgrp 1 ,
174.Xr chmod 1 ,
175.Xr cp 1 ,
176.Xr mv 1 ,
177.Xr strip 1 ,
178.Xr mmap 2 ,
179.Xr chown 8
180.Sh HISTORY
181The
182.Nm
183utility appeared in
184.Bx 4.2 .
185.Sh BUGS
186Temporary files may be left in the target directory if
187.Nm
188exits abnormally.
189.Pp
190File flags cannot be set by
191.Xr fchflags 2
192over a NFS file system.  Other file systems do not have a concept of flags.
193.Nm
194will only warn when flags could not be set on a file system
195that does not support them.
196.Pp
197.Nm
198with
199.Fl v
200falsely says a file is copied when
201.Fl C
202snaps hard links.
203