Debian and Gambas (long read)

Post your Gambas programming questions here.
User avatar
gbWilly
Posts: 86
Joined: Friday 23rd September 2016 11:41am
Location: Netherlands
Contact:

Re: Debian and Gambas (long read)

Post by gbWilly »

Today I found me some spare time (the gods where good for me today ;) )...

So, I packaged gambas 3.19.2 for both debian 11 and debian 12 and for i386 and amd64 -> so four time packaging.
All went very smooth and so I found some time to start testing my packages as well.

I made a local file repo for 3.19.2 (I called it stable and the 3.18.4 long -> for longterm -> see earlier post) for both bookworm and bullseye (debian 12 and 11)
I have succesfully set up a local file repo on debian 11 i386 and debian 11 amd64 (using my instructions from 3.18.4 file repo setup).
So, I have gambas 3.19.2 running on both architectures from the local file repo.
Debian11-i386-gambas3.19.2.png
Debian11-i386-gambas3.19.2.png (210.1 KiB) Viewed 339 times
debian 11 - bullseye - i386 - gambas 3.19.2
Debian11-amd64-gambas3.19.2.png
Debian11-amd64-gambas3.19.2.png (212.92 KiB) Viewed 339 times
debian 11 - bullseye - amd64 - gambas 3.19.2

I still have some time left and I will be testing debian 12 next, as my file repo setup is ready to rumble..
I' ll be back to report on my findings and updated all instructions.
So if all is well I should have some archive files with a complete repository and instructions on how to set up on your local drive.
repo-archives.png
repo-archives.png (16.24 KiB) Viewed 339 times
Above you can see the size, so I need a manner to share it for those who want to use it on their system.
gbWilly
- Dutch translation for Gambas3
- Gambas wiki content contributer


... there is always a Catch if things go wrong!
User avatar
gbWilly
Posts: 86
Joined: Friday 23rd September 2016 11:41am
Location: Netherlands
Contact:

Re: Debian and Gambas (long read)

Post by gbWilly »

Got it all up and running...
debian12-amd64-gambas3.19.2.png
debian12-amd64-gambas3.19.2.png (220.52 KiB) Viewed 335 times
Debian 12 i386 gambas 3.19.2
Debian12-i386-gambas3.19.2.png
Debian12-i386-gambas3.19.2.png (202.81 KiB) Viewed 335 times
Debian 12 amd64 gambas 3.19.2
Need to do some small tweaks to the instructions and a manner to share it with the public.
Suggestions are welcome...
gbWilly
- Dutch translation for Gambas3
- Gambas wiki content contributer


... there is always a Catch if things go wrong!
User avatar
gbWilly
Posts: 86
Joined: Friday 23rd September 2016 11:41am
Location: Netherlands
Contact:

Re: Debian and Gambas (long read)

Post by gbWilly »

The filerepositories below will enable you to use apt-get to install gambas3 from local .deb files
It is advised to unpack the archive from the link into ~/shared. So make a folder shared in you home folder.
Instructions for setting up a file repo are based on stuff being in my ~/shared (so /home/willy/shared) .
So it makes it easier to adapt the instructions to your personal situation if you unpack all in /home/<youruser>/shared.

Further instructions are found once you unpacked all in 2 textfiles (one for Debian 11 and one for Debian 12)

Link to gambas 3.18.4 archive (long) containing the filerepository and instructions for setup: Gambas 3.18.4
Link to gambas 3.19.2 archive (stable) containing the filerepository and instructions for setup: Gambas 3.19.2

