1.\" $OpenBSD: packages-specs.7,v 1.15 2010/11/15 07:44:23 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: November 15 2010 $ 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. 56All packages must 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 p0 , 63.Sq p1 ... 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.8p0 . 70Obviously, these specific markers are reserved for 71.Ox 72purposes. 73See 74.Ev REVISION 75in 76.Xr bsd.port.mk 5 . 77.Pp 78In some rare cases, version numbering changes completely upstream. 79A version style marker, of the form 80.Sq v0 , 81.Sq v1 ... 82can be appended to the version number (after the patch level) 83to denote the new numbering scheme. 84See 85.Ev EPOCH 86in 87.Xr bsd.port.mk 5 . 88.Pp 89Flavored packages will also contain a list of flavors after the version 90identifier, in a canonical order determined by 91.Ev FLAVORS 92in the corresponding port's 93.Pa Makefile . 94For instance, kterm has an xaw3d flavor: 95.Qq ja-kterm-xaw3d . 96.Pp 97Note that, to uniquely identify the version part, no flavor shall ever 98start with a digit. 99Usually, flavored packages are slightly different versions of the same 100package that offer very similar functionalities. 101.Sh CONFLICTS 102Most conflicts between packages are handled on a package name basis. 103Unless the packages have been specially prepared, it is 104normally not possible to install two packages with the same 105.Ar stem . 106.Pp 107Note that the 108.Ar stem 109ends at the 110.Ar version 111part. 112So, for instance, 113.Qq kdelibs-1.1.2 114and 115.Qq kdelibs-2.1.1 116conflict. 117But 118.Qq openldap-2.0.7 119and 120.Qq openldap-client-2.0.7 121don't. 122Neither do 123.Qq qt-1.45 124and 125.Qq qt2-3.0 . 126.Sh DEPENDENCIES 127Packages may depend on other packages, as specified by their port's 128Makefile, in a 129.Ev BUILD_DEPENDS , 130.Ev LIB_DEPENDS , 131.Ev REGRESS_DEPENDS 132or 133.Ev RUN_DEPENDS . 134All those conform to 135.Bd -literal -offset indent 136[pkgspec:]directory,[-multi],[flavor...] 137.Ed 138.Pp 139The 140.Ar directory,[-multi],[flavor...] 141part of the dependency is always used to obtain the default dependency for 142the given package (the package that will be built and installed if no package 143is found). 144The corresponding package name is also used as a package specification, 145after removing any version and flavor requirements. 146.Pp 147Without a 148.Sq pkgspec: 149part, any package with the right stem will do: in effect, 150the pkgspec used is 151.Sq stem-* . 152.Pp 153An explicit specification such as 154.Qq png-1.0.7 . 155may be used to ask for a more specific version number. 156Version numbers may also include ranges, separated by commas, so for 157instance, 158.Qq foo->=1.3 159would match any foo with version at least 1.3, and 160.Qq foo->=1.3,<=1.5 161would match any version of foo between 1.3 and 1.5, inclusive. 162.Pp 163As a convenience, the ports tree recognizes a specification that starts 164with STEM, and will replace this with the correct stem, which can be useful 165for embarrassingly long package names. 166.Pp 167If the flavor specification is left blank, any flavor will do. 168Note that most default package names don't contain flavor specification, 169which means that any flavor will do 170For instance, in 171.Bd -literal -offset indent 172LIB_DEPENDS = graphics/aalib 173.Ed 174.Pp 175both 176.Qq aalib-1.2 177and 178.Qq aalib-1.2-no_x11 179will do. 180To restrict the specification to packages that match flavor 181.Sq f , 182append 183.Sq -f . 184To restrict the specification to packages that do not match flavor 185.Sq f , 186append 187.Sq -!f . 188In the preceding case, one may use 189.Bd -literal -offset indent 190LIB_DEPENDS = aalib-*-!no_x11:graphics/aalib 191.Ed 192.Pp 193to ensure the no_x11 flavor is not picked. 194.Sh DEPENDENCIES RESOLUTION 195Several packages may be specified for a dependency: 196.Qq foo-*|bar-* 197will match either any version of package foo, or any version of package bar. 198In the general case, each package holds a tree of dependencies. 199Resolution occurs at 200.Xr pkg_add 1 201time, and all dependencies are tracked only as far as needed. 202.Pp 203For instance, if package 204.Qq foo-1.0 205depends on either 206.Qq bar-* 207or 208.Qq fuzz-* , 209and 210.Qq bar-2.0 211depends 212on 213.Qq toughluck-* , 214.Xr pkg_add 1 215will first check whether 216.Qq bar-* 217or 218.Qq fuzz-* 219is installed. 220If either is there, the 221.Qq toughluck-* 222dependency will never be examined. 223It would only be used in the case where neither 224.Qq bar-* 225nor 226.Qq fuzz-* 227are present, thus 228.Xr pkg_add 1 229would decide to bring in 230.Qq bar-2.0 , 231and so would check on 232.Qq toughluck-* . 233.Sh SEE ALSO 234.Xr pkg_add 1 , 235.Xr bsd.port.mk 5 , 236.Xr library-specs 7 , 237.Xr packages 7 , 238.Xr ports 7 239.Sh HISTORY 240Support for a more complex form of those package specifications first 241appeared in 242.Ox 2.9 . 243The current simplified form was introduced in 244.Ox 4.9 . 245