summaryrefslogtreecommitdiffstats
path: root/man/opkhelper.7.in
blob: 1b564e19f4094dfae188f8f4888bb40d9b276cd6 (plain)
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
.\" Author: Patrick "P. J." McDermott
.TH opkhelper 7 \
"2012-04-23" "@@PACKAGE@@-@@VERSION@@" "opkg Build Helper Tools"

.SH NAME
opkhelper \- opkg build helper tools

.SH DESCRIPTION
opkhelper is a set of programs to assist in building binary packages installable
by the lightweight package manager
.BR opkg .
These tools are inspired by debhelper, a similar set of programs written
primarily by Joey Hess for Debian.
.sp
opkhelper is designed to build source packages that comply with draft version
1.0 of the source package format at
.IR http://specs.os.pehjota.net/source-package-format-1.0.html .

.SH MAINTAINER AND PACKAGE INTERFACES
opkhelper exposes various interfaces to users building packages and to packages
themselves.  Users generally just call
.B opkbuild(1)
to begin building packages.  The
.I build
file of a package generally calls a number of opkhelper tools to help it manage
and pack data and control files for packages.  Additionally,
.B opkbuild(1)
documents the build environment by setting environment variables that are
available to the
.I build
file and other opkhelper tools.

.SH OPKHELPER COMMANDS
.TP
.B opkbuild(1)
Build opkg packages.
.sp
Executed by the user to begin building packages.
.TP
.B oh-checkbuilddeps(1)
Make sure that package build dependencies are installed.
.sp
Executed by
.BR opkbuild(1) .
.TP
.B oh-applypatches(1)
Apply patches to source code.
.sp
Executed by
.BR opkbuild(1) .
.TP
.B oh-copyconfig(1)
Copy build-time or run-time platform configuration files.
.sp
Executed by
.BR opkbuild(1) .
.TP
.B oh-strip(1)
Strip binary objects of symbols.
.sp
Generally executed by package
.I build
files.
.TP
.B oh-installfiles(1)
Install files into a binary package staging area.
.sp
Generally executed by package
.I build
files.
.TP
.B oh-installdocs(1)
Install package documentation into a binary package staging area.
.sp
Generally executed by package
.I build
files.
.TP
.B oh-gencontrol(1)
Generates a control directory with a control file and scripts.
.sp
Generally executed by package
.I build
files.
.TP
.B oh-buildopk(1)
Pack binary package files into an opk file.
.sp
Generally executed by package
.I build
files.

.SH ENVIRONMENT VARIABLES
opkbuild makes available to package
.I build
files and other opkhelper tools a number of environment variables that describe
the packages being built, the build and host systems, and the toolchain to be
used.  The difference between "build" and "host" systems follows the convention
set by GNU Autoconf.  The build system is the one on which software is built.
The host system is the one on which software is to be run.  For more information, see
.IR https://www.gnu.org/software/autoconf/manual/autoconf.html#Specifying-Targe\
t-Triplets .
.TP
.B OH_SRCPKG
The name of the source package
.TP
.B OH_PKGVER
The version of the source package
.TP
.B OH_BINPKG
The name of the current binary package
.TP
.B OH_BUILD_ARCH_DIST
Build system distribution architecture string
.TP
.B OH_BUILD_ARCH_CPU
Build system CPU
.TP
.B OH_BUILD_ARCH_KERNEL
Build system kernel
.TP
.B OH_BUILD_ARCH_LIBS
Build system C/C++ libraries
.TP
.B OH_BUILD_PLATFORM
Build system application platform
.TP
.B OH_BUILD_ARCH_GNU
Build system GNU system type
.TP
.B OH_HOST_ARCH_DIST
Host system distribution architecture string
.TP
.B OH_HOST_ARCH_CPU
Host system CPU
.TP
.B OH_HOST_ARCH_KERNEL
Host system kernel
.TP
.B OH_HOST_ARCH_LIBS
Host system C/C++ libraries
.TP
.B OH_HOST_PLATFORM
Host system application platform
.TP
.B OH_HOST_ARCH_GNU
Host system GNU system type
.TP
.B AR
"ar" with cross toolchain prefix, if any
.TP
.B AS
"as" with cross toolchain prefix, if any
.TP
.B CC
"gcc" with cross toolchain prefix, if any
.TP
.B CPP
"cpp" with cross toolchain prefix, if any
.TP
.B CXX
"g++" with cross toolchain prefix, if any
.TP
.B LD
"ld" with cross toolchain prefix, if any
.TP
.B NM
"nm" with cross toolchain prefix, if any
.TP
.B OBJCOPY
"objcopy" with cross toolchain prefix, if any
.TP
.B OBJDUMP
"objdump" with cross toolchain prefix, if any
.TP
.B RANLIB
"ranlib" with cross toolchain prefix, if any
.TP
.B READELF
"readelf" with cross toolchain prefix, if any
.TP
.B SIZE
"size" with cross toolchain prefix, if any
.TP
.B STRINGS
"strings" with cross toolchain prefix, if any
.TP
.B STRIP
"strip" with cross toolchain prefix, if any

.SH EXAMPLES
The following is an example
.I build
makefile, showing the use of opkhelper tools and environment variables:
.sp
.nf
#! /usr/bin/make -f

PKGS = xmlwf xmlwf-doc libexpat.1 libexpat.1-dev libexpat.1-dbg

$(PKGS): expat.buildstamp

\a.SILENT: expat.buildstamp
expat.buildstamp:
	cd src && \\
		./configure --prefix=/usr \\
		--build=$${OH_BUILD_ARCH_GNU} --host=$${OH_HOST_ARCH_GNU} && \\
		make && make DESTDIR=$$(pwd)/../dest install
	oh-strip -gl /usr/lib/libexpat.so.1.6.0
	oh-installfiles $(PKGS)
	oh-installdocs libexpat.1
	oh-gencontrol $(PKGS)
	oh-buildopk $(PKGS)
	touch expat.buildstamp
.fi

.SH COPYRIGHT
Copyright (C) 2012 Patrick "P. J." McDermott
.sp
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
.sp
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.
.sp
You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.