NOTES:
- Long or longterm here meaning that gambas 3.18.4 will stay available for a longer period of time, for people using Gambas in production environment.
- Stable meaning that this repo will get a new version a.s.a.p. when there is a new gambas version (although slower that the ubuntu ppa I guess :( )
- Each repo contains amd64 and i386 packages for both Debian 11 and 12 (hope to do armhf/arm64 as well for the pi boys, but still need to figure out how to run it in vm)
- I have tested all situations in vm's and all worked for me

Please report back successes and failures.

Enjoy

Edit: I updated the links to be available for anyone who has the link, so please let me know if downloading the archives works for you.
Last edited by gbWilly on Sunday 9th June 2024 2:10pm, edited 10 times in total.
gbWilly
- Dutch translation for Gambas3
- Gambas wiki content contributer


... there is always a Catch if things go wrong!
User avatar
BruceSteers
Posts: 1624
Joined: Thursday 23rd July 2020 5:20pm
Location: Isle of Wight
Contact:

Re: Debian and Gambas (long read)

Post by BruceSteers »

Cheers Willy

I have been busy with other things but am looking forward to your info.

Seems the dropbox is not public access i have had to send a request to access the files.

But I can hopefully do something with the info.

I hope to make some kind of script that will automatically update the archives at some public address/url possibly Packagecloud
If at first you don't succeed , try doing something differently.
BruceS
User avatar
gbWilly
Posts: 86
Joined: Friday 23rd September 2016 11:41am
Location: Netherlands
Contact:

Re: Debian and Gambas (long read)

Post by gbWilly »

I noticed your request and have granted you permission.
Haven't used dropbox in ages, so have to fiddle a little to share it for anyone with a link.
So you should be good in a moment for downloading it.

If you have questions on how to package Gambas3 for debian, just shoot.

P.s. This repo has instructions for setting up a local file repo, but (with different instructions) can be hosted by apache as an online gambas3 repository. I have them running like this at work on a server hosting Gambas3 repo on the intranet and at home in my own intranet on an old Debian 11 server.

My aim would be to have an online server hosting more recent Gambas3 for Debian (kind of like the Ubuntu ppa). All that is needed is an online apache webserver.

I've looked into package cloud, but I'm not a fan, as I guess all works automated with them.
It would mean a reinvest to figure out how they do stuff. No time for that, already to much planned and going on.

I like to keep control of the process and automate it myself, if needed. And I know this process by now.
All you need is a good recipe and from there it is rinse and repeat and sometimes adapt the recipe because of new components or changes in the environment it gets installed to (like no more qt4 available for example) etc.
gbWilly
- Dutch translation for Gambas3
- Gambas wiki content contributer


... there is always a Catch if things go wrong!
User avatar
BruceSteers
Posts: 1624
Joined: Thursday 23rd July 2020 5:20pm
Location: Isle of Wight
Contact:

Re: Debian and Gambas (long read)

Post by BruceSteers »

cool , i have more than an online apache with my digital ocean account, it has an ubuntu system with gambas installed so i am free to write all kinds of programs (with gambas) that might be able to package up the files and post them somewhere (i think a public repository will eat my bandwith and possibly increase my charges so i plan to make some script/program there that will post to somewhere else i can set a repo)

But i've always wanted to do something like launchpad PPA for other systems.

Kinda busy with other things at mo but it's winding down so hopefully will have some time to get on this as well.
I will study your info and see what I can possibly do :)

Thanks again
If at first you don't succeed , try doing something differently.
BruceS
User avatar
gbWilly
Posts: 86
Joined: Friday 23rd September 2016 11:41am
Location: Netherlands
Contact:

Re: Debian and Gambas (long read)

Post by gbWilly »

My setup.

My laptop with some vm's for packaging and some for testing (using snapshots for getting clean installs)
vm's are pre setup to start packaging (unless new components with new dependencies)

Step 1: Packaging means:
Extracted source code from gitlab gambas3
Add debian folder to source code folder with the recipe
-> the debian folder content is the recipe that tells the packaging application how to configure/compile/install everything
Go to source folder in cli
Issue a command to make the packages (I use dpkg-buildpackage)
Go have a coffee

This for 2 architectures and 2 Debian versions (so 4x packaging)
I gather each packaging in a seperate folder on usb named something like 'incoming-arch-debversion-gambasversion'

