xref: /freebsd/usr.bin/xinstall/install.1 (revision 0de89efe5c443f213c7ea28773ef2dc6cf3af2ed)
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.\"	$Id: install.1,v 1.9 1997/02/22 19:57:54 peter Exp $
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 install
43.Op Fl CcDps
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 install
50.Op Fl CcDps
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 install
59.Fl d
60.Op Fl g Ar group
61.Op Fl m Ar mode
62.Op Fl o Ar owner
63.Ar directory
64\&...
65.Sh DESCRIPTION
66The file(s) are moved (or copied if the
67.Fl c
68option is specified) to the target file or directory.
69If the destination is a directory, then the
70.Ar file
71is moved into
72.Ar directory
73with its original filename.
74If the target file already exists, it is overwritten if permissions
75allow.
76.Pp
77.Bl -tag -width Ds
78.It Fl C
79Copy the file, as if the
80.Fl c
81option is specified,
82except if the target file already exists and the files are the same,
83then don't change the modification time of the target.
84.It Fl c
85Copy the file.
86This flag turns off the default behavior of
87.Nm install
88where it deletes the original file after creating the target.
89.It Fl D
90Print debugging information.
91If
92.Fl D
93is specified one or more times,
94then print the renaming steps for
95.Fl C .
96If
97.Fl D
98is specified two or more times,
99then warn about files that aren't installed with
100.Fl C .
101.It Fl d
102Create directories.
103Missing parent directories are created as required.
104.It Fl f
105Specify the target's file flags; see
106.Xr chflags 1
107for a list of possible flags and their meanings.
108.It Fl g
109Specify a group. A numeric GID is allowed.
110.It Fl m
111Specify an alternate mode.
112The default mode is set to rwxr-xr-x (0755).
113The specified mode may be either an octal or symbolic value; see
114.Xr chmod  1
115for a description of possible mode values.
116.It Fl o
117Specify an owner. A numeric UID is allowed.
118.It Fl p
119Preserve the modification time.
120Copy the file, as if the
121.Fl C
122(Compare and copy) option is specified,
123except if the target file doesn't already exist or is different,
124then preserve the modification time of the file.
125.It Fl s
126.Nm Install
127exec's the command
128.Xr strip  1
129to strip binaries so that install can be portable over a large
130number of systems and binary types.
131.El
132.Pp
133By default,
134.Nm
135preserves all file flags, with the exception of the ``nodump'' flag.
136.Pp
137The
138.Nm
139utility attempts to prevent moving a file onto itself.
140.Pp
141Installing
142.Pa /dev/null
143creates an empty file.
144.Pp
145Upon successful completion a value of 0 is returned.
146Otherwise, a value of 1 is returned.
147.Sh FILES
148.Bl -tag -width INS@XXXX -compact
149.It Pa INS@XXXX
150If the
151.Fl C
152or
153.Fl p
154option is used, then temporary files named INS@XXXX,
155where XXXX is decided by
156.Xr mkstemp 3 ,
157are created in the target directory.
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
167The
168.Nm
169utility appeared in
170.Bx 4.2 .
171.Sh BUGS
172Temporary files may be left in the target directory if
173.Nm
174exits abnormally.
175