#
Bacula Developer Notes

This document is intended mostly for developers and describes how you can contribute to the Bacula project and the the general framework of making Bacula source changes.

##
Contributions

Contributions to the Bacula project come in many forms: ideas, participation in helping people on the bacula-users email list, packaging Bacula binaries for the community, helping improve the documentation, and submitting code.

Contributions in the form of submissions for inclusion in the project are broken into two groups. The first are contributions that are aids and not essential to Bacula. In general, these will be scripts or will go into and examples or contributions directory. For these kinds of non-essential contributions there is no obligation to do a copyright assignment as described below. However, a copyright assignment would still be appreciated.

The second class of contributions are those which will be integrated with Bacula and become an essential part (code, scripts, documentation, ...) Within this class of contributions, there are two hurdles to surmount. One is getting your patch accepted, and two is dealing with copyright issues. The following text describes some of the requirements for such code.

##
Patches

Subject to the copyright assignment described below, your patches should be sent in diff -u format relative to the current contents of the Source Forge SVN. The diff -u format is the easiest for us to understand and integrate. Please be sure to use the Bacula indenting standard (see below) for source code. If you have checked out the source with SVN, you can get a diff using:

    svn update
    svn diff > change.patch

If you plan on doing significant development work over a period of time, after having your first patch reviewed and approved, you will be eligible for having developer SVN write access so that you can commit your changes directly to the SVN repository. To do so, you will need a userid on Source Forge.

##
Copyrights

To avoid future problems concerning changing licensing or copyrights, all code contributions more than a hand full of lines must be in the Public Domain or have the copyright transferred to the Free Software Foundation Europe e.V. with a Fiduciary License Agreement (FLA) as in the current code. Note, prior to November 2004, the code was copyrighted by Kern Sibbald and John Walker. After November 2004, the code was copyrighted by Kern Sibbald, then on the 15th of November 2006, the copyright was transferred to the Free Software Foundation Europe e.V. In signing the FLA and transferring the copyright, you retain the right to use the code you have submitted as you want.

Your name should be clearly indicated as the author of the code, and you must be extremely careful not to violate any copyrights or patents or use other people's code without acknowledging it. The purpose of this requirement is to avoid future copyright, patent, or intellectual property problems. Please read the LICENSE agreement in the main Bacula source code directory. When you sign the Fiduciary License Agreement (FLA) and send it in, you are argeeing to the terms of that LICENSE file.

If you don't understand what we mean by future problems, please examine the difficulties Mozilla was having finding previous contributors at http://www.mozilla.org/MPL/missing.html. The other important issue is to avoid copyright, patent, or intellectual property violations as was (May 2003) claimed by SCO against IBM.

Although the copyright will be held by the Free Software Foundation Europe e.V., each developer is expected to indicate that he wrote and/or modified a particular module (or file) and any other sources. The copyright assignment may seem a bit unusual, but in reality, it is not. Most large projects require this.

If you have any doubts about this, please don't hesitate to ask. The objective is to assure the long term servival of the Bacula project.

Items not needing a copyright assignment are: most small changes, enhancements, or bug fixes of 5-10 lines of code, which amount to less than 20

##
Copyright Assignment -- Fiduciary License Agreement

Since this is not a commercial enterprise, and we prefer to believe in everyone's good faith, previously developers could assign the copyright by explicitly acknowledging that they do so in their first submission. This was sufficient if the developer is independent, or an employee of a not-for-profit organization or a university. However, in an effort to ensure that the Bacula code is really clean, beginning in August 2006, all previous and future developers with SVN write access will be asked to submit a copyright assignment (or Fiduciary License Agreement -- FLA), which means you agree to the LICENSE in the main source directory. It also means that you receive back the right to use the code that you have submitted.

Any developer who wants to contribute and is employed by a company should either list the employer as the owner of the code, or get explicit permission from him to sign the copyright assignment. This is because in many countries, all work that an employee does whether on company time or in the employee's free time is considered to be Intellectual Property of the company. Obtaining official approval or an FLA from the company will avoid misunderstandings between the employee, the company, and the Bacula project. A good number of companies have already followed this procedure.

The Fiduciary License Agreement is posted on the Bacula web site at: http://www.bacula.org/en/FLA-bacula.en.pdf

The instructions for filling out this agreement are also at: http://www.bacula.org/?page=fsfe

It should be filled out, then sent to:

         Kern Sibbald
         Cotes-de-Montmoiret 9
         1012 Lausanne
         Switzerland

Please note that the above address is different from the officially registered office mentioned in the document. When you send in such a complete document, please notify me: kern at sibbald dot com, and please add your email address to the FLA so that I can contact you to confirm reception of the signed FLA.

Subsections

- - Contributions
  - Patches
  - Copyrights
  - Copyright Assignment -- Fiduciary License Agreement
- The Development Cycle
- Bacula Code Submissions and Projects
- Patches for Released Versions
- SVN Usage
- Subversion Resources
- Developing Bacula
  - Debugging
  - Using a Debugger
  - Memory Leaks
  - Special Files
  - When Implementing Incomplete Code
  - Bacula Source File Structure
  - Header Files
  - Programming Standards
  - Do Not Use
  - Avoid if Possible
  - Do Use Whenever Possible
  - Indenting Standards
  - Tabbing
  - Don'ts
  - Message Classes
  - Debug Messages
  - Error Messages
  - Job Messages
  - Queued Job Messages
  - Memory Messages
  - Bugs Database