xref: /openbsd-src/share/man/man7/packages-specs.7 (revision b2ea75c1b17e1a9a339660e7ed45cd24946b230e)
1.\" $OpenBSD: packages-specs.7,v 1.2 2001/07/16 00:27:02 espie Exp $
2.\"
3.\" Copyright (c) 2001 Marc Espie
4.\"
5.\" All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\" 1. Redistributions of source code must retain the above copyright
11.\"    notice, this list of conditions and the following disclaimer.
12.\" 2. Redistributions in binary form must reproduce the above copyright
13.\"    notice, this list of conditions and the following disclaimer in the
14.\"    documentation and/or other materials provided with the distribution.
15.\"
16.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
17.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
20.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26.\"
27.Dd April 9, 2001
28.Dt PACKAGES-SPECS 7
29.Os
30.Sh NAME
31.Nm packages-specs
32.Nd binary package names specifications
33.Sh DESCRIPTION
34Each package has a name consisting of at most three parts:
35.Bd -literal -offset indent
36stem-version[-flavors]
37.Ed
38.Pp
39The
40.Ar stem
41part identifies the package.
42It may contain some dashes, but its form is mostly conventional.
43For instance, japanese packages usually
44start with a
45.Sq ja
46prefix, e.g.,
47.Qq ja-kterm-6.2.0 .
48.Pp
49The
50.Ar version
51part starts at the first digit that follows a
52.Sq - ,
53and goes on up to the following
54.Sq - ,
55or to the end of the package name, if no flavor modifier is present.
56It is highly recommended that all packages have a version number.
57Normally, the version number directly matches the original software
58distribution version number, or release date.
59In case there are substantial changes in the
60.Ox
61package, a patch level marker should be appended, e.g.,
62.Sq p1 ,
63.Sq p2 ...
64For example, assuming that the screen package for release 2.8 was
65named
66.Qq screen-2.9.8
67and that an important security patch led to a newer package,
68the new package would be called
69.Qq screen-2.9.8p1 .
70Obviously, these specific markers are reserved for
71.Ox
72purposes.
73.Pp
74Flavored packages will also contain a list of flavors after the version
75identifier, in a canonical order determined by
76.Ev FLAVORS
77in the corresponding port's
78.Pa Makefile .
79For instance, kterm has an xaw3d flavor:
80.Qq ja-kterm-xaw3d .
81.Pp
82Note that, to uniquely identify the version part, no flavor shall ever
83start with a digit.
84Usually, flavored packages are slightly different versions of the same
85package that offer very similar functionalities.
86.Sh CONFLICTS
87Most conflicts between packages are handled on a package name basis. Unless
88the packages have been specially prepared, it is
89normally not possible to install two packages with the same
90.Ar stem .
91.Pp
92Note that the
93.Ar stem
94ends at the
95.Ar version
96part. So, for instance,
97.Qq kdelibs-1.1.2
98and
99.Qq kdelibs-2.1.1
100conflict.
101But
102.Qq openldap-2.0.7
103and
104.Qq openldap-client-2.0.7
105don't.
106Neither do
107.Qq qt-1.45
108and
109.Qq qt2-3.0 .
110.Sh DEPENDENCIES
111Packages may depend on other packages, as specified by their port's
112Makefile.
113The
114.Ar directory,[-multi],[flavor...]
115part of the dependency is always used to obtain the default dependency for
116the given package (the package that will be installed if no package
117is found).
118The corresponding package name is also used as a package specification,
119unless a more specific specification has been given.
120.Pp
121Package specifications are extended package names, that may use
122.Xr sh 1
123-style wildcards, like
124.Sq *
125or
126.Sq ? .
127.Pp
128A specification such as
129.Qq ghostscript-*
130may be used to ask for any version of package ghostscript,
131or a more specific wildcard may be used, such as
132.Qq png-1.0.* .
133Version numbers may also include ranges, separated by commas, so for
134instance,
135.Qq foo-1.0.*,>=1.3,<1.5
136would match either foo-1.0.something, or any version of foo between 1.3
137and 1.5.
138.Pp
139If the flavor specification is left blank, any flavor will do.
140Note that most default package names don't contain flavor specification,
141which means that any flavor will do. For instance, in
142.Bd -literal -offset indent
143LIB_DEPENDS=aa.1.2::graphics/aalib
144.Ed
145.Pp
146both
147.Qq aalib-1.2
148and
149.Qq aalib-1.2-no_x11
150will do.
151To restrict the specification to packages that match flavor
152.Sq f ,
153append
154.Sq -f .
155To restrict the specification to packages that do not match flavor
156.Sq f ,
157append
158.Sq -!f .
159In the preceding case, one may use
160.Bd -literal -offset indent
161LIB_DEPENDS=aa.1.2:aalib-1.2-!no_x11:graphics/aalib
162.Ed
163.Pp
164to ensure the no_x11 flavor is not picked.
165.Sh DEPENDENCIES RESOLUTION
166Several packages may be specified for a dependency:
167.Qq foo|bar
168will match either package foo, or package bar.
169In the general case, each package holds a tree of dependencies.
170Resolution occurs at
171.Xr pkg_add 1
172time, and all dependencies are tracked only as far as needed.
173.Pp
174For instance, if package
175.Qq foo
176depends on either
177.Qq bar
178or
179.Qq fuzz ,
180and
181.Qq bar
182depends
183on
184.Qq toughluck ,
185.Xr pkg_add 1
186will first check whether
187.Qq bar
188or
189.Qq fuzz
190is installed.
191If either is there, the
192.Qq toughluck
193dependency will never be examined.
194It would only be used in the case where neither
195.Qq bar
196nor
197.Qq fuzz
198are present, thus
199.Xr pkg_add 1
200would decide to bring in
201.Qq bar ,
202and so would check on
203.Qq toughluck .
204.Sh HISTORY
205Support for these package specifications first appeared in
206.Ox 2.9 .
207.Sh SEE ALSO
208.Xr pkg_add 1 ,
209.Xr bsd.port.mk 5 ,
210.Xr packages 7 ,
211.Xr ports 7
212