Debian package source

From Lazarus wiki
Revision as of 17:01, 1 November 2020 by Circular (talk | contribs) (→‎changelog: fix bug)
Jump to navigationJump to search

One a Debian upstream is ready, it is possible to make a package source from it. This is the role of the maintainer.

You can request one with an RFP bug: https://wiki.debian.org/RFP

It will be useful to the maintainer to know about the dependencies necessary to compile a Lazarus project:

  • fpc, lcl, lazarus for all projects
  • libqt5pas-dev if the project uses Qt

debian directory

If you will do the role of the maintainer, or if you would like to check required dependencies, you will need to add the debian folder (in lowercase). Here is the minimal structure:

debian
  ├─ changelog        # changes with previous version
  ├─ control          # description of Debian packages
  ├─ copyright        # copyright information of the source code
  ├─ rules            # build script
  ├─ watch            # file to check for latest version
  ├─ source
  │   └─ format       # format of this package source
  └─ upstream
      └─ metadata     # upstream repository information

changelog

The first changelog of your program should be something like (spaces are important):

myproject (1.0-1) unstable; urgency=medium

  * Initial release. (Closes: #ITP_NUMBER)

 -- Firstname Lastname <email@server.com>  Sun, 1 Nov 2020 15:01:00 +0100

Of course you need to specify myproject, ITP_NUMBER, Firstname, Lastname, email and date. The version of the upstream program here is supposed to be 1.0 but it can be otherwise. The "-1" specifies the version of the package source as there a may be newer version of the package source but based on the same upstream version, in order to fix bugs for example.

You may not have an ITP number yet, as it is a number you will get when you make the request for your package to be added to Debian. If you would like to be the maintainer, here is an example of e-mail to send. In this case the ITP number is 972503: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=972503

control

This file gives all the information on the Debian packages, what is needed to build it, etc. This format is a bit different from the one found inside the .deb files.

Source: myproject
Section: graphics
Priority: optional
Maintainer: Firstname Lastname <email@server.com>
Build-Depends: fpc, lcl, lazarus, libqt5pas-dev, debhelper-compat (= 13)
Rules-Requires-Root: no
Standards-Version: 4.5.0
Homepage: https://mywebsite/myproject
Vcs-Git: https://github.com/myorg/myproject.git
Vcs-Browser: https://github.com/myorg/myproject

Package: myproject
Architecture: any
Depends: ${misc:Depends}, ${shlibs:Depends}
Conflicts: myoldproject
Description: Short description
 More details, blablabla

Here we suppose it is a graphics application using qt5 and with its repository on GitHub. If the project does not use qt5, you can remove the build-dependency libqt5pas-dev.

Note that the empty line is important. It introduces one package and there can be multiple packages in one package source, for example one for each widgetset and one common package.