This page is a work-in-progress. See this old PDF file for any information that may be missing here.
Contents
Packages & Package Managers
Most Linux and BSD based operating systems use package managers to install & organize software. This software is bundled in compressed archives. Debian based systems use the Debian Package Management System (dpkg) and the Advanced Packaging Tool (apt). There are also a number of GUI front-ends such as Synaptic that can be used as well.
Binary Packages
The term "binary package" refers to a software archive assembled for deployment & active use within a system. Not only do binary packages serve to distribute software applications, they can also be used for non-executable media such as images, audio, fonts, configuration files, etc.
Source Packages
Source packages require steps to prepare the contents for system use. Often part of the process includes compiling text source code into machine code to be executed on the host system or targeted at another platform (cross-compiling). Many source packages include instructions for build systems on how the contents the archive should be installed to the system. This allows the build tools to stage files in preparation for inclusion into a binary package.
Debreate's Role
As of yet, Debreate does not support creating source packages or the creation of binary packages from source. It is currently only capable of the manual creation of .deb packages using specified files ready for system deployment.
Debreate's UI
Startup
If the app's configuration file is not found on the system a dialog will display with a first time run message. A new configuration with default values will be created in ${HOME}/.config/debreate.conf. Close the dialog to access the main interface.
The UI implements a wizard-like layout. Navigation is done via the & buttons to the top-right of the window or from the "Page" menu. For a[n old] video tutorial, click the link labelled "Building a Debian Package with Debreate" on the Information page.
Menu
Description of menu options:
- File:
- New project: Clears all fields.
- Open: Opens a dialog to load a project file.
- Save: Exports the current state to project file.
- Save as: Opens a dialog to export the current state to project file.
- Quick Build: Opens the Quick Build dialog.
- Close: Close the application.
- Page: Navigate between pages of the application.
- Options:
- Show tooltips: Toggle information tooltips.
- Open logs directory: Attempts to open Debreate's log directory in system file manager.
- Update dist names cache: Opens Update Dist Names Cache dialog.
- Clear local cache: Deletes the ${HOME}/.local/debreate/cache directory.
- Help:
- Check for update: Checks if a new version is available.
- Reference: Links to help & reference pages.
- Manual: Opens Debreate usage manual.
- About: Opens a dialog with information about Debreate.
Control File
.deb packages contain the file DEBIAN/control. This file contains meta information about the package. Such as the package name, package version, author, & requirements. This page is the first half of filling out the control file information.
It is divided into three sections: Required, recommended, & optional. Fields under the required section must be filled out to build a package.
The three buttons on the top-right of the page allow you to do the following:
- Load control information from a file.
- Export control information to file.
- Preview the formatted information.
For more information see the binary package control files section of the Debian Policy Manual.
Dependencies & Conflicts
Though on a separate page, dependencies & conflicts are part of the control file.
To add an entry, select the type of dependency or conflict from the available categories. Enter the name of the package & optionally version information. Press the button to add it to the list. If there is an alternative that can be used in place of a package, fill out the fields for the alternative package (category must be the same), then select the item from the list of packages already added & press the button. Individual packages can be removed from the list with the button. And the entire list can be emptied with the button.
The three buttons in upper-right of this page have the same functions as on the Control page.
For more information see the binary dependencies section of the Debian Policy Manual.
Files
This section is for the main contents of the package that will be installed to the target system (currently some of the features are broken). Files are organized by where they will reside on the system directory tree when installed.
Files & directories can be added to the target list via the built-in directory tree on the left panel or by drag-and-drop from a system file manager. To use the directory tree, select the files & directories you want to add. Set the target path from one of the pre-defined options or use the custom path input. When ready, press to import the selection into to file list. Or right-click the directory tree to bring up a context menu & select "Add to project". The app will try to detect file MimeTypes & executability. Executable files are denoted by red text. It should be noted that files cannot be set as executable from within the app (yet). It must be executable on the filesystem before importing.
can be used to delete selected items from the item list. will remove all items. is used to open a dialog to select a path to be used for the target directory.
Directory Options:
- List files individually: Add files individually to list instead of only the containing folder.
- Preserve top-level directories: By default, directory contents are added to the list. Enable this option to add the directory instead.
- Don't follow symbolic links: Enable this option to add symbolic links as regular files instead of adding the contents they point to.
Scripts
Debian packages support four scripts that are executed at different points during the install or uninstall process. These scripts can be useful for handling operations outside the scope of package contents, such as dynamically creating or removing symbolic links or setting up configuration files, or executing commands to update system information such as the MimeTypes database.
The supported scripts are:
- Pre-Install (preinst): Executed before package contents are installed on the host system.
- Post-Install (postinst): Executed after package contents are installed on the host system.
- Pre-Remove (prerm): Executed before package contents are uninstalled from the host system.
- Post-Remove (postrm): Executed after package contents are uninstalled from the host system.
These files can be formatted in the syntax of any supported scripting language & must start with the proper shebang line (#!).
Debian policy supports using binary executables in place of executable scripts, but Debreate currently does not.
Debreate also offers an Auto-Link Executables feature. This will detect executables listed on the Files page and generate a postinst script that will create symbolic links to them in the specified path. This is useful if you are installing executables to a directory that is not located on the system PATH but want to access it from the command line without requiring inputting the absolute path to the file. Auto-Link also creates a prerm script that will delete the link upon uninstalling the package.
How to use Auto-Link:
Press the button to copy any executables from the Files page. They will be listed in the right side panel. Then press the button. Post-Install and Pre-Remove scripts will be enabled & text added that when executed will place symbolic links to your executables in the path designated by the "Path" option. Any executables you do not want linked can be removed from the list with the button before generation.
For more information see the maintainer scripts section of the Debian Policy Manual.
Changelog
A changelog file is not required by Debian policy, but is useful to inform users of fixes & new features to your package. This page will generate changes information formatted according to Debian standards.
Fields Explanation:
- Package: Package name. This should match the Control page.
- Version: Package version. This should match the Control page.
- Distribution: Name of OS distribution for which this package is intented. The list of available pre-defined names can be updated with the Update Dist Names Cache dialog.
- Urgency: Level of importance for upgrading from previous version.
- Maintainer: Name of the package maintainer. This is not necessarily the same as the software author.
- : Imports maintainer, email, package name, & package version from Control page.
- Email: Package maintainer email address.
- Changes: Staging area for listing changes for the current version of the package.
- Changelog Output: Actual contents to be exported to the changelog file. This section can be edited manually.
- : Formats text from Changes field & prepends it to Changelog output as a new section.
- Preserve indentation: Indentation whitespace of lines not prepended with an item delimiter (*, -, +, or #) will not be stripped.
- Target: Filename path of changelog when installed. The default location is /usr/share/doc/<package>, but can be set to a custom value by deselecting the check box.
For more information see the changelog section of Debian Policy Manual.
Copyright
Inclusion of a copyright/license file notifies end users of how the software they are receieving may be used & redistributed. The text may contain any licensing information but Debreate includes a selection of templates of commonly used free software licenses that can be generated. Some of which are detected on the host system & others are packaged with the app.
As with the changelog, the license file is installed to /usr/share/doc/<package>. If you need to install multiple licenses you should add them using the Files page.
To use a pre-defined template select the desired type from the available list. Use the button to import the entire text. Optionally edit to add copyright holder name & email address. If a "short" template is available for the selected license, you can use the button to import the path to the referenced license file.
The button can be used to refresh the list with new templates added in the ${HOME}/.local/share/debreate/templates/licenses directory. Or a custom text can be imported with the button.
For more information see the copyright considerations section of the Debian Policy Manual.
Menu
This section is for an optional menu entry to be included with the package. Adding a menu file places an icon in the system menu upon installation.
TODO: fields descriptions
Debian packages actually support multiple menu entry files using the .desktop filename extenstion. Currently, only creation of a single file is supported by this page. But as an alternative to filling out the information here, the pre-formatted files can be added on the Files page targeting either the directory /usr/share/applications or /usr/local/share/applications.
As with control files, the , , & buttons can be used to import, export, or preview a .desktop menu entry file.
For more information see the freedesktop.org Desktop Entry Specification.
Build
The final step in building the package. Press the button to begin. A dialog will open to select the output package name & location. After selecting "save" a new dialog will open displaying progress of the build. Any errors or warnings that occur during the process should be displayed after completion.
Options on this page:
- Create md5sums file: A file containing hashes for the file contents of the package will be created. This is useful for if the package manager needs to check if files have been altered before installing a new version of a package.
- Strip binaries: Uses the strip command to remove debugging data from any ELF binaries.
- Delete staged directory: Upon completion of package building, the directory tree constructed for temporary file placement will be deleted. It may be useful to disable this option for debugging build errors. (currently staged files are placed in the directory where the target package is built, but this will change to use the system's temporary directory in the future)
- Check package for errors with lintian: If the Lintian Reports utilities are installed the constructed package will be checked for compliancy with Debian standards. Lintian error & warning tags information can be found here.
- Install package after build: Installs package after build, either in the background by directly calling dpkg --install, or via an available GUI package installer program. Requires elevated privileges & will prompt for password.
Dialogs
Quick Build
The Quick Build dialog can be used to build a .deb package using a pre-formatted directory tree. The directory must include a top-level DEBIAN directory containing meta information for the package.
Fields
- Staged directory tree: Location of directory tree.
- Target file: Filename of package to be created.
- : Closes the dialog.
- : Begin building.
Update Dist Names Cache
The dist names cache is used for updating the list of available distributions on the changelog page. Distribution names are parsed from the system's /etc/lsb-release file. Updating the cache adds additional names using predefined standards or from remote sources for Ubuntu, Debian, & Linux Mint (broken).
By default the following is included for each system:
- Debian: (remote source: wiki.debian.org/DebianReleases)
- The current production release.
- Ubuntu: (remote source: wiki.ubuntu.com/Releases)
- All currently supported LTS releases.
- Linux Mint: (remote source: linuxmint.com/download_all.php)
- broken
Options:
- Unstable:
- Includes "sid" & "stretch" in Debian releases.
- Includes next Ubuntu LTS release.
- Obsolete:
- Includes "oldstable" in Debian releases.
- Includes first six listed end of life Ubuntu releases.
- Generic:
- Includes "stable" in Debian releases. If Unstable is checked, also includes "unstable" & "testing".