当前位置:   article > 正文

开源LGPL——如何宣告自己的程式为自由软件

怎样写lgpl的软件license
这里使用LGPL协议为例简单说明一下如何将自己的程序宣告为开源软件。

首先确定自己要使用的开源协议,这里选择LGPL(关于其它协议及协议的详细内容,请参考其它资料);
然后确定并准备以下几部分内容:

    一份版权信息声明文件,一般命名为"NOTICE"。
    一份所使用的协议的副本。
    如果程序为多个文件构成,则在每个文件中包含文件头信息,声明协议及版权信息。
一般来说主要就是由以上几部分组成,下面简单说明一下相关组成部分。

1.首先,对于版权信息声明文件,我们可以写一份文本文档,一般命名为NOTICE, 其中包含版权声明及一些自己想要声明的信息,示例如:
Copyright 1998, 1999 Terry Jones
用于声明软件的发布年份及作者姓名,一般建议分别列出每个年份,不一定需要符号©, 最简单的NOTICE,包含这些内容就可以了。
但是一般建议应该包含以下一些信息:
a) 软件作者联系信息,用于在必要时联系作者

b) 获取软件源码的地址,当发布为二进制时,可以告诉用户在那里可以获得软件的源码。

c) 其它开源组件库的开源协议及源码地址,如果你所分发的软件使用了其它开源产品,则应该同时包含他们的开源协议以及相应的源码地址。

2. 一份软件的使用协议,这里我们使用LGPL(GNU Lesser General Public License)为例说明.
我们需要在(一般为软件所在的根目录下)包含这两个文件:

a) 一份GPL的协议副本,一般命名为COPYING, 你可以从这里获得相关的协议副本 http://www.gnu.org/licenses/gpl.txt

b) 一份LGPL协议副本,一般命名为COPYING.LESSER, 可以从这里获得相关的协议副本 http://www.gnu.org/licenses/lgpl.txt

如果软件发布在GPL下,则只需要一份GPL协议副本就可以,如果为LGPL则应该同时包含GPL及LGPL两个协议副本。

3.如果程序为多个文件源文件构成,则在每个文件中包含文件头信息,声明协议及版权信息.

来自gnu.org的示例文本如下:
This file is part of Foobar.
Foobar is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Foobar is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with Foobar. If not, see <http://www.gnu.org/licenses/>.

上面是以LGPL为例说明的. 更详细的信息可以参考这里 http://www.gnu.org/licenses/gpl-howto.html

下面是我的使用示例,以下信息仅供参考:

