anise.features.packages_ package

Submodules

anise.features.packages_.android module

Feature for creation of Android distribution packages.

class anise.features.packages_.android.Internals

Bases: object

static buildandroidpackage_with_ant(*, projectroot, name, version, targetname, androidpath)

Builds an Android package with Ant.

Parameters
  • projectroot (str) – The path to the Android package.

  • name (str) – The project name.

  • version (str) – The project version.

  • targetname (str) – The Ant target name that shall be built.

  • androidpath (str) – Path to the Android sdk’s android tool.

Return type

anise.framework.files.Filestructure

anise.features.packages_.android.inject_projectdata_to_androidmanifest(outfile)

Updates some project data (like version number) in the AndroidManifest.xml.

Parameters

outfile (str) – The directory that holds the AndroidManifest.xml. Can be absolute or relative to the Anise project directory.

Return type

None

anise.features.packages_.android.package_with_ant(androidpath, source, relpath='', targetname='debug')

Builds an Android package with Ant.

Parameters
  • androidpath (str) – Full path to the android tool (something like .../android-sdk/tools/android).

  • source (anise.framework.files.Filestructure) – The source file structure.

  • relpath (str) – The root path of the android project, relative to `source`s root.

  • targetname (str) – Name of the Ant target to build.

Return type

anise.framework.files.Filestructure

anise.features.packages_.appc module

Feature for creation of appc container images.

class anise.features.packages_.appc.EnvironmentVariableDescription(name, value)

Bases: object

Description for Appc environment variables to be added to the container image.

Parameters
  • name (str) – The variable name.

  • value (str) – The value.

class anise.features.packages_.appc.Internals

Bases: object

static _initproject()
static call(cmd, raise_on_errors='unable to run acbuild')
Parameters
  • cmd (List[str]) –

  • raise_on_errors (Optional[str]) –

Return type

None

class anise.features.packages_.appc.PortDescription(name, protocol, port)

Bases: object

Description for Appc network ports to be added to the container image.

Parameters
  • name (str) – The port name.

  • protocol (str) – The protocol (typically “tcp” or “udp”).

  • port (int) – The port number as available inside the container.

anise.features.packages_.appc.appcdebianpackage(debianpackage, fullname=None, ports=None, environment_variables=None, execcommand=None, run=None, run_late=None)

Builds an appc container image based on Debian.

You need an existing Debian package source.

Parameters
  • debianpackage (anise.framework.files.Filestructure) – The source file structure containing the debian package.

  • fullname (Optional[str]) – The full container name.

  • ports (Optional[List[anise.features.packages_.appc.PortDescription]]) – A list of port descriptions to add to the container image.

  • environment_variables (Optional[List[anise.features.packages_.appc.EnvironmentVariableDescription]]) – A list of environment variable descriptions to add to the container image.

  • execcommand (Optional[List[str]]) – A list of strings to specify the command to execute inside the container after boot.

  • run (Optional[List[List[str]]]) – A list of command-line lists to execute for preparation.

  • run_late (Optional[List[List[str]]]) – A list of command-line lists to execute for preparation after installing the package.

Return type

anise.framework.files.Filestructure

anise.features.packages_.debian module

Feature for creation of Debian distribution packages.

class anise.features.packages_.debian.Category

Bases: object

Enumeration for Debian’s categories for software packages.

