開源LGPL——如何宣告自己的程式為自由軟件

          這里使用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文件如下

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

          文件頭信息參考如下:


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






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

          posted on 2010-09-29 14:44 huliqing 閱讀(3361) 評論(0)  編輯  收藏 所屬分類: QBlog

          導航

          統計

          公告

          文章原創,歡迎轉載
          ——轉載請注明出處及原文鏈接

          隨筆分類(60)

          隨筆檔案(33)

          最新評論

          評論排行榜

          主站蜘蛛池模板: 鄂伦春自治旗| 固安县| 友谊县| 大余县| 溧阳市| 海门市| 玛沁县| 库伦旗| 福贡县| 白山市| 东兰县| 东莞市| 鸡泽县| 汉川市| 普兰县| 塔城市| 望奎县| 和龙市| 依安县| 乡宁县| 牙克石市| 香港| 盐边县| 云安县| 武川县| 崇左市| 乌兰浩特市| 大英县| 堆龙德庆县| 余江县| 福州市| 亚东县| 资兴市| 咸丰县| 凤山市| 宽甸| 大埔县| 中宁县| 宣汉县| 镇康县| 东乡|