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