Packaging Gambas for Debian

Post Reply
User avatar
Got2BeFree
Posts: 86
Joined: Saturday 26th November 2016 2:52am
Location: Lost

Packaging Gambas for Debian

Post by Got2BeFree » Monday 16th December 2019 10:59pm

The one thing I miss about using OpenSuse was having new Gambas releases within a day or two available for updating through the package manager. Now, being on Debian, I have to wait for many weeks or even months before I see Gambas appear in the package manager.

Back when I was on RPM based flavors (RedHat, SuSE, Mandrake, etc.) I would sometimes build my own RPM's (before I used Gambas). It's been 20 years since I've done anything like that, but I would like to start doing the same for .deb's and offer up a way to download them for anyone that wants them. I've started digging into building packages for Debian and have set up a spare box to do the builds. Looking at the howto for Gambas packagers on the Gambas website left me feeling a bit dumber than before I read through that page.

Anyone have links to good instructions on building Gambas .deb packages for Debian? Also, any good advice on automated software/scripts for doing the builds?
sholzy

I'm wondering around lost in the past, not knowing where the present is.

User avatar
jornmo
Site Admin
Posts: 217
Joined: Wednesday 21st September 2016 1:19pm
Location: Norway

Re: Packaging Gambas for Debian

Post by jornmo » Monday 16th December 2019 11:12pm

You could look at Arch’s PKGBUILD file for some inspiration

User avatar
jornmo
Site Admin
Posts: 217
Joined: Wednesday 21st September 2016 1:19pm
Location: Norway

Re: Packaging Gambas for Debian

Post by jornmo » Monday 16th December 2019 11:13pm


User avatar
gbWilly
Posts: 34
Joined: Friday 23rd September 2016 11:41am
Location: Netherlands
Contact:

Re: Packaging Gambas for Debian

Post by gbWilly » Wednesday 08th January 2020 12:41pm

Hi sholzy,

To package for Debian you will need to provide a certain directory structure with all files in a certain place.
This directory structure comes down to a folder with all gambas source files and in there a folder named debian.
In this debian folder you will need all kinds of files being:
- control -> sets all the names and dependencies for the packages (very important file)
- rules -> for Debian specific stuff
- changelog -> changelog for packaging
- compat -> contains debhelper version
- copyright
- install files for the packages -> tells debian where to install the files
- optional are some patch files in a patch folder

Check this archive (http://deb.debian.org/debian/pool/main/ ... ian.tar.xz) to see how that all looks like.
It is for Gambas 3.13.0 in Debian unstable

So it comes down to making a directory with all Gambas source code.
In that directory you make a folder debian with above mentioned stuff (see archive link)

You do need to install Gambas 3 on you test environment first to make sure all dependencies are met before making the package.

After you have installed Gambas and made the source directory with the debian folder in there you can finally start making the packages
I have once made packages for Gambas 3.6.2 on Debian/Ubuntu and I used: dpkg-buildpackage -d -rfakeroot.
So look into that command for better understanding.

The simplest for now is to take the Gambas 3.13 source code from Gambas site and unpack it.
Then take the archive linked above with the debian folder containing all needed scripts, patches, control file and so on from unstable.
unpack this debian folder into your source file folder.

Next try to package this for stable and see what you run into.
This will give you some better understanding of packaging on Debain and specificly packaging Gambas on Debain.
You might need to tweak some dependencies to meet stable.

If that works try this same process for Gambas 3.14.
If there are new components in Gambas 3.14 you will need to add them to the control file with their proper dependencies and you might need to add .install files for these new componenet.

Good luck and feel free to ask more details.
gbWilly
- Dutch translation for Gambas3
- Gambas wiki content contributer


... there is always a Catch if things go wrong!

User avatar
cogier
Site Admin
Posts: 395
Joined: Wednesday 21st September 2016 2:22pm
Location: Guernsey, Channel Islands

Re: Packaging Gambas for Debian

Post by cogier » Wednesday 08th January 2020 2:56pm

With *buntu and its derivatives, Mint etc. you can use the Gambas ppa.

I have no idea if it will work on Debian but this link seems to think that it is not a problem after you install the necessary software.

The Terminal commands I use, in Mint, are: -

Gambas3 Stable

Code: Select all

sudo add-apt-repository -y ppa:gambas-team/gambas3 && sudo apt-get update && sudo apt-get -y install gambas3
Gambas3 Daily Build

Code: Select all

sudo add-apt-repository -y ppa:gambas-team/gambas-daily && sudo apt-get update && sudo apt-get -y install gambas3

User avatar
gbWilly
Posts: 34
Joined: Friday 23rd September 2016 11:41am
Location: Netherlands
Contact:

Re: Packaging Gambas for Debian

Post by gbWilly » Wednesday 08th January 2020 3:44pm

Hi,
I have no idea if it will work on Debian but this link seems to think that it is not a problem after you install the necessary software.
The link mentioned provides a manner to use Ubuntu sources from an Ubuntu version closest to your Debian version and repackage it to debian packages.
You might run into some dependency trouble, that needs to be solved as Ubuntu is not exactly the same Debian.
Ubuntu uses Debian as a base but does it's own thing after that with possible more recent packages, where Debian packages stay at the same version for a longer period, with only fixes to that specific version.

Nevertheless this could work, but might give some dependencies problems that need to be solved.
Gambas3 Stable
sudo add-apt-repository -y ppa:gambas-team/gambas3 && sudo apt-get update && sudo apt-get -y install gambas3

Gambas3 Daily Build
sudo add-apt-repository -y ppa:gambas-team/gambas-daily && sudo apt-get update && sudo apt-get -y install gambas3
This for sure doesn't work on Debian as Debian doesn't use ppa's. The article in the link gives you the proper steps to get the repository and next use the source there to make packages yourself.
gbWilly
- Dutch translation for Gambas3
- Gambas wiki content contributer


... there is always a Catch if things go wrong!

User avatar
Got2BeFree
Posts: 86
Joined: Saturday 26th November 2016 2:52am
Location: Lost

Re: Packaging Gambas for Debian

Post by Got2BeFree » Thursday 09th January 2020 3:31am

Thanks, guys, I actually forgot I had started this thread!

I've been reading through all the info, but I still have a lot to digest. Hopefully this weekend I'll have time to sit and get to a point I can actually create a .deb package.

The info you guys posted has greatly helped in filling in some of the holes I had while researching.
sholzy

I'm wondering around lost in the past, not knowing where the present is.

User avatar
gbWilly
Posts: 34
Joined: Friday 23rd September 2016 11:41am
Location: Netherlands
Contact:

Re: Packaging Gambas for Debian

Post by gbWilly » Thursday 09th January 2020 6:05pm

Hi sholzy,

When you manage to package Gambas you might wanna setup your own repo to install from there.
Have a look at https://wiki.debian.org/DebianRepositor ... thReprepro

As a said before, I did this whole process once for Gambas 3.6.2 and setup a repo in an intranet at work to install all the clients.
Starting packaging with Gambas is not the most easiest of choices as it has multiple packages, but I did it anyway and failed several times ;)

