Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2015-10

Deployment tool: make deb

13 messages · 6 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Anthony Walter

If anyone is interested, I wrote a quick and dirty utility to create debian (deb) deployment packages for Lazarus applications (any really):

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

Features:

* Creates deb files for deploying your applications to Debian distros (Mint, Ubuntu, ect)
* Automatically finds dependencies for you
* Automatically detects application architecture
* Includes your executable and pixmap as well as creating an app desktop file (app shortcut in /usr/local/share/application)
* Stores each applications settings in files which you can reuse (make changes and redeploy)

If enough people are interested in this kind of app, let me know, because I would spend a little extra time to make it a bit friendlier (file associations, deployment save to folder, license file support, and desktop actions).

Note: If anyone is familiar with deb files, how do you normally create the dependencies section of the deb control file? I want to make sure my programmatic method to find them isn't overkill.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20151030/0bc61ac0/attachment.html>

Reply by email

JuuS
to Anthony Walter: If anyone is interested, I wrote a quick and dirty utility to create debian (deb)…
Anthony Walter wrote
If anyone is interested, I wrote a quick and dirty utility to create debian (deb) deployment packages for Lazarus applications (any really):

Hi,

Yes, very interested in using it. I didn't see a link to the utility...?

Thanks for doing this!

Julius

Show quoted text 30 lines
http://cache.getlazarus.org/images/makedeb-screen.png Features: * Creates deb files for deploying your applications to Debian distros (Mint, Ubuntu, ect) * Automatically finds dependencies for you * Automatically detects application architecture * Includes your executable and pixmap as well as creating an app desktop file (app shortcut in /usr/local/share/application) * Stores each applications settings in files which you can reuse (make changes and redeploy) If enough people are interested in this kind of app, let me know, because I would spend a little extra time to make it a bit friendlier (file associations, deployment save to folder, license file support, and desktop actions). Note: If anyone is familiar with deb files, how do you normally create the dependencies section of the deb control file? I want to make sure my programmatic method to find them isn't overkill. -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

leledumbo
to Anthony Walter: If anyone is interested, I wrote a quick and dirty utility to create debian (deb)…
If enough people are interested in this kind of app, let me know, because I

would spend a little extra time to make it a bit friendlier (file associations, deployment save to folder, license file support, and desktop actions).

Can I test now?

View this message in context: http://free-pascal-lazarus.989080.n3.nabble.com/Lazarus-Deployment-tool-make-deb-tp4045090p4045093.html Sent from the Free Pascal - Lazarus mailing list .

Reply by email

Anthony Walter
to Anthony Walter: If anyone is interested, I wrote a quick and dirty utility to create debian (deb)…

To be clear, I didn't upload the tool. I am just asking if people are interested. I'll probably add a few features and use it to create i386 and amd64 deb files containing itself, then post those to some download page which I've yet to create. I'll let you know.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20151030/489315d6/attachment.html>

Reply by email

C Pomalo
to Arne Hanssen

+1

30 oct. 2015 a ?crit?:

