/
pkg-create.8
312 lines (312 loc) · 8.29 KB
/
pkg-create.8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
.\"
.\" FreeBSD pkg - a next generation package for the installation and maintenance
.\" of non-core utilities.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\"
.\"
.\" @(#)pkg.8
.\" $FreeBSD$
.\"
.Dd July 10, 2012
.Dt PKG-CREATE 8
.Os
.\" ---------------------------------------------------------------------------
.Sh NAME
.Nm "pkg create"
.Nd a utility for creating software package distributions
.\" ---------------------------------------------------------------------------
.Sh SYNOPSIS
.Nm
.Op Fl n
.Op Fl f Ar format
.Op Fl o Ar outdir
.Op Fl p Ar plist
.Op Fl r Ar rootdir
.Fl m Ar manifestdir
.Nm
.Op Fl gnxX
.Op Fl f Ar format
.Op Fl o Ar outdir
.Op Fl r Ar rootdir
.Ar pkg-name ...
.Nm
.Op Fl n
.Op Fl f Ar format
.Op Fl o Ar outdir
.Op Fl r Ar rootdir
.Fl a
.\" ---------------------------------------------------------------------------
.Sh DESCRIPTION
.Nm
is used to create packages from binaries or other files installed on
your computer.
Package tarballs can created from the files of a previously installed
package using metadata from the local package database.
Any number of packages may be created in one invocation of this style.
.Pp
Alternatively, a single package can be created from an arbitrary
selection of files on your system, but this requires a
.Ar manifestdir
and optionally
.Ar plist
to be supplied.
The package name will be derived from the
.Fa +MANIFEST
file which must be contained within the
.Ar manifestdir .
.Pp
Packages thus created can be distributed and subsequently installed on
other machines using the
.Cm pkg add
command.
.\" ---------------------------------------------------------------------------
.Sh OPTIONS
The following options are supported by
.Nm :
.Bl -tag -width ".Fl m Ar manifestdir"
.It Fl a
Create package tarballs from all packages installed on your system.
This option is incompatible with the
.Fl g , x , X
or
.Fl m Ar manifestdir
options.
.It Fl g
Interpret
.Ar pkg-name
as a shell glob pattern and create package only for installed binaries whose
name match this pattern.
This option is incompatible with the
.Fl a , x , X
or
.Fl m Ar manifestdir
options.
.It Fl x
Like
.Fl g ,
but interpret
.Ar pkg-name
as a regular expression.
This option is incompatible with the
.Fl a, g , X
or
.Fl m Ar manifestdir
options.
.It Fl X
Like
.Fl g ,
but interpret
.Ar pkg-name
as an extended regular expression.
This option is incompatible with the
.Fl a, g , x
or
.Fl m Ar manifestdir
options.
.It Fl f Ar format
Set
.Ar format
as the package output format.
It can be one of
.Ar txz , tbz , tgz
or
.Ar tar
which are currently the only supported format.
If an invalid or no format is specified
.Ar txz
is assumed.
.It Fl m Ar manifestdir
Specify the directory containing the package manifest,
.Fa +MANIFEST
and optionally two other files; one containing a message to be
displayed on package installation,
.Fa +DISPLAY
and the other containing an mtree specification,
.Fa +MTREE_DIRS ,
for the directory tree the package will use.
See
.Xr mtree 5
for the format of the mtree file.
If specified, only a single package will be created.
Neither
.Fa +DISPLAY
nor
.Fa +MTREE_DIRS
are required; the
.Fa +MANIFEST
file can contain all the required information needed to build a
package.
This option is incompatible with the
.Fl a, g , x
or
.Fl X
options.
.It Fl n
Do not overwrite already existing packages
.It Fl o Ar outdir
Set
.Ar outdir
as the output directory.
If this option is not given, all created packages will
be saved in the current directory.
.It Fl p Ar plist
Specify some package metadata using the legacy plist format from
.Xr pkg_add 1 ,
commonly found in
.Fa pkg-plist
files in the ports tree.
Metadata from the
.Ar plist
file, if specified, will take precedence over any equivalents from
the
.Ar manifestdir .
Only has any effect when used with
.Ar manifestdir .
.It Fl r Ar rootdir
.Ar rootdir
specifies the top-level directory to be treated as the root of the
filesystem heirarchy containing the package files.
File paths in generated packages will be relative to
.Ar rootdir .
This allows a package to be generated from content offset from its
intended final location, which allows a package building without
disturbing similar content already on the system.
If unspecified, the default is effectively
.Fa / ,
the actual root directory.
.El
.\" ---------------------------------------------------------------------------
.Sh MANIFEST FILE DETAILS
.Bl -tag -width ".Cm www"
.It Cm name Ar pkg-name
This entry sets the package's name to
.Ar pkg-name . \" TODO: Find out why there is a space after the ``.''
Among other things, this name is used - with the version and the origin of the
concerned package - to identify a dependency.
.It Cm version Ar pkg-version
This entry sets the package's version to
.Ar pkg-version .
.It Cm origin Ar pkg-origin
This entry sets the package's origin to
.Ar pkg-origin .
This is a string of the form
.Pa category/port-dir
which designate the port this package was built from.
.It Cm comment Ar comment-string
.Ar comment-string
is a one-line description of this package.
It is the equivalent of the
.Dv COMMENT
variable for a port, not a way to put comments in a
.Pa +MANIFEST
file.
.It Cm arch Ar cpu-type
The architecture of the machine the package was built on.
.Ar cpu-type
takes values like x86, amd64...
.It Cm osversion Ar os-version
Version of the OS used to build the package.
.It Cm www Ar url
The software's official website.
.It Cm maintainer Ar mail-address
The maintainer's mail address.
.It Cm prefix Ar path-prefix
The path where the files contained in this package are installed
.Pq usually Pa /usr/local .
.It Cm flatsize Ar size
The size that the files contained in this package will occupy on your system
once uncompressed.
This value does not take into account files stored in the
package database.
.It Cm dep Ar dep-name dep-origin dep-version
Declare a dependency on the package which name, origin and version match
.Ar dep-name , dep-origin
and
.Ar dep-version
respectively.
.It Cm conflict Ar pkg-glob
Flag this package as incompatible with the one designated by
.Ar pkg-glob .
Conflicting packages cannot be installed on the same system as they may contain
references to the sames files.
.It Cm option Ar option-name option-value
Set the option
.Ar option-name
to the value
.Ar option-value .
.It Cm file Ar sha256-hash path
.Cm file
entries list files included in the package.
If the file is a regular one, such
an entry contains its sha256 digest along with its path.
If a packaged file is
a link, you must use this entry's other form, as described below.
.It Cm file Ar - path
Same as above but for file links.
The sha256 hash is replaced with a
.Ar -
(dash).
.It Cm dir Ar path
Mimics the
.Cm file
entry but for directories.
.El
.\" ---------------------------------------------------------------------------
.Sh ENVIRONMENT
The following environment variables affect the execution of
.Nm .
See
.Xr pkg.conf 5
for further description.
.Bl -tag -width ".Ev NO_DESCRIPTIONS"
.It Ev PKG_DBDIR
.It Ev PLIST_KEYWORDS_DIR
.It Ev PORTSDIR
.El
.\" ---------------------------------------------------------------------------
.Sh FILES
See
.Xr pkg.conf 5 .
.\" ---------------------------------------------------------------------------
.Sh EXAMPLES
Create package files for installed packages:
.Dl % pkg create -a -o /usr/ports/packages/All
.Pp
Create package file for pkg:
.Dl % pkg create -o /usr/ports/packages/All pkg
.\" ---------------------------------------------------------------------------
.Sh SEE ALSO
.Xr pkg 8 ,
.Xr pkg-add 8 ,
.Xr pkg-audit 8 ,
.Xr pkg-autoremove 8 ,
.Xr pkg-backup 8 ,
.Xr pkg-check 8 ,
.Xr pkg-clean 8 ,
.Xr pkg-delete 8 ,
.Xr pkg-fetch 8 ,
.Xr pkg-info 8 ,
.Xr pkg-install 8 ,
.Xr pkg-query 8 ,
.Xr pkg-register 8 ,
.Xr pkg-repo 8 ,
.Xr pkg-rquery 8 ,
.Xr pkg-search 8 ,
.Xr pkg-set 8 ,
.Xr pkg-shell 8 ,
.Xr pkg-shlib 8 ,
.Xr pkg-stats 8 ,
.Xr pkg-update 8 ,
.Xr pkg-updating 8 ,
.Xr pkg-upgrade 8 ,
.Xr pkg-version 8 ,
.Xr pkg-which 8 ,
.Xr pkg.conf 5