summaryrefslogtreecommitdiffstats
path: root/specs/spf-2.0/overview.mdwn
blob: b4e6f09a5898358f52a14edb1b5ee304d02e3e05 (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
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
Directory Tree [tree]
=====================

The source package directory hierarchy can be summarized with the following
tree:

    <source-package-directory>/
     |  No naming requirements are made for this directory.
     +- <binpkg>.pkg/
     |   |  Required for each binary package after execution of "config".
     |   +- control
     |   |      Required.
     |   |      Metadata about the binary package.
     |   +- install
     |   |      Required.
     |   |      A list of patterns to match files to be installed in the binary
     |   |      package.
     |   +- platconf
     |   |      Optional.
     |   |      A list of run-time configuration files.
     |   +- postinst
     |   |      Optional.
     |   |      A maintainer script to be executed after a binary package is
     |   |      unpacked.
     |   +- postrm
     |   |      Optional.
     |   |      A maintainer script to be executed after a binary package is
     |   |      removed.
     |   +- preinst
     |   |      Optional.
     |   |      A maintainer script to be executed before a binary package is
     |   |      unpacked.
     |   \- prerm
     |          Optional.
     |          A maintainer script to be executed before a binary package is
     |          removed.
     +- build
     |      Required after execution of "config".
     |      A makefile with target rules to build the binary package(s).
     +- changelog
     |      Required.
     |      A log of changes made to the source package.
     +- config
     |      Optional.
     |      A shell script to configure the package build.
     +- control
     |      Required.
     |      Metadata about the source package.
     +- copyright
     |      Required.
     |      Information about copyrights and licenses in the source package.
     +- format
     |      Required.
     |      A magic file to identify the source format version.  Should simply
     |      contain the string "2.0".
     +- patches/
     |      Optional.
     |      Patches to be applied to package sources before building.
     +- <pkgname>-<pkgver>.tar.<ext>
     |      Optional.
     |      Upstream source archive (for non-native packages).
     +- platconf
     |      Optional.
     |      A list of build-time configuration files.
     \- src/
            Optional.
            Package sources (for native packages).


Descriptions of Files [files]
=============================

All of the following files are located under what is called a "source package
directory" (`<source-package-directory>` in the tree in $[sectlink][tree]).  No
naming requirements are made for this directory.

`<binpkg>.pkg/` [files-binpkg.pkg]
----------------------------------

After execution of the `config` file, for each binary package there must exist a
directory named `<binpkg>.pkg`, where `<binpkg>` is the name of the binary
package.

Binary package names may only consist of lowercase Latin letters, digits, plus
and minus signs, and periods.  Names must be at least two characters long and
must start with either a letter or a digit.  (A regular expression for this is
`[a-z0-9][a-z0-9+.-]+`.)

This directory contains metadata and scripts for a binary package.

`<binpkg>.pkg/control` [files-binpkg.pkg-control]
-------------------------------------------------

This file is required.

This file contains control fields describing the binary package.  See
$[sectlink][control] for the syntax of this file and $[sectlink][fields-bin] for
the list of control fields in this file.

`<binpkg>.pkg/install` [files-binpkg.pkg-install]
-------------------------------------------------

This file is required.

This file contains a list of patterns to match files to be installed in the
binary package.

Each line in this file is a pattern that is expanded to match files as explained
in [POSIX.1-2008, Shell & Utilities Volume, Section 2.6.6][posix-xcu-2.6.6].

A file or directory in the destination directory may not be matched by more than
one binary package's `install` file.  The behavior of package building tools in
such a case is undefined.

`<binpkg>.pkg/platconf` [files-binpkg.pkg-platconf]
---------------------------------------------------

This file is optional.  Its presence indicates that a binary package is
platform-specific.

This file contains a list of run-time configuration files to be installed in the
binary package.  Files listed in this file shall not be listed in the binary
package's `install` file.

See $[sectlink][platconf] for the syntax of this file.

`<binpkg>.pkg/postinst` [files-binpkg.pkg-postinst]
---------------------------------------------------

This file is optional.

This file is a maintainer script to be executed after a binary package is
unpacked.  See $[sectlink][scripts] for more information about maintainer
scripts.

`<binpkg>.pkg/postrm` [files-binpkg.pkg-postrm]
-----------------------------------------------

This file is optional.

This file is a maintainer script to be executed after a binary package is
removed.  See $[sectlink][scripts] for more information about maintainer
scripts.

`<binpkg>.pkg/preinst` [files-binpkg.pkg-preinst]
-------------------------------------------------

This file is optional.

This file is a maintainer script to be executed before a binary package is
unpacked.  See $[sectlink][scripts] for more information about maintainer
scripts.

`<binpkg>.pkg/prerm` [files-binpkg.pkg-prerm]
---------------------------------------------

This file is optional.

This file is a maintainer script to be executed before a binary package is
removed.  See $[sectlink][scripts] for more information about maintainer
scripts.

`build` [files-build]
---------------------

After execution of the `config` file, this file must exist.

This file is a makefile that controls the building of binary packages.  See
$[sectlink][build] for requirements for this file.

`changelog` [files-changelog]
-----------------------------

This file is required.

This file is a log of changes made to the source package.  See
$[sectlink][changelog] for the format of this file.

`config` [files-config]
-----------------------

This file is optional.

This file is a script in shell command language that configures the package
build.  See $[sectlink][config] for requirements for this file.

`control` [files-control]
-------------------------

This file is required.

This file contains control fields describing the source package.  See
$[sectlink][control] for the syntax of this file and $[sectlink][fields-src] for
the list of control fields in this file.

`copyright` [files-copyright]
-----------------------------

This file is required.

This file contains information about the copyrights in and licenses for the
source package.  This specification currently makes no requirements for the
format of this file.

`format` [files-format]
-----------------------

This file is required.

This "magic" file identifies the format version of the source package.  For
packages in this version of the source package format, this file should simply
contain the string `2.0`.

`patches/` [files-patches]
--------------------------

This directory is optional.

This directory shall contain patches to be applied to package sources before
configuring and building any binary packages.

See $[sectlink][patches] for the syntax of patch files.

`<pkgname>-<pkgver>.tar.<ext>` [files-src-src-ver-tar-ext]
----------------------------------------------------------

TODO

`platconf` [files-platconf]
---------------------------

This file is optional.  Its presence indicates that each binary package is
platform-specific.

This file contains a list of build-time configuration files to be installed into
the package building work area.

See $[sectlink][platconf] for the syntax of this file.

`src/` [files-src]
------------------

TODO


[posix-xcu-2.6.6]: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_06_06