Reuse, not rework
Home

License Awareness



Highly Reusable Software

By activity
Professions, Sciences, Humanities, Business, ...

User Interface
Text-based, GUI, Audio, Video, Keyboards, Mouse, Images,...

Text Strings
Conversions, tests, processing, manipulation,...

Math
Integer, Floating point, Matrix, Statistics, Boolean, ...

Processing
Algorithms, Memory, Process control, Debugging, ...

Stored Data
Data storage, Integrity, Encryption, Compression, ...

Communications
Networks, protocols, Interprocess, Remote, Client Server, ...

Hard World
Timing, Calendar and Clock, Audio, Video, Printer, Controls...

File System
Management, Filtering, File & Directory access, Viewers, ...


Creating license stamps for files


LIDESC can positively determine the licenses for a file using one of four different kinds of license stamps. Even when the full license text is short enough to appear in a file, it is important to include appropriate LIDESC stamp(s) to enable automated scanning, processing, and positive identification. For an overview see How LIDESC identifies licensing of a file

To create stamps using the command line utility, LIDESC requires the license text and description files for each license. See Obtaining existing license description files (which also links to instructions for creating such files.)


1. Embedded, simple license stamps.

This method is highly recommended because stamps will be propagated with each copy and do not have to be updated when the file is modified. (In C/C++ files, LIDESC stamps can even be propagated into the compiled version, see the next part.)

An example stamp is:
License text in <librock/license/gpl.txt> librock_LIDESC_HC=63c4046d603e0628fdae5b89c418ed01e4e4fdf1

To embed a plain text stamp that LIDESC will recognize, run
	lidesc stamp license.txt [license.txt ...]

where "license.txt" is replaced as appropriate. If the the file is covered by multiple licenses, list each license on the command line.

The output is a single line for each named license which must appear in the file as plain ASCII text on a single line. (Most computer languages allow embedding this within a comment.) If the file format does not allow insertion of the item as a single line of plain ASCII text, use one of the other methods described below to create the stamp.

2. Embedded C or C++ license stamps.
C and C++ source files can use a different form of stamp which works to identify the license for the source code, and also compiles a stamp into the compiled output. Use the output of:
	lidesc stamp c filename license.txt [license.txt ...]
in the C or C++ source. If the the file is covered by multiple licenses, list each license on the command line. IMPORTANT: LIDESC will able to locate the license stamp in the binary only when you define the appropriate preprocessor symbol at compile time. (Test to verify the operation before relying on it.)

3. License stamp in a separate file of same name plus .lic extension.

Before checking for embedded stamps, LIDESC takes the filename and adds a .lic suffix. If that file exists, it is scanned for stamps instead of looking for embedded stamps. (For example, if a file is named filename.doc, then LIDESC will look for filename.doc.lic.)

Since the stamp is stored in a separate file, this method works without requiring changes to a file. To preserve these stamps, the .lic file must be copied along with the file. The stamp does not need to be updated when the file is changed.

When a file is distributed under a "disjoint license" (where you pick one set of license terms from several choices) this is the method to indicate your selection. See LIDESC stamps for disjoint licenses for discussion.)

To create a .lic file for a file with the name "filename.doc", you can use
	lidesc stamp license.txt [license.txt ...] >filename.doc.lic
If the the file is covered by multiple licenses, list each license on the command line.

4. List of license stamps for many files

The license stamps for many separate files, for example, all files in a directory tree, can be collected into a single file. Concatenate the output of running the following command line for each file.
	lidesc stamp lic file.ext license.txt [license.txt ...] >>tree.lic
If the the file is covered by multiple licenses, list each license on the command line.

The form of this output should be compatible with GNU md5sum with regular LIDESC txt format stamps following each line. For example:
00000000000000000000000000000000  some.file
    >License text in <librock/license/librock.txt> librock_LIDESC_HC=f2a00374df769e694451262ac9df1336

00000000000000000000000000000000  some.other.file
    >License text in <librock/license/librock.txt> librock_LIDESC_HC=f2a00374df769e694451262ac9df1336
    >License text in <librock/license/bsdorig.txt> librock_LIDESC_HC=f2a00374df769e694451262ac9df1336

LIDESC verifies the hashcode for licenses, but the ignores the MD5 sum for the files themselves. (You can simply specify files with a string of 32 '0' followed by two spaces, and then the filename.) There may be other reasons you want the hashcode to be up to date, but LIDESC ignores the file hashcode so that the .lic stamps can be used even when the file changes. To preserve these stamps when copying, the .lic file must be copied along with the files.

To check files stamped with this method, the file which holds the stamps is specified at run time using the -l parameter. This disables scanning for embedded stamps and .lic files. (They can be present, but they are not checked.) The path to the file to check must match what is in the file exactly. See Reporting the licenses which cover files for further instructions.

One application of using this method is that one license list can be digitally signed to "certify" the licensing of the files. The cryptographic signature can be verified, and then GNU md5sum can verify the authenticity of each file using the file's md5 sum. (When doing this, the license description files themselves should also be certified in the same manner. SeeUsing certified license description files)


MD5 is the "RSA Data Security, Inc. MD5 Message-Digest Algorithm"

See Also: Reporting the licenses which cover files
Up to: LIDESC User Documentation


Librock LIDESC. Software License Analyzer and Compatibility Reporter
Copyright 2001-2002, Forrest J. Cavalier III, Mib Software
You may reproduce verbatim copies of this page, but changing it is not allowed.
Email: Contact