Sign in Join
Wiki copytemporary

Debian package source: what changed

Revision 1 to 2. Removed lines have a minus sign; added lines have a plus sign.

OldNewLine
11Once a [[Debian upstream]] is ready, it is possible to make a source package from it. This is the role of the maintainer.
22
33### Requesting help
44
55You can request that someone would make the source package with an RFP bug: <https://wiki.debian.org/RFP>
66
77It will be useful to the maintainer to know about the dependencies necessary to compile a Lazarus project:
88
99- `fpc, lcl, lazarus` for all projects
1010- `libqt5pas-dev` if the project uses Qt5
1111
1212Though in practice, it is likely that you will have to make the package source yourself. Debian provides a number of tools to build and test a source package, as well as documentation on the process (see Further reading below).
1313
1414### debian directory
1515
1616If 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:
1717
1818`debian`\
1919`  ├─ changelog        # changes with previous version`\
2020`  ├─ control          # description of Debian packages`\
2121`  ├─ copyright        # copyright information of the source code`\
2222`  ├─ rules            # build script`\
2323`  ├─ watch            # file to check for latest version`\
2424`  ├─ source`\
2525`  │   └─ format       # format of this package source`\
2626`  └─ upstream`\
2727`      └─ metadata     # upstream repository information`
2828
2929#### changelog
3030
3131The first changelog of your program should be something like (spaces are important):
3232
3333`myproject (1.0-1) unstable; urgency=medium`\
34-\
34+
3535`  * Initial release. (Closes: #ITP_NUMBER)`\
36-\
36+
3737` -- Firstname Lastname <email@server.com>  Sun, 1 Nov 2020 15:01:00 +0100`
3838
3939Of 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.
4040
4141You 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>
4242
4343#### control
4444
4545This 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 [[Debian package structure|.deb files]].
4646
4747`Source: myproject`\
4848`Section: graphics`\
4949`Priority: optional`\
5050`Maintainer: Firstname Lastname <email@server.com>`\
5151`Build-Depends: fpc, lcl, lazarus, libqt5pas-dev, debhelper-compat (= 13)`\
5252`Rules-Requires-Root: no`\
5353`Standards-Version: 4.5.0`\
5454`Homepage: `[`https://mywebsite/myproject`](https://mywebsite/myproject)\
5555`Vcs-Git: `[`https://github.com/myorg/myproject.git`](https://github.com/myorg/myproject.git)\
5656`Vcs-Browser: `[`https://github.com/myorg/myproject`](https://github.com/myorg/myproject)\
57-\
57+
5858`Package: myproject`\
5959`Architecture: any`\
6060`Depends: ${misc:Depends}, ${shlibs:Depends}`\
6161`Conflicts: myoldproject`\
6262`Description: Short description`\
6363` More details, blablabla`
6464
6565Here 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`.
6666
6767Note 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.
6868
6969#### copyright
7070
7171Basically a copyright file contains a reference to all copyrights in the source code, as well as a global copyright for the package and for the debian folder. If you include custom packages in your upstream (that are statically linked), you need to specify the copyright for them as well. The first part of the file looks like this:
7272
7373`Format: `[`https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/`](https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/)\
7474`Upstream-Name: mypackage`\
7575`Upstream-Contact: Firstname Lastname <email@server.com>`\
7676`Source: `[`https://github.com/myorg/myproject`](https://github.com/myorg/myproject)\
77-\
77+
7878`Files: *`\
7979`Copyright: 2011-2020 Firstname Lastname <email@server.com>`\
8080`License: GPL-3+`\
81-\
81+
8282`Files: debian/*`\
8383`Copyright: 2011-2020 Maintainer <email@server.com>`\
8484`License: GPL-3+`\
85-\
85+
8686`Files: custompackage1/*`\
8787`Copyright: 2012 Author <mail@server.com>`\
8888`License: LGPL-2+`
8989
9090Then the file contains an empty line and the description of the licenses. Those descriptions are also separated by empty lines.
9191
9292Make sure you look for all mention of copyright in the source code (using grep or search in files). Even if the code is opensource, it is better to provide the full name of the person that created the files in the first place and the year. This can be needed for legal purposes as writing the copyright statement in a digital file counts as declaring the copyright. It is valid up to 70 years after the death of the copyright owner. This is based on the American legislation though other legislations may apply as well. For example, in French legislation, there is no need to declare a copyright, just being identified as the author is sufficient.
9393
9494File format documentation: <https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/>
9595
9696Complete list of licenses: <https://spdx.org/licenses/> and <https://spdx.org/licenses/exceptions-index.html>
9797
9898##### LGPL-2
9999
100100This is the license for libraries that can be used with commercial projects. With Lazarus, you need to add the linking exception, but it is not part of the SPDX list, so I would add it in the license description (second paragraph).
101101
102102`License: LGPL-2`\
103103` This program is free software; you can redistribute it and/or modify`\
104104` it under the terms of the GNU Lesser General Public License as published`\
105105` by the Free Software Foundation; version 2, with the following modification:`\
106106` .`\
107107` As a special exception, the copyright holders of this library give you`\
108108` permission to link this library with independent modules to produce an`\
109109` executable, regardless of the license terms of these independent modules,`\
110110` and to copy and distribute the resulting executable under terms of your choice,`\
111111` provided that you also meet, for each linked independent module, the terms`\
112112` and conditions of the license of that module. An independent module is a`\
113113` module which is not derived from or based on this library. If you modify this`\
114114` library, you may extend this exception to your version of the library, but`\
115115` you are not obligated to do so. If you do not wish to do so, delete this`\
116116` exception statement from your version.`\
117117` .`\
118118` This program is distributed in the hope that it will be useful,`\
119119` but WITHOUT ANY WARRANTY; without even the implied warranty of`\
120120` MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the`\
121121` GNU Lesser General Public License for more details.`\
122122` .`\
123123` You should have received a copy of the GNU Lesser General Public License`\
124124` along with this program; if not, write to the Free Software Foundation,`\
125125` Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.`\
126126` .`\
127127` On Debian systems, the full text of the GNU Lesser General Public`\
128128` License version 2 can be found in the file`\
129129` '/usr/share/common-licenses/LGPL-2'.`
130130
131131##### LGPL-2+
132132
133133Same as above, but not limited to version 2.
134134
135135`License: LGPL-2+`\
136136` This program is free software; you can redistribute it and/or modify`\
137137` it under the terms of the GNU Lesser General Public License as published`\
138138` by the Free Software Foundation; either version 2 of the License, or`\
139139` (at your option) any later version, with the following modification:`\
140140` .`\
141141` As a special exception, the copyright holders of this library give you`\
142142` permission to link this library with independent modules to produce an`\
143143` executable, regardless of the license terms of these independent modules,`\
144144` and to copy and distribute the resulting executable under terms of your choice,`\
145145` provided that you also meet, for each linked independent module, the terms`\
146146` and conditions of the license of that module. An independent module is a`\
147147` module which is not derived from or based on this library. If you modify this`\
148148` library, you may extend this exception to your version of the library, but`\
149149` you are not obligated to do so. If you do not wish to do so, delete this`\
150150` exception statement from your version.`\
151151` .`\
152152` This program is distributed in the hope that it will be useful,`\
153153` but WITHOUT ANY WARRANTY; without even the implied warranty of`\
154154` MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the`\
155155` GNU Lesser General Public License for more details.`\
156156` .`\
157157` You should have received a copy of the GNU Lesser General Public License`\
158158` along with this program; if not, write to the Free Software Foundation,`\
159159` Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.`\
160160` .`\
161161` On Debian systems, the full text of the GNU Lesser General Public`\
162162` License version 2 can be found in the file`\
163163` '/usr/share/common-licenses/LGPL-2'.`
164164
165165##### LGPL-3-linking-exception
166166
167167The version 3 has a specific name when there is the linking exception.
168168
169169`License: LGPL-3-linking-exception`\
170170` This program is free software; you can redistribute it and/or modify`\
171171` it under the terms of the GNU Lesser General Public License as published`\
172172` by the Free Software Foundation; version 3, with the following modification:`\
173173` .`\
174174` As a special exception, the copyright holders of this library give you`\
175175` permission to link this library with independent modules to produce an`\
176176` executable, regardless of the license terms of these independent modules,`\
177177` and to copy and distribute the resulting executable under terms of your choice,`\
178178` provided that you also meet, for each linked independent module, the terms`\
179179` and conditions of the license of that module. An independent module is a`\
180180` module which is not derived from or based on this library. If you modify this`\
181181` library, you may extend this exception to your version of the library, but`\
182182` you are not obligated to do so. If you do not wish to do so, delete this`\
183183` exception statement from your version.`\
184184` .`\
185185` This program is distributed in the hope that it will be useful,`\
186186` but WITHOUT ANY WARRANTY; without even the implied warranty of`\
187187` MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the`\
188188` GNU Lesser General Public License for more details.`\
189189` .`\
190190` You should have received a copy of the GNU Lesser General Public License`\
191191` along with this program; if not, write to the Free Software Foundation,`\
192192` Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.`\
193193` .`\
194194` On Debian systems, the full text of the GNU Lesser General Public`\
195195` License version 3 can be found in the file`\
196196` '/usr/share/common-licenses/LGPL-3'.`
197197
198198##### GPL-3+
199199
200200This is the recommended license when possible.
201201
202202`License: GPL-3+`\
203203` This program is free software; you can redistribute it and/or modify`\
204204` it under the terms of the GNU General Public License as published by`\
205205` the Free Software Foundation; either version 3 of the License, or`\
206206` (at your option) any later version. `\
207207` .`\
208208` This program is distributed in the hope that it will be useful,`\
209209` but WITHOUT ANY WARRANTY; without even the implied warranty of`\
210210` MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the`\
211211` GNU General Public License for more details.`\
212212` .`\
213213` You should have received a copy of the GNU General Public License along`\
214214` with this program; if not, write to the Free Software Foundation, Inc.,`\
215215` 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.`\
216216` .`\
217217` On Debian systems, the full text of the GNU General Public`\
218218` License version 3 can be found in the file`\
219219` '/usr/share/common-licenses/GPL-3'.`
220220
221221#### rules
222222
223223The `rules` file contains build instructions. If you are building a simple package, it will be the following:
224224
225225`#!/usr/bin/make -f`\
226-\
226+
227227`# see FEATURE AREAS in dpkg-buildflags(1)`\
228228`export DEB_BUILD_MAINT_OPTIONS = hardening=+all`\
229-\
229+
230230`%:`\
231231`   dh $@ --no-parallel`
232232
233233The `--no-parallel` flag is needed to avoid potential problems with parallel builds.
234234
235235#### watch
236236
237237The `watch` file explains how to check for latest version. For example, on GitHub, that would be:
238238
239239`version=4`\
240240`opts=filenamemangle=s/.+\/v?(\d\S+)\.tar\.gz/myproject-$1\.tar\.gz/ \`\
241241`  `[`https://github.com/myorg/myproject/tags`](https://github.com/myorg/myproject/tags)` .*/v?(\d\S+)\.tar\.gz`
242242
243243The version 4 is the for the file format, not your program. You need to change the *myorg* and *myproject* to your actual project.
244244
245245See documentation: <https://wiki.debian.org/debian/watch>
246246
247247#### source/format
248248
249249At the moment of this writing, it is:
250250
251251`3.0 (quilt)`
252252
253253#### upstream/metadata
254254
255255For a project on GitHub, that would be:
256256
257257`Bug-Database: `[`https://github.com/myorg/myproject/issues`](https://github.com/myorg/myproject/issues)\
258258`Bug-Submit: `[`https://github.com/myorg/myproject/issues/new`](https://github.com/myorg/myproject/issues/new)\
259259`Repository: `[`https://github.com/myorg/myproject.git`](https://github.com/myorg/myproject.git)\
260260`Repository-Browse: `[`https://github.com/myorg/myproject`](https://github.com/myorg/myproject)
261261
262262You may need to change those path according to the tools you are using.
263263
264264### Further reading
265265
266266- <https://wiki.debian.org/BuildingTutorial>
267267- <https://www.debian.org/doc/manuals/maint-guide/first.en.html>
268268- <https://lintian.debian.org/tags.html> and <https://lintian.debian.org/sources/fpc>
269269
270270---
271271*From the Free Pascal wiki, page "Debian package source", as it stood on 2022-01-22 after a change by Kai Burghardt, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*

Back to history