Step 2: Setting up repo and get .deb in and signed

Next step is on my system creating a debian repo setup. That means creating a basic folder structure (I have a template for that to copy/past)
Next is importing the incoming folders in a certain order and have them signed at the same time. (I use reprepro)
reprepro creates all other structures and files needed and provides a pool with the .deb files.

Step 3: Test the setup as file repo and online repo
On local systems:
File repo setup is a matter ol using the instructions of old version on the new version and adapt if needed
I do this for all 4 situtions (2 arch.2 debian version) using my test vm's (other that those I package on)
Online repo (intranet in my case):
Using rsync over ssh to sync my updated local created repo with that on the server hosting the repo online.
Issue apt-get update on client systems using the repo and new gambas get's installed.
-> this last configuration can be done with an online webserver for the world to enjoy just as easy.

That would be your debian ppa, so to speak (Debian doesn't do ppa, but ppa's use debian repo format)

A packaging tutorial in short. Documentation is hard to find in my experience.
I have learned most by trial and error
Same with the recipe, I studied debian gambas3 recipes and ppa gambas3 recipes, combined with gambas wiki.
The longer you are at it, the more sense it makes, how it al fits together.
The stuff you do when compiling from source is now written into files for the packaging application to configure/compile/testinstall and make .deb files from.
That is what a recipe is all about.
gbWilly
- Dutch translation for Gambas3
- Gambas wiki content contributer


... there is always a Catch if things go wrong!
User avatar
gbWilly
Posts: 86
Joined: Friday 23rd September 2016 11:41am
Location: Netherlands
Contact:

Re: Debian and Gambas (long read)

Post by gbWilly »

The tar.xz files in earlier post contain a gambas 3.18.4 and a gambas 3.19.2 debian repository with instructions to set it up as a local file repository.
This means doing apt-get update will pull gambas3 from your local repo and NOT from official debain anymore (like ppa does for Ubuntu)

I wrote instruction to setup this repo as a webrepo. This means you can setup a server with apache2 hosting the repository online.
Or use your local system as a webserver to host you your gambas (instead of file repo).

Setup is so that you can update your repo on your local pc with new version .deb files and rsync these with the webserver
A new Gambas version will then be automatically available for client systems tio use.

I'll post the content here as I can' t upload text files or tar.xz files containing them
Gambas 3.19.2 on Debian 11 and/or 12
================================================================================
== follow these instructions exactly (they are very case sensitive!!)
== replace '/home/willy/shared' with your own location to gbwilly.gambas3.long
== do a su root or with sudo
== I use useraccount willy in instructions, replace by your useraccount name
== Your server hosting the repo can be on your local system (use 127.0.0.1 as ip)
== <ip of server> can be replaced by FQDN of server if known to host
================================================================================

---------------------
On your client system
---------------------

1. First extract gbwilly.gambas3.long to a location (so you can read this file)
-> I will use the folder shared in my home drive as example for extraction (so /home/willy/shared/)
-> you need to end up with /home/willy/shared/gbwilly.gambas3.long

2. open a terminal and install openssh client on your system: (-> you can do this with sudo)

$: su root
$: apt-get install openssh-client rsync

3. As root or with sudo rights:

$: cd /home/willy/shared
$: chown -R willy:root gbwilly.gambas3.long
$: chmod -R 750 gbwilly.gambas3.long
$: cd gbwilly.gambas3.long
$: chmod 640 gbwilly.gambas3* && ls -l

drwxr-x--x 2 willy root 4096 mei 3 11:25 conf
drwxr-x--x 2 willy root 4096 mei 3 22:41 db
drwxr-x--x 4 willy root 4096 mei 3 12:37 dists
-rw-r----- 1 willy root 1745 mei 3 20:54 gbwilly.gambas3.asc
-rw-r----- 1 willy root 1745 mei 3 20:54 gbwilly.gambas3.gpg
drwxr-x--x 3 willy root 4096 apr 30 01:54 pool

