Attention : support for WAPT 1.8.2 ended on June the 30th 2022.

There are known vulnerabilities in WAPT dependencies in WAPT 1.8.2 branch. Please upgrade to the latest supported version. CVE listing (non exhaustive) :
  • * python engine : python 2.7 (CVE-2020-10735, CVE-2015-20107, CVE-2022-0391, CVE-2021-23336, CVE-2021-3177, CVE-2020-27619, CVE-2020-26116, CVE-2019-20907, CVE-2020-8492, etc.)
  • * cryptography : openssl : CVE-2022-2068, CVE-2022-1292, CVE-2022-0778, CVE-2021-4160, CVE-2021-3712, CVE-2021-23841, CVE-2021-23840, CVE-2021-23839, CVE-2020-1971, CVE-2020-1968, CVE-2019-1551
  • * python dependencies : cryptography (CVE-2020-36242, CVE-2020-25659), eventlet (CVE-2021-21419), jinja2 (CVE-2020-28493), psutil (CVE-2019-18874), waitress (CVE-2022-31015), lxml (CVE-2021-4381, CVE-2021-28957, CVE-2020-27783, CVE-2018-19787), ujson (CVE-2022-31117, CVE-2022-31116, CVE-2021-45958), python-ldap (CVE-2021-46823)

Packaging simple Linux packages

Before starting, we assume several conditions:

  • you have a graphical interface on your Linux system;

  • you have installed the vscode package from the Tranquil IT repository;

  • your user is named linuxuser and is a member of the sudoers group;

create a base template from you linux computer

  • start up a Command Line utility;

  • as linuxuser, create a WAPT package template;

    wapt-get make-template <template_name>
    

    Warning

    Do not launch this command as root or with sudo.

    When you create a template, there will be several files in the folder .vscode inside your package folder:

    • settings.json;

    • launch.json;

    Example with VLC:

    wapt-get make-template "tis-vlc"
    
    Using config file: /opt/wapt/wapt-get.ini
    Template created. You can build the WAPT package by launching
    /opt/wapt//wapt-get.py build-package /home/linuxuser/waptdev/tis-vlc-wapt
    You can build and upload the WAPT package by launching
    /opt/wapt//wapt-get.py build-upload /home/linuxuser/waptdev/tis-vlc-wapt
    

    Hint

    All packages are stored in linuxuser’s home.

VSCode loads up and opens package project.

VSCode opening with focus on the *setup* file

VSCode opening with focus on the setup file

  • check the control file content;

    You have to give a description to you package, give the os_target and the version of you package.

    Hint

    os_target for unix is linux

    Warning

    version in you control file must start at 0, not the version number of the software, we don’t know precisely from apt/yum repo which version will be.

    Original control file

    package           : tis-vlc
    version           : 0-0
    architecture      : all
    section           : base
    priority          : optional
    maintainer        : user
    description       : automatic package for vlc
    

    Modified control file

    package           : tis-vlc
    version           : 0
    architecture      : all
    section           : base
    priority          : optional
    maintainer        : Tranquil-IT Systems
    description       : VLC for linux
    target_os         : linux
    min_wapt_version  : 1.8
    

    Note

    It is to be noted that a sub-version -1 has been added. It is the packaging version of WAPT package.

    It allows the Package Developer to release several WAPT package versions of the same software.

  • make changes to the code in the setup.py file accordingly;

    :emphasize-lines: 8
    # -*- coding: utf-8 -*-
    from setuphelpers import *
    
    uninstallkey = []
    
    def install():
        apt_install('vlc')
    
  • save the package;

Managing the uninstallation

  • make changes to the setup.py file with an uninstall ;

def uninstall():
apt_remove('vlc')
  • launch a remove from VSCode Run Configurations;

    After uninstallation, the software is correctly removed
  • check that the software has been correctly removed

dpkg -l | grep vlc

Hint

In the uninstall() function, it is not possible to call for files included inside the WAPT package. To call files from the package, it is necessary to copy/ paste the files in a temporary directory during package installation.

Managing the session-setup

  • make changes to the setup.py file with an session-setup ;

    In this example, you’ll need a vlcrc file in your package to copy in home user. ensure_dir function and filecopyto are from setuphelpers, the first one will test if the path exists, the second one will copy your file from the WAPT package to its destination.

    def session-setup():
      vlcdir = os.path.join(os.environ['HOME'], '.config', 'vlc')
      ensure_dir(vlcdir)
      filecopyto('vlcrc',vlcdir)
    
  • launch a session-setup from VSCode Run Configurations;

    After uninstallation, the software is correctly removed

Build and upload the package

Once the installation and the de-installation are configured and tested and the package is customized to your satisfaction, you may build and upload your new WAPT package onto your WAPT repository.

If you have built packages on a different machine (ex: Windows for building your Windows WAPT packages), you have to copy your .pem and .crt keys on your Linux machine with WinSCP or equivalent. Usually, this certificate bundle will be located in C:\private on your Windows computer. Then, provide the path to the certificates in /opt/wapt/wapt-get.ini.

sudo vim /opt/wapt/wapt-get.ini
  • provide the path to your certificate;

personnal_certificate_path=/opt/wapt/private/mykey.crt
  • then launch a build-upload from VSCode Run Configurations;

When everything is ready, upload your package
  • provide the password to your private key then admin/password of your waptconsole;

Your package is now uploaded and available in your private repository on your WAPT server.