Gambas creates multiple .deb files that can all be installed separately and that have inter-dependencies.
That's the stuff you will find on the gambas site in the "how to package" part. The actual making of the packages is of course distribution specific.

You might wanna starts practicing with something more simple that is just 1 package (1 .deb file in the end).
Look in unstable for something like that (like a newer version of apt), download source and try to make a backport package for stable.
This will give you a lot more insight than reading all the manuals, as they are complicated because of all the possibilities and tools they offer.

It's actually less complicated as they make it look like in the manuals. I kinda got lost in the manuals and they make more sense after a few tries.
The dpkg-buildpackage command is the official command to build the Debian binary package and a lot of the other stuff mentioned are often just wrappers around this command.

That complicates the reading of the manuals, so to help you make it a bit more clearer know this:
- The debuild command is a wrapper script of the dpkg-buildpackage command to build the Debian binary package under the proper environment variables.
- The pdebuild command is a wrapper script of the dpkg-buildpackage to build the Debian binary package under the proper chroot environment with the proper environment variables.
- The git-pbuilder command is another wrapper script of the dpkg-buildpackage to build the Debian binary package under the proper chroot environment with the proper environment variables. This provides an easier command line UI to switch among different build environments.

I did not use any of the wrappers as I prefer understanding the core being dpkg-buildpackage.
To make it even more complicated there are multiple other manners to make the packages.
All that makes the manuals hard to read is that they explain it too much and too diverse in my opinion.
It would probably be easier if they made separate manuals for all the different manners of building the packages.

All that is important is:
1. Having the source code in a folder and
2. having a debian folder in there with all the proper files (and that works has already been done for Gambas 3.13 in unstable).

Note that for Gambas 3.14 this work (the debian folder) has been done in the Ubuntu ppa mentioned in an earlier post by cogier.
Simply downloading the source from there will give you a debian folder to study for Gambas 3.14 and you could compare it with the 3.13 version from Debain unstable. You will for sure notice differences even if you would compare Ubuntu's Gambas 3.13 debian folder with Debians Gambas 3.13 debian folder.

The debain folder and especially the control file and the .install files are the most important part to understand.
Next just start playing with dpkg-buildpackage and you will get a grasp of things a lot faster by making mistakes. :lol:
gbWilly
- Dutch translation for Gambas3
- Gambas wiki content contributer


... there is always a Catch if things go wrong!

Post Reply