-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpkgnew.8
252 lines (228 loc) · 4.9 KB
/
pkgnew.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
.TH pkgnew 8 2019 1.19
.SH NAME
.B pkgnew
- Update and build CRUX packages
.SH SYNOPSIS
.B pkgnew [options] [arguments]
.SH DESCRIPTION
The
.B pkgnew
shell script is designed as alternative of package management utilities
.I ports
and
.IR pkgmk .
.BR pkgnew ,
like
.IR ports ,
uses the configuration of the port collections from the
.I /etc/ports
directory.
.BR pkgnew ,
like
.IR pkgmk ,
uses the global build configuration stored in
.I /etc/pkgmk.conf
and package build description from
.IR Pkgfile .
.SH OPTIONS
.TP
.I -b
Build and install packages
.TP
.I -e
Edit working Pkgfile
.TP
.I -h
Display help
.TP
.I -i
Information about specified packages or a list of possible unused ports
.TP
.I -n
When rebuilding ports, do not automatically increase the release number
.TP
.I -p
Show differences between original and used Pkgfile
.TP
.I -u
Update the port collections
.TP
.I -z
Delete unused source files and packages after build
.SH ARGUMENTS
Port or collection names
.SH USAGE
.B pkgnew
uses the standard package build description file
.IR Pkgfile :
# Description: DESCRIPTION
# URL: URL
# Maintaner: MAINTAINER
# Depends on: PORT PORT ...
name=PORTNAME
version=VERSION
release=NUM
source=(URL_SOURCE LOCAL_SOURCE)
build() {
cd $name-$version
...
}
Extensions to
.I Pkgfile
that
.B pkgnew
checks:
# Post-install: yes
# Required user: User Uid [Group Gid] [Home [Comment]]
# Build also: PkgName
buildalso() {
mkdir -p PkgName
...
}
Before use
.B pkgnew
in
.I /etc/pkgmk.conf
must be defined variable
.IR PKGMK_SOURCE_DIR ,
.I PKGMK_PACKAGE_DIR
and
.IR PKGMK_WORK_DIR
and have a
.I /usr/ports/CRUX/PKG.cfg
configuration file.
In the first step,
.B pkgnew
checks the installed and specified by the command line packages and builds
a script to build them in the order of dependencies. For this, the descriptions
of building packages with applied patches, if any, are used.
In the next step,
.B pkgnew
organizes the execution of the resulting script to get and install changed or
new packages. To do this, using
.IR wget ,
the necessary sources are downloaded and the checksums from
.I .signature
are checked. Then, if any, add-ons from
.I
are copied and the package build script is run. If a package requires
a specific user, it is created before building the package.
At the end of the work,
.B pkgnew
creates a list of libraries required for each package and creates a list of
packages for installation by
.BR pkguse .
Finally, it removes unused sources and packages.
.SH EXAMPLES
.B 1.
Updating the ports collection
.I core
and show the process of building and installing changed packages:
# pkgnew -u core
.B 2.
Building used packages and upgrading them:
# pkgnew -b
.B 3.
Building and installing the missing package and all the dependencies required
by it, for example, installing the
.I cdrkit
package:
# pkgnew -b cdrkit
.B 4.
Delete unused files after building packages:
# pkgnew -bz
.B 5.
An example of splitting
.I core/acl
port into a main package and a developer package:
Need insert the following code to
.IR core/acl/Pkgfile :
# Build also: acl-dev
buildalso() {
mkdir -p $name-dev/usr/{lib,share/man}
mv $name/usr/include $name-dev/usr
mv $name/usr/lib/*.{a,la} $name/usr/lib/pkgconfig $name-dev/usr/lib
mv $name/usr/share/man/man3 $name-dev/usr/share/man
}
Rebuild
.I core/acl
port:
# pkgnew -e acl
{pasting the previous code with your favorite editor}
pkgnew: Create a patch for the original Pkgfile? [N/y] y
# pkgnew -b
.SH EXIT STATUS
.B 0
- successful completion.
.br
.B 1
- error termination.
.SH ENVIRONMENT
.TP
.B EDITOR
Default user's editor.
.SH FILES
.TP
.I /etc/pkgmk.conf
Global package make configuration.
.TP
.I /etc/ports/
Directory for port collection configuration.
.TP
.I /etc/ports/drivers/
Directory for driver scripts.
.TP
.I /usr/ports/
Root of local ports collection.
.TP
.I /usr/ports/{REPO}/{NAME}/.signature
SHA256 checksum and signify checksum for port
.IR NAME .
.TP
.I /usr/ports/{REPO}/{NAME}/Pkgfile
Package build description for port
.IR NAME .
.TP
.I /usr/ports/CRUX/
Directory for
.B pkgnew
work files.
.TP
.I /usr/ports/CRUX/PKG.cfg
Configuration file for
.BR pkgnew .
.TP
.I /usr/ports/CRUX/{NAME}
Patch for building a package for port
.IR NAME .
.TP
.I /usr/ports/CRUX/{NAME}#{ADD-ONS}
Additional files to build the port package
.IR NAME .
.TP
.I ${PKGMK_PACKAGE_DIR}/PKG.new
Resulting script used to build and install packages.
.TP
.I ${PKGMK_PACKAGE_DIR}/PKG.ldd
Resulting list of libraries used by packages.
.TP
.I ${PKGMK_PACKAGE_DIR}/PKG.use
Resulting list of packages in order of dependencies to install with
.BR pkguse .
.SH SEE ALSO
.BR pkgadd (8),
.BR pkginfo (8),
.BR pkgmk (8),
.BR pkgmk.conf (5),
.BR pkgrm (8),
.BR pkguse (8),
.BR ports (8),
.BR rejmerge (8),
.BR signify (1),
.BR wget (1).
.SH REPORTING BUGS
Report any errors to the author below.
.SH AUTHOR
Roman Oreshnikov <r.oreshnikov@gmail.com>.
.SH COPYRIGHT
Copyright 2019 by Roman Oreshnikov