xref: /onnv-gate/usr/src/README.license-files (revision 12998:c0270875939a)
16417Smjnelson#
26417Smjnelson# CDDL HEADER START
36417Smjnelson#
46417Smjnelson# The contents of this file are subject to the terms of the
56417Smjnelson# Common Development and Distribution License (the "License").
66417Smjnelson# You may not use this file except in compliance with the License.
76417Smjnelson#
86417Smjnelson# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
96417Smjnelson# or http://www.opensolaris.org/os/licensing.
106417Smjnelson# See the License for the specific language governing permissions
116417Smjnelson# and limitations under the License.
126417Smjnelson#
136417Smjnelson# When distributing Covered Code, include this CDDL HEADER in each
146417Smjnelson# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
156417Smjnelson# If applicable, add the following below this CDDL HEADER, with the
166417Smjnelson# fields enclosed by brackets "[]" replaced with your own identifying
176417Smjnelson# information: Portions Copyright [yyyy] [name of copyright owner]
186417Smjnelson#
196417Smjnelson# CDDL HEADER END
206417Smjnelson#
21*12998SMark.J.Nelson@Oracle.COM
226417Smjnelson#
23*12998SMark.J.Nelson@Oracle.COM# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
246417Smjnelson#
256417Smjnelson
266417SmjnelsonOK, so you've got approval to integrate code, and you want to know how to
276417Smjnelsonproperly communicate the license terms.  What do you do next?
286417Smjnelson
29*12998SMark.J.Nelson@Oracle.COM0. Determine whether your code should be covered by Oracle copyright,
30*12998SMark.J.Nelson@Oracle.COM   CDDL, and/or a third party license.  If only Oracle copyright and/or
31*12998SMark.J.Nelson@Oracle.COM   CDDL, then skip to step 3.
326417Smjnelson
336417Smjnelson1. Scan the source code and extract all of the third party licenses
346417Smjnelson   into one or more separate files.
356417Smjnelson
36*12998SMark.J.Nelson@Oracle.COM   This information may be present in comments in source code, or may
37*12998SMark.J.Nelson@Oracle.COM   already be provided as separate files.  For example, GPL license
38*12998SMark.J.Nelson@Oracle.COM   terms are often found in files named "COPYING."
39*12998SMark.J.Nelson@Oracle.COM
406417Smjnelson   A. In general, you'll name these files "THIRDPARTYLICENSE," and
416417Smjnelson      you'll put one in each source directory (i.e. one per library,
426417Smjnelson      or one per command, or one per kernel module.)
436417Smjnelson
446417Smjnelson      EXAMPLE: usr/src/uts/common/io/pcan/THIRDPARTYLICENSE
456417Smjnelson
466417Smjnelson      If this file proves unmanageable, or you're adding licenses
476417Smjnelson      that really are independent of each other, you may instead
486417Smjnelson      create multiple "THIRDPARTYLICENSE.foo" files, where "foo"
496417Smjnelson      obviously corresponds to the license in question.
506417Smjnelson
516417Smjnelson      EXAMPLE: usr/src/lib/libsmbfs/smb/THIRDPARTYLICENSE.*
526417Smjnelson
536417Smjnelson   B. If you planned ahead and included graceful delimiters in your
546417Smjnelson      source code, the THIRDPARTYLICENSE files may actually be build
556417Smjnelson      targets in your Makefiles.
566417Smjnelson
576417Smjnelson      EXAMPLE: usr/src/cmd/perl/Makefile
586417Smjnelson
59*12998SMark.J.Nelson@Oracle.COM      If the corresponding copyright will change dates frequently,
60*12998SMark.J.Nelson@Oracle.COM      then this approach can work well, because you won't need to
61*12998SMark.J.Nelson@Oracle.COM      update the license files manually.
62*12998SMark.J.Nelson@Oracle.COM
63*12998SMark.J.Nelson@Oracle.COM      If you do this, then your license file should be a dependency of
64*12998SMark.J.Nelson@Oracle.COM      both the all and install targets, and should be removed via
65*12998SMark.J.Nelson@Oracle.COM      clobber, usually by way of CLOBBERFILES.
666417Smjnelson
676417Smjnelson2. Give each of the license files a corresponding ".descrip" file with
68*12998SMark.J.Nelson@Oracle.COM   a terse explanation of the contents.  Something like "MJN DRIVER"
69*12998SMark.J.Nelson@Oracle.COM   or "PORTIONS OF ARCANE FUNCTIONALITY" is sufficient.
706417Smjnelson
716417Smjnelson   EXAMPLE: usr/src/cmd/refer/THIRDPARTYLICENSE.descrip
726417Smjnelson
73*12998SMark.J.Nelson@Oracle.COM3. Figure out which packages deliver objects that are built using the
7411838SLiane.Praza@Sun.COM   new source, and add license actions to the package manifest(s).
756417Smjnelson
766417Smjnelson   A. It's extremely rare for a package NOT to include a Sun copyright
7711838SLiane.Praza@Sun.COM      and CDDL.  If your package is one of the 99 percent that should
7811838SLiane.Praza@Sun.COM      have a Sun copyright and CDDL, then your package should have license
7911838SLiane.Praza@Sun.COM      actions like this:
806417Smjnelson
8111838SLiane.Praza@Sun.COM	  license lic_CDDL license=lic_CDDL
8211838SLiane.Praza@Sun.COM	  license cr_Sun license=cr_Sun
836417Smjnelson
8411838SLiane.Praza@Sun.COM   B. If your package delivers ONLY header files, and has multiple different
856417Smjnelson      copyrights or licenses, you can use
866417Smjnelson
8711838SLiane.Praza@Sun.COM          license license_in_headers license=license_in_headers
88*12998SMark.J.Nelson@Oracle.COM	  license path/to/most/common/copyright/file \
89*12998SMark.J.Nelson@Oracle.COM	      license=path/to/most/common/copyright/file
90*12998SMark.J.Nelson@Oracle.COM	  license path/to/most/common/license/file \
91*12998SMark.J.Nelson@Oracle.COM	      license=path/to/most/common/license/file
926417Smjnelson
9311838SLiane.Praza@Sun.COM   C. For your new license files, the path you use in your license
94*12998SMark.J.Nelson@Oracle.COM      actions should be relative to ${CODEMGR_WS}.
956417Smjnelson
9611838SLiane.Praza@Sun.COM   D. Empty packages: if your package delivers nothing (or, more strictly
9711838SLiane.Praza@Sun.COM      speaking, nothing besides directories) you should include the Sun
9811838SLiane.Praza@Sun.COM      copyright but not the CDDL.
996417Smjnelson
10011838SLiane.Praza@Sun.COM   E. As with any other action that is architecture dependent, license
10111838SLiane.Praza@Sun.COM      actions may be preceded by $(blah_ONLY), where "blah" corresponds
10211838SLiane.Praza@Sun.COM      to $(uname -p).
103*12998SMark.J.Nelson@Oracle.COM
104*12998SMark.J.Nelson@Oracle.COM   If you don't add the appropriate license actions to package
105*12998SMark.J.Nelson@Oracle.COM   manifests, then your license and description files will show up as
106*12998SMark.J.Nelson@Oracle.COM   unreferenced in the build.
107