1 Reply Latest reply: Oct 31, 2010 10:09 PM by Richard Fontana RSS

Forking open source code

Paul Gier Master

What are the typical license requirements when forking an open source project?  For example, let's say I want to fork an upstream project licensed using the Apache Software License (http://www.apache.org/licenses/LICENSE-2.0.txt), and I want to release a fork licensed using LGPL.  The upstream project contains the Apache license in the XML and Java source files, and the license is a text file in the root of the project zip.  According to the ASL I need to include a copy of the full license text file with the distribution of my project (section 4a), do I also need to retain the Apache license notification in the source files of the project (section 4c)?  Or can I replace these with a different (LGPL) copyright notice?

  • 1. Re: Forking open source code
    Richard Fontana Newbie

    The general answer to the general question is that it depends on the license of the original project and the desired license of the forked project.

     

    The specific question actually raises a lot of complex issues about the relationship between the Apache License and the LGPL, but I'll try to focus on what you're specifically asking about, and I'll just note that there are a number of justifications for why you can have a project that is partly LGPL and partly Apache 2.0 (or globally LGPL with some components Apache 2.0), which I won't go into here. I guess my opinions about this issue have been changing somewhat too.

    According to the ASL I need to include a copy of the full license text file with the distribution of my project (section 4a), do I also need to retain the Apache license notification in the source files of the project (section 4c)?  Or can I replace these with a different (LGPL) copyright notice?

     

    According to the Apache License 2.0, section 4c,

     

    You must retain, in the Source form of any Derivative Works that You distribute, all copyright, 
    patent, trademark, and attribution notices from the Source form of the Work, excluding those
    notices that do not pertain to any part of the Derivative Works; and

     

    So, yes, you need to retain any original Apache License notices in source files of the original project, including where you've modified those source files.

     

    For unmodified source files, just retain the original notice and don't add anything additional.

     

    For modified source files, you have a number of choices. In the past I've generally recommended that otherwise LGPL projects that make use of Apache-licensed source files, which they modify, keep the modified source file purely under the Apache License. This avoids some complex questions about license compatibility. How to do this exactly may depend on the form in which the original notice appears. Here's a hypothetical example:

     

    /*

    * Copyright 2010 Red Hat, Inc.

    * Copyright 2003-2009 the original author or authors.

    *

    * Licensed under the Apache License, version 2.0 (the "License");
    * you may not use this file except in compliance with the License.
    * You may obtain a copy of the License at
    *
    *        http://www.apache.org/licenses/LICENSE-2.0
    *
    * Unless required by applicable law or agreed to in writing, software
    * distributed under the License is distributed on an "AS IS" BASIS,
    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    * See the License for the specific language governing permissions and
    * limitations under the License.
    */

     

    I took this header, except for the Red Hat copyright notice at the top, from a source file in Groovy. So here I've preserved the original notice verbatim, including the odd notice that just references generic original authors, and just added a new copyright notice at the top which signals that some copyrightable modifications were made to the original Groovy file.

     

    However, it would be justifiable to instead put an LGPL notice above the original Apache License notice. Here's an example using LGPLv3:

     

    /*

    * Copyright 2010 Red Hat, Inc.

    *

    * This program 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.

    *

    * This program 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 General Public License for more details.

    *

    * You should have received a copy of the GNU Lesser General Public License

    * along with this program.  If not, see <http://www.gnu.org/licenses/>.

    *

    * This file incorporates code covered by the following terms:


    *  Licensed to the Apache Software Foundation (ASF) under one or more

    *  contributor license agreements.  See the NOTICE file distributed with

    *  this work for additional information regarding copyright ownership.

    *  The ASF licenses this file to You under the Apache License, version 2.0

    *  (the "License"); you may not use this file except in compliance with

    *  the License.  You may obtain a copy of the License at

    *

    *

    *      http://www.apache.org/licenses/LICENSE-2.0

    *

    *  Unless required by applicable law or agreed to in writing, software

    *  distributed under the License is distributed on an "AS IS" BASIS,

    *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

    *  See the License for the specific language governing permissions and

    *  limitations under the License.

    */ 

     

    Obviously, this example uses a header from an ASF project.

     

    With respect to the Apache License 2.0, LGPLv3 raises fewer complex questions about license compatibility and the effective license of the code than LGPLv2.1, though use of LGPLv2.1 could be justified as well.

     

    Some Apache License 2.0 projects have a NOTICE file which must be preserved (particularly common with ASF projects).

     

    If there is a global Apache License text or license notice, you should preserve that, but do something to make clear that it is no longer the global license of all the code.