xref: /openbsd-src/share/man/man7/packages-specs.7 (revision 9490d37cb6a2f9c8feb8d4b7f9c43b2ac41784aa)
1.\" $OpenBSD: packages-specs.7,v 1.8 2007/05/31 19:19:58 jmc 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 $Mdocdate: May 31 2007 $
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.
88Unless the 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.
97So, for instance,
98.Qq kdelibs-1.1.2
99and
100.Qq kdelibs-2.1.1
101conflict.
102But
103.Qq openldap-2.0.7
104and
105.Qq openldap-client-2.0.7
106don't.
107Neither do
108.Qq qt-1.45
109and
110.Qq qt2-3.0 .
111.Sh DEPENDENCIES
112Packages may depend on other packages, as specified by their port's
113Makefile.
114The
115.Ar directory,[-multi],[flavor...]
116part of the dependency is always used to obtain the default dependency for
117the given package (the package that will be installed if no package
118is found).
119The corresponding package name is also used as a package specification,
120unless a more specific specification has been given.
121.Pp
122Package specifications are extended package names, that may use
123.Xr sh 1
124-style wildcards, like
125.Sq *
126or
127.Sq \&? .
128.Pp
129A specification such as
130.Qq ghostscript-*
131may be used to ask for any version of package ghostscript,
132or a more specific wildcard may be used, such as
133.Qq png-1.0.* .
134Version numbers may also include ranges, separated by commas, so for
135instance,
136.Qq foo-1.0.*,>=1.3,<1.5
137would match either foo-1.0.something, or any version of foo between 1.3
138and 1.5.
139.Pp
140If the flavor specification is left blank, any flavor will do.
141Note that most default package names don't contain flavor specification,
142which means that any flavor will do.
143For instance, in
144.Bd -literal -offset indent
145LIB_DEPENDS=aa.1.2::graphics/aalib
146.Ed
147.Pp
148both
149.Qq aalib-1.2
150and
151.Qq aalib-1.2-no_x11
152will do.
153To restrict the specification to packages that match flavor
154.Sq f ,
155append
156.Sq -f .
157To restrict the specification to packages that do not match flavor
158.Sq f ,
159append
160.Sq -!f .
161In the preceding case, one may use
162.Bd -literal -offset indent
163LIB_DEPENDS=aa.1.2:aalib-1.2-!no_x11:graphics/aalib
164.Ed
165.Pp
166to ensure the no_x11 flavor is not picked.
167.Sh DEPENDENCIES RESOLUTION
168Several packages may be specified for a dependency:
169.Qq foo|bar
170will match either package foo, or package bar.
171In the general case, each package holds a tree of dependencies.
172Resolution occurs at
173.Xr pkg_add 1
174time, and all dependencies are tracked only as far as needed.
175.Pp
176For instance, if package
177.Qq foo
178depends on either
179.Qq bar
180or
181.Qq fuzz ,
182and
183.Qq bar
184depends
185on
186.Qq toughluck ,
187.Xr pkg_add 1
188will first check whether
189.Qq bar
190or
191.Qq fuzz
192is installed.
193If either is there, the
194.Qq toughluck
195dependency will never be examined.
196It would only be used in the case where neither
197.Qq bar
198nor
199.Qq fuzz
200are present, thus
201.Xr pkg_add 1
202would decide to bring in
203.Qq bar ,
204and so would check on
205.Qq toughluck .
206.Sh SEE ALSO
207.Xr pkg_add 1 ,
208.Xr bsd.port.mk 5 ,
209.Xr library-specs 7 ,
210.Xr packages 7 ,
211.Xr ports 7
212.Sh HISTORY
213Support for these package specifications first appeared in
214.Ox 2.9 .
215