xref: /minix3/usr.bin/xinstall/install.1 (revision 9d04c193d2abd0c557271531f31fb19f2a3703a3)
1*9d04c193SThomas Veerman.\"	$NetBSD: install.1,v 1.47 2012/04/08 22:00:40 wiz Exp $
2*9d04c193SThomas Veerman.\"
3*9d04c193SThomas Veerman.\" Copyright (c) 1987, 1990, 1993
4*9d04c193SThomas Veerman.\"	The Regents of the University of California.  All rights reserved.
5*9d04c193SThomas Veerman.\"
6*9d04c193SThomas Veerman.\" Redistribution and use in source and binary forms, with or without
7*9d04c193SThomas Veerman.\" modification, are permitted provided that the following conditions
8*9d04c193SThomas Veerman.\" are met:
9*9d04c193SThomas Veerman.\" 1. Redistributions of source code must retain the above copyright
10*9d04c193SThomas Veerman.\"    notice, this list of conditions and the following disclaimer.
11*9d04c193SThomas Veerman.\" 2. Redistributions in binary form must reproduce the above copyright
12*9d04c193SThomas Veerman.\"    notice, this list of conditions and the following disclaimer in the
13*9d04c193SThomas Veerman.\"    documentation and/or other materials provided with the distribution.
14*9d04c193SThomas Veerman.\" 3. Neither the name of the University nor the names of its contributors
15*9d04c193SThomas Veerman.\"    may be used to endorse or promote products derived from this software
16*9d04c193SThomas Veerman.\"    without specific prior written permission.
17*9d04c193SThomas Veerman.\"
18*9d04c193SThomas Veerman.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19*9d04c193SThomas Veerman.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20*9d04c193SThomas Veerman.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21*9d04c193SThomas Veerman.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22*9d04c193SThomas Veerman.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23*9d04c193SThomas Veerman.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24*9d04c193SThomas Veerman.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25*9d04c193SThomas Veerman.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26*9d04c193SThomas Veerman.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27*9d04c193SThomas Veerman.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28*9d04c193SThomas Veerman.\" SUCH DAMAGE.
29*9d04c193SThomas Veerman.\"
30*9d04c193SThomas Veerman.\"     @(#)install.1	8.1 (Berkeley) 6/6/93
31*9d04c193SThomas Veerman.\"
32*9d04c193SThomas Veerman.Dd May 1, 2009
33*9d04c193SThomas Veerman.Dt INSTALL 1
34*9d04c193SThomas Veerman.Os
35*9d04c193SThomas Veerman.Sh NAME
36*9d04c193SThomas Veerman.Nm install
37*9d04c193SThomas Veerman.Nd install binaries
38*9d04c193SThomas Veerman.Sh SYNOPSIS
39*9d04c193SThomas Veerman.Nm
40*9d04c193SThomas Veerman.Op Fl bcprsU
41*9d04c193SThomas Veerman.Op Fl a Ar command
42*9d04c193SThomas Veerman.Op Fl B Ar suffix
43*9d04c193SThomas Veerman.Op Fl D Ar destdir
44*9d04c193SThomas Veerman.Op Fl f Ar flags
45*9d04c193SThomas Veerman.Op Fl g Ar group
46*9d04c193SThomas Veerman.Op Fl h Ar hash
47*9d04c193SThomas Veerman.Op Fl l Ar linkflags
48*9d04c193SThomas Veerman.Op Fl M Ar metalog
49*9d04c193SThomas Veerman.Op Fl m Ar mode
50*9d04c193SThomas Veerman.Op Fl N Ar dbdir
51*9d04c193SThomas Veerman.Op Fl o Ar owner
52*9d04c193SThomas Veerman.Op Fl S Ar stripflag
53*9d04c193SThomas Veerman.Op Fl T Ar tags
54*9d04c193SThomas Veerman.Ar file1 file2
55*9d04c193SThomas Veerman.Nm
56*9d04c193SThomas Veerman.Op Fl bcprsU
57*9d04c193SThomas Veerman.Op Fl a Ar command
58*9d04c193SThomas Veerman.Op Fl B Ar suffix
59*9d04c193SThomas Veerman.Op Fl D Ar destdir
60*9d04c193SThomas Veerman.Op Fl f Ar flags
61*9d04c193SThomas Veerman.Op Fl g Ar group
62*9d04c193SThomas Veerman.Op Fl h Ar hash
63*9d04c193SThomas Veerman.Op Fl l Ar linkflags
64*9d04c193SThomas Veerman.Op Fl M Ar metalog
65*9d04c193SThomas Veerman.Op Fl m Ar mode
66*9d04c193SThomas Veerman.Op Fl N Ar dbdir
67*9d04c193SThomas Veerman.Op Fl o Ar owner
68*9d04c193SThomas Veerman.Op Fl S Ar stripflag
69*9d04c193SThomas Veerman.Op Fl T Ar tags
70*9d04c193SThomas Veerman.Ar file1 ...\&
71*9d04c193SThomas Veerman.Ar fileN directory
72*9d04c193SThomas Veerman.Nm
73*9d04c193SThomas Veerman.Fl d
74*9d04c193SThomas Veerman.Op Fl pU
75*9d04c193SThomas Veerman.Op Fl a Ar command
76*9d04c193SThomas Veerman.Op Fl D Ar destdir
77*9d04c193SThomas Veerman.Op Fl g Ar group
78*9d04c193SThomas Veerman.Op Fl M Ar metalog
79*9d04c193SThomas Veerman.Op Fl m Ar mode
80*9d04c193SThomas Veerman.Op Fl N Ar dbdir
81*9d04c193SThomas Veerman.Op Fl o Ar owner
82*9d04c193SThomas Veerman.Op Fl T Ar tags
83*9d04c193SThomas Veerman.Ar directory ...\&
84*9d04c193SThomas Veerman.Sh DESCRIPTION
85*9d04c193SThomas VeermanThe file(s) are copied
86*9d04c193SThomas Veerman(or linked if the
87*9d04c193SThomas Veerman.Fl l
88*9d04c193SThomas Veermanoption is specified) to the target file or directory.
89*9d04c193SThomas VeermanIf the destination is a directory, then the
90*9d04c193SThomas Veerman.Ar file
91*9d04c193SThomas Veermanis copied into
92*9d04c193SThomas Veerman.Ar directory
93*9d04c193SThomas Veermanwith its original filename.
94*9d04c193SThomas VeermanIf the target file already exists, it is
95*9d04c193SThomas Veermaneither renamed to
96*9d04c193SThomas Veerman.Ar file.old
97*9d04c193SThomas Veermanif the
98*9d04c193SThomas Veerman.Fl b
99*9d04c193SThomas Veermanoption is given
100*9d04c193SThomas Veermanor overwritten
101*9d04c193SThomas Veermanif permissions allow; an alternate backup suffix may be specified via the
102*9d04c193SThomas Veerman.Fl B
103*9d04c193SThomas Veermanoption's argument.
104*9d04c193SThomas Veerman.Pp
105*9d04c193SThomas Veerman.Bl -tag -width XsXXstripflagsXX
106*9d04c193SThomas Veerman.It Fl a Ar command
107*9d04c193SThomas VeermanRun
108*9d04c193SThomas Veerman.Ar command
109*9d04c193SThomas Veermanon the target after installation and stripping
110*9d04c193SThomas Veerman.Pq Fl s ,
111*9d04c193SThomas Veermanbut before
112*9d04c193SThomas Veermanownership, permissions or timestamps are set and before renaming
113*9d04c193SThomas Veerman.Pq Fl r
114*9d04c193SThomas Veermanoccurs.
115*9d04c193SThomas Veerman.Ar command
116*9d04c193SThomas Veermanis invoked via the
117*9d04c193SThomas Veerman.Xr sh 1
118*9d04c193SThomas Veermanshell, allowing a single
119*9d04c193SThomas Veerman.Fl a
120*9d04c193SThomas Veermanargument be to specified to
121*9d04c193SThomas Veerman.Nm
122*9d04c193SThomas Veermanwhich the shell can then tokenize.
123*9d04c193SThomas Veerman.It Fl B Ar suffix
124*9d04c193SThomas VeermanUse
125*9d04c193SThomas Veerman.Ar suffix
126*9d04c193SThomas Veermanas the backup suffix if
127*9d04c193SThomas Veerman.Fl b
128*9d04c193SThomas Veermanis given.
129*9d04c193SThomas VeermanIf
130*9d04c193SThomas Veerman.Ar suffix
131*9d04c193SThomas Veermancontains a '%' sign, a numbered backup will be performed, and the
132*9d04c193SThomas Veerman%-pattern will be expanded using
133*9d04c193SThomas Veerman.Xr sprintf 3 ,
134*9d04c193SThomas Veermangiven an integer counter as the backup number.
135*9d04c193SThomas VeermanThe counter used starts from 0, and the first available name resulting
136*9d04c193SThomas Veermanfrom the expansion is used.
137*9d04c193SThomas Veerman.It Fl b
138*9d04c193SThomas VeermanBackup any existing files before overwriting them by renaming
139*9d04c193SThomas Veermanthem to
140*9d04c193SThomas Veerman.Ar file.old . See
141*9d04c193SThomas Veerman.Fl B
142*9d04c193SThomas Veermanfor specifying a different backup suffix.
143*9d04c193SThomas Veerman.It Fl c
144*9d04c193SThomas VeermanCopy the file.
145*9d04c193SThomas VeermanThis is the default behavior; the flag is maintained for backwards
146*9d04c193SThomas Veermancompatibility only.
147*9d04c193SThomas Veerman.It Fl D Ar destdir
148*9d04c193SThomas VeermanSpecify the
149*9d04c193SThomas Veerman.Ev DESTDIR
150*9d04c193SThomas Veerman(top of the file hierarchy) that the items are installed in to.
151*9d04c193SThomas VeermanIf
152*9d04c193SThomas Veerman.Fl M Ar metalog
153*9d04c193SThomas Veermanis in use, a leading string of
154*9d04c193SThomas Veerman.Dq Ar destdir
155*9d04c193SThomas Veermanwill be removed from the file names logged to the
156*9d04c193SThomas Veerman.Ar metalog .
157*9d04c193SThomas VeermanThis option does not affect where the actual files are installed.
158*9d04c193SThomas Veerman.It Fl d
159*9d04c193SThomas VeermanCreate directories.
160*9d04c193SThomas VeermanMissing parent directories are created as required.
161*9d04c193SThomas Veerman.It Fl f Ar flags
162*9d04c193SThomas VeermanSpecify the target's file flags.
163*9d04c193SThomas Veerman(See
164*9d04c193SThomas Veerman.Xr chflags 1
165*9d04c193SThomas Veermanfor a list of possible flags and their meanings.)
166*9d04c193SThomas Veerman.It Fl g Ar group
167*9d04c193SThomas VeermanSpecify a group.
168*9d04c193SThomas Veerman.It Fl h Ar hash
169*9d04c193SThomas VeermanWhen copying, calculate the digest of the files with
170*9d04c193SThomas Veerman.Ar hash
171*9d04c193SThomas Veermanto store in the
172*9d04c193SThomas Veerman.Fl M Ar metalog .
173*9d04c193SThomas VeermanSupported digests:
174*9d04c193SThomas Veerman.Bl -tag -width rmd160 -offset indent
175*9d04c193SThomas Veerman.It Sy none
176*9d04c193SThomas VeermanNo hash.
177*9d04c193SThomas VeermanThis is the default.
178*9d04c193SThomas Veerman.It Sy md5
179*9d04c193SThomas VeermanThe MD5 cryptographic message digest.
180*9d04c193SThomas Veerman.It Sy rmd160
181*9d04c193SThomas VeermanThe RMD-160 cryptographic message digest.
182*9d04c193SThomas Veerman.It Sy sha1
183*9d04c193SThomas VeermanThe SHA-1 cryptographic message digest.
184*9d04c193SThomas Veerman.It Sy sha256
185*9d04c193SThomas VeermanThe 256-bits
186*9d04c193SThomas Veerman.Tn SHA-2
187*9d04c193SThomas Veermancryptographic message digest of the file.
188*9d04c193SThomas Veerman.It Sy sha384
189*9d04c193SThomas VeermanThe 384-bits
190*9d04c193SThomas Veerman.Tn SHA-2
191*9d04c193SThomas Veermancryptographic message digest of the file.
192*9d04c193SThomas Veerman.It Sy sha512
193*9d04c193SThomas VeermanThe 512-bits
194*9d04c193SThomas Veerman.Tn SHA-2
195*9d04c193SThomas Veermancryptographic message digest of the file.
196*9d04c193SThomas Veerman.El
197*9d04c193SThomas Veerman.It Fl l Ar linkflags
198*9d04c193SThomas VeermanInstead of copying the file make a link to the source.
199*9d04c193SThomas VeermanThe type of the link is determined by the
200*9d04c193SThomas Veerman.Ar linkflags
201*9d04c193SThomas Veermanargument.
202*9d04c193SThomas VeermanValid
203*9d04c193SThomas Veerman.Ar linkflags
204*9d04c193SThomas Veermanare:
205*9d04c193SThomas Veerman.Ar a
206*9d04c193SThomas Veerman(absolute),
207*9d04c193SThomas Veerman.Ar r
208*9d04c193SThomas Veerman(relative),
209*9d04c193SThomas Veerman.Ar h
210*9d04c193SThomas Veerman(hard),
211*9d04c193SThomas Veerman.Ar s
212*9d04c193SThomas Veerman(symbolic),
213*9d04c193SThomas Veerman.Ar m
214*9d04c193SThomas Veerman(mixed).
215*9d04c193SThomas VeermanAbsolute and relative have effect only for symbolic links.
216*9d04c193SThomas VeermanMixed links
217*9d04c193SThomas Veermanare hard links for files on the same filesystem, symbolic otherwise.
218*9d04c193SThomas Veerman.It Fl M Ar metalog
219*9d04c193SThomas VeermanWrite the metadata associated with each item installed to
220*9d04c193SThomas Veerman.Ar metalog
221*9d04c193SThomas Veermanin an
222*9d04c193SThomas Veerman.Xr mtree 8
223*9d04c193SThomas Veerman.Dq full path
224*9d04c193SThomas Veermanspecification line.
225*9d04c193SThomas VeermanThe metadata includes: the file name and file type, and depending upon
226*9d04c193SThomas Veermanother options, the owner, group, file flags, modification time, and tags.
227*9d04c193SThomas Veerman.It Fl m Ar mode
228*9d04c193SThomas VeermanSpecify an alternative mode.
229*9d04c193SThomas VeermanThe default mode is set to rwxr-xr-x (0755).
230*9d04c193SThomas VeermanThe specified mode may be either an octal or symbolic value; see
231*9d04c193SThomas Veerman.Xr chmod 1
232*9d04c193SThomas Veermanfor a description of possible mode values.
233*9d04c193SThomas Veerman.It Fl N Ar dbdir
234*9d04c193SThomas VeermanUse the user database text file
235*9d04c193SThomas Veerman.Pa master.passwd
236*9d04c193SThomas Veermanand group database text file
237*9d04c193SThomas Veerman.Pa group
238*9d04c193SThomas Veermanfrom
239*9d04c193SThomas Veerman.Ar dbdir ,
240*9d04c193SThomas Veermanrather than using the results from the system's
241*9d04c193SThomas Veerman.Xr getpwnam 3
242*9d04c193SThomas Veermanand
243*9d04c193SThomas Veerman.Xr getgrnam 3
244*9d04c193SThomas Veerman(and related) library calls.
245*9d04c193SThomas Veerman.It Fl o Ar owner
246*9d04c193SThomas VeermanSpecify an owner.
247*9d04c193SThomas Veerman.It Fl p
248*9d04c193SThomas VeermanPreserve the source files access and modification times.
249*9d04c193SThomas Veerman.It Fl r
250*9d04c193SThomas VeermanInstall to a temporary file and then rename the file to its final destination
251*9d04c193SThomas Veermanname.
252*9d04c193SThomas VeermanThis can be used for precious files, to avoid truncation of the original
253*9d04c193SThomas Veermanwhen error conditions (filesystem full etc.) occur.
254*9d04c193SThomas Veerman.It Fl S Ar stripflags
255*9d04c193SThomas Veerman.Nm
256*9d04c193SThomas Veermanpasses
257*9d04c193SThomas Veerman.Ar stripflags
258*9d04c193SThomas Veermanas option arguments to
259*9d04c193SThomas Veerman.Xr strip 1 .
260*9d04c193SThomas VeermanWhen
261*9d04c193SThomas Veerman.Fl S
262*9d04c193SThomas Veermanis used,
263*9d04c193SThomas Veerman.Xr strip 1
264*9d04c193SThomas Veermanis invoked via the
265*9d04c193SThomas Veerman.Xr sh 1
266*9d04c193SThomas Veermanshell, allowing a single
267*9d04c193SThomas Veerman.Fl S
268*9d04c193SThomas Veermanargument be to specified to
269*9d04c193SThomas Veerman.Nm
270*9d04c193SThomas Veermanwhich the shell can then tokenize.
271*9d04c193SThomas VeermanNormally,
272*9d04c193SThomas Veerman.Nm
273*9d04c193SThomas Veermaninvokes
274*9d04c193SThomas Veerman.Xr strip 1
275*9d04c193SThomas Veermandirectly.
276*9d04c193SThomas VeermanThis flag implies
277*9d04c193SThomas Veerman.Fl s .
278*9d04c193SThomas Veerman.It Fl s
279*9d04c193SThomas Veerman.Nm
280*9d04c193SThomas Veermanexec's the command
281*9d04c193SThomas Veerman.Xr strip 1
282*9d04c193SThomas Veermanto strip binaries so that install can be portable over a large
283*9d04c193SThomas Veermannumber of systems and binary types.
284*9d04c193SThomas VeermanIf the environment variable
285*9d04c193SThomas Veerman.Ev STRIP
286*9d04c193SThomas Veermanis set, it is used as the
287*9d04c193SThomas Veerman.Xr strip 1
288*9d04c193SThomas Veermanprogram.
289*9d04c193SThomas Veerman.It Fl T Ar tags
290*9d04c193SThomas VeermanSpecify the
291*9d04c193SThomas Veerman.Xr mtree 8
292*9d04c193SThomas Veermantags to write out for the file when using
293*9d04c193SThomas Veerman.Fl M Ar metalog .
294*9d04c193SThomas Veerman.It Fl U
295*9d04c193SThomas VeermanIndicate that install is running unprivileged, and that it should not
296*9d04c193SThomas Veermantry to change the owner, the group, or the file flags of the destination.
297*9d04c193SThomas VeermanThe information that would have been updated can be stored in a log
298*9d04c193SThomas Veermanfile with
299*9d04c193SThomas Veerman.Fl M Ar metalog .
300*9d04c193SThomas Veerman.El
301*9d04c193SThomas Veerman.Pp
302*9d04c193SThomas VeermanBy default,
303*9d04c193SThomas Veerman.Nm
304*9d04c193SThomas Veermanpreserves all file flags, with the exception of the ``nodump'' flag.
305*9d04c193SThomas Veerman.Pp
306*9d04c193SThomas VeermanThe
307*9d04c193SThomas Veerman.Nm
308*9d04c193SThomas Veermanutility attempts to prevent copying a file onto itself.
309*9d04c193SThomas Veerman.Pp
310*9d04c193SThomas VeermanInstalling
311*9d04c193SThomas Veerman.Pa /dev/null
312*9d04c193SThomas Veermancreates an empty file.
313*9d04c193SThomas Veerman.Sh ENVIRONMENT
314*9d04c193SThomas Veerman.Bl -tag -width Fl
315*9d04c193SThomas Veerman.It Ev STRIP
316*9d04c193SThomas VeermanThe program used to strip installed binaries when the
317*9d04c193SThomas Veerman.Fl s
318*9d04c193SThomas Veermanoption is used.
319*9d04c193SThomas VeermanIf unspecified,
320*9d04c193SThomas Veerman.Pa /usr/bin/strip
321*9d04c193SThomas Veermanis used.
322*9d04c193SThomas Veerman.El
323*9d04c193SThomas Veerman.Sh EXIT STATUS
324*9d04c193SThomas Veerman.Ex -std
325*9d04c193SThomas Veerman.Sh SEE ALSO
326*9d04c193SThomas Veerman.Xr chflags 1 ,
327*9d04c193SThomas Veerman.Xr chgrp 1 ,
328*9d04c193SThomas Veerman.Xr chmod 1 ,
329*9d04c193SThomas Veerman.Xr cp 1 ,
330*9d04c193SThomas Veerman.Xr mv 1 ,
331*9d04c193SThomas Veerman.Xr strip 1 ,
332*9d04c193SThomas Veerman.Xr chown 8 ,
333*9d04c193SThomas Veerman.Xr mtree 8
334*9d04c193SThomas Veerman.Sh HISTORY
335*9d04c193SThomas VeermanThe
336*9d04c193SThomas Veerman.Nm
337*9d04c193SThomas Veermanutility appeared in
338*9d04c193SThomas Veerman.Bx 4.2 .
339