Page 1 of 1
Linux package creation
Published: August 10, 2026 - 5:49 PM
by gsalin
Hello,
we're currently testing WAPT, thank you for this tool! I'm particularly interested in creating Linux (Ubuntu 24) packages to deploy internal tools.
I've looked through the documentation, but I'm struggling to find what I need. Specifically, on the page
https://www.wapt.fr/fr/doc/wapt-create- ... y-packages, there's section 1.3.3 "Packaging simple Linux packages," but it's empty.
For example, I want to deploy a connection script to an RDP server, using xfreerdp3 in /usr/local/bin. I want to copy the associated launcher to the desktop of all existing users (and to /etc/skel for future users) and the launcher icon to /usr/share/icons/.
Do you have any resources or pointers that could help me get started?
PyScripter is specific to Windows, if I understand correctly. Is there a Linux equivalent that would allow testing the different functions of the package (install, uninstall, etc.)?
Thanks in advance for your help,
Gerald.
PS: I installed the console on my Ubuntu 24 machine with the help of the admin who set up the WAPT server (I don't know which OS it's running).
Re: Creating Linux packages
Published: August 11, 2026 - 09:34
by italbot
Hello,
Yes, it's a shame this section is empty. We'll consider adding sample packages for Linux.
In the meantime, I invite you to consult this page:
https://www.wapt.fr/fr/doc-2.6/wapt-cre ... lpers.html
You'll find the different functions available for the various operating systems there.
If I understand correctly, in your package you simply want to copy files?
Sincerely,
Ingrid
Re: Creating Linux packages
Published: August 11, 2026 - 10:36
by gsalin
Hello Ingrid,
Thanks for the link, I'd only found the Windows helpers... I didn't search hard enough ;(
For now, yes, I only want to do copying, but it should evolve into more complex things (installing deb + copying... but according to the helper, it should be fairly easy)

)
Okay, so all I need to do is modify the setup.py file in the installer, using helpers and pure Python
For example, in my case, my setup.py would look something like this:
Code: Select all
from setuphelpers import *
import glob
import os
def install():
install_apt("freerdp3-x11") #installe xfreerdp3
install_apt("yad") #installe yad, utilisé dans le script bash ci-dessous
filecopyto("xfreeRDP3-VM-Windows.sh","/usr/local/bin") #copie l'exécutable dans bin
filecopyto("xfreeRDP3-VM-Windows.desktop","/etc/skel") #copie le lanceur dans /etc/skel pour le déployer aux nouveaux utilisateurs du poste
filecopyto("iconXfreeRDP3-VM-Windows.svg","/usr/share/icons/INRAEUbuntuInstall") #copie l'icone du lanceur dans le répertoire d'icone
for file in glob.glob("/home/*"): #recherche tous les homes directory existant
print(file)
if os.path.isdir(file + '/Bureau'): #si le répertoire Bureau existe dans le home, y copie le lanceur
filecopyto("xfreeRDP3-VM-Windows.desktop",file + '/Bureau')
elif os.path.isdir(file + '/Desktop'): #si le répertoire Desktop existe dans le home, y copie le lanceur
filecopyto("xfreeRDP3-VM-Windows.desktop",file + '/Desktop')
def uninstall():
remove_file("/usr/local/bin/xfreeRDP3-VM-Windows.sh")
remove_file("/etc/skel/xfreeRDP3-VM-Windows.desktop")
remove_tree("/usr/share/icons/INRAEUbuntuInstall")
for file in glob.glob("/home/*"): #recherche tous les homes directory existant
print(file)
if os.path.isdir(file + '/Bureau'): #si le répertoire Bureau existe dans le home, y copie le lanceur
if os.path.isfile(file + '/Bureau/xfreeRDP3-VM-Windows.desktop'):
remove_file(file + '/Bureau/xfreeRDP3-VM-Windows.desktop')
elif os.path.isdir(file + '/Desktop'): #si le répertoire Desktop existe dans le home, y copie le lanceur
if os.path.isfile(file + '/Desktop/xfreeRDP3-VM-Windows.desktop'):
remove_file(file + '/Desktop/xfreeRDP3-VM-Windows.desktop')
I'll test that in the next few days
Re: Creating Linux packages
Published: August 11, 2026 - 11:24
by italbot
Yes, that seems pretty good considering what you need to do.
Normally you can shorten `os.path.isdir()` to `isdir()` to save some code.
Regards,
Ingrid
Re: Creating Linux packages
Published: August 11, 2026 - 11:39
by gsalin
Well,
I couldn't resist... I tested it. The installation went smoothly (after a few corrections, of course... but seeing the errors after deployment via the console).
I just discovered that you can test the installation and uninstallation scripts locally under Linux with the command `
sudo wapt-get install myPackage_0-1_ubuntu_PROD-wapt/`.
If there are Python errors in setup.py, they will be detected before deploying the package, which is much smoother

. It must be the equivalent of PyScripter.
Cool, it's progressing.
Re: Creating Linux packages
Published: August 11, 2026 - 2:01 PM
by gsalin
I'm encountering a permissions issue with a file located in /usr/local/bin. Users don't have execute permissions on this script.
I haven't seen a method in setuhelpers to manage permissions. Can you confirm this?
If so, I'll look into using Python.
Re: Creating Linux packages
Published: August 11, 2026 - 5:09 PM
by gsalin
I used pure Python to change permissions (os.chmod()). In the end,
I created a small document for developing a basic Linux package. I couldn't attach it to this message because the file size limit is 256KB, so here it is as a link (which will expire in 15 days):
https://filesender.renater.fr/?s=downlo ... 5ba491b765
I'm open to suggestions for linking this file somewhere (pinned post or otherwise), or better yet, integrating it into the documentation.
If you see any improvements to be made, I'm open to them.