4. As user willy (use your own user of choice)

$: mkdir ~/.ssh && cd ~/.ssh
$: ssh-keygen (generate a key named id_rsa.pub in ~/.ssh)

-----------------------------------------------------------------------------
On your webserver (I asume a Debian server for my instructions)
-----------------------------------------------------------------------------

1. Make sure you have a user willy made (or your name of choice, but same as on your local system with extracted repo)
You can add this user to sudo group if you like.

2. Open a terminal and configure and install ssh-server:

$: su root
$: apt-get install openssh-server apache2

Configure the ssh server to accept connections from users based on authenticated keys.

$: nano -w /etc/ssh/sshd_config

PermitRootLogin no
PermitEmptyPasswords no
# PubkeyAuthentication yes (unmark this later after we send the client key to server)

$: systemctl restart sshd

---------------------
On your client system
---------------------

1. From terminal as user willy copy key to webserver:

$: ssh-copy-id -i id-rsa.pub "willy@<ip of webserver>"

2. Check if it works to connect to webserver

$: ssh willy@<ip of server>

-----------------------------------------------------------------------------
On your webserver (I asume a Debian server for my instructions)
-----------------------------------------------------------------------------

1. Open terminal:

$: su root
$: nano -w /etc/ssh/sshd_config

PermitRootLogin no
PermitEmptyPasswords no
PubkeyAuthentication yes (unmark this)

$: systemctl restart sshd
$: exit

2. Continue in terminal as user willy:

$: mkdir /home/willy/shared/gbWilly.gambas3.long
$: chown willy:root /home/willy/shared/gbWilly.gambas3.long
$: chmod 755 //home/willy/shared/gbWilly.gambas3.long


---------------------
On your client system
---------------------

1. Open a terminal as user willy to push the repository to the webserver:

