Templetizing free and open source licenses for SPDX
One of the problems of automatic license matching is that some open source licenses are expected to be modified every time they are used. For example, the BSD3 license is expected to have several sections replaced by the one that uses it, such as its copyright holder and year of copyright:
Copyright (c) <year>, <copyright holder>
All rights reserved.
Redistribution and use in source and binary forms, with or without
...
The problem is that information is not standardized. The SPDX is tryig to do this. As part of the team, and given my experience, I have been helping. My proposal is the following:
A proposal for templetization of Free and Open Source licenses for SPDX
Introduction
Certain sections of a license vary as they are used. Some of this variability is by design (think of the BSD family of licenses). In other cases it is due to small changes in licenses as they are copied and propagated.
Rules
A variable section of a license is specified with a rule. A rule is wrapped between and is composed of 5 parts. Each is separated with ; (semicolo). They cannot be embedded within other rules.
original: the original text of the rule. It should be the first field. It is required.
match: a POSIX regular expression (semicolons are escaped with \; within it). This field is required.
name: name of the field in the template. Each rule must have a name. This field is required.
type: required or optional. This field is required.
example: another example of the use of the text. This field is optional.
Example:
{{original=THE AUTHOR OR CONTRIBUTORS;match=.+;name=copyrightHolderLiability;type=required;example=dmg inc.}}
Here is an example of the its use for the BSD3:
{{original=(c) <year> <copyright holder>;match=Copyright \(c\).+ All rights reserved.;name=copyrigh;type=optional;example=Copyright (c) 1994 David Burren All rights reserved}}
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the {{original=name;{match=(name|names;name=nameprefix;example=name}} of {{original=the author nor the names of other contributors;match=.+;name=organizationClause4;example=ACME Inc.}}
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY {{original=THE AUTHOR AND CONTRIBUTORS;match=.+;name=copyrightHolderAsIs;type=required}} "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL {{original=THE AUTHOR OR CONTRIBUTORS;match=.+;name=copyrightHolderLiability;type=required;example=John Wayne}} BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
This proposal is hosted at github.
–dmg