1.\" $OpenBSD: packages-specs.7,v 1.13 2010/07/11 07:25:10 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 $Mdocdate: July 11 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[legacy]:[pkgspec]:directory,[-multi],[flavor...] 137.Ed 138.Pp 139The 140.Ar [legacy] 141part of the dependency corresponds to older semantics that have been 142deprecated. 143.Pp 144The 145.Ar directory,[-multi],[flavor...] 146part of the dependency is always used to obtain the default dependency for 147the given package (the package that will be built and installed if no package 148is found). 149The corresponding package name is also used as a package specification, 150after removing any version and flavor requirements. 151.Pp 152If the 153.Sq pkgspec 154part is left empty, any package with the right stem will do: in effect, 155the pkgspec used is 156.Sq stem-* . 157.Pp 158An explicit specification such as 159.Qq ghostscript-* 160may be used to ask for any version of package ghostscript, 161or a more specific version number may be required, such as 162.Qq png-1.0.7 . 163Version numbers may also include ranges, separated by commas, so for 164instance, 165.Qq foo->=1.3 166would match any foo with version at least 1.3, and 167.Qq foo->=1.3,<=1.5 168would match any version of foo between 1.3 and 1.5, inclusive. 169.Pp 170If the flavor specification is left blank, any flavor will do. 171Note that most default package names don't contain flavor specification, 172which means that any flavor will do. 173For instance, in 174.Bd -literal -offset indent 175LIB_DEPENDS=::graphics/aalib 176.Ed 177.Pp 178both 179.Qq aalib-1.2 180and 181.Qq aalib-1.2-no_x11 182will do. 183To restrict the specification to packages that match flavor 184.Sq f , 185append 186.Sq -f . 187To restrict the specification to packages that do not match flavor 188.Sq f , 189append 190.Sq -!f . 191In the preceding case, one may use 192.Bd -literal -offset indent 193LIB_DEPENDS=:aalib-*-!no_x11:graphics/aalib 194.Ed 195.Pp 196to ensure the no_x11 flavor is not picked. 197.Sh DEPENDENCIES RESOLUTION 198Several packages may be specified for a dependency: 199.Qq foo-*|bar-* 200will match either any version of package foo, or any version of package bar. 201In the general case, each package holds a tree of dependencies. 202Resolution occurs at 203.Xr pkg_add 1 204time, and all dependencies are tracked only as far as needed. 205.Pp 206For instance, if package 207.Qq foo-1.0 208depends on either 209.Qq bar-* 210or 211.Qq fuzz-* , 212and 213.Qq bar-2.0 214depends 215on 216.Qq toughluck-* , 217.Xr pkg_add 1 218will first check whether 219.Qq bar-* 220or 221.Qq fuzz-* 222is installed. 223If either is there, the 224.Qq toughluck-* 225dependency will never be examined. 226It would only be used in the case where neither 227.Qq bar-* 228nor 229.Qq fuzz-* 230are present, thus 231.Xr pkg_add 1 232would decide to bring in 233.Qq bar-2.0 , 234and so would check on 235.Qq toughluck-* . 236.Sh SEE ALSO 237.Xr pkg_add 1 , 238.Xr bsd.port.mk 5 , 239.Xr library-specs 7 , 240.Xr packages 7 , 241.Xr ports 7 242.Sh HISTORY 243Support for these package specifications first appeared in 244.Ox 2.9 . 245