Show quoted text 18 lines
Den 30. okt. 2015 17:48, skrev Anthony Walter: If anyone is interested, I wrote a quick and dirty utility to create debian (deb) deployment packages for Lazarus applications (any really): Nice! I'm interested. -- Vennlig hilsen / Best regards |\ ___,,--, _ Arne Hanssen, Senja, Norway /,`--'' \-,,__,'/ [ Linux counter #102028 @ ] |,4 ) )_ ) /~-----' [ http://linuxcounter.net ]------'---^~(_/-_)--(_/_)------- ------------------------------------------------------------------------ -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Envoy? de mon t?l?phone Android avec <a href="https://play.google.com/store/apps/details?id=com.onegravity.k10.pro2"><b>K-@ Mail</b></a>. Excusez la bri?vet?. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20151030/55d9422b/attachment.html>

Reply by email

Anthony Walter
to C Pomalo

Okay if anyone wants to TEST this program, I've uploaded a 64bit version which you can download below. A 32bit version will be coming soon if you should need it.

http://cache.getlazarus.org/debs/makedeb_1.0-1-x86_64.deb

To install either double click the deb and use your package manager program (Software Center on Ubuntu) and press install.
Or type "sudo dpkg -i makedeb_1.0-1-x86_64.deb"

If you don't already have apt-file installed, installing this deb should also install apt-file. The apt-file program is required to look up package names of your application's dependencies. It should build the cache when installed, but if you need to do it manually (I don't believe you do) the command would be "sudo apt-file update".

To run the application type makedeb in any terminal, or search for Debian Packager in the dash (Ubuntu).

Usage should be self explanatory. You either type of the path to you application, or press the button with the green plus and choose your application. Fill out the fields and press build.

A few tips:

You can pick the desktop icon by clicking the big image in the top left and picking a graphic file.
The caption value is what will appear in the dash or if you pin the icon somewhere.
Search for you program using with apt-cache search or aptitude search using the package name.
Your short description will appear next to the package name when searching. Versions should be formatted majorver.minorver-packagever eg. 0.9-1 Author should be in the form of Your Name
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20151031/0c40cf9d/attachment.html>

Reply by email

JuuS
to Anthony Walter
Anthony Walter wrote
Okay if anyone wants to TEST this program,

Done!

I've uploaded a 64bit version which you can download below. A 32bit version will be coming soon if you should need it.
Show quoted text 12 lines
http://cache.getlazarus.org/debs/makedeb_1.0-1-x86_64.deb To install either double click the deb and use your package manager program (Software Center on Ubuntu) and press install. Or type "sudo dpkg -i makedeb_1.0-1-x86_64.deb" If you don't already have apt-file installed, installing this deb should also install apt-file. The apt-file program is required to look up package names of your application's dependencies. It should build the cache when installed, but if you need to do it manually (I don't believe you do) the command would be "sudo apt-file update".

It turns out that you do need to do this, at least on my system (Kub 14.04 VM). It does install apt-file but immediately one gets a notification that it needs to be "updated" and raises a dialog to allow you to do so. The first few go rounds I ran the dialog, it opens a terminal, runs and then hangs at the end.

After googling and trying things what one needs to do is IGNORE/CANCEL that update notification because it runs with only user permissions! Then do the "sudo apt-file update" manually, that works properly.

And thanks for the instructions you provided in private email, all worked great, I paste an important bit here for others if they get a missing libxml2.so message (from what I understand this is fixed now in later build of Deb Packager):

Fix the problem by creating a symlink to libxml2.so.2 in /usr/lib/ folder.

Eg:
find /usr/lib -name libxml2*
Lists:
/usr/lib/x86_64-linux-gnu/libxml2.so.2
Fix:
sudo ln -s /usr/lib/x86_64-linux-gnu/libxml2.so.2
/usr/lib/x86_64-linux-gnu/libxml2.so

To keep this reply short I post my test findings at:

https://www.timepirate.org/downloads/DebPackagerTestResults.txt

How will this work with updates, transparently or will we need to do
something special?

Thanks for doing this! Looks like it is going to be very very handy, easy, convenient, and quick. Is this open to dev on git or svn?

Julius

Show quoted text 28 lines
To run the application type makedeb in any terminal, or search for Debian Packager in the dash (Ubuntu). Usage should be self explanatory. You either type of the path to you application, or press the button with the green plus and choose your application. Fill out the fields and press build. A few tips: You can pick the desktop icon by clicking the big image in the top left and picking a graphic file. The caption value is what will appear in the dash or if you pin the icon somewhere. Search for you program using with apt-cache search or aptitude search using the package name. Your short description will appear next to the package name when searching. Versions should be formatted majorver.minorver-packagever eg. 0.9-1 Author should be in the form of Your Name < <mailto:>> -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Anthony Walter
to JuuS

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 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 " 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.freepascal.org/pipermail/lazarus/attachments/20151105/e3ec9167/attachment.html>

Reply by email

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

Super, thanks for the info, I see now where I had some confusion.

I will definitely use this, please keep us apprised of deb packager updates (for instance the umlaut ? problem)?

But you are right that it is ready to use now, though I'm still at a loss as to why my program does not show up in Kub's utilities menu, your deb packager shows up fine in development menu. Any ideas?

Show quoted text 12 lines
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

I was reading about this and I, personally, prefer the manual sudo method simply because the user permission terminal window for the "apt-file update" hangs and never returns to a prompt. Maybe that's not a real issue but I am reassured when I run it under sudo that the terminal window returns to normal. The downside (if it is one), as discussed on the sites I've read, is that once this decision is made then the use of sudo must be consistent.

Show quoted text 92 lines
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 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 < <mailto:>>" 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. -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Anthony Walter
to JuuS

I'm not sure why it's not showing up. Do an "ls -l /usr/share/applications" and see if there is a package.desktop file there related to your application. You can "cat /usr/share/applications/yourapp.desktop" and check that the contents are correct. Maybe I am using the wrong category string. You should be eable to find it by Caption in the dash or whatever spotlight type tool you desktop provides.

I'll be posting another version of makedeb (final perhaps) this weekend. -------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20151106/eb605b2f/attachment.html>

Reply by email

JuuS
to Anthony Walter

Ahhh, your cpugraph doesn't show up either, utilities is misspelled.

Anthony Walter wrote 17 lines
I'm not sure why it's not showing up. Do an "ls -l /usr/share/applications" and see if there is a package.desktop file there related to your application. You can "cat /usr/share/applications/yourapp.desktop" and check that the contents are correct. Maybe I am using the wrong category string. You should be eable to find it by Caption in the dash or whatever spotlight type tool you desktop provides. I'll be posting another version of makedeb (final perhaps) this weekend. -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email