The license templates are a set of known licenses used for the analysis. When any part of the known license (called a raw template) match, then the license is marked as a match. However, new or unknown licenses may not match well. In some cases, you may want to add in your own license.
Currently, adding licenses is not user-friendly. It requires re-running the build and modifying the database.
There are two places where you can put your raw license template:
cd trunk/fossology/agents/foss_license_agent/Licenses/Raw/
This directory contains all of the “Raw” license templates. For organization, templates are created directories. You can either put your raw license in one of these directories, or make your own.
Alternately:
NOTE: When doing this alternate install, the migration command 'fo-cleanold' will remove the installed license directory and the templates.
After installing the license, use the UI to set any canonical names for the new license: Organize → License → Manage Terms. Your new license will be installed under its own canonical name. If it should be part of another license group (e.g., it is another variant of the GPLv2 license reference), then delete the current canonical name and add the license to a different group. Alternately, you can change the canonical name or add license terms for the new license.
There are some general guidelines when selecting raw license text:
One sentence license phrases (1SL) are phrases commonly associated with licenses. When no license template is found, 1SL phrases are displayed.
Currently, all 1SL templates are hard-coded into the Filter_License agent. The file is: trunk/fossology/agents/foss_license_agent/Filter_License/1sl.c
At the very beginning of the code is a global array named “List1SL”. The array ends with NULL,NULL. If you want to add in your own one-sentence-license (1SL), then just add the pattern before the NULL's.
Each 1SL array entry has two parts:
As an example one-sentence license phrase:
< * * proprietary % > *.*|*,*|*;*|*:*|*$*|*(*|*)*|*{*|*}*
This expression looks for any set of words containing the word “proprietary”. It returns 2 words before “proprietary” and then any number of words until it finds an end-of-phrase character (period, comma, semi-colon, etc.). This will match phrases like:
This software contains proprietary source code.
(The expression returns “software contains proprietary source code”)
This gets around proprietary Microsoft APIs.
(A real phrase from some open source projects.)
Maybe this should be proprietary?
(Returns “should be proprietary”)
After changing this file, use “make” in the Filter_License/ directory to make sure that it builds. Then use “make” from trunk/fossology/ to build the code and “make install” to install it.
Changes to the license templates or 1SL system are not currently applied to previous analysis results. As a result, files that are already processed will not be reprocessed with the new license.
New uploads should be reanalyzed through the UI.
Alternately, you can reschedule jobs using the command-line interface:
/usr/local/lib/fossology/agents/delagent -l/usr/local/lib/fossology/agents/delagent -L 3fossjobs -a agent_license -U 3. To see the list of jobs, use fossjobs -u. You can also specify analysis for all jobs (that do not have analysis) by using fossjobs -a agent_license -U ALL.