ApplicationsAccessibility = ('Applications/Accessibility', 'System')
ApplicationsAmateurradio = ('Applications/Amateur Radio', 'Utility')
ApplicationsDatamanagement = ('Applications/Data Management', 'System')
ApplicationsEditors = ('Applications/Editors', 'Utility')
ApplicationsEducation = ('Applications/Education', 'Education')
ApplicationsEmulators = ('Applications/Emulators', 'System')
ApplicationsFilemanagement = ('Applications/File Management', 'System')
ApplicationsGraphics = ('Applications/Graphics', 'Graphics')
ApplicationsMobiledevices = ('Applications/Mobile Devices', 'Utility')
ApplicationsNetwork = ('Applications/Network', 'Network')
ApplicationsNetworkCommunication = ('Applications/Network/Communication', 'Network')
ApplicationsNetworkFiletransfer = ('Applications/Network/File Transfer', 'Network')
ApplicationsNetworkMonitoring = ('Applications/Network/Monitoring', 'Network')
ApplicationsNetworkWebbrowsing = ('Applications/Network/Web Browsing', 'Network')
ApplicationsNetworkWebnews = ('Applications/Network/Web News', 'Network')
ApplicationsOffice = ('Applications/Office', 'Office')
ApplicationsProgramming = ('Applications/Programming', 'Development')
ApplicationsProjectmanagement = ('Applications/Project Management', 'Development')
ApplicationsScience = ('Applications/Science', 'Education')
ApplicationsScienceAstronomy = ('Applications/Science/Astronomy', 'Education')
ApplicationsScienceBiology = ('Applications/Science/Biology', 'Education')
ApplicationsScienceChemistry = ('Applications/Science/Chemistry', 'Education')
ApplicationsScienceDataanalysis = ('Applications/Science/Data Analysis', 'Education')
ApplicationsScienceElectronics = ('Applications/Science/Electronics', 'Education')
ApplicationsScienceEngineering = ('Applications/Science/Engineering', 'Education')
ApplicationsScienceGeoscience = ('Applications/Science/Geoscience', 'Education')
ApplicationsScienceMathematics = ('Applications/Science/Mathematics', 'Education')
ApplicationsScienceMedicine = ('Applications/Science/Medicine', 'Education')
ApplicationsSciencePhysics = ('Applications/Science/Physics', 'Education')
ApplicationsScienceSocial = ('Applications/Science/Social', 'Education')
ApplicationsShells = ('Applications/Shells', 'System')
ApplicationsSounds = ('Applications/Sound', 'AudioVideo')
ApplicationsSystem = ('Applications/System', 'System')
ApplicationsSystemAdministration = ('Applications/System/Administration', 'System')
ApplicationsSystemHardware = ('Applications/System/Hardware', 'System')
ApplicationsSystemLanguageenvironment = ('Applications/System/Language Environment', 'System')
ApplicationsSystemMonitoring = ('Applications/System/Monitoring', 'System')
ApplicationsSystemPackagemanagement = ('Applications/System/Package Management', 'System')
ApplicationsSystemSecurity = ('Applications/System/Security', 'System')
ApplicationsTerminalemulators = ('Applications/Terminal Emulators', 'System')
ApplicationsText = ('Applications/Text', 'Utility')
ApplicationsTvandradio = ('Applications/TV and Radio', 'AudioVideo')
ApplicationsVideo = ('Applications/Video', 'AudioVideo')
ApplicationsViewers = ('Applications/Viewers', 'Utility')
ApplicationsWebdevelopment = ('Applications/Web Development', 'Development')
GamesAction = ('Games/Action', 'Game')
GamesAdventure = ('Games/Adventure', 'Game')
GamesBlocks = ('Games/Blocks', 'Game')
GamesBoard = ('Games/Board', 'Game')
GamesCard = ('Games/Card', 'Game')
GamesPuzzles = ('Games/Puzzles', 'Game')
GamesSimulation = ('Games/Simulation', 'Game')
GamesStrategy = ('Games/Strategy', 'Game')
GamesTools = ('Games/Tools', 'Game')
GamesToys = ('Games/Toys', 'Game')
Help = ('Help', 'System')
ScreenLocking = ('Screen/Locking', 'System')
ScreenSaving = ('Screen/Saving', 'System')
class anise.features.packages_.debian.Internals

Bases: object

static builddebpackage(*, name, version, licensename, authors, email, summary, description, section, architecture, websiteurl, menuentries, executablelinks, requireddependencies, stronglyrecommendeddependencies, suggesteddependencies, services, rawpkgpath, projectfsroot, prerm='', postinst='')

