xref: /illumos-gate/usr/src/README.license-files (revision 99dda208)
1#
2# CDDL HEADER START
3#
4# The contents of this file are subject to the terms of the
5# Common Development and Distribution License (the "License").
6# You may not use this file except in compliance with the License.
7#
8# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9# or http://www.opensolaris.org/os/licensing.
10# See the License for the specific language governing permissions
11# and limitations under the License.
12#
13# When distributing Covered Code, include this CDDL HEADER in each
14# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15# If applicable, add the following below this CDDL HEADER, with the
16# fields enclosed by brackets "[]" replaced with your own identifying
17# information: Portions Copyright [yyyy] [name of copyright owner]
18#
19# CDDL HEADER END
20#
21#
22# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
23# Use is subject to license terms.
24#
25# ident	"%Z%%M%	%I%	%E% SMI"
26#
27
28OK, so you've got approval to integrate code, and you want to know how to
29properly communicate the license terms.  What do you do next?
30
310. If everything is covered by a Sun copyright and the CDDL, you're done.
32
331. Scan the source code and extract all of the third party licenses
34   into one or more separate files.
35
36   A. In general, you'll name these files "THIRDPARTYLICENSE," and
37      you'll put one in each source directory (i.e. one per library,
38      or one per command, or one per kernel module.)
39
40      EXAMPLE: usr/src/uts/common/io/pcan/THIRDPARTYLICENSE
41
42      If this file proves unmanageable, or you're adding licenses
43      that really are independent of each other, you may instead
44      create multiple "THIRDPARTYLICENSE.foo" files, where "foo"
45      obviously corresponds to the license in question.
46
47      EXAMPLE: usr/src/lib/libsmbfs/smb/THIRDPARTYLICENSE.*
48
49   B. If you planned ahead and included graceful delimiters in your
50      source code, the THIRDPARTYLICENSE files may actually be build
51      targets in your Makefiles.
52
53      EXAMPLE: usr/src/cmd/perl/Makefile
54
55      This approach is usually overkill.  But if the third party license
56      will remain unchanged while the corresponding copyright will change
57      dates frequently, then this approach can work well, because you won't
58      need to update the license files manually.
59
602. Give each of the license files a corresponding ".descrip" file with
61   an extremely terse explanation of the contents.  Something like
62   "MJN DRIVER" or "PORTIONS OF ARCANE FUNCTIONALITY" is sufficient.
63
64   EXAMPLE: usr/src/cmd/refer/THIRDPARTYLICENSE.descrip
65
663. Edit usr/src/tools/opensolaris/license-list and add the full path
67   of your new license file(s).
68
694. Figure out which packages deliver objects that are built using the
70   new third party source, and add a reference to LICENSEFILES in the
71   pkg Makefile.
72
73   A. It's extremely rare for a package NOT to include a Sun copyright
74      statement.  If your package is one of the 99 percent that should
75      have a Sun copyright, then you should append to LICENSEFILES like
76      this:
77
78          LICENSEFILES += relative/path/to/my/new/license/file
79
80      or
81
82          LICENSEFILES += \
83                  path/to/first/file \
84                  path/to/other/file
85
86      These paths should be relative to the pkg build directory, for
87      example relative to usr/src/pkgdefs/SUNWbcp for pkg SUNWbcp.
88
89      EXAMPLE: usr/src/pkgdefs/SUNWpsm-ipp/Makefile
90      EXAMPLE: usr/src/pkgdefs/SUNWrcmdc/Makefile
91
92   B. If, on the other hand, you do NOT want a Sun copyright, then you
93      should follow the example above, but use "=" instead of "+=" when
94      you assign the LICENSEFILES macro.
95
96      EXAMPLE: usr/src/pkgdefs/SUNWrtls/Makefile
97
98   C. It's also unusual for a package NOT to reference the CDDL.  If you
99      used "+=" above, and you want the CDDL, then you don't need to do
100      anything else.  It will automatically be appended.
101
102   D. If you used "+=" above, because you want the Sun copyright, but you
103      do NOT want the CDDL, then you should also include the following line:
104
105          CDDL=
106
107      in your pkg Makefile.
108
109      EXAMPLE: usr/src/pkgdefs/SUNWwpi/Makefile
110
111   E. If you used "=" above, then you will not get the CDDL unless you
112      explicitly append it to LICENSEFILES:
113
114          LICENSEFILES = \
115                  path/to/first/file \
116                  path/to/other/file \
117                  $(CDDL)
118
119
120      EXAMPLE: usr/src/pkgdefs/SUNWhea/Makefile
121
122   F. If your package delivers ONLY header files, and has multiple different
123      copyrights or licenses, you can use
124
125          LICENSEFILES = $(LIC_IN_HDRS) \
126                  path/to/most/common/copyright/file \
127                  path/to/most/common/license/file
128
129      EXAMPLE: usr/src/pkgdefs/SUNWhea/Makefile
130
131   G. Empty packages: if your package delivers nothing (or, more strictly
132      speaking, nothing besides directories) you should keep the Sun
133      copyright but nix the CDDL.  As a reminder, that's done simply by
134      adding the single line
135
136          CDDL=
137
138      to your pkg Makefile.
139
140      EXAMPLE: usr/src/pkgdefs/SUNWdfb.i/Makefile
141
142   H. COPYRIGHT: Don't mess with this.  If you reset this, then you must
143      use the "copyright=" convention in your prototype_com.  As described
144      above, LICENSEFILES is the preferred mechanism.
145
146   I. Architecture dependent license files look like this:
147
148          LICENSEFILES_i386 = path/to/i386/only/license(s)
149
150          LICENSEFILES_sparc = path/to/sparc/only/license(s)
151
152          LICENSEFILES += \
153                  path/to/common/license/files(s) \
154                  $(LICENSEFILES_$(MACH))
155
156      EXAMPLE: usr/src/pkgdefs/SUNWcsl/Makefile
157      EXAMPLE: usr/src/pkgdefs/SUNWbcp/Makefile
158
159