lazdebutil is a command line tool for building deb package for Lazarus projects.
This current version of it is only meant for using with Ubuntu Touch on armhf architecture, and especially designed to help creating *.deb packages of Lazarus-made GTK projects that require Xmir to run on the phone.
Currently the GTK is not available on Ubuntu Touch. Apparently a backport is being worked on, but this is not yet ready or shipped with the Ubuntu Touch by default. So far, the only viable way to run GTK applications is to do it via Xmir on the phone.
Also worth mentionning, on Ubuntu Touch the rootfs is read-only by default. This means, that even though installing .deb packages is made with as root but still it would fail to try to extract .deb packaged contet onto that write-protected file system. Unless the destination for extracting the content is on a read-write portion. And this is also something that lazdebutil takes care of.
Usage:
lazdebutil <path_to_debdef_file>.debdef</path_to_debdef_file>
debdef file is a simple text file with settings that are required in the .deb package building process. The file is in the simple INI format where every line consists of a key name, followed by equation sign, followed by a value of that key.
The exact format is as follows:
app=<full_path_to_the_executable>
app_id=<ApplicationId>
app_launcher=<ApplicationLauncher>
dev_id=<DeveloperId>
dev=<Maintainer>
inc_files=<semicolon-separated list of files to include>
inc_dirs=<semicolon-separated list of folders to include>
ver=<version>
requires=<required_packages>
xmir=<true/false>
description=<description>
and the keys are explained below (relative path means relative to where the .debdef is located):
app - is thefull path to the executable that this package is being built for
app_id - is a name that will be used for package name and for the app's launcher
app_launcher - is the full or relative path to a launcher file for the app. If this is left empty, then the launcher will be auto-generated, and it will expect to find an app icon either called <app_id>.png or <app_name>.png</app_name></app_id>
dev_id - this is for organizing your app in a folder named by your chosen developer id. If you do not fill it then you will become 'jane_doe'
dev - a maintainer, ie: John Smith <jsmith@domain.com>
inc_files - these is for listing files (either full or relative path) to be also included in your deb package. You separate the files with a semicolon
inc_dirs - as above but this is for including whole folders with their content
ver - this is the version of your app
requires - you can leave empty, or include packages that you'd like to install along with your deb. Space separated list. This is not like setting Depends property inside deb's DEBIAN/control file, rather a script will try to spt-get install those packages when installing your deb.
xmir - if set to true, a desktop launcher will be hecked for settings that are required for Xmir execution.
description - as the name indicates, a description of your package
EXAMPLE:
let's say we have a lazarus project in /home/user/code/lazproject and the executable in that folder is called project, and we also want to include a data folder in the package called data. We create an icon for the app and call it project.png, and the profile.debdef will look like this:
app=/home/user/code/lazproject/project
app_id=MyApp
dev_id=john.smith.software
inc_dirs=data
inc_files=project.png
xmir=true
ver=1.0
prefix=debs
requires=
dev=John Smith <jsmith@hotmail.com>
description=my simple description.
now we call:
# sudo lazdebutil /home/user/code/lazproject/profile.debdef
and the /home/user/code/lazproject/project/debs/MyApp_1.0 directory will be created and then compiled into MyApp_1.0.deb package also in /home/user/code/lazproject/project/debs directory.
Since the app_launcher was not defined, it got auto-generated and included in the deb. This .deb package is now ready to be installed on Ubuntu Touch phone with:
# sudo dpkg -i MyApp_1.0.deb
and will not require user to manually remount rootfs to write-enabled. Also, upon istalling the .deb it will create launchers in users' home flders under every user's ~/.local/share/applications