Builds a Debian package (.deb).

Parameters
  • name (str) – The package name.

  • version (str) – The package version string.

  • licensename (str) – The name of the project license.

  • authors (List[str]) – Project authors.

  • email (str) – Project email address.

  • summary (str) – Short project description.

  • description (str) – Longer project description.

  • section (str) – The Debian section name.

  • architecture (str) – The Debian architecture name.

  • websiteurl (str) – The project homepage url.

  • menuentries (List[MenuEntry]) – Menu entries to register.

  • executablelinks (Dict[str, str]) – Symlinks to executables to be created.

  • requireddependencies (List[str]) – List of required dependencies.

  • stronglyrecommendeddependencies (List[str]) – List of dependencies that are not strongly required but very typical.

  • suggesteddependencies (List[str]) – List of optional dependencies.

  • services (List[ServiceDescription]) – List of services to be registered.

  • rawpkgpath (str) – The raw source directory; can be damaged.

  • projectfsroot (str) – The project source directory path.

  • prerm (str) – Bash code snippet executed before the package is removed on a target machine.

  • postinst (str) – Bash code snippted executed after the package is installed on a target machine.

Return type

anise.framework.files.Filestructure

class anise.features.packages_.debian.MenuEntry(*, name, title, category, command, gui, icon)

Bases: object

Specification for one menu entry added by a Debian installation package.

Parameters
  • name (str) – Internal menu entry name.

  • title (str) – Menu entry Title.

  • category (Tuple) – Menu entry category. One of Category.

  • command (str) – Menu entry command.

  • gui (bool) – If the command opens a gui (instead of a terminal application).

  • icon (str) – The path to a menu entry icon.

class anise.features.packages_.debian.ServiceDescription(name, command)

Bases: object

Description for Debian services to be included in a package.

Parameters
  • name (str) – The display name.

  • command (str) – The command to be executed.

anise.features.packages_.debian.debpackage(source, dependencies=None, executablelinks=None, menuentries=None, services=None, prerm='', postinst='', architecture='all')

Builds a Debian package.

Parameters
  • source (anise.framework.files.Filestructure) – A source file structure.

  • dependencies (Optional[List[dependencies.Dependency]]) – A list of Debian dependencies for installation on target machines.

  • executablelinks (Optional[Dict[str, str]]) – A dict for links to executables for deployment on target machines.

  • menuentries (Optional[List[anise.features.packages_.debian.MenuEntry]]) – A list of menu entries for creation on target machines.

  • services (Optional[List[anise.features.packages_.debian.ServiceDescription]]) – A list of services for deployment on target machines.

  • prerm (str) – Piece of bash script executed before removal of the package on target machines.

  • postinst (str) – Piece of bash script executed after installation of the package on the target machines.

  • architecture (str) – The target architecture name.

Return type

anise.framework.files.Filestructure

anise.features.packages_.debian.only_programfiles(source)

Returns a filtered set of files for a Debian program directory (no documentation, license, tests, …).

Parameters

source – An anise.framework.files.Filestructure.

Returns

A filtered anise.framework.files.Filestructure.

anise.features.packages_.flatpak module

anise.features.packages_.oci module

Feature for creation of oci container images.

class anise.features.packages_.oci.EnvironmentVariableDescription(name, value)

Bases: object

Description for Oci environment variables to be added to the container image.

Parameters
  • name (str) – The variable name.

  • value (str) – The value.

class anise.features.packages_.oci.Internals

Bases: object

static _initproject()
static call(cmd, raise_on_errors='unable to run buildah')
Parameters
  • cmd (List[str]) –

  • raise_on_errors (Optional[str]) –

Return type

str

class anise.features.packages_.oci.PortDescription(port)

Bases: object

Description for Oci network ports to be added to the container image.

Parameters

port (int) – The port number as available inside the container.

anise.features.packages_.oci.ocidebianpackage(debianpackage, fullname=None, ports=None, environment_variables=None, execcommand=None, run=None, run_late=None)

Builds an oci container image based on Debian.

You need an existing Debian package source.

Parameters
  • debianpackage (anise.framework.files.Filestructure) – A file structure containing the debian package.

  • fullname (Optional[str]) – The full container name.

  • ports (Optional[List[anise.features.packages_.oci.PortDescription]]) – A list of PortDescription port descriptions to add to the container image.

  • environment_variables (Optional[List[anise.features.packages_.oci.EnvironmentVariableDescription]]) – A list of EnvironmentVariableDescription descriptions to add to the container image.

  • execcommand (Optional[List[str]]) – A list of strings to specify the command to execute inside the container after boot.

  • run (Optional[List[List[str]]]) – A list of command-line lists to execute for preparation.

  • run_late (Optional[List[List[str]]]) – A list of command-line lists to execute for preparation after installing the package.

Return type

anise.framework.files.Filestructure

anise.features.packages_.python module

anise.features.packages_.win32 module

Feature for creation of Win32 distribution packages.

class anise.features.packages_.win32.Internals

Bases: object

static buildwindowsinstallerpackage(*, name, version, licensefile, authors, email, summary, architecture, websiteurl, menuentries, rawpkgpath, projectfsroot, projecticon=None, globalscript='', oninitscript='', oninstallscript='', usemodernui2=False)

Builds a Windows installer executable (.exe).

Parameters
  • name (str) – The package name.

  • version (str) – The package version.

  • licensefile (str) – The path to the full text of the project’s license.

  • authors (List[str]) – Project authors.

  • email (str) – Project email address.

  • summary (str) – Short project description.

  • architecture (str) – The Debian architecture name.

  • websiteurl (str) – The project homepage url.

  • menuentries (List[MenuEntry]) – Menu entries to register.

  • rawpkgpath (str) – The raw source directory; can be damaged.

  • projectfsroot (str) – The project source directory path.

  • projecticon (Optional[str]) – Path to the project icon.

  • globalscript (str) – NSIS script global part.

  • oninitscript (str) – NSIS script that runs at initialization of the installer.

  • oninstallscript (str) – NSIS script that runs after file copying of the installer.

  • usemodernui2 (bool) – If Modern UI 2 shall be used (brings a more fresh look).

Return type

anise.framework.files.Filestructure

class anise.features.packages_.win32.MenuEntry(*, title, command, icon=None, params='', workdir='$INSTDIR')

Bases: object

Specification for one start menu entry added by a Windows package installer.

Parameters
  • title (str) – Menu entry title.

  • command (str) – Menu entry command.

  • icon (Optional[str]) – The path to a menu entry icon.

  • params (str) – Additional command parameters.

  • workdir (str) – The working directory for this menu entry.

anise.features.packages_.win32.deployqt5dlls(milieu, binsource=None, pluginssource=None)

Returns the DLLs needed for Qt deployment on Windows.

Parameters
Return type

anise.framework.files.Filestructure

anise.features.packages_.win32.win32exepackage(source, architecture='all', menuentries=None, projecticon=None, oninitscript='', oninstallscript='', usemodernui2=True)

Builds a Win32 installation executable (as .exe file).

Parameters
  • source (anise.framework.files.Filestructure) – An anise.framework.files.Filestructure.

  • architecture (str) – The target architecture name.

  • menuentries (Optional[List[anise.features.packages_.win32.MenuEntry]]) – A list of menu entries for creation on target machines.

  • projecticon (Optional[str]) – Path to a project icon. Relative to the project root directory.

  • oninitscript (str) – Additional NSIS on-init script.

  • oninstallscript (str) – Additional NSIS on-install script.

  • usemodernui2 (bool) – If Modern UI 2 shall be used (brings a more fresh look).

Return type

anise.framework.files.Filestructure

Module contents

Inner module for anise.features.packages.