Polymorph: Zak Greant's Blog

Machine-readable licensing blocks

One of our recent activities at eZ has been to rework our licensing. While most of the changes have been related to improving the agreements involved (simplifying, internationalizing, improving the legal robustness, etc.) we plan to make some changes to how we attach licensing information to our source code.

The basic plan is to drop in a block of YAML that provides useful meta-data about the source file and the license that is applied to it.

Ideally, the block is put at the end of the file (to prevent buggering up diffs). Alternately, put the block at the beginning of a file, but make sure to keep it a consistent length.

For example:

/* BEGIN COPYRIGHT, LICENSING, VERSION AND WARRANTY INFO BLOCK
SOFTWARE NAME: eZ publish
SOFTWARE RELEASE: 3.6.2
BUILD VERSION: $Rev$
COPYRIGHT NOTICE: Copyright (C) 1999-2006 eZ systems AS
SOFTWARE LICENSE: eZ Proprietary Use License v1.0
NOTICE: >
  This source file is part of the eZ publish (tm) CMS and is
  licensed under the terms and conditions of the eZ Proprietary
  Use License v1.0 (eZPUL).

  A copy of the eZPPL was included with the software. If the
  license is missing, request a copy of the license via email
  at eZPUL-v1.0­@­ez.no or via postal mail at
    Att: Licensing Dept., Postboks 253, N-3701 Skien, Norway

  IMPORTANT: THE SOFTWARE IS LICENSED, NOT SOLD. ADDITIONALLY, THE
  SOFTWARE IS LICENSED "AS IS," WITHOUT ANY WARRANTIES WHATSOEVER.
  READ THE eZPUL BEFORE USING, INSTALLING OR MODIFYING THE SOFTWARE.

NOTE: LICENSING NOTICES MUST BE 20 LINES LONG (KEEPS SANE LINE #s)
END COPYRIGHT, LICENSING, VERSION AND WARRANTY INFO BLOCK */

Some of the neat things about the block above are:

  • YAML is easily parsable by Perl, PHP, Python, Ruby, etc. into native data structures.
  • We will be able to generate reports and perform searches based on the meta-data in the YAML block.
  • All of the blocks are the same length for each release (but not always between releases), so that we don’t get confused by small variations in line numbering.
  • We are setting up auto-responders at addresses like eZPUL-v1.0­@­ez.no to automatically deliver copies of the license to requestors. (Yes, we can also use the magic of the web for this, but the cool thing with email is that you can write the mail when you are offline and have it delivered as soon as you get back to connectivity)
  • The headers and footers make it easy to spot the block and swap it out for a different block when needed.
  • Share/Bookmark

Posted on Saturday, February 4th, 2006 at 03:42

You can follow any responses to this entry through the RSS 2.0 feed.

You can leave a response, or trackback from your own site.

Leave a Reply

Comments are moderated. I delete obvious SEO attempts and other content-free comments.

Polymorph is powered by Wordpress running on Apache, Ubuntu Linux, MySQL and PHP.

The marvelous illustration of the Mad Hatter is by the late, great John Tenniel.
Like many great parts of our culture, it is in the public domain.

Contact: zak@greant.com | Gnu Privacy Guard Key

Entries (RSS) and Comments (RSS)