$: rsync -avze ssh /home/willy/shared/gbWilly.gambas3.long/* <ip of server>:/home/willy/shared/gbWilly.gambas3.long

This will update the repo on your account on the webserver. This is the way to update your online repo as well.
Make repo ok on local system, rsync to server and done.

-----------------------------------------------------------------------------
On your webserver (I asume a Debian server for my instructions)
-----------------------------------------------------------------------------

1. Now we need to make sure that your repository is published for use. Open a terminal

$: su root
$: mkdir /var/www/public_html/gbwilly.gambas3.intra (-> add an index.html to this folder)
$: chown -R willy:root /var/www/
$: chmod -R 755 /var/www/
$: nano /etc/apache2/sites-available/gbwilly.gambas3.intra

<VirtualHost *:80>
ServerAdmin webmaster@<your ip>
ServerName freya.home.intra
ServerAlias gbwilly.gambas3.intra

DocumentRoot /var/www/public_html/gbwilly.gambas3.intra

<Directory /var/www/public_html/gbwilly.gambas3.intra/>
Options Indexes FollowSymLinks MultiViews
Require all granted
</Directory>

Alias /gambas3-long /home/willy/shared/gbWilly.gambas3.long

<Directory /home/willy/shared/gbWilly.gambas3.long/>
Options Indexes FollowSymLinks MultiViews
Require all granted
</Directory>

</VirtualHost>

$: nano /etc/apache2/ports.conf

LISTEN 80

$: a2ensite gbwilly.gambas3
$: systemctl reload apache2

---------------------
On your client system
---------------------

$: su root
$: nano /etc/hosts

<ip of server> gbwilly.gambas3.intra <hostname server>

for debian 12:
$: echo "deb http://gbWilly.gambas3.intra/gambas3-long bookworm main" >> /etc/apt/sources.list

for debian 11:
$: echo "deb http://gbWilly.gambas3.intra/gambas3-long bullseye main" >> /etc/apt/sources.list

$: wget -O - http://develop.eurogarden.intra/gambas3 ... .intra.gpg | tee /etc/apt/trusted.gpg.d/gbwilly.gambas3.intra.gpg
$: apt-get update
$: apt-get upgrade
$: apt-get install gambas3

3. If updating from 3.18.0 from official make sure to reinstall gambas3-runtime as the 3.18.0 version of official will stick around because of the way it is packaged and conflicts with my version. Installing it will remove the old one and some obselete dependencies and might install new ones (all in the gui section, if running gui applications)

$: apt-get install gambas3-runtime

--> you could also first remove old gambas3 and then reinstall new version

4. If on gui check SynapticPackageManager if all is ok
- open SynapticPackageManager from system menu
- Search for gambas3
- check if all installed packages are 3.19.2-1~debian12
- if not replace the old ones by installing the new ones

5. Report back on any trouble you encounter (or successes as well)
Gambas 3.18.4 on Debian 11 and/or 12
================================================================================
== follow these instructions exactly (they are very case sensitive!!)
== replace '/home/willy/shared' with your own location to gbwilly.gambas3.stable
== do a su root or with sudo
== I use useraccount willy in instructions, replace by your useraccount name
== Your server hosting the repo can be on your local system (use 127.0.0.1 as ip)
== <ip of server> can be replaced by FQDN of server if known to host
================================================================================

---------------------
On your client system
---------------------

1. First extract gbwilly.gambas3.stable to a location (so you can read this file)
-> I will use the folder shared in my home drive as example for extraction (so /home/willy/shared/)
-> you need to end up with /home/willy/shared/gbwilly.gambas3.stable

2. open a terminal and install openssh client on your system: (-> you can do this with sudo)

$: su root
$: apt-get install openssh-client rsync

3. As root or with sudo rights:

$: cd /home/willy/shared
$: chown -R willy:root gbwilly.gambas3.stable
$: chmod -R 750 gbwilly.gambas3.stable
$: cd gbwilly.gambas3.stable
$: chmod 640 gbwilly.gambas3* && ls -l

drwxr-x--x 2 willy root 4096 mei 3 11:25 conf
drwxr-x--x 2 willy root 4096 mei 3 22:41 db
drwxr-x--x 4 willy root 4096 mei 3 12:37 dists
-rw-r----- 1 willy root 1745 mei 3 20:54 gbwilly.gambas3.asc
-rw-r----- 1 willy root 1745 mei 3 20:54 gbwilly.gambas3.gpg
drwxr-x--x 3 willy root 4096 apr 30 01:54 pool

4. As user willy (use your own user of choice)

$: mkdir ~/.ssh && cd ~/.ssh
$: ssh-keygen (generate a key named id_rsa.pub in ~/.ssh)

-----------------------------------------------------------------------------
On your webserver (I asume a Debian server for my instructions)
-----------------------------------------------------------------------------

1. Make sure you have a user willy made (or your name of choice, but same as on your local system with extracted repo)
You can add this user to sudo group if you like.

2. Open a terminal and configure and install ssh-server:

$: su root
$: apt-get install openssh-server apache2

Configure the ssh server to accept connections from users based on authenticated keys.

$: nano -w /etc/ssh/sshd_config

PermitRootLogin no
PermitEmptyPasswords no
# PubkeyAuthentication yes (unmark this later after we send the client key to server)

$: systemctl restart sshd

---------------------
On your client system
---------------------

1. From terminal as user willy copy key to webserver:

$: ssh-copy-id -i id-rsa.pub "willy@<ip of webserver>"

2. Check if it works to connect to webserver

$: ssh willy@<ip of server>

-----------------------------------------------------------------------------
On your webserver (I asume a Debian server my instructions)
-----------------------------------------------------------------------------

1. Open terminal:

$: su root
$: nano -w /etc/ssh/sshd_config

PermitRootLogin no
PermitEmptyPasswords no
PubkeyAuthentication yes (unmark this)

$: systemctl restart sshd
$: exit

2. Continue in terminal as user willy:

$: mkdir /home/willy/shared/gbWilly.gambas3.stable
$: chown willy:root /home/willy/shared/gbWilly.gambas3.stable
$: chmod 755 //home/willy/shared/gbWilly.gambas3.stable


---------------------
On your client system
---------------------

1. Open a terminal as user willy to push the repository to the webserver:

$: rsync -avze ssh /home/willy/shared/gbWilly.gambas3.stable/* <ip of server>:/home/willy/shared/gbWilly.gambas3.stable

This will update the repo on your account on the webserver. This is the way to update your online repo as well.
Make repo ok on local system, rsync to server and done.

-----------------------------------------------------------------------------
On your webserver (I asume a Debian server for my instructions)
-----------------------------------------------------------------------------

1. Now we need to make sure that your repository is published for use. Open a terminal

$: su root
$: mkdir /var/www/public_html/gbwilly.gambas3.intra (-> add an index.html to this folder)
$: chown -R willy:root /var/www/
$: chmod -R 755 /var/www/
$: nano /etc/apache2/sites-available/gbwilly.gambas3.intra

<VirtualHost *:80>
ServerAdmin webmaster@<your ip>
ServerName freya.home.intra
ServerAlias gbwilly.gambas3.intra

DocumentRoot /var/www/public_html/gbwilly.gambas3.intra

<Directory /var/www/public_html/gbwilly.gambas3.intra/>
Options Indexes FollowSymLinks MultiViews
Require all granted
</Directory>

Alias /gambas3-stable /home/willy/shared/gbWilly.gambas3.stable

<Directory /home/willy/shared/gbWilly.gambas3.stable/>
Options Indexes FollowSymLinks MultiViews
Require all granted
</Directory>

</VirtualHost>

$: nano /etc/apache2/ports.conf

LISTEN 80

$: a2ensite gbwilly.gambas3
$: systemctl reload apache2

---------------------
On your client system
---------------------

$: su root
$: nano /etc/hosts

<ip of server> gbwilly.gambas3.intra

$: echo "deb http://gbWilly.gambas3.intra/gambas3-stable bookworm main" >> /etc/apt/sources.list
$: wget -O - http://develop.eurogarden.intra/gambas3 ... .intra.gpg | tee /etc/apt/trusted.gpg.d/gbwilly.gambas3.intra.gpg
$: apt-get update
$: apt-get upgrade
$: apt-get install gambas3

3. If updating from 3.18.0 from official make sure to reinstall gambas3-runtime as the 3.18.0 version of official will stick around because of the way it is packaged and conflicts with my version. Installing it will remove the old one and some obselete dependencies and might install new ones (all in the gui section, if running gui applications)

$: apt-get install gambas3-runtime

--> you could also first remove old gambas3 and then reinstall new version

4. If on gui check SynapticPackageManager if all is ok
- open SynapticPackageManager from system menu
- Search for gambas3
- for bullseye: check if all installed packages are 3.18.4-1~debian11
- for bookworm: check if all installed packages are 3.18.4-1~debian12
- if not replace the old ones by installing the new ones

5. Report back on any trouble you encounter (or successes as well)

If you understand the instructions and setup, you will see that only 1 online server and access for me to rsync new version .deb packages is all it takes to have latest gambas on debian. Question is. who has the online server and bandwith to host it, that is all that is missing.

If I could afford I would do it, but I lost my job few years ago and I am at an, apparently to high of an age, to be suited for current IT jobs it seems. I found a part time job barely paying my bills and I' m burning my savings for my pension atm.

Positive thing is I do have a lot off spare time and way less stress.So had some time to update Dutch translations for gambas, update some wiki pages and write some new ones, package gambas for debian and more to come as my brain is filled with ideas...

Oh, and also time to reorganize a lot of older libraries and refurbish old applications I still use, get all my gathered findings in notes etc. into a know how database and write a fucking awesome gambas libraries to manage and approach all that know how in whatever application I want.
gbWilly
- Dutch translation for Gambas3
- Gambas wiki content contributer


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