"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do."
-- unsure; often attributed without source to information philosopher Ted Nelson
In today's hyperlegal world, every software package should explicitly specify its legal status (copyrighted or uncopyrighted). Each source code file should include a line near the top that says either "This software is in the public domain" or "Copyright (C) year copyright-holder".
Copyright information should also be displayed in each program's "--version" message.
The software package might have one license for the whole package, or separate licenses for programs, libraries and documentation. Any licenses for the software package as a whole should be included in a plain text file named "COPYING" in the top-level directory. Licenses may also be included in other documentation as appropriate.
Packages may wish to list the principal authors of the software, including which files each has substantially written or modified, in a plain text file named "AUTHORS" in the top-level directory. This information can be used to register a copyright.
Each developer is free to set unique license conditions. There are three broad categories:
Public domain: Public domain software is uncopyrighted, meaning that anyone can freely copy, distribute, modify, and sell it, and may even convert their version of it into proprietary software. No license is needed for public domain software, simply a statement that it is in the public domain.
Free software: When used to describe licensing, as opposed to price, free software means copyrighted software that is licensed to allow free use, distribution, and modification, including with source code. Free software licenses may impose certain restrictions.
Proprietary software: Proprietary software is copyrighted with restrictions on use, distribution, and modification. Proprietary software is usually distributed without source code.
There are standard licenses available, including the Free Software Foundation (FSF) licenses:
The GNU General Public License (GPL) allows free use, distribution and modification of the software, including for all derived works, meaning that anyone who releases a modified version must release it as free software.
The GNU Lesser General Public License (LGPL) is similar but allows certain cases for derived works to be restricted. This is generally used for libraries so that applications using the libraries can be restricted.
The GNU Free Documentation License (FDL) allows free use, distribution, and modification of documentation, including all derived works.
Software licenses are legal documents, so consulting an attorney may be helpful in some cases to address legal liability.