[Lazarus] Deployment tool: make deb

Anthony Walter sysrpl at gmail.com
Thu Nov 5 23:02:21 CET 2015


JuuS, right. I knew about apt-file builing of user database on first run.

Here's how it will work:

On start of makedeb it checks if apt-file is installed.
  If apt-file is not installed the program will ask to install it for you
or close.
    If you say okay to install, it'll popup the gksudo prompt and install
apt-file.
    Else makedeb will terminate

Once apt-file is detected it'll check that you have the cache has been built
  If not it will run apt-file update without sudo, to build the local
apt-file user cache

After apt-file and its cache is working, you can then fill out the form
with the information in you deb package:

http://cache.getlazarus.org/images/makedeb-file.png

Fields Explained

Icon: Click the icon to pick a graphics file. Icons should support
transparency, so select either a png, xpm, ico, or svg image file. They
will all be resized as 64x64 pngs and packed into your deb, then deployed
to /usr/local/share/icons/<package name>.png.

Application: The path to your executable. The binary format must be either
i386 or amd64 architecture. Any other format will be rejected. The binary
will be stripped before being placed in the deb.

Caption: The name of your application as seen when searching in the Ubuntu
dash or other graphical application launcher. Will appear in the Name field
of the generated desktop file deployed to
/user/local/share/applications/<package name>.desktop.

Package name: The name of the package as seen by apt-get, dpkg, aptitude,
apt-file, and other command line package tools. I force you to use an
identifier name, i.e. following the same rules at variables. No spaces, no
punctuation, letters, numbers, and underscore. Must start with a letter or
underscore.

Package version: Should be app major version dot minor version dash package
version. e.g. 1.0-1

Category: Used by some systems to group applications by functionality. Will
be inserted into the desktop file and the DEBIAN control file.

Author: You name and email in to form of "John Doe <johnd at example.com>"
without the quotes.

Website: The url where people can download the deb from or read about the
program.

Short description: Will appear in under next to the package name as the
description in your package manager (apt-get, aptitude, Ubuntu Software
Center).

Long description: Will appear in Ubuntu Software Center after the fold.

When you press build, make deb does the following:

Validates the fields are filled in correctly.
Checks that the application file is a valid amd64 or i386 executable binary.
Your previous deb file for that architecture is deleted if it already
exists.
The deb folder structure is created, if it doesn't exists in the same
directory at the application file.
You applicate is copied to app-folder/packagename_version/usr/local/bin.
Makedeb then locates the shared object files (.so) linked in the elf header
of your application.
It checks if the .so has already been cached and associated with a package
name and version..
  If the .so hasn't been cached, apt-file is used to lookup the package and
version (this can take a while).
  The .so package name and version is then cached in your
$HOME/.config/makedeb folder.
It copies your icon file to app-folder/packagename_version/usr/share/icons.
It builds a desktop file and copies it to
app-folder/packagename_version/usr/share/applications.
It builds the app-folder/packagename_version/DEBIAN/control file.
It builds the deb packagename_version-architecture.deb. e.g.
my_awesome_app_1.0-1-amd64.deb

And finally your project information is saved to the same name as your
application file with the .mkdeb extension added. The next time you open
the file with makedeb (using the button next to the Application field). It
will reuse your last settings.

You can then increment the application or package versions numbers, build
again, and uploads the new deb file to your website. The user can download
the new version, run "dpkg -i my_awesome_app_1.1-1-amd64.deb" and he will
be upgraded, or double click the file to upgrade through a graphical
interface tool.

If you want automatic upgrades (sudo apt-get upgrade), then you'll need to
put the debs in a PPA, but that is beyond the scope of this email.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20151105/e3ec9167/attachment-0003.html>


More information about the Lazarus mailing list