[ previous ] [ Contents ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ next ]

Debian Programmers' Manual
Chapter 3 - Getting the Source and creating debian structure.


3.1 Getting the source

You should get the source from a site that is listed as official distribution site in the documentation of the program you are debianizing. This way, you make sure you have the latest version, and that the program has not been modifieed by anyone. Unfortunately, the hello program did not have the official site mentioned in its documentation, but since it is a GNU program, I assumed its home site must be ftp.gnu.ai.mit.edu. If you don't see such indications, you might want to contact the author of the program, and ask him.

Usually, you should contact the upstream author anyway to let him know what you are doing. You should also remember the name of the site you downloaded the program from, because you will need it later, when you will be creating the copyright file, and when checking for a new upstream version.


3.2 Creating debian structure

If you have debmake installed on your system, and would like to use it, then all you have to do to create debian dirs and files is do the following:

  1. unpack the source file to a directory whose name is in the package-version format, removing any capital letters, if present. It looks like this:
         hello-1.3
    
  1. Cd to that directory and type deb-make. You will see your e-mail address, date, your name, the name of the package and version on your screen. Make sure all are correct, then you'll see a list of options like the following:
         Type of Package: (S=Single binary, M=multi-binary, L=Library, X=abort?
         s/m/l/x
    

    You are most likely to be packaging a single binary package, so choose "S". Note that Multi-binary package implies that it will produce more than one .deb file, not that it will have more than one binary executable.

  1. You will see that debian directory has been created, and that the original directory has been renamed to package-version.orig. Edit the necessary files in debian directory. You will need to edit at least control, rules, changelog and copyright files. See below for more information. For discussion on the structure of the rules file, see Rules File Structure, Chapter 4

Without debmake the process is slightly more complicated.

Unpack the original upstream source into package-version.orig,directory and another copy in package-version. It is best not to touch the sources in the .orig directory, but if the upstream source requires modification in order to debianise it, you may do so, but make sure to document your changes in the copyright file. Create debian directory and the following files inside it:


3.3 Debian files

control file consists of a number of required fields: The information from these fields is used in several other control files automatically created by dpkg in the build stage. The following fields are required in the control file, please refer to Packaging Manual for detailed descriptions.

Pre-depends, Depends, Recommends and Suggests fields describe the interrelationships between packages. They are not required, but most packages do need them. These fields should not be hard coded. Instead, the variable ${shlibs:Relationship} should be used. For example, Depends:${shlibs:Depends and Suggests: ${shlibs:Suggests} are properly formatted fields. The variables are filled by dpkg-shlibdeps program which will be covered in Rules File Structure, Chapter 4

rules is covered in Rules File Structure, Chapter 4

changelog file has a special format described in section 3.2.3 of Debian Packaging Manual. This format is used by dpkg to obtain the version number of debian package and other information. If you used deb-make to create your source package, the file is already in the correct format, and the only thing you need to do is record your changes.

copyright file does not have any special format, but it must contain the following:


[ previous ] [ Contents ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ next ]

Debian Programmers' Manual


17 June 2006

Igor Grobman [email protected]