NOTICE文件如下:

  1. 01 /*
  2. 02 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
  3. 03 *
  4. 04 * Copyright 2010 huliqing, huliqing.cn@gmail.com
  5. 05 *
  6. 06 *
  7. 07 * QBlog is free software: you can redistribute it and/or modify
  8. 08 * it under the terms of the GNU Lesser General Public License as published by
  9. 09 * the Free Software Foundation, either version 3 of the License, or
  10. 10 * (at your option) any later version.
  11. 11 *
  12. 12 * QBlog is distributed in the hope that it will be useful,
  13. 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. 15 * GNU Lesser General Public License for more details.
  16. 16 *
  17. 17 * You should have received a copy of the GNU Lesser General Public License
  18. 18 * along with QBlog. If not, see <http://www.gnu.org/licenses/>.
  19. 19 *
  20. 20 * QBlog是一个自由软件,您可以自由分发、修改其中的源代码或者重新发布它,
  21. 21 * 新的任何修改后的重新发布版必须同样在遵守LGPL3或更后续的版本协议下发布.
  22. 22 * 关于LGPL协议的细则请参考COPYING、COPYING.LESSER文件,
  23. 23 * 您可以在QBlog的相关目录中获得LGPL协议的副本,
  24. 24 * 如果没有找到,请连接到 http://www.gnu.org/licenses/ 查看。
  25. 25 *
  26. 26 * - Author: Huliqing
  27. 27 * - Contact: huliqing.cn@gmail.com
  28. 28 * - License: GNU Lesser General Public License (LGPL)
  29. 29 * - Blog and source code availability: http://www.huliqing.name/
  30. 30 */
  31. 31
  32. 32
  33. 33 LICENSE INFORMATION REGARDING BUNDLED THIRD-PARTY SOFTWARE
  34. 34
  35. 35
  36. 36
  37. 37 The following third party software is distributed with the QBlog and is provided
  38. 38 under other
  39. 39 licenses and/or has source available from other locations.
  40. 40
  41. 41 * JSF Frameworker
  42. 42 License: CDDLv.1.0 + GPL v.2.0
  43. 43 Source code availability: https://javaserverfaces.dev.java.net/
  44. 44
  45. 45 lib/jsf-api.jar
  46. 46 lib/jsf-impl.jar
  47. 47
  48. 48 * Jakarta Taglibs
  49. 49
  50. 50 License: Apache License v. 2.0
  51. 51
  52. 52 Source code availability: http://jakarta.apache.org/taglibs/
  53. 53 lib/standard-1.1.2.jar
  54. 54
  55. 55 lib/jstl-1.1.2.jar
  56. 56
  57. 57 * DataNucleus Access Platform
  58. 58
  59. 59 License: Apache License v. 2.0
  60. 60
  61. 61 Source code availability: http://www.datanucleus.org/
  62. 62
  63. 63 lib/datanucleus-core-1.1.5.jar
  64. 64
  65. 65 lib/datanucleus-jpa-1.1.5.jar
  66. 66
  67. 67
  68. 68 * Xml
  69. 69 License: Apache License v. 2.0
  70. 70
  71. 71 Apache Software Foundation (http://xml.apache.org/commons)
  72. 72 David Megginson, Simple API for XML (http://www.saxproject.org)
  73. 73 World Wide Web Consortium, xml-commons for http://xml.apache.org/ subproject (http://www.w3c.org/DOM)
  74. 74 Sun Microsystems Inc., JSR 206, Java API for XML Processing 1.3(http://java.sun.com/xml/jaxp.html)
  75. 75 lib/xml-apis.jar
  76. 76 lib/xalan.jar
  77. 77 lib/xsltc.jar
  78. 78 lib/serializer.jar
  79. 79 lib/xercesImpl.jar
  80. 80
  81. 81 * el
  82. 82 JSP 2.1's EL API, as used by JSF 2.0
  83. 83 SUN (http://java.sun.com/products/jsp)
  84. 84 lib/el-api-1.1.jar
  85. 85 lib/el-impl-1.1.jar
  86. 86
  87. 87 * QFaces
  88. 88 License: LGPL v. 3.0
  89. 89 Source code availability: http://www.huliqing.name/
  90. 90 lib/qfaces-2.0.2.jar
  91. 91
  92. 92 * huliqing-common
  93. 93 No license and no source code, free use.
  94. 94 lib/huliqing-common-1.1.jar
  95. 95

文件头信息参考如下:
  1. 01 /*
  2. 02 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
  3. 03 *
  4. 04 * Copyright 2010 huliqing, huliqing.cn@gmail.com
  5. 05 *
  6. 06 * This file is part of QBlog.
  7. 07 * QBlog is free software: you can redistribute it and/or modify
  8. 08 * it under the terms of the GNU Lesser General Public License as published by
  9. 09 * the Free Software Foundation, either version 3 of the License, or
  10. 10 * (at your option) any later version.
  11. 11 *
  12. 12 * QBlog is distributed in the hope that it will be useful,
  13. 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. 15 * GNU Lesser General Public License for more details.
  16. 16 *
  17. 17 * You should have received a copy of the GNU Lesser General Public License
  18. 18 * along with QBlog. If not, see <http://www.gnu.org/licenses/>.
  19. 19 *
  20. 20 * 这个文件是QBlog的一部分。
  21. 21 * 您可以单独使用或分发这个文件,但请不要移除这个头部声明信息.
  22. 22 * QBlog是一个自由软件,您可以自由分发、修改其中的源代码或者重新发布它,
  23. 23 * 新的任何修改后的重新发布版必须同样在遵守LGPL3或更后续的版本协议下发布.
  24. 24 * 关于LGPL协议的细则请参考COPYING、COPYING.LESSER文件,
  25. 25 * 您可以在QBlog的相关目录中获得LGPL协议的副本,
  26. 26 * 如果没有找到,请连接到 http://www.gnu.org/licenses/ 查看。
  27. 27 *
  28. 28 * - Author: Huliqing
  29. 29 * - Contact: huliqing.cn@gmail.com
  30. 30 * - License: GNU Lesser General Public License (LGPL)
  31. 31 * - Blog and source code availability: http://www.huliqing.name/
  32. 32 */
  33. 33
  34. 34 package name.huliqing.qblog;
  35. 35
  36. 36 import java.text.SimpleDateFormat;
  37. 37 import java.util.Date;
  38. 38 import java.util.TimeZone;
  39. 39 import java.util.logging.Logger;
  40. 40 import javax.servlet.ServletContextEvent;
  41. 41 import javax.servlet.ServletContextListener;
  42. 42 import name.huliqing.qblog.service.MailSe;
  43. 43
  44. 44 public class ContextListener implements ServletContextListener {
  45. 45 private final static Logger logger = Logger.getLogger(ContextListener.class.getName());
  46. 46
  47. 47 public void contextDestroyed(ServletContextEvent arg0) {
  48. 48 logger.info("QBlog Shutdown");
  49. 49 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
  50. 50 sdf.setTimeZone(TimeZone.getTimeZone("GMT+8"));
  51. 51 MailSe.sendToSelf("QBlog shutdown at:" + sdf.format(new Date()), "QBlog shutdown.");
  52. 52 }
  53. 53
  54. 54 public void contextInitialized(ServletContextEvent arg0) {
  55. 55 logger.info("QBlog Start...");
  56. 56 }
  57. 57
  58. 58 }
  59. 59

出处:

- huliqing@huliqing.name
- http://www.huliqing.name


转载于:https://my.oschina.net/eechen/blog/66341

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/笔触狂放9/article/detail/809526
推荐阅读
相关标签
  

闽ICP备14008679号