| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | <!-- $NetBSD: fixes.xml,v 1.137 2016/06/21 21:47:29 wiz Exp $ --> | | 1 | <!-- $NetBSD: fixes.xml,v 1.138 2016/07/09 14:44:06 rillig Exp $ --> |
2 | | | 2 | |
3 | <chapter id="fixes"> <?dbhtml filename="fixes.html"?> | | 3 | <chapter id="fixes"> <?dbhtml filename="fixes.html"?> |
4 | <title>Making your package work</title> | | 4 | <title>Making your package work</title> |
5 | | | 5 | |
6 | <sect1 id="general-operation"> | | 6 | <sect1 id="general-operation"> |
7 | <title>General operation</title> | | 7 | <title>General operation</title> |
8 | | | 8 | |
9 | <para>One appealing feature of pkgsrc is that it runs on many | | 9 | <para>One appealing feature of pkgsrc is that it runs on many |
10 | different platforms. As a result, it is important to ensure, | | 10 | different platforms. As a result, it is important to ensure, |
11 | where possible, that packages in pkgsrc are portable. This | | 11 | where possible, that packages in pkgsrc are portable. This |
12 | chapter mentions some particular details you should pay | | 12 | chapter mentions some particular details you should pay |
13 | attention to while working on pkgsrc.</para> | | 13 | attention to while working on pkgsrc.</para> |
14 | | | 14 | |
| @@ -78,53 +78,42 @@ | | | @@ -78,53 +78,42 @@ |
78 | | | 78 | |
79 | <programlisting> | | 79 | <programlisting> |
80 | INTERACTIVE_STAGE= configure install | | 80 | INTERACTIVE_STAGE= configure install |
81 | </programlisting> | | 81 | </programlisting> |
82 | | | 82 | |
83 | <para>The user can then decide to skip this package by setting the | | 83 | <para>The user can then decide to skip this package by setting the |
84 | <varname>BATCH</varname> variable. Packages that require interaction | | 84 | <varname>BATCH</varname> variable. Packages that require interaction |
85 | are also excluded from bulk builds.</para> | | 85 | are also excluded from bulk builds.</para> |
86 | </sect2> | | 86 | </sect2> |
87 | | | 87 | |
88 | <sect2 id="handling-licenses"> | | 88 | <sect2 id="handling-licenses"> |
89 | <title>Handling licenses</title> | | 89 | <title>Handling licenses</title> |
90 | | | 90 | |
91 | <para>Authors of software can choose the licence under which | | 91 | <para>Authors of software can choose the licence under which software |
92 | software can be copied. This is due to copyright law, and reasons | | 92 | can be copied. The Free Software Foundation has declared some |
93 | for license choices are outside the scope of pkgsrc. The pkgsrc | | 93 | licenses "Free", and the Open Source Initiative has a definition of |
94 | system recognizes that there are a number of licenses which some | | 94 | "Open Source".</para> |
95 | users may find objectionable or difficult or impossible to comply | | 95 | |
96 | with. The Free Software Foundation has declared some licenses | | 96 | <para>By default, pkgsrc allows packages with Free or Open Source |
97 | "Free", and the Open Source Initiative has a definition of "Open | | 97 | licenses to be built. To allow packages with other licenses to be |
98 | Source". The pkgsrc system, as a policy choice, does not label | | 98 | built as well, the pkgsrc user needs to add these licenses to the |
99 | packages which have licenses that are Free or Open Source. | | 99 | <varname>ACCEPTABLE_LICENSES</varname> variable in &mk.conf;. Note |
100 | However, packages without a license meeting either of those tests | | 100 | that this variable only affects which packages may be |
101 | are labeled with a license tag denoting the license. Note that a | | 101 | <emphasis>built</emphasis>, while the license terms often also |
102 | package with no license to copy trivially does not meet either the | | 102 | restrict the actual use of the package and its redistribution.</para> |
103 | Free or Open Source test.</para> | | | |
104 | | | | |
105 | <para>For packages which are not Free or Open Source, pkgsrc will | | | |
106 | not build the package unless the user has indicated to pkgsrc that | | | |
107 | packages with that particular license may be built. Note that | | | |
108 | this documentation avoids the term "accepted the license". The | | | |
109 | pkgsrc system is merely providing a mechanism to avoid | | | |
110 | accidentally building a package with a non-free license; | | | |
111 | judgement and responsibility remain with the user. (Installation | | | |
112 | of binary packages are not currently subject to this mechanism; | | | |
113 | this is a bug.)</para> | | | |
114 | | | 103 | |
115 | <para>One might want to only install packages with a BSD license, | | 104 | <para>One might want to only install packages with a BSD license, |
116 | or the GPL, and not the other. The free licenses are added to the | | 105 | or the GPL, and not the other. The free licenses are added to the |
117 | default <varname>ACCEPTABLE_LICENSES</varname> variable. The | | 106 | default <varname>ACCEPTABLE_LICENSES</varname> variable. The pkgsrc |
118 | user can override the default by setting the | | 107 | user can override the default by setting the |
119 | <varname>ACCEPTABLE_LICENSES</varname> variable with "=" instead | | 108 | <varname>ACCEPTABLE_LICENSES</varname> variable with "=" instead |
120 | of "+=". The licenses accepted by default are: | | 109 | of "+=". The licenses accepted by default are: |
121 | <programlisting> | | 110 | <programlisting> |
122 | apache-1.1 apache-2.0 | | 111 | apache-1.1 apache-2.0 |
123 | arphic-public | | 112 | arphic-public |
124 | artistic artistic-2.0 | | 113 | artistic artistic-2.0 |
125 | boost-license | | 114 | boost-license |
126 | cc-by-sa-v3.0 | | 115 | cc-by-sa-v3.0 |
127 | cc0-1.0-universal | | 116 | cc0-1.0-universal |
128 | cddl-1.0 | | 117 | cddl-1.0 |
129 | cpl-1.0 | | 118 | cpl-1.0 |
130 | epl-v1.0 | | 119 | epl-v1.0 |
| @@ -190,55 +179,75 @@ LICENSE= xv-license | | | @@ -190,55 +179,75 @@ LICENSE= xv-license |
190 | *** Error code 1 | | 179 | *** Error code 1 |
191 | </programlisting> | | 180 | </programlisting> |
192 | | | 181 | |
193 | <para>The license can be viewed with <command>make | | 182 | <para>The license can be viewed with <command>make |
194 | show-license</command>, and if the user so chooses, the line | | 183 | show-license</command>, and if the user so chooses, the line |
195 | printed above can be added to &mk.conf; to | | 184 | printed above can be added to &mk.conf; to |
196 | convey to pkgsrc that it should not in the future fail because of | | 185 | convey to pkgsrc that it should not in the future fail because of |
197 | that license:</para> | | 186 | that license:</para> |
198 | | | 187 | |
199 | <programlisting> | | 188 | <programlisting> |
200 | ACCEPTABLE_LICENSES+=xv-license | | 189 | ACCEPTABLE_LICENSES+=xv-license |
201 | </programlisting> | | 190 | </programlisting> |
202 | | | 191 | |
| | | 192 | <para>The use of <varname>LICENSE=shareware</varname>, |
| | | 193 | <varname>LICENSE=no-commercial-use</varname>, and similar language |
| | | 194 | is deprecated because it does not crisply refer to a particular |
| | | 195 | license text. Another problem with such usage is that it does not |
| | | 196 | enable a user to tell pkgsrc to proceed for a single package |
| | | 197 | without also telling pkgsrc to proceed for all packages with that |
| | | 198 | tag.</para> |
| | | 199 | |
| | | 200 | <sect3 id="new-license"> |
| | | 201 | <title>Adding a package with a new license</title> |
| | | 202 | |
203 | <para>When adding a package with a new license, the following steps | | 203 | <para>When adding a package with a new license, the following steps |
204 | are required:</para> | | 204 | are required:</para> |
205 | <orderedlist> | | 205 | <orderedlist> |
206 | <listitem><para>Check if the file can avoid the -license filename tag as described above by referencing <ulink url="http://www.gnu.org/licenses/license-list.html">Various Licenses and Comments about Them</ulink> and <ulink url="http://opensource.org/licenses/alphabetical">Licenses by Name | Open Source Initiative</ulink>. If this is the case, additionally add the license filename to:</para> | | 206 | |
| | | 207 | <listitem><para>Check whether the license qualifies as Free or Open |
| | | 208 | Source by referencing <ulink |
| | | 209 | url="http://www.gnu.org/licenses/license-list.en.html">Various Licenses |
| | | 210 | and Comments about Them</ulink> and <ulink |
| | | 211 | url="http://opensource.org/licenses/alphabetical">Licenses by Name | |
| | | 212 | Open Source Initiative</ulink>. If this is the case, the filename in |
| | | 213 | <filename>pkgsrc/licenses/</filename> does not need the |
| | | 214 | <filename>-license</filename> suffix, and the license name should be |
| | | 215 | added to:</para> |
| | | 216 | |
207 | <itemizedlist> | | 217 | <itemizedlist> |
208 | <listitem><para>DEFAULT_ACCEPTABLE_LICENSES in <filename>pkgsrc/mk/license.mk</filename></para></listitem> | | 218 | <listitem><para>DEFAULT_ACCEPTABLE_LICENSES in <filename>pkgsrc/mk/license.mk</filename></para></listitem> |
209 | <listitem><para>default_acceptable_licenses in <filename>pkgsrc/pkgtools/pkg_install/files/lib/license.c</filename></para></listitem> | | 219 | <listitem><para>default_acceptable_licenses in <filename>pkgsrc/pkgtools/pkg_install/files/lib/license.c</filename></para></listitem> |
210 | <listitem><para>the ACCEPTABLE_LICENSES list in <filename>pkgsrc/doc/guide/files/fixes.xml</filename></para></listitem> | | 220 | <listitem><para>the ACCEPTABLE_LICENSES list in <filename>pkgsrc/doc/guide/files/fixes.xml</filename></para></listitem> |
211 | </itemizedlist> | | 221 | </itemizedlist> |
212 | <para>with the proper syntax as demonstrated in those files, respectively.</para></listitem> | | 222 | <para>with the proper syntax as demonstrated in those files, respectively.</para></listitem> |
213 | <listitem><para>The license text should be added to <filename>pkgsrc/licenses</filename> for displaying. A list of known licenses can be seen in this directory.</para></listitem> | | 223 | <listitem><para>The license text should be added to <filename>pkgsrc/licenses</filename> for displaying. A list of known licenses can be seen in this directory.</para></listitem> |
214 | </orderedlist> | | 224 | </orderedlist> |
| | | 225 | </sect3> |
| | | 226 | |
| | | 227 | <sect3 id="change-license"> |
| | | 228 | <title>Change to the license</title> |
| | | 229 | |
215 | <para>When the license changes (in a way other than formatting), | | 230 | <para>When the license changes (in a way other than formatting), |
216 | please make sure that the new license has a different name (e.g., | | 231 | please make sure that the new license has a different name (e.g., |
217 | append the version number if it exists, or the date). Just | | 232 | append the version number if it exists, or the date). Just |
218 | because a user told pkgsrc to build programs under a previous | | 233 | because a user told pkgsrc to build programs under a previous |
219 | version of a license does not mean that pkgsrc should build | | 234 | version of a license does not mean that pkgsrc should build |
220 | programs under the new licenses. The higher-level point is that | | 235 | programs under the new licenses. The higher-level point is that |
221 | pkgsrc does not evaluate licenses for reasonableness; the only | | 236 | pkgsrc does not evaluate licenses for reasonableness; the only |
222 | test is a mechanistic test of whether a particular text has been | | 237 | test is a mechanistic test of whether a particular text has been |
223 | approved by either of two bodies.</para> | | 238 | approved by either of two bodies.</para> |
224 | | | 239 | </sect3> |
225 | <para>The use of <varname>LICENSE=shareware</varname>, | | 240 | </sect2> |
226 | <varname>LICENSE=no-commercial-use</varname>, and similar language | | | |
227 | is deprecated because it does not crisply refer to a particular | | | |
228 | license text. Another problem with such usage is that it does not | | | |
229 | enable a user to tell pkgsrc to proceed for a single package | | | |
230 | without also telling pkgsrc to proceed for all packages with that | | | |
231 | tag.</para> </sect2> | | | |
232 | | | 241 | |
233 | <sect2 id="restricted-packages"> | | 242 | <sect2 id="restricted-packages"> |
234 | <title>Restricted packages</title> | | 243 | <title>Restricted packages</title> |
235 | | | 244 | |
236 | <para>Some licenses restrict how software may be re-distributed. | | 245 | <para>Some licenses restrict how software may be re-distributed. |
237 | Because a license tag is required unless the package is Free or | | 246 | Because a license tag is required unless the package is Free or |
238 | Open Source, all packages with restrictions should have license | | 247 | Open Source, all packages with restrictions should have license |
239 | tags. By declaring the restrictions, package tools can | | 248 | tags. By declaring the restrictions, package tools can |
240 | automatically refrain from e.g. placing binary packages on FTP | | 249 | automatically refrain from e.g. placing binary packages on FTP |
241 | sites.</para> | | 250 | sites.</para> |
242 | | | 251 | |
243 | <para>There are four restrictions that may be encoded, which are | | 252 | <para>There are four restrictions that may be encoded, which are |
244 | the cross product of sources (distfiles) and binaries not being | | 253 | the cross product of sources (distfiles) and binaries not being |