1.. _rfc-34:
2
3================================================================================
4RFC 34: License Policy Enforcement
5================================================================================
6
7Authors: Frank Warmerdam
8
9Contact: warmerdam@pobox.com
10
11Status: Development
12
13Summary
14-------
15
16This document proposes the addition of a new mechanisms so that
17applications and end users can define a license policy, and so that GDAL
18can help avoid license conflicts between proprietary and reciprocally
19licensed applications and format drivers.
20
21Definitions
22-----------
23
24Reciprocal FOSS License: A open source software license, such as the
25GPL, that requires all other software components linked into the same
26executable and distributed beyond the creator to also be offered under
27open source terms.
28
29Non-Reciprocal FOSS License: A open source software license, such as
30MIT/X, BSD or LGPL, that does not place any requirements on other linked
31components in the same executable at distribution time.
32
33Proprietary License: Software provided under terms that do not adhere to
34the requirements of the open source definition, such as libraries from
35Oracle (OCI), Lizardtech (MrSID) and Erdas (ECW). While often offered
36for zero cost, these components are incompatible with reciprocal FOSS
37licenses and may place a variety of other restrictions on the
38distributor or end user.
39
40Rationale
41---------
42
43GDAL/OGR is distributed under the Non-Reciprocal MIT/X open source
44license which facilitates it's use by proprietary and open source
45applications, and facilitates the inclusion of proprietary format
46drivers along side the open source format drivers. However, it is still
47a license violation to distribute reciprocally licensed applications
48(like QGIS and GRASS) which use GDAL with proprietary licensed drivers
49(such as the MrSID, ECW or Oracle drivers). Likewise, it is a license
50violation to distribute proprietary applications with reciprocally
51licensed drivers such as the GDAL GRASS driver, or the PDF driver.
52
53This RFC, and the improvements it promotes are intended to facilitate
54users, applications and drivers setting and following license policies
55to avoid unintentional license violations. One area this can be
56particularly helpful is broad software distributions like
57`OSGeo4W <http://osgeo4w.osgeo.org>`__.
58
59Approach
60--------
61
62The general approach proposed is that drivers will declare their license
63category, and applications or end users will declare a policy for what
64sorts of drivers may be used in combination with them. The
65GDALDriverManager and OGRDriverRegistrar classes will apply this
66information to avoid unintentional license violations.
67
68Drivers
69-------
70
71Drivers will declare one of these three driver specific licensing
72policies via the "LICENSE_POLICY" (DMD_LICENSE_POLICY) metadata item on
73the driver:
74
75-  "RECIPROCAL": the driver is available under a reciprocal FOSS license
76   such as the GPL, and should not be mixed with proprietary drivers or
77   applications.
78-  "NONRECIPROCAL": the driver is available under a non-reciprocal FOSS
79   license such as MIT/X, or LGPL. This is the default if no licensing
80   policy is declared and is the natural policy of drivers provided as
81   part of GDAL without outside dependencies.
82-  "PROPRIETARY": the driver, usually due to use of proprietary
83   libraries, has some licensing restrictions which make it ineligible
84   for distribution with reciprocally licensed software. This would
85   include MrSID, ECW, and Oracle related drivers.
86
87Application License Policy
88--------------------------
89
90Applications are encouraged to set one of the following licensing
91policies reflective of the applications nature. The policy should be set
92as the value of the GDAL_APPLICATION_LICENSE_POLICY configuration
93variable, typically via a call to GDALSetConfigOption() *before* the
94call to GDALAllRegister() or OGRRegisterAll().
95
96-  "RECIPROCAL": the application is licensed under a reciprocal license
97   such as the GPL, and no proprietary drivers should be loaded.
98-  "PROPRIETARY": the application has some licensing restrictions which
99   make it ineligible for distribution with reciprocally licensed
100   software. Care will be taken to avoid loading reciprocally licensed
101   drivers, such as the GRASS and PDF drivers.
102-  "DEFAULT": the application does not apply any licensing restrictions.
103   This is typical of non-GPL open source applications such as
104   MapServer, and will be the default policy if nothing is declared.
105
106User License Policy
107-------------------
108
109The restrictions on mixing proprietary and reciprocally licensed
110software generally applies at the point of distribution. In particular,
111it is not intended to prevent the end user from assembling a variety of
112components for their own use as they see fit, for their own use. To that
113end it is important to provide a mechanism for the end user to
114deliberately override the restrictions on mixing reciprocally licensed,
115and proprietary components. This is accomplished via the
116GDAL_LICENSE_POLICY configuration variable which might typically be set
117via the environment or via the --config commandline switch to most GDAL
118applications. It may have the following values:
119
120-  "USE_ALL": do not discard any drivers based on licensing
121   restrictions.
122-  "PREFER_PROPRIETARY": If there is a conflict between proprietary and
123   reciprocally licensed drivers, use the proprietary ones.
124-  "PREFER_RECIPROCAL": If there is a conflict between proprietary and
125   reciprocally licensed drivers, use the reciprocally licensed ones.
126
127In addition to setting this via config variables, there will also be a
128configure / nmake.opt declaration to alter the default
129GDAL_LICENSE_POLICY. Thus a local build could be configured to USE_ALL
130at build time instead of having to set environment variables or
131commandline switches. This would not be suitable for software that will
132be redistributed.
133
134Policy Logic
135------------
136
1371. If the user selected a GDAL_LICENSE_POLICY of "USE_ALL" then no
138   drivers are unloaded on the basis of licensing.
1392. If the user selected a GDAL_LICENSE_POLICY of "PREFER_PROPRIETARY" or
140   "PREFER_RECIPROCAL" then ignore the GDAL_APPLICATION_LICENSE_POLICY.
1413. if the application select a GDAL_APPLICATION_LICENSE_POLICY of
142   "PROPRIETARY" or "RECIPROCAL" then use that.
1434. In the absence of a user or application level policy, default to a
144   policy of "PREFER_PROPRIETARY".
145
146The policy will be applied in the GDALDriverManager::AutoSkipDrivers()
147method and in the newly introduced OGRSFDriverManager::AutoSkipDrivers()
148method. The AutoSkipDrivers() method is already used to unload drivers
149based on GDAL_SKIP (and soon OGR_SKIP) and is generally called after the
150preliminary registration of drivers.
151
152Strict Link Level Compliance
153----------------------------
154
155The GPL, the leading reciprocal license, talks about distribution of GPL
156applications with proprietary code linked in. In a literal sense we may
157still have running processes with mixed code linked in. Instead of
158addressing the problem at the point of linking we are disabling use of
159incompatible components at runtime. There is some small risk that this
160may be considered not to be compliant with the requirements of the GPL
161license in a literal sense, though it is clear we are making every
162reasonable effort to enforce it in a practical sense.
163
164In the situation of standalone software packages being distributed with
165GDAL, it may still be best for those preparing the package to completely
166omit any components incompatible with the license of the applications.
167This RFC is primarily intended to support complex mixed-component
168distributions such as OSGeo4W.
169
170Drivers Affected
171----------------
172
173I believe the following drivers should be marked as "PROPRIETARY":
174
175-  ECW
176-  JP2ECW
177-  MRSID
178-  JP2MRSID
179-  MG4Lidar
180-  GEORASTER
181-  JP2KAK
182-  JPIPKAK
183-  ArcObjects
184-  OCI
185-  FileGDB
186-  FME
187-  ArcSDE (raster and vector)
188
189I believe the following drivers should be marked as "RECIPROCAL":
190
191-  grass (raster and vector)
192-  EPSILON
193-  MySQL (depending on active license terms!)
194-  PDF
195
196Unresolved:
197
198-  The OGR SOSI driver should probably be marked as proprietary
199   currently as it relies on linking with binary objects with unknown
200   licencing terms, even if apparently the ultimate goal seems to open
201   source them.
202-  I'm a bit confused by :ref:`raster.msg`.
203   Seems that it relies on third party stuff with both proprietary and
204   GPL code.
205-  I am unsure about the ODBC based drivers. I suppose PGEO and
206   MSSQLSPATIAL drivers ought to be marked proprietary too? Might it
207   depend on the actual license terms of the odbc library?
208
209Please let me know of other drivers needing marking.
210
211SWIG Bindings
212-------------
213
214Some (all?) swig bindings automatically call GDALAllRegister() and/or
215OGRRegisterAll() at the point the bindings are loaded making it hard to
216set the application level GDAL_LICENSE_POLICY in a script before the
217registration takes place. To address that I believe we should expose the
218AutoSkipDrivers() methods via SWIG so that scripts can set the policy
219and then "clean" the drivers based on the policy in force.
220
221Test Suite
222----------
223
224How to test?
225
226Documentation
227-------------
228
229How to document?
230
231Implementation
232--------------
233
234Frank Warmerdam will do the core implementation in trunk. Driver
235maintainers may need to update the metadata for particular drivers.
236