Sign in Join
Wiki copytemporary

Publish project on Launchpad: what changed

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

Title: Publish project on Launchpad

OldNewLine
1+[Launchpad](https://launchpad.net/) is default Ubuntu build system. It allows us to register own project and let build server build our application. But web interface is overcomplicated and it is not easy to setup build of Lazarus project. Here this wiki pages can help.
2+
3+It is not simply possible to get own application package immediately directly to standard Ubuntu packages. Such package needs to comply with several rules to be accepted as standard distribution package. But Launchpad also supports PPA (Personal Package Archives) which is place where non distribution packages can be prepared.
4+
5+## Build package on Launchpad
6+
7+- First [register](https://login.launchpad.net/+login) new user account or login to your existing user account
8+
9+- [Register new project](https://launchpad.net/projects/+new) for your application
10+
11+- After the project is created you can import source code from external repository to Launchpad Bazaar project repository. Go to Code section and click to **Configure code** link. Then fill required fields and click to **Update** button.
12+
13+- Create debian directory under your project. It doesn't need to be in branch root directory. It will be appended to branch from specified location. The directory need to contain several debian package specific files.
14+
15+control file:
16+
17+ Source: project-name
18+ Maintainer: Username <email@email.xx>
19+ Section: utils
20+ Priority: optional
21+ Standards-Version: 1.0.0
22+ Build-Depends: fpc, lazarus, lcl, lcl-utils, debhelper (>= 8)
23+
24+ Package: project-name
25+ Architecture: any
26+ Depends: ${shlibs:Depends}, ${misc:Depends},
27+ Description: Short description of package.
28+ HomePage: http://project-homepage.xx/
29+
30+For section you can use only predefined strings. See question here <http://askubuntu.com/questions/722597/what-packages-sections-are-available-for-trusty>
31+
32+rules file:
33+
34+```make
35+#!/usr/bin/make -f
36+
37+# Set temporary HOME for lazarus primary config directory
38+export HOME=$(CURDIR)/tmphome
39+
40+ROOT = $(CURDIR)/debian/project-name
41+
42+override_dh_auto_clean:
43+ $(RM) -r lib
44+ $(RM) lib *.res project-name
45+
46+override_dh_auto_build:
47+ lazbuild --build-mode=Release project-name.lpi
48+
49+override_dh_auto_install:
50+ install -d -m 755 $(ROOT)/usr/bin
51+ install -s -m 755 project-executable $(ROOT)/usr/bin
52+ install -d -m 755 $(ROOT)/usr/share/applications
53+ install -m 644 project-name.desktop $(ROOT)/usr/share/applications
54+ install -d -m 755 $(ROOT)/usr/share/pixmaps
55+ install -m 644 project-name.png $(ROOT)/usr/share/pixmaps
56+ install -d -m 755 $(ROOT)/usr/share/project-name/i18n
57+ install -D -m 644 i18n/*.po $(ROOT)/usr/share/project-name/i18n
58+
59+%:
60+ dh $@
61+```
62+
63+changelog file:
64+
65+ project-name (1.0.0-1) precise; urgency=low
66+
67+ * Original version 1.0.0 packaged with lazdebian
68+
69+ -- Username <email@email.xx> Sun, 27 Nov 2016 00:51:08 +0100
70+
71+copyright file:
72+
73+ Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
74+
75+ Files: *
76+ Copyright: 2016 Creator name
77+ License: GPL-2+
78+ This program is free software; you can redistribute it and/or modify
79+ it under the terms of the GNU General Public License as published by
80+ the Free Software Foundation; either version 2 of the License, or
81+ at your option) any later version.
82+ .
83+ This program is distributed in the hope that it will be useful,
84+ but WITHOUT ANY WARRANTY; without even the implied warranty of
85+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
86+ GNU General Public License for more details.
87+ .
88+ You should have received a copy of the GNU General Public License along
89+ with this program; if not, write to the Free Software Foundation, Inc.,
90+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
91+ .
92+ On Debian systems, the full text of the GNU General Public
93+ License version 2 can be found in the file
94+ /usr/share/common-licenses/GPL-2
95+
96+compact file:
97+
98+ 8
99+
100+source/format:
101+
102+ 3.0 (quilt)
103+
104+- Now also in Code section of the project click to **Import a branch** link on right panel. Fill branch name with **debian-packaging** and as source select import from location where debian directory for the application is stored. If you create multi-platform application then usually debian directory is not stored in root of your application branch but rather in some subdirectory. Then click to **Request import**.
105+
106+- Create recipe for branch:
107+
108+ # bzr-builder format 0.3 deb-version {debupstream}-0~{revno}
109+ lp:custom-app
110+ nest packaging lp:~user/application-name/debian-packaging debian
111+
112+- Click to **Request build(s)** link to start build process
113+
114+## Build package locally
115+
116+You can also build your deb package locally outside of launchpad. Just create script called for example build.sh. This script will copy your project files with debian subdirectory to temporary directory where build process will be started and new deb package created.
117+
118+``` bash
119+#!/bin/bash
120+
121+BUILD_ROOT=/tmp/build-root/application-name
122+mkdir -p $BUILD_ROOT
123+cp -r -f . $BUILD_ROOT
124+cd $BUILD_ROOT
125+dpkg-buildpackage -b -rfakeroot -us -uc
126+```
127+
128+After execution new package will be placed in /tmp/build-root.
129+
130+## LazPackager
131+
132+Is Lazarus IDE extension which helps to create and build deb packages.
133+
134+Download: <https://github.com/prof7bit/LazPackager>
135+
136+## See also
137+
138+- [[How to setup a FPC and Lazarus Ubuntu repository|How to setup a FPC and Lazarus Ubuntu repository#The debs]]
139+
140+## External links
141+
142+- [Required files under the debian directory](https://www.debian.org/doc/manuals/maint-guide/dreq.en.html)
143+
144+---
145+*From the Free Pascal wiki, page "Publish project on Launchpad", as it stood on 2020-02-29 after a change by Trev, 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).*
146+Category: Deployment
147+Category: Linux

Back to history