Perkify - APT Details
Written by Rich Morin.
Precis: detailed discussion of APT packaging, etc.
Most of Perkify’s added packages are installed using Debian’s Advanced Package Toolkit (APT). The vast majority of these packages Just Work for our build system. However, some packages don’t exist already or have characteristics (e.g., configuration dialogs) which cause problems for our build system. In order to resolve these issues, we need to dig into APT a bit.
Note: If you’re looking for an introduction to APT usage on Perkify, see Perkify - APT.
Emacspeak is a blind-friendly version of Emacs. We definitely want to include it in Perkify, but its APT package uses a configuration dialog. Let’s see if there’s anything we can do about that.
To get started, we need to find and peruse a few web pages.
emacspeak package is based on Debian’s,
so we may need to look in both places:
https://packages.debian.org/buster/emacspeak This page describes the
https://packages.debian.org/search?keywords=emacspeak This page supports searching for information on
Ubuntu (e.g., 19.10; Eoan Ermine)
https://launchpad.net/ubuntu/+source/emacspeak This page provides information of interest to Ubuntu developers.
https://packages.ubuntu.comeoanemacspeak This page describes the
https://packages.ubuntu.com/search?keywords=emacspeak This page supports searching for information on
Ubuntu’s package page for
emacspeak has a section
for “Download Source Package”, containing three links:
This is the Debian source control file. It contains checksums, metadata, etc.
This archive file contains the original content of the package.
This archive file contains Debian’s packaging additions.
After an archive has been downloaded, it can be unpacked using tar(1):
$ tar xf emacspeak_49.0+dfsg.orig.tar.xz $ tar xf emacspeak_49.0+dfsg-3.debian.tar.xz
This produces two directories,
debian directory contains several dozen files (gleep),
but no sub-directories (whew).
emacspeak_49.0 several sub-directories and several hundred files.
We won’t be modifying anything in this directory tree,
but we may need to examine it to find out things about Emacspeak.
- Try installing Emacspeak interactively.
- Examine the selections this defined.
- Add the selections to a control file.
- Load the control file in
In order to install Emacspeak interactively, we need to emulate
the expected behavior of our
This presents us with a series of terminal-based GUI dialogs.
Edited for brevity, our terminal session looks something like this:
sudo apt-get install -y emacspeak ... Default speech server: ... espeak sound card with Software DECtalk <Ok> If a hardware device is used to generate speech, please enter the Unix device file associated with it ... │ <Ok>
We’re installing eSpeakNG,
espeak and “none” are plausible selections.
Assuming these are OK, how can we make them non-interactively?
I’m delighted you asked… It turns out that, now that Emacspeak has been installed, we can examine its configuration parameters as follows:
vagrant@perkify-make:~$ sudo debconf-get-selections | more ... # Hardware port of the speech generation device: emacspeak shared/emacspeak/port string none ... # Default speech server: emacspeak shared/emacspeak/device select espeak ...
Note: It isn’t always obvious how to identify the configuration parameters for a particular package. For instance, the configuration dialog (and thus, its parameters) may actually be generated by a dependency.
Having determined the configuration parameters,
we put them (suitably commented) into the
# Package Name Database Key Type Value # ------------ ------------ ---- ----- emacspeak shared/emacspeak/port string none emacspeak shared/emacspeak/device select espeak ...
add_ons script can then load this file:
Debian Administrator’s Handbook
The “Debian Administrator’s Handbook” is a gold mine of useful (albeit slightly dated) advice and information. Here are some links:
- Front matter
- Chapter 1. The Debian Project
- Chapter 2. Presenting the Case Study
- Chapter 3. Analyzing the Existing Setup and Migrating
- Chapter 4. Installation
- Chapter 5. Packaging System: Tools and Fundamental Principles
- Chapter 6. Maintenance and Updates: The APT Tools
- Section 6.8. Automatic Upgrades
- Chapter 7. Solving Problems and Finding Relevant Information
- Chapter 8. Basic Configuration: Network, Accounts, Printing…
- Chapter 9. Unix Services
- Chapter 10. Network Infrastructure
- Chapter 11. Network Services: Postfix, Apache, NFS, Samba, Squid, LDAP, SIP, XMPP, TURN
- Chapter 12. Advanced Administration
- Chapter 13. Workstation
- Chapter 14. Security
- Chapter 15. Creating a Debian Package
- Chapter 16. Conclusion: Debian’s Future
- Appendix A. Derivative Distributions
- Appendix B. Short Remedial Course
Debian New Maintainers’ Guide
The “Debian New Maintainers’ Guide” contains a great deal of information on creating Debian packages, etc. Here are some links:
- Front matter
- Chapter 1. Getting started The Right Way
- Chapter 2. First steps
- Chapter 3. Modifying the source
- Chapter 4. Required files under the debian directory
- Chapter 5. Other files under the debian directory
- Chapter 6. Building the package
- Chapter 7. Checking the package for errors
- Chapter 8. Updating the package
- Chapter 9. Uploading the package
- Appendix A. Advanced packaging
To be continued…