xref: /openbsd/share/man/man7/library-specs.7 (revision 17df1aa7)
1.\" $OpenBSD: library-specs.7,v 1.7 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 LIBRARY-SPECS 7
29.Os
30.Sh NAME
31.Nm library-specs
32.Nd shared library name specifications
33.Sh DESCRIPTION
34Each
35.Ev LIB_DEPENDS
36item in the port tree conforms to
37.Sq lib_specs:[pkgspec]:directory[,-subpackage][,flavor ...][:target] ,
38where
39.Sq lib_specs
40is a comma-separated list of
41.Sq lib_spec
42of the form:
43.Sq libname[.=major[.minor]]
44or
45.Sq libname[.>=major[.minor]] .
46.Pp
47All libraries that a port needs must be mentioned in that list, either
48directly or indirectly through recursive dependencies (except, of course,
49for system libraries).
50.Pp
51The package system will embed correct dependency checks in the built
52package, according to the normal shared library semantics: any library with
53the same major number, and a greater or equal minor number will do.
54.Pp
55Therefore, porters must strive to respect correct shared library semantics
56in their own ports: by bumping the minor number each time the interface is
57augmented, and by bumping the major number each time the interface changes.
58Note that adding functions to a library is an interface augmentation.
59Removing functions is an interface change.
60.Pp
61The major.minor components of the library specification are used only as a
62build-time check.
63For
64.Sq libname.>=major[.minor] ,
65any library which is more recent than the given major.minor version will
66do.
67If a specific major number is needed, use the form
68.Sq libname.=major[.minor] .
69If the minor component is left empty, any minor will do.
70If both components are left empty, any version will do.
71.Pp
72The
73.Sq pkgspec
74part is always checked, both at build-time, and at
75.Xr pkg_add 1
76time.
77If
78.Sq pkgspec
79is left empty, any package will do: in effect, the pkgspec used is
80.Sq stem-* .
81.Pp
82If a given architecture does not support shared libraries, all
83.Ev LIB_DEPENDS
84will be turned into simple
85.Ev BUILD_DEPENDS
86checks.
87Failure to mention
88.Ev RUN_DEPENDS
89if the port needs anything beyond libraries from the dependent port will
90lead to strange errors.
91.Sh SEE ALSO
92.Xr pkg_add 1 ,
93.Xr bsd.port.mk 5 ,
94.Xr packages 7 ,
95.Xr packages-specs 7 ,
96.Xr ports 7
97.Sh HISTORY
98Full support for library specifications first appeared in
99.Ox 3.1 .
100The format of specifications changed slightly to include
101.Sq >=
102before
103.Ox